jitcraft/TypeManager.cpp
changeset 67 b765a6383849
parent 59 b7d61ddb3c8d
child 68 b40b0e18a918
     1.1 --- a/jitcraft/TypeManager.cpp	Mon Jul 09 21:40:20 2012 -0700
     1.2 +++ b/jitcraft/TypeManager.cpp	Mon Jul 09 22:25:52 2012 -0700
     1.3 @@ -54,7 +54,7 @@
     1.4      Local<Type> type(zone_);
     1.5      for (unsigned i = 0; i < PrimitiveTypes_Total; i++) {
     1.6          type = primitiveTypes_[i];
     1.7 -        if ((referenceTypes_[i] = Type::NewReference(zone_, type)) == NULL)
     1.8 +        if ((referenceTypes_[i] = Type::NewReference(zone_, type, false)) == NULL)
     1.9              return false;
    1.10      }
    1.11  
    1.12 @@ -74,20 +74,20 @@
    1.13  }
    1.14  
    1.15  Type *
    1.16 -TypeManager::unsafeArray(Handle<Type> contained, int elements)
    1.17 +TypeManager::unsafeArray(Handle<Type> contained, int elements, bool isConst)
    1.18  {
    1.19      // :TODO: cache this.
    1.20 -    return Type::NewArray(zone_, contained, elements, false);
    1.21 +    return Type::NewArray(zone_, contained, elements, isConst);
    1.22  }
    1.23  
    1.24  Type *
    1.25 -TypeManager::getReference(Handle<Type> type)
    1.26 +TypeManager::getReference(Handle<Type> type, bool isConst)
    1.27  {
    1.28 -    if (type->isFloat() || (type->isInt32() && !type->tag()))
    1.29 +    if (!isConst && (type->isFloat() || (type->isInt32() && !type->tag())))
    1.30          return referenceTypes_[type->primitive()];
    1.31  
    1.32      // :TODO: cache this.
    1.33 -    return Type::NewReference(zone_, type);
    1.34 +    return Type::NewReference(zone_, type, isConst);
    1.35  }
    1.36  
    1.37  Type *