Index: src/full-codegen/ppc/full-codegen-ppc.cc |
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc |
index 4af5bc4ab8f5afe2a0ca747794ac6356d38867f6..fc23ff79f5b379224cca999f50b2b2edc2c0fec2 100644 |
--- a/src/full-codegen/ppc/full-codegen-ppc.cc |
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc |
@@ -5009,23 +5009,23 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, |
} else if (String::Equals(check, factory->function_string())) { |
__ JumpIfSmi(r3, if_false); |
- STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
- __ CompareObjectType(r3, r3, r4, JS_FUNCTION_TYPE); |
- __ beq(if_true); |
- __ cmpi(r4, Operand(JS_FUNCTION_PROXY_TYPE)); |
+ __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
+ __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
+ __ andi(r4, r4, |
+ Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
+ __ cmpi(r4, Operand(1 << Map::kIsCallable)); |
Split(eq, if_true, if_false, fall_through); |
} else if (String::Equals(check, factory->object_string())) { |
__ JumpIfSmi(r3, if_false); |
__ CompareRoot(r3, Heap::kNullValueRootIndex); |
__ beq(if_true); |
- // Check for JS objects => true. |
- __ CompareObjectType(r3, r3, r4, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
+ STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
+ __ CompareObjectType(r3, r3, r4, FIRST_SPEC_OBJECT_TYPE); |
__ blt(if_false); |
- __ CompareInstanceType(r3, r4, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
- __ bgt(if_false); |
- // Check for undetectable objects => false. |
+ // Check for callable or undetectable objects => false. |
__ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
- __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); |
+ __ andi(r0, r4, |
+ Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
Split(eq, if_true, if_false, fall_through, cr0); |
// clang-format off |
#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |