| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index f82c8b8603e54171e18d16cecf67421fcdf0477f..6e368de036c72366b0f11e5ff6bee38b2233a562 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -2618,27 +2618,39 @@
|
|
|
| __ JumpIfSmi(input, is_false);
|
|
|
| - STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
|
| - __ CompareObjectType(input, temp, temp2, FIRST_JS_RECEIVER_TYPE);
|
| - __ b(lt, is_false);
|
| -
|
| - // Objects with [[Call]] have class 'Function'.
|
| - __ ldrb(temp2, FieldMemOperand(temp, Map::kBitFieldOffset));
|
| - __ tst(temp2, Operand(1 << Map::kIsCallable));
|
| if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
|
| - __ b(ne, is_true);
|
| - } else {
|
| - __ b(ne, is_false);
|
| - }
|
| -
|
| - // Now we are in the FIRST-LAST_JS_RECEIVER_TYPE range.
|
| + // 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(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE ==
|
| + FIRST_SPEC_OBJECT_TYPE + 1);
|
| + STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
|
| + LAST_SPEC_OBJECT_TYPE - 1);
|
| + STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
|
| + __ CompareObjectType(input, temp, temp2, FIRST_SPEC_OBJECT_TYPE);
|
| + __ b(lt, is_false);
|
| + __ b(eq, is_true);
|
| + __ cmp(temp2, Operand(LAST_SPEC_OBJECT_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_NONCALLABLE_SPEC_OBJECT_TYPE));
|
| + __ cmp(temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
|
| + FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
|
| + __ b(gt, 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 (String::Equals(isolate()->factory()->Object_string(), class_name)) {
|
| + if (class_name->IsOneByteEqualTo(STATIC_CHAR_VECTOR("Object"))) {
|
| __ b(ne, is_true);
|
| } else {
|
| __ b(ne, is_false);
|
|
|