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

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

Issue 1537613002: X87: [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 unified diff | Download patch
« no previous file with comments | « no previous file | src/full-codegen/x87/full-codegen-x87.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 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 Label* is_false, 2717 Label* is_false,
2718 Handle<String>class_name, 2718 Handle<String>class_name,
2719 Register input, 2719 Register input,
2720 Register temp, 2720 Register temp,
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 __ CmpObjectType(input, JS_FUNCTION_TYPE, temp);
2727 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { 2728 if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
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.
2730 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
2731 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
2732 LAST_JS_RECEIVER_TYPE - 1);
2733 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
2734 __ CmpObjectType(input, FIRST_JS_RECEIVER_TYPE, temp);
2735 __ j(below, is_false);
2736 __ CmpInstanceType(temp, LAST_JS_RECEIVER_TYPE);
2737 __ j(equal, is_true); 2729 __ j(equal, is_true);
2738 } else { 2730 } else {
2739 // Faster code path to avoid two compares: subtract lower bound from the 2731 __ j(equal, is_false);
2740 // actual type and do a signed compare with the width of the type range.
2741 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
2742 __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset));
2743 __ sub(Operand(temp2), Immediate(FIRST_JS_RECEIVER_TYPE));
2744 __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
2745 FIRST_JS_RECEIVER_TYPE));
2746 __ j(above, is_false);
2747 } 2732 }
2748 2733
2749 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. 2734 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
2750 // Check if the constructor in the map is a function. 2735 // Check if the constructor in the map is a function.
2751 __ GetMapConstructor(temp, temp, temp2); 2736 __ GetMapConstructor(temp, temp, temp2);
2752 // Objects with a non-function constructor have class 'Object'. 2737 // Objects with a non-function constructor have class 'Object'.
2753 __ CmpInstanceType(temp2, JS_FUNCTION_TYPE); 2738 __ CmpInstanceType(temp2, JS_FUNCTION_TYPE);
2754 if (String::Equals(class_name, isolate()->factory()->Object_string())) { 2739 if (String::Equals(class_name, isolate()->factory()->Object_string())) {
2755 __ j(not_equal, is_true); 2740 __ j(not_equal, is_true);
2756 } else { 2741 } else {
(...skipping 3318 matching lines...) Expand 10 before | Expand all | Expand 10 after
6075 RecordSafepoint(Safepoint::kNoLazyDeopt); 6060 RecordSafepoint(Safepoint::kNoLazyDeopt);
6076 } 6061 }
6077 6062
6078 6063
6079 #undef __ 6064 #undef __
6080 6065
6081 } // namespace internal 6066 } // namespace internal
6082 } // namespace v8 6067 } // namespace v8
6083 6068
6084 #endif // V8_TARGET_ARCH_X87 6069 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698