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

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 2079393003: [builtins] NonNumberToNumber and StringToNumber now use CallRuntime instead of TailCallRuntime (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 6 months 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/arm64/builtins-arm64.cc ('k') | src/mips/builtins-mips.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/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2659 // Check if string has a cached array index. 2659 // Check if string has a cached array index.
2660 Label runtime; 2660 Label runtime;
2661 __ test(FieldOperand(eax, String::kHashFieldOffset), 2661 __ test(FieldOperand(eax, String::kHashFieldOffset),
2662 Immediate(String::kContainsCachedArrayIndexMask)); 2662 Immediate(String::kContainsCachedArrayIndexMask));
2663 __ j(not_zero, &runtime, Label::kNear); 2663 __ j(not_zero, &runtime, Label::kNear);
2664 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset)); 2664 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset));
2665 __ IndexFromHash(eax, eax); 2665 __ IndexFromHash(eax, eax);
2666 __ Ret(); 2666 __ Ret();
2667 2667
2668 __ bind(&runtime); 2668 __ bind(&runtime);
2669 __ PopReturnAddressTo(ecx); // Pop return address. 2669 {
2670 __ Push(eax); // Push argument. 2670 FrameScope frame(masm, StackFrame::INTERNAL);
2671 __ PushReturnAddressFrom(ecx); // Push return address. 2671 // Push argument.
2672 __ TailCallRuntime(Runtime::kStringToNumber); 2672 __ push(eax);
2673 // We cannot use a tail call here because this builtin can also be called
2674 // from wasm.
2675 __ CallRuntime(Runtime::kStringToNumber);
2676 }
2677 __ Ret();
2673 } 2678 }
2674 2679
2675 // static 2680 // static
2676 void Builtins::Generate_ToNumber(MacroAssembler* masm) { 2681 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
2677 // The ToNumber stub takes one argument in eax. 2682 // The ToNumber stub takes one argument in eax.
2678 Label not_smi; 2683 Label not_smi;
2679 __ JumpIfNotSmi(eax, &not_smi, Label::kNear); 2684 __ JumpIfNotSmi(eax, &not_smi, Label::kNear);
2680 __ Ret(); 2685 __ Ret();
2681 __ bind(&not_smi); 2686 __ bind(&not_smi);
2682 2687
(...skipping 20 matching lines...) Expand all
2703 __ Jump(masm->isolate()->builtins()->StringToNumber(), 2708 __ Jump(masm->isolate()->builtins()->StringToNumber(),
2704 RelocInfo::CODE_TARGET); 2709 RelocInfo::CODE_TARGET);
2705 __ bind(&not_string); 2710 __ bind(&not_string);
2706 2711
2707 Label not_oddball; 2712 Label not_oddball;
2708 __ CmpInstanceType(edi, ODDBALL_TYPE); 2713 __ CmpInstanceType(edi, ODDBALL_TYPE);
2709 __ j(not_equal, &not_oddball, Label::kNear); 2714 __ j(not_equal, &not_oddball, Label::kNear);
2710 __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset)); 2715 __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset));
2711 __ Ret(); 2716 __ Ret();
2712 __ bind(&not_oddball); 2717 __ bind(&not_oddball);
2713 2718 {
2714 __ pop(ecx); // Pop return address. 2719 FrameScope frame(masm, StackFrame::INTERNAL);
2715 __ push(eax); // Push argument. 2720 // Push argument.
2716 __ push(ecx); // Push return address. 2721 __ push(eax);
2717 __ TailCallRuntime(Runtime::kToNumber); 2722 // We cannot use a tail call here because this builtin can also be called
2723 // from wasm.
2724 __ CallRuntime(Runtime::kToNumber);
2725 }
2726 __ Ret();
2718 } 2727 }
2719 2728
2720 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2729 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2721 // ----------- S t a t e ------------- 2730 // ----------- S t a t e -------------
2722 // -- eax : actual number of arguments 2731 // -- eax : actual number of arguments
2723 // -- ebx : expected number of arguments 2732 // -- ebx : expected number of arguments
2724 // -- edx : new target (passed through to callee) 2733 // -- edx : new target (passed through to callee)
2725 // -- edi : function (passed through to callee) 2734 // -- edi : function (passed through to callee)
2726 // ----------------------------------- 2735 // -----------------------------------
2727 2736
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2968 // And "return" to the OSR entry point of the function. 2977 // And "return" to the OSR entry point of the function.
2969 __ ret(0); 2978 __ ret(0);
2970 } 2979 }
2971 2980
2972 2981
2973 #undef __ 2982 #undef __
2974 } // namespace internal 2983 } // namespace internal
2975 } // namespace v8 2984 } // namespace v8
2976 2985
2977 #endif // V8_TARGET_ARCH_IA32 2986 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698