__ b(eq, &use_receiver);
// If the type of the result (stored in its map) is less than
- // JS_OBJECT type, it is not an object in the ECMA sense.
+ // FIRST_JS_OBJECT_TYPE, it is not an object in the ECMA sense.
__ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
__ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset));
- __ cmp(r2, Operand(JS_OBJECT_TYPE));
+ __ cmp(r2, Operand(FIRST_JS_OBJECT_TYPE));
__ b(ge, &exit);
// Throw away the result of the constructor invocation and use the
__ j(zero, &use_receiver, not_taken);
// If the type of the result (stored in its map) is less than
- // JS_OBJECT type, it is not an object in the ECMA sense.
+ // FIRST_JS_OBJECT_TYPE, it is not an object in the ECMA sense.
__ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset));
__ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset));
- __ cmp(ecx, JS_OBJECT_TYPE);
+ __ cmp(ecx, FIRST_JS_OBJECT_TYPE);
__ j(greater_equal, &exit, not_taken);
// Throw away the result of the constructor invocation and use the
// Check that the object isn't a smi.
__ tst(r1, Operand(kSmiTagMask));
__ b(eq, &slow);
- // Check that the object is some kind of JS object.
+
+ // Check that the object is some kind of JS object EXCEPT JS Value type.
+ // In the case that the object is a value-wrapper object,
+ // we enter the runtime system to make sure that indexing into string
+ // objects work as intended.
+ ASSERT(JS_OBJECT_TYPE > JS_VALUE_TYPE);
__ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
__ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset));
__ cmp(r2, Operand(JS_OBJECT_TYPE));
__ b(lt, &slow);
- // Check if the object is a value-wrapper object. In that case we
- // enter the runtime system to make sure that indexing into string
- // objects work as intended.
- __ cmp(r2, Operand(JS_VALUE_TYPE));
- __ b(eq, &slow);
-
// Get the elements array of the object.
__ ldr(r1, FieldMemOperand(r1, JSObject::kElementsOffset));
// Check that the object is in fast mode (not dictionary).
__ cmp(r2, Operand(JS_ARRAY_TYPE));
__ b(eq, &array);
// Check that the object is some kind of JS object.
- __ cmp(r2, Operand(JS_OBJECT_TYPE));
+ __ cmp(r2, Operand(FIRST_JS_OBJECT_TYPE));
__ b(lt, &slow);
__ b(eq, &primitive);
__ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
__ ldrb(r1, FieldMemOperand(r1, Map::kInstanceTypeOffset));
- __ cmp(r1, Operand(JS_OBJECT_TYPE));
+ __ cmp(r1, Operand(FIRST_JS_OBJECT_TYPE));
__ b(hs, &jsobject);
__ bind(&primitive);
__ j(not_zero, &false_result);
// JavaScript object => true.
- __ cmp(ecx, JS_OBJECT_TYPE);
+ __ cmp(ecx, FIRST_JS_OBJECT_TYPE);
__ j(above_equal, &true_result);
// String value => false iff empty.
__ j(zero, &primitive);
__ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset));
__ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset));
- __ cmp(ecx, JS_OBJECT_TYPE);
+ __ cmp(ecx, FIRST_JS_OBJECT_TYPE);
__ j(above_equal, &jsobject);
__ bind(&primitive);
// Check that the object isn't a smi.
__ test(ecx, Immediate(kSmiTagMask));
__ j(zero, &slow, not_taken);
- // Check that the object is some kind of JS object.
+ // Check that the object is some kind of JS object EXCEPT JS Value type.
+ // In the case that the object is a value-wrapper object,
+ // we enter the runtime system to make sure that indexing
+ // into string objects work as intended.
+ ASSERT(JS_OBJECT_TYPE > JS_VALUE_TYPE);
__ mov(edx, FieldOperand(ecx, HeapObject::kMapOffset));
__ movzx_b(edx, FieldOperand(edx, Map::kInstanceTypeOffset));
__ cmp(edx, JS_OBJECT_TYPE);
__ test(eax, Immediate(kSmiTagMask));
__ j(not_zero, &check_string, not_taken);
__ sar(eax, kSmiTagSize);
- // Check if the object is a value-wrapper object. In that case we
- // enter the runtime system to make sure that indexing into string
- // objects work as intended.
- __ cmp(edx, JS_VALUE_TYPE);
- __ j(equal, &slow, not_taken);
// Get the elements array of the object.
__ mov(ecx, FieldOperand(ecx, JSObject::kElementsOffset));
// Check that the object is in fast mode (not dictionary).
__ cmp(ecx, JS_ARRAY_TYPE);
__ j(equal, &array);
// Check that the object is some kind of JS object.
- __ cmp(ecx, JS_OBJECT_TYPE);
+ __ cmp(ecx, FIRST_JS_OBJECT_TYPE);
__ j(less, &slow, not_taken);
bool Object::IsJSObject() {
return IsHeapObject()
- && HeapObject::cast(this)->map()->instance_type() >= JS_OBJECT_TYPE;
+ && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE;
}
// HeapObject::Size, HeapObject::IterateBody, the typeof operator, and
// Object::IsString.
//
-// NOTE: Everything following JS_OBJECT_TYPE is considered a
+// NOTE: Everything following JS_VALUE_TYPE is considered a
// JSObject for GC purposes. The first four entries here have typeof
// 'object', whereas JS_FUNCTION_TYPE has typeof 'function'.
#define INSTANCE_TYPE_LIST(V) \
V(BREAK_POINT_INFO_TYPE) \
V(SCRIPT_TYPE) \
\
+ V(JS_VALUE_TYPE) \
V(JS_OBJECT_TYPE) \
V(JS_GLOBAL_OBJECT_TYPE) \
V(JS_BUILTINS_OBJECT_TYPE) \
- V(JS_VALUE_TYPE) \
V(JS_ARRAY_TYPE) \
\
V(JS_FUNCTION_TYPE) \
BREAK_POINT_INFO_TYPE,
SCRIPT_TYPE,
+ JS_VALUE_TYPE,
JS_OBJECT_TYPE,
JS_GLOBAL_OBJECT_TYPE,
JS_BUILTINS_OBJECT_TYPE,
- JS_VALUE_TYPE,
JS_ARRAY_TYPE,
JS_FUNCTION_TYPE,
// Boundaries for testing the type is a JavaScript "object". Note that
// function objects are not counted as objects, even though they are
// implemented as such; only values whose typeof is "object" are included.
- FIRST_JS_OBJECT_TYPE = JS_OBJECT_TYPE,
+ FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE,
LAST_JS_OBJECT_TYPE = JS_ARRAY_TYPE
};