Index: src/crankshaft/arm/lithium-codegen-arm.cc |
diff --git a/src/crankshaft/arm/lithium-codegen-arm.cc b/src/crankshaft/arm/lithium-codegen-arm.cc |
index b2d57954093f5bfbee6f364d94d7fcafa77a6725..794085e99540cc47732972acfaa440920583d6a9 100644 |
--- a/src/crankshaft/arm/lithium-codegen-arm.cc |
+++ b/src/crankshaft/arm/lithium-codegen-arm.cc |
@@ -2538,36 +2538,20 @@ void LCodeGen::EmitClassOfTest(Label* is_true, |
__ JumpIfSmi(input, is_false); |
+ __ CompareObjectType(input, temp, temp2, JS_FUNCTION_TYPE); |
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); |
- __ CompareObjectType(input, temp, temp2, FIRST_JS_RECEIVER_TYPE); |
- __ b(lt, is_false); |
- __ cmp(temp2, Operand(LAST_JS_RECEIVER_TYPE)); |
__ b(eq, 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. |
- __ ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset)); |
- __ ldrb(temp2, FieldMemOperand(temp, Map::kInstanceTypeOffset)); |
- __ sub(temp2, temp2, Operand(FIRST_JS_RECEIVER_TYPE)); |
- __ cmp(temp2, |
- Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - FIRST_JS_RECEIVER_TYPE)); |
- __ b(gt, is_false); |
+ __ b(eq, is_false); |
} |
- // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |
// Check if the constructor in the map is a function. |
Register instance_type = ip; |
__ GetMapConstructor(temp, temp, temp2, instance_type); |
// Objects with a non-function constructor have class 'Object'. |
__ cmp(instance_type, Operand(JS_FUNCTION_TYPE)); |
- if (class_name->IsOneByteEqualTo(STATIC_CHAR_VECTOR("Object"))) { |
+ if (String::Equals(isolate()->factory()->Object_string(), class_name)) { |
__ b(ne, is_true); |
} else { |
__ b(ne, is_false); |