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 1433aa4a76c136838a90448ff6f88145cd3e3985..89b1a7277f5e80dd98d825ca8cb7064464876d54 100644 |
--- a/src/full-codegen/ppc/full-codegen-ppc.cc |
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc |
@@ -3321,23 +3321,16 @@ void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { |
VisitForAccumulatorValue(args->at(0)); |
- // If the object is a smi, we return null. |
+ // If the object is not a JSReceiver, we return null. |
__ JumpIfSmi(r3, &null); |
- |
- // Check that the object is a JS object but take special care of JS |
- // functions to make sure they have 'Function' as their class. |
- // Assume that there are only two callable types, and one of them is at |
- // either end of the type range for JS object types. Saves extra comparisons. |
- STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
+ STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
__ CompareObjectType(r3, r3, r4, FIRST_JS_RECEIVER_TYPE); |
// Map is now in r3. |
__ blt(&null); |
- __ cmpi(r4, Operand(LAST_JS_RECEIVER_TYPE)); |
- STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_JS_RECEIVER_TYPE - 1); |
+ // Return 'Function' for JSFunction objects. |
+ __ cmpi(r4, Operand(JS_FUNCTION_TYPE)); |
__ beq(&function); |
- // Assume that there is no larger type. |
- STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE - 1); |
// Check if the constructor in the map is a JS function. |
Register instance_type = r5; |