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

Side by Side Diff: src/crankshaft/x87/lithium-codegen-x87.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
« no previous file with comments | « src/crankshaft/x64/lithium-codegen-x64.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" 7 #include "src/crankshaft/x87/lithium-codegen-x87.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after
2721 Register temp2) { 2721 Register temp2) {
2722 DCHECK(!input.is(temp)); 2722 DCHECK(!input.is(temp));
2723 DCHECK(!input.is(temp2)); 2723 DCHECK(!input.is(temp2));
2724 DCHECK(!temp.is(temp2)); 2724 DCHECK(!temp.is(temp2));
2725 __ JumpIfSmi(input, is_false); 2725 __ JumpIfSmi(input, is_false);
2726 2726
2727 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { 2727 if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
2728 // Assuming the following assertions, we can use the same compares to test 2728 // Assuming the following assertions, we can use the same compares to test
2729 // for both being a function type and being in the object type range. 2729 // for both being a function type and being in the object type range.
2730 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 2730 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
2731 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE ==
2732 FIRST_JS_RECEIVER_TYPE + 1);
2733 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == 2731 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
2734 LAST_JS_RECEIVER_TYPE - 1); 2732 LAST_JS_RECEIVER_TYPE - 1);
2735 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); 2733 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
Camillo Bruni 2015/12/11 12:37:27 It would probably make some things easier by havin
2736 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, temp); 2734 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, temp);
2737 __ j(below, is_false); 2735 __ j(below, is_false);
2738 __ j(equal, is_true);
2739 __ CmpInstanceType(temp, LAST_JS_RECEIVER_TYPE); 2736 __ CmpInstanceType(temp, LAST_JS_RECEIVER_TYPE);
Camillo Bruni 2015/12/11 12:37:27 Why don't we compare directly with JS_FUNCTION_TYP
2740 __ j(equal, is_true); 2737 __ j(equal, is_true);
2741 } else { 2738 } else {
2742 // Faster code path to avoid two compares: subtract lower bound from the 2739 // Faster code path to avoid two compares: subtract lower bound from the
2743 // actual type and do a signed compare with the width of the type range. 2740 // actual type and do a signed compare with the width of the type range.
2744 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); 2741 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
2745 __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); 2742 __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset));
2746 __ sub(Operand(temp2), Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 2743 __ sub(Operand(temp2), Immediate(FIRST_JS_RECEIVER_TYPE));
2747 __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - 2744 __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
2748 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 2745 FIRST_JS_RECEIVER_TYPE));
2749 __ j(above, is_false); 2746 __ j(above, is_false);
2750 } 2747 }
2751 2748
2752 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. 2749 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
2753 // Check if the constructor in the map is a function. 2750 // Check if the constructor in the map is a function.
2754 __ GetMapConstructor(temp, temp, temp2); 2751 __ GetMapConstructor(temp, temp, temp2);
2755 // Objects with a non-function constructor have class 'Object'. 2752 // Objects with a non-function constructor have class 'Object'.
2756 __ CmpInstanceType(temp2, JS_FUNCTION_TYPE); 2753 __ CmpInstanceType(temp2, JS_FUNCTION_TYPE);
2757 if (String::Equals(class_name, isolate()->factory()->Object_string())) { 2754 if (String::Equals(class_name, isolate()->factory()->Object_string())) {
2758 __ j(not_equal, is_true); 2755 __ j(not_equal, is_true);
(...skipping 3312 matching lines...) Expand 10 before | Expand all | Expand 10 after
6071 RecordSafepoint(Safepoint::kNoLazyDeopt); 6068 RecordSafepoint(Safepoint::kNoLazyDeopt);
6072 } 6069 }
6073 6070
6074 6071
6075 #undef __ 6072 #undef __
6076 6073
6077 } // namespace internal 6074 } // namespace internal
6078 } // namespace v8 6075 } // namespace v8
6079 6076
6080 #endif // V8_TARGET_ARCH_X87 6077 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/crankshaft/x64/lithium-codegen-x64.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698