Index: src/ppc/lithium-codegen-ppc.cc |
diff --git a/src/ppc/lithium-codegen-ppc.cc b/src/ppc/lithium-codegen-ppc.cc |
index 9abe91e1aee3ce40328701b83238dd3d5aa10b24..b287c4b4464eb8697313e4a3105a9cdf8d0c5610 100644 |
--- a/src/ppc/lithium-codegen-ppc.cc |
+++ b/src/ppc/lithium-codegen-ppc.cc |
@@ -5829,24 +5829,25 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, Label* false_label, |
final_branch_condition = ne; |
} else if (String::Equals(type_name, factory->function_string())) { |
- STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
- Register type_reg = scratch; |
__ JumpIfSmi(input, false_label); |
- __ CompareObjectType(input, scratch, type_reg, JS_FUNCTION_TYPE); |
- __ beq(true_label); |
- __ cmpi(type_reg, Operand(JS_FUNCTION_PROXY_TYPE)); |
+ __ LoadP(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
+ __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
+ __ andi(scratch, scratch, |
+ Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
+ __ cmpi(scratch, Operand(1 << Map::kIsCallable)); |
final_branch_condition = eq; |
} else if (String::Equals(type_name, factory->object_string())) { |
- Register map = scratch; |
__ JumpIfSmi(input, false_label); |
__ CompareRoot(input, Heap::kNullValueRootIndex); |
__ beq(true_label); |
- __ CheckObjectTypeRange(input, map, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, |
- LAST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label); |
- // Check for undetectable objects => false. |
- __ lbz(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); |
- __ ExtractBit(r0, scratch, Map::kIsUndetectable); |
+ STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
+ __ CompareObjectType(input, scratch, ip, FIRST_SPEC_OBJECT_TYPE); |
+ __ blt(false_label); |
+ // Check for callable or undetectable objects => false. |
+ __ lbz(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
+ __ andi(r0, scratch, |
+ Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
__ cmpi(r0, Operand::Zero()); |
final_branch_condition = eq; |