Index: src/crankshaft/x87/lithium-codegen-x87.cc |
diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc |
index 500bfb6ec085cca564a77f72550b1eb9c5fdaebc..ddbfad763c4a34b72dc7ba8cf88e45f19b29c1ed 100644 |
--- a/src/crankshaft/x87/lithium-codegen-x87.cc |
+++ b/src/crankshaft/x87/lithium-codegen-x87.cc |
@@ -2724,26 +2724,11 @@ void LCodeGen::EmitClassOfTest(Label* is_true, |
DCHECK(!temp.is(temp2)); |
__ JumpIfSmi(input, is_false); |
+ __ CmpObjectType(input, JS_FUNCTION_TYPE, temp); |
if (String::Equals(isolate()->factory()->Function_string(), class_name)) { |
- // Assuming the following assertions, we can use the same compares to test |
- // for both being a function type and being in the object type range. |
- STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
- STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == |
- LAST_JS_RECEIVER_TYPE - 1); |
- STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
- __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, temp); |
- __ j(below, is_false); |
- __ CmpInstanceType(temp, LAST_JS_RECEIVER_TYPE); |
__ j(equal, is_true); |
} else { |
- // Faster code path to avoid two compares: subtract lower bound from the |
- // actual type and do a signed compare with the width of the type range. |
- __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); |
- __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); |
- __ sub(Operand(temp2), Immediate(FIRST_JS_RECEIVER_TYPE)); |
- __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - |
- FIRST_JS_RECEIVER_TYPE)); |
- __ j(above, is_false); |
+ __ j(equal, is_false); |
} |
// Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |