Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 2ab4650fb4f0f4f9a2db58b41a32ce2fa018b168..f5eb72f4ad9f395723fb9c8e4fcb1b99f75e4b06 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -880,7 +880,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
Label convert, done_convert; |
__ test(eax, Immediate(kSmiTagMask)); |
__ j(zero, &convert, Label::kNear); |
- __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ecx); |
+ __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); |
__ j(above_equal, &done_convert, Label::kNear); |
__ bind(&convert); |
__ push(eax); |
@@ -2403,9 +2403,9 @@ void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) { |
__ test(ecx, Immediate(1 << Map::kIsUndetectable)); |
__ j(not_zero, if_false); |
__ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
- __ cmp(ecx, FIRST_JS_OBJECT_TYPE); |
+ __ cmp(ecx, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
__ j(below, if_false); |
- __ cmp(ecx, LAST_JS_OBJECT_TYPE); |
+ __ cmp(ecx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); |
Split(below_equal, if_true, if_false, fall_through); |
@@ -2427,7 +2427,7 @@ void FullCodeGenerator::EmitIsSpecObject(ZoneList<Expression*>* args) { |
__ test(eax, Immediate(kSmiTagMask)); |
__ j(equal, if_false); |
- __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ebx); |
+ __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ebx); |
PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); |
Split(above_equal, if_true, if_false, fall_through); |
@@ -2713,16 +2713,18 @@ void FullCodeGenerator::EmitClassOf(ZoneList<Expression*>* args) { |
// Check that the object is a JS object but take special care of JS |
// functions to make sure they have 'Function' as their class. |
- __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, eax); // Map is now in eax. |
+ __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, eax); |
+ // Map is now in eax. |
__ j(below, &null); |
- // As long as JS_FUNCTION_TYPE is the last instance type and it is |
- // right after LAST_JS_OBJECT_TYPE, we can avoid checking for |
- // LAST_JS_OBJECT_TYPE. |
- ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); |
- ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); |
- __ CmpInstanceType(eax, JS_FUNCTION_TYPE); |
- __ j(equal, &function); |
+ // As long as LAST_CALLABLE_SPEC_OBJECT_TYPE is the last instance type, and |
+ // FIRST_CALLABLE_SPEC_OBJECT_TYPE comes right after |
+ // LAST_NONCALLABLE_SPEC_OBJECT_TYPE, we can avoid checking for the latter. |
+ STATIC_ASSERT(LAST_TYPE == LAST_CALLABLE_SPEC_OBJECT_TYPE); |
+ STATIC_ASSERT(FIRST_CALLABLE_SPEC_OBJECT_TYPE == |
+ LAST_NONCALLABLE_SPEC_OBJECT_TYPE + 1); |
+ __ CmpInstanceType(eax, FIRST_CALLABLE_SPEC_OBJECT_TYPE); |
+ __ j(above_equal, &function); |
// Check if the constructor in the map is a function. |
__ mov(eax, FieldOperand(eax, Map::kConstructorOffset)); |
@@ -4063,16 +4065,16 @@ bool FullCodeGenerator::TryLiteralCompare(Token::Value op, |
Split(not_zero, if_true, if_false, fall_through); |
} else if (check->Equals(isolate()->heap()->function_symbol())) { |
__ JumpIfSmi(eax, if_false); |
- __ CmpObjectType(eax, FIRST_FUNCTION_CLASS_TYPE, edx); |
+ __ CmpObjectType(eax, FIRST_CALLABLE_SPEC_OBJECT_TYPE, edx); |
Split(above_equal, if_true, if_false, fall_through); |
} else if (check->Equals(isolate()->heap()->object_symbol())) { |
__ JumpIfSmi(eax, if_false); |
__ cmp(eax, isolate()->factory()->null_value()); |
__ j(equal, if_true); |
- __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, edx); |
+ __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
__ j(below, if_false); |
- __ CmpInstanceType(edx, FIRST_FUNCTION_CLASS_TYPE); |
- __ j(above_equal, if_false); |
+ __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
+ __ j(above, if_false); |
// Check for undetectable objects => false. |
__ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
1 << Map::kIsUndetectable); |