public static Stmt ctor(Ctx ctx) { Expression<Func<int>> eHashCode = () => hashCode; var field = (FieldInfo)((MemberExpression)eHashCode.Body).Member; var f = ctx.Module.Import(field); var fExpr = new ExprFieldAccess(ctx, null, f).Named("hashCode"); var stmt = new StmtJsExplicit(ctx, "this.$=++hashCode;", ctx.ThisNamed, fExpr); return stmt; }
protected override ICode VisitFieldAccess(ExprFieldAccess e) { if (e.IsStatic) { this.Add(e.Field.DeclaringType, e.Ctx); } return e; }
protected override ICode VisitFieldAccess(ExprFieldAccess e) { this.fieldAccesses.Add(e.Field); return base.VisitFieldAccess(e); }
protected override ICode VisitFieldAccess(ExprFieldAccess e) { if (!e.IsStatic) { this.Visit(e.Obj); this.js.Append("."); } this.js.Append(this.resolver.FieldNames[e.Field]); return e; }
protected override ICode VisitFieldAccess(ExprFieldAccess e) { if (e.IsStatic) { this.code.Append(e.Field.DeclaringType.FullName); } else { this.Visit(e.Obj); } this.code.Append("."); this.code.Append(e.Field.Name); return e; }
private Stmt StoreStaticField(Instruction inst) { var value = this.stack.Pop(); var fRef = ((FieldReference)inst.Operand).FullResolve(this.ctx); var expr = new ExprFieldAccess(this.ctx, null, fRef); return new StmtAssignment(this.ctx, expr, value); }
private Stmt LoadStaticField(Instruction inst) { var fRef = ((FieldReference)inst.Operand).FullResolve(this.ctx); var expr = new ExprFieldAccess(this.ctx, null, fRef); return this.SsaLocalAssignment(expr); }
private Stmt LoadField(Instruction inst) { var obj = this.stack.Pop(); var fRef = ((FieldReference)inst.Operand).FullResolve(this.ctx); var expr = new ExprFieldAccess(this.ctx, obj, fRef); return this.SsaLocalAssignment(expr); }