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

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

Issue 2554493002: [x86] [crankshaft] unify jump label's distance value in DoWrapReceiver(). (Closed)
Patch Set: Created 4 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/crankshaft/x64/lithium-codegen-x64.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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 __ j(not_equal, &receiver_ok, dist); 2755 __ j(not_equal, &receiver_ok, dist);
2756 2756
2757 // Do not transform the receiver to object for builtins. 2757 // Do not transform the receiver to object for builtins.
2758 __ test_b(FieldOperand(scratch, SharedFunctionInfo::kNativeByteOffset), 2758 __ test_b(FieldOperand(scratch, SharedFunctionInfo::kNativeByteOffset),
2759 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); 2759 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte));
2760 __ j(not_equal, &receiver_ok, dist); 2760 __ j(not_equal, &receiver_ok, dist);
2761 } 2761 }
2762 2762
2763 // Normal function. Replace undefined or null with global receiver. 2763 // Normal function. Replace undefined or null with global receiver.
2764 __ cmp(receiver, factory()->null_value()); 2764 __ cmp(receiver, factory()->null_value());
2765 __ j(equal, &global_object, Label::kNear); 2765 __ j(equal, &global_object, dist);
2766 __ cmp(receiver, factory()->undefined_value()); 2766 __ cmp(receiver, factory()->undefined_value());
2767 __ j(equal, &global_object, Label::kNear); 2767 __ j(equal, &global_object, dist);
2768 2768
2769 // The receiver should be a JS object. 2769 // The receiver should be a JS object.
2770 __ test(receiver, Immediate(kSmiTagMask)); 2770 __ test(receiver, Immediate(kSmiTagMask));
2771 DeoptimizeIf(equal, instr, DeoptimizeReason::kSmi); 2771 DeoptimizeIf(equal, instr, DeoptimizeReason::kSmi);
2772 __ CmpObjectType(receiver, FIRST_JS_RECEIVER_TYPE, scratch); 2772 __ CmpObjectType(receiver, FIRST_JS_RECEIVER_TYPE, scratch);
2773 DeoptimizeIf(below, instr, DeoptimizeReason::kNotAJavaScriptObject); 2773 DeoptimizeIf(below, instr, DeoptimizeReason::kNotAJavaScriptObject);
2774 2774
2775 __ jmp(&receiver_ok, Label::kNear); 2775 __ jmp(&receiver_ok, dist);
2776 __ bind(&global_object); 2776 __ bind(&global_object);
2777 __ mov(receiver, FieldOperand(function, JSFunction::kContextOffset)); 2777 __ mov(receiver, FieldOperand(function, JSFunction::kContextOffset));
2778 __ mov(receiver, ContextOperand(receiver, Context::NATIVE_CONTEXT_INDEX)); 2778 __ mov(receiver, ContextOperand(receiver, Context::NATIVE_CONTEXT_INDEX));
2779 __ mov(receiver, ContextOperand(receiver, Context::GLOBAL_PROXY_INDEX)); 2779 __ mov(receiver, ContextOperand(receiver, Context::GLOBAL_PROXY_INDEX));
2780 __ bind(&receiver_ok); 2780 __ bind(&receiver_ok);
2781 } 2781 }
2782 2782
2783 2783
2784 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { 2784 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
2785 Register receiver = ToRegister(instr->receiver()); 2785 Register receiver = ToRegister(instr->receiver());
(...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after
5148 __ bind(deferred->exit()); 5148 __ bind(deferred->exit());
5149 __ bind(&done); 5149 __ bind(&done);
5150 } 5150 }
5151 5151
5152 #undef __ 5152 #undef __
5153 5153
5154 } // namespace internal 5154 } // namespace internal
5155 } // namespace v8 5155 } // namespace v8
5156 5156
5157 #endif // V8_TARGET_ARCH_IA32 5157 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698