예제 #1
0
 public override void Visit(ArrayLiteral node)
 {
   VisitNodes(node.Items);
   Visit((Literal)node);
 }
예제 #2
0
      public override void Visit(ArrayLiteral node)
      {
        PushLocation(node);

        var arraySize = node.Items.Count;
        _ilGen.Ldc_I4(arraySize);
        _ilGen.Newobj(Types.DArray.CONSTRUCTOR_Int32); //Here we are sure that the internal array has the correct size, so we can directly .Set stuff
        if (arraySize > 0)
        {
          _ilGen.Dup(); //The one on the stack is for storage, one more to get the InternalArray
          _ilGen.Ldfld(Types.DArray.Elements);

          var elements = _localVars.PushTemporary(Types.DValue.ArrayOf);
          _ilGen.Stloc(elements);

          for (var i = 0; i < arraySize; ++i)
          {
            var stackState = _localVars.GetTemporaryStackState();
            _ilGen.Ldloc(elements);
            _ilGen.Ldc_I4(i);
            _ilGen.Ldelema(Types.DValue.TypeOf);
            VisitNode(node.Items[i]);
            _ilGen.Call(Types.DValue.Set.Get(_result.ValueType));
            _localVars.PopTemporariesAfter(stackState);
          }

          _localVars.PopTemporary(elements);
        }
        _result.ValueType = mdr.ValueTypes.Array;
        PopLocation();
      }
예제 #3
0
 internal static mdr.ValueTypes GetType(ArrayLiteral expression) { return mdr.ValueTypes.Array; }
예제 #4
0
 public override void Visit(ArrayLiteral node) { base.Visit(node); node.ValueType = GetType(node); }
예제 #5
0
      public override void Visit(ArrayLiteral node)
      {
        PushLocation(node);
        VisitNodes(node.Items);

        BeginICMethod(node);
        var arraySize = node.Items.Count;
        _stackModel.Pop(arraySize);
        _ilGen.Ldarg_CallFrame();
        _ilGen.Ldc_I4(_stackModel.StackPointer);
        _ilGen.Ldc_I4(arraySize);
        _ilGen.Call(Types.Operations.ICMethods.CreateArray);
        EndICMethod();

        _result.ValueType = mdr.ValueTypes.DValueRef;
        _stackModel.Push(1);

        PopLocation();
      }
예제 #6
0
 public override void Visit(ArrayLiteral node) { Visit((Literal)node); }
예제 #7
0
 public override void Visit(ArrayLiteral node)
 {
     Visit((Literal)node);
 }
예제 #8
0
 public abstract void Visit(ArrayLiteral node);
예제 #9
0
      public override void Visit(ArrayLiteral node)
      {
        PushLocation(node);
        VisitNodes(node.Items);

        var arraySize = node.Items.Count;
        _ilGen.Ldc_I4(arraySize);
        Call(Types.Operations.Stack.CreateArray, arraySize, 1);
        PopLocation();
      }
예제 #10
0
 public override void Visit(ArrayLiteral node)
 {
   throw new NotImplementedException();
 }
예제 #11
0
 public override void Visit(ArrayLiteral node) { AssignToImplicitReturn(node); }