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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.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/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after
2535 DCHECK(!input.is(temp)); 2535 DCHECK(!input.is(temp));
2536 DCHECK(!input.is(temp2)); 2536 DCHECK(!input.is(temp2));
2537 DCHECK(!temp.is(temp2)); 2537 DCHECK(!temp.is(temp2));
2538 2538
2539 __ JumpIfSmi(input, is_false); 2539 __ JumpIfSmi(input, is_false);
2540 2540
2541 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { 2541 if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
2542 // Assuming the following assertions, we can use the same compares to test 2542 // Assuming the following assertions, we can use the same compares to test
2543 // for both being a function type and being in the object type range. 2543 // for both being a function type and being in the object type range.
2544 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 2544 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
2545 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE ==
2546 FIRST_JS_RECEIVER_TYPE + 1);
2547 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == 2545 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
2548 LAST_JS_RECEIVER_TYPE - 1); 2546 LAST_JS_RECEIVER_TYPE - 1);
2549 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); 2547 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
2550 __ CompareObjectType(input, temp, temp2, FIRST_JS_RECEIVER_TYPE); 2548 __ CompareObjectType(input, temp, temp2, FIRST_JS_RECEIVER_TYPE);
2551 __ b(lt, is_false); 2549 __ b(lt, is_false);
2552 __ b(eq, is_true);
2553 __ cmp(temp2, Operand(LAST_JS_RECEIVER_TYPE)); 2550 __ cmp(temp2, Operand(LAST_JS_RECEIVER_TYPE));
2554 __ b(eq, is_true); 2551 __ b(eq, is_true);
2555 } else { 2552 } else {
2556 // Faster code path to avoid two compares: subtract lower bound from the 2553 // Faster code path to avoid two compares: subtract lower bound from the
2557 // actual type and do a signed compare with the width of the type range. 2554 // actual type and do a signed compare with the width of the type range.
2558 __ ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset)); 2555 __ ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset));
2559 __ ldrb(temp2, FieldMemOperand(temp, Map::kInstanceTypeOffset)); 2556 __ ldrb(temp2, FieldMemOperand(temp, Map::kInstanceTypeOffset));
2560 __ sub(temp2, temp2, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 2557 __ sub(temp2, temp2, Operand(FIRST_JS_RECEIVER_TYPE));
2561 __ cmp(temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - 2558 __ cmp(temp2,
2562 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 2559 Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - FIRST_JS_RECEIVER_TYPE));
2563 __ b(gt, is_false); 2560 __ b(gt, is_false);
2564 } 2561 }
2565 2562
2566 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. 2563 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
2567 // Check if the constructor in the map is a function. 2564 // Check if the constructor in the map is a function.
2568 Register instance_type = ip; 2565 Register instance_type = ip;
2569 __ GetMapConstructor(temp, temp, temp2, instance_type); 2566 __ GetMapConstructor(temp, temp, temp2, instance_type);
2570 2567
2571 // Objects with a non-function constructor have class 'Object'. 2568 // Objects with a non-function constructor have class 'Object'.
2572 __ cmp(instance_type, Operand(JS_FUNCTION_TYPE)); 2569 __ cmp(instance_type, Operand(JS_FUNCTION_TYPE));
(...skipping 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after
5643 __ push(ToRegister(instr->function())); 5640 __ push(ToRegister(instr->function()));
5644 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5641 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5645 RecordSafepoint(Safepoint::kNoLazyDeopt); 5642 RecordSafepoint(Safepoint::kNoLazyDeopt);
5646 } 5643 }
5647 5644
5648 5645
5649 #undef __ 5646 #undef __
5650 5647
5651 } // namespace internal 5648 } // namespace internal
5652 } // namespace v8 5649 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698