예제 #1
0
 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);
 }
예제 #4
0
 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;
 }
예제 #5
0
 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;
 }
예제 #6
0
 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);
 }
예제 #7
0
 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);
 }
예제 #8
0
 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);
 }