Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 1537013002: PPC: [runtime] Drop FIRST/LAST_NONCALLABLE_SPEC_OBJECT instance type range. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/ppc/lithium-codegen-ppc.cc
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc
index e163af229cc5f5b5d679f3b8d4b58ac02acd4cce..c827b252be0217d0bb0fdbf9ebb5b0ee6955d7ea 100644
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc
@@ -2610,36 +2610,20 @@ void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false,
__ JumpIfSmi(input, is_false);
+ __ CompareObjectType(input, temp, temp2, JS_FUNCTION_TYPE);
if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
- // Assuming the following assertions, we can use the same compares to test
- // for both being a function type and being in the object type range.
- STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
- STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
- LAST_JS_RECEIVER_TYPE - 1);
- STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
- __ CompareObjectType(input, temp, temp2, FIRST_JS_RECEIVER_TYPE);
- __ blt(is_false);
- __ cmpi(temp2, Operand(LAST_JS_RECEIVER_TYPE));
__ beq(is_true);
} else {
- // Faster code path to avoid two compares: subtract lower bound from the
- // actual type and do a signed compare with the width of the type range.
- __ LoadP(temp, FieldMemOperand(input, HeapObject::kMapOffset));
- __ lbz(temp2, FieldMemOperand(temp, Map::kInstanceTypeOffset));
- __ subi(temp2, temp2, Operand(FIRST_JS_RECEIVER_TYPE));
- __ cmpi(temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
- FIRST_JS_RECEIVER_TYPE));
- __ bgt(is_false);
+ __ beq(is_false);
}
- // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
// Check if the constructor in the map is a function.
Register instance_type = ip;
__ GetMapConstructor(temp, temp, temp2, instance_type);
// Objects with a non-function constructor have class 'Object'.
__ cmpi(instance_type, Operand(JS_FUNCTION_TYPE));
- if (class_name->IsOneByteEqualTo(STATIC_CHAR_VECTOR("Object"))) {
+ if (String::Equals(isolate()->factory()->Object_string(), class_name)) {
__ bne(is_true);
} else {
__ bne(is_false);
« no previous file with comments | « no previous file | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698