diff -r a350c2cc736a -r 75e385f68b7e jitcraft/Types.cpp --- a/jitcraft/Types.cpp Fri Jun 29 19:35:17 2012 -0700 +++ b/jitcraft/Types.cpp Sat Jun 30 19:38:53 2012 -0700 @@ -25,7 +25,7 @@ Type::initPrimitive(Name *tag) { WRITE_FIELD(kind, PRIMITIVE); - WRITE_FIELD(tag, CrapPtr(tag)); + WRITE_FIELD(tag, VoidPtr(tag)); WRITE_FIELD_OBJ_NO_BARRIER(contained, NULL); if (tag && strcmp(tag, "Float") == 0) @@ -35,6 +35,15 @@ } void +Type::initPrimitive(PrimitiveType type) +{ + WRITE_FIELD(kind, PRIMITIVE); + WRITE_FIELD(tag, NULL); + WRITE_FIELD_OBJ_NO_BARRIER(contained, NULL); + WRITE_FIELD(primitive, type); +} + +void Type::initInlineArray(Type *contained, int elements) { WRITE_FIELD(kind, UNSAFE_ARRAY); @@ -60,6 +69,18 @@ } Type * +Type::NewPrimitive(Zone *zone, PrimitiveType prim) +{ + Object *obj = zone->allocate(MapKind_Type, sizeof(Type), Heap::Tenure_Old); + if (!obj) + return NULL; + + Type *type = Type::cast(obj); + type->initPrimitive(prim); + return type; +} + +Type * Type::NewUnsafeArray(Zone *zone, Type *contained, int elements) { Object *obj = zone->allocate(MapKind_Type, sizeof(Type), Heap::Tenure_Old);