src/BytecodeCompiler.cpp
changeset 154 a85a0303bcb8
parent 153 fc91c4a3dfe2
child 155 7926a7921fa3
     1.1 --- a/src/BytecodeCompiler.cpp	Sat Aug 04 23:58:23 2012 -0700
     1.2 +++ b/src/BytecodeCompiler.cpp	Sun Aug 05 00:31:20 2012 -0700
     1.3 @@ -539,11 +539,7 @@
     1.4      node->right()->accept(this);
     1.5      __ note_position(node->pos());
     1.6      __ bounds();
     1.7 -
     1.8 -    if (node->type()->isArray())
     1.9 -        __ getarray_o();
    1.10 -    else
    1.11 -        __ getarray(node->type());
    1.12 +    __ getarray(node->type());
    1.13  }
    1.14  
    1.15  void
    1.16 @@ -741,15 +737,15 @@
    1.17  static inline ArrayMap *
    1.18  BuildArrayMap(Zone *zone, Handle<Type> type)
    1.19  {
    1.20 -    Local<ArrayMap> contained(zone);
    1.21 -    if (type->levels() > 1) {
    1.22 -        Local<Type> containedType(zone, type->contained());
    1.23 -        contained = BuildArrayMap(zone, containedType);
    1.24 -        if (!contained)
    1.25 -            return NULL;
    1.26 -    }
    1.27 +    if (type->newMap())
    1.28 +        return ArrayMap::cast(type->newMap());
    1.29  
    1.30 -    return ArrayMap::New(zone, type, contained);
    1.31 +    Local<ArrayMap> map(zone, ArrayMap::New(zone, type));
    1.32 +    if (!map)
    1.33 +        return NULL;
    1.34 +
    1.35 +    type->setNewMap(map);
    1.36 +    return map;
    1.37  }
    1.38  
    1.39  void