Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index d6e8dbaca01ca059fb68d52021e4e2d5ac90d87e..0a8a4fa6deab1fe2d4910bb04d78419a2fcaf374 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -1759,9 +1759,9 @@ Condition LCodeGen::EmitIsObject(Register input, |
// Load instance type and check that it is in object type range. |
__ ldrb(temp2, FieldMemOperand(temp1, Map::kInstanceTypeOffset)); |
- __ cmp(temp2, Operand(FIRST_JS_OBJECT_TYPE)); |
+ __ cmp(temp2, Operand(FIRST_OBJECT_CLASS_TYPE)); |
__ b(lt, is_not_object); |
- __ cmp(temp2, Operand(LAST_JS_OBJECT_TYPE)); |
+ __ cmp(temp2, Operand(LAST_OBJECT_CLASS_TYPE)); |
return le; |
} |
@@ -1968,26 +1968,26 @@ void LCodeGen::EmitClassOfTest(Label* is_true, |
ASSERT(!temp.is(temp2)); // But input and temp2 may be the same register. |
__ tst(input, Operand(kSmiTagMask)); |
__ b(eq, is_false); |
- __ CompareObjectType(input, temp, temp2, FIRST_JS_OBJECT_TYPE); |
+ __ CompareObjectType(input, temp, temp2, FIRST_OBJECT_OR_FUNCTION_CLASS_TYPE); |
__ b(lt, is_false); |
// Map is now in temp. |
// Functions have class 'Function'. |
- __ CompareInstanceType(temp, temp2, JS_FUNCTION_TYPE); |
+ __ CompareInstanceType(temp, temp2, FIRST_FUNCTION_CLASS_TYPE); |
if (class_name->IsEqualTo(CStrVector("Function"))) { |
- __ b(eq, is_true); |
+ __ b(ge, is_true); |
} else { |
- __ b(eq, is_false); |
+ __ b(ge, is_false); |
} |
// Check if the constructor in the map is a function. |
__ ldr(temp, FieldMemOperand(temp, Map::kConstructorOffset)); |
- // 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); |
+ // As long as LAST_FUNCTION_CLASS_TYPE is the last instance type and |
+ // FIRST_FUNCITON_CLASS_TYPE comes right after LAST_OBJECT_CLASS_TYPE, |
+ // we can avoid checking for LAST_OBJECT_CLASS_TYPE. |
+ ASSERT(LAST_TYPE == LAST_FUNCTION_CLASS_TYPE); |
Kevin Millikin (Chromium)
2011/05/26 09:31:08
Do you think that all these asserts can be STATIC_
rossberg
2011/05/31 14:50:24
Done (here and elsewhere).
|
+ ASSERT(FIRST_FUNCTION_CLASS_TYPE == LAST_OBJECT_CLASS_TYPE + 1); |
// Objects with a non-function constructor have class 'Object'. |
__ CompareObjectType(temp, temp2, temp2, JS_FUNCTION_TYPE); |
@@ -2706,7 +2706,8 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
// Deoptimize if the receiver is not a JS object. |
__ tst(receiver, Operand(kSmiTagMask)); |
DeoptimizeIf(eq, instr->environment()); |
- __ CompareObjectType(receiver, scratch, scratch, FIRST_JS_OBJECT_TYPE); |
+ __ CompareObjectType(receiver, scratch, scratch, |
+ FIRST_OBJECT_OR_FUNCTION_CLASS_TYPE); |
DeoptimizeIf(lo, instr->environment()); |
__ jmp(&receiver_ok); |
@@ -4356,10 +4357,10 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
__ JumpIfSmi(input, false_label); |
__ CompareRoot(input, Heap::kNullValueRootIndex); |
__ b(eq, true_label); |
- __ CompareObjectType(input, input, scratch, FIRST_JS_OBJECT_TYPE); |
+ __ CompareObjectType(input, input, scratch, FIRST_OBJECT_CLASS_TYPE); |
__ b(lo, false_label); |
- __ CompareInstanceType(input, scratch, FIRST_FUNCTION_CLASS_TYPE); |
- __ b(hs, false_label); |
+ __ CompareInstanceType(input, scratch, LAST_OBJECT_CLASS_TYPE); |
+ __ b(hi, false_label); |
// Check for undetectable objects => false. |
__ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset)); |
__ tst(ip, Operand(1 << Map::kIsUndetectable)); |