Index: src/crankshaft/mips/lithium-codegen-mips.cc |
diff --git a/src/crankshaft/mips/lithium-codegen-mips.cc b/src/crankshaft/mips/lithium-codegen-mips.cc |
index 5a5cd4e0b6a4396675e4babde45e7a84a42ff7b6..e78096958b7aa0746a55007fdb642da59358e7a9 100644 |
--- a/src/crankshaft/mips/lithium-codegen-mips.cc |
+++ b/src/crankshaft/mips/lithium-codegen-mips.cc |
@@ -2448,28 +2448,13 @@ void LCodeGen::EmitClassOfTest(Label* is_true, |
DCHECK(!temp.is(temp2)); |
__ JumpIfSmi(input, is_false); |
- |
+ __ GetObjectType(input, temp, temp2); |
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); |
- |
- __ GetObjectType(input, temp, temp2); |
- __ Branch(is_false, lt, temp2, Operand(FIRST_JS_RECEIVER_TYPE)); |
- __ Branch(is_true, eq, temp2, Operand(LAST_JS_RECEIVER_TYPE)); |
+ __ Branch(is_true, eq, temp2, Operand(JS_FUNCTION_TYPE)); |
} 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. |
- __ GetObjectType(input, temp, temp2); |
- __ Subu(temp2, temp2, Operand(FIRST_JS_RECEIVER_TYPE)); |
- __ Branch(is_false, gt, temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - |
- FIRST_JS_RECEIVER_TYPE)); |
+ __ Branch(is_false, eq, temp2, Operand(JS_FUNCTION_TYPE)); |
} |
- // 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 = scratch1(); |
DCHECK(!instance_type.is(temp)); |