Index: src/full-codegen/arm64/full-codegen-arm64.cc |
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc |
index fe7ad4bb580c178b82a9581862cb81d5f7d31af3..1ac0596001c802b0e82e7f2abacde1a912de886d 100644 |
--- a/src/full-codegen/arm64/full-codegen-arm64.cc |
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc |
@@ -3034,25 +3034,17 @@ 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(x0, &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(x0, x10, x11, FIRST_JS_RECEIVER_TYPE); |
// x10: object's map. |
// x11: object's type. |
__ B(lt, &null); |
- __ Cmp(x11, LAST_JS_RECEIVER_TYPE); |
- STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == |
- LAST_JS_RECEIVER_TYPE - 1); |
+ // Return 'Function' for JSFunction objects. |
+ __ Cmp(x11, JS_FUNCTION_TYPE); |
__ B(eq, &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 = x14; |