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

Side by Side Diff: src/crankshaft/mips64/lithium-codegen-mips64.cc

Issue 1517673002: Fix Object.prototype.toString.call(proxy) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add test 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h"
(...skipping 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 DCHECK(!input.is(temp)); 2567 DCHECK(!input.is(temp));
2568 DCHECK(!input.is(temp2)); 2568 DCHECK(!input.is(temp2));
2569 DCHECK(!temp.is(temp2)); 2569 DCHECK(!temp.is(temp2));
2570 2570
2571 __ JumpIfSmi(input, is_false); 2571 __ JumpIfSmi(input, is_false);
2572 2572
2573 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { 2573 if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
2574 // Assuming the following assertions, we can use the same compares to test 2574 // Assuming the following assertions, we can use the same compares to test
2575 // for both being a function type and being in the object type range. 2575 // for both being a function type and being in the object type range.
2576 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 2576 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
2577 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE ==
2578 FIRST_JS_RECEIVER_TYPE + 1);
2579 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == 2577 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
2580 LAST_JS_RECEIVER_TYPE - 1); 2578 LAST_JS_RECEIVER_TYPE - 1);
2581 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); 2579 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
2582 2580
2583 __ GetObjectType(input, temp, temp2); 2581 __ GetObjectType(input, temp, temp2);
2584 __ Branch(is_false, lt, temp2, Operand(FIRST_JS_RECEIVER_TYPE)); 2582 __ Branch(is_false, lt, temp2, Operand(FIRST_JS_RECEIVER_TYPE));
2585 __ Branch(is_true, eq, temp2, Operand(FIRST_JS_RECEIVER_TYPE));
2586 __ Branch(is_true, eq, temp2, Operand(LAST_JS_RECEIVER_TYPE)); 2583 __ Branch(is_true, eq, temp2, Operand(LAST_JS_RECEIVER_TYPE));
2587 } else { 2584 } else {
2588 // Faster code path to avoid two compares: subtract lower bound from the 2585 // Faster code path to avoid two compares: subtract lower bound from the
2589 // actual type and do a signed compare with the width of the type range. 2586 // actual type and do a signed compare with the width of the type range.
2590 __ GetObjectType(input, temp, temp2); 2587 __ GetObjectType(input, temp, temp2);
2591 __ Dsubu(temp2, temp2, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 2588 __ Dsubu(temp2, temp2, Operand(FIRST_JS_RECEIVER_TYPE));
2592 __ Branch(is_false, gt, temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - 2589 __ Branch(is_false, gt, temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
2593 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 2590 FIRST_JS_RECEIVER_TYPE));
2594 } 2591 }
2595 2592
2596 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. 2593 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
2597 // Check if the constructor in the map is a function. 2594 // Check if the constructor in the map is a function.
2598 Register instance_type = scratch1(); 2595 Register instance_type = scratch1();
2599 DCHECK(!instance_type.is(temp)); 2596 DCHECK(!instance_type.is(temp));
2600 __ GetMapConstructor(temp, temp, temp2, instance_type); 2597 __ GetMapConstructor(temp, temp, temp2, instance_type);
2601 2598
2602 // Objects with a non-function constructor have class 'Object'. 2599 // Objects with a non-function constructor have class 'Object'.
2603 if (String::Equals(class_name, isolate()->factory()->Object_string())) { 2600 if (String::Equals(class_name, isolate()->factory()->Object_string())) {
(...skipping 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after
5873 __ Push(at, ToRegister(instr->function())); 5870 __ Push(at, ToRegister(instr->function()));
5874 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5871 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5875 RecordSafepoint(Safepoint::kNoLazyDeopt); 5872 RecordSafepoint(Safepoint::kNoLazyDeopt);
5876 } 5873 }
5877 5874
5878 5875
5879 #undef __ 5876 #undef __
5880 5877
5881 } // namespace internal 5878 } // namespace internal
5882 } // namespace v8 5879 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698