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

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

Issue 2090723005: [builtins] New frame type for exits to C++ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing condition in SafeStackFrameIter::frame() Created 4 years, 5 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/frames-inl.h ('k') | src/ia32/code-stubs-ia32.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"
11 #include "src/ia32/frames-ia32.h" 11 #include "src/ia32/frames-ia32.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 16
17 #define __ ACCESS_MASM(masm) 17 #define __ ACCESS_MASM(masm)
18 18
19 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { 19 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
20 ExitFrameType exit_frame_type) {
20 // ----------- S t a t e ------------- 21 // ----------- S t a t e -------------
21 // -- eax : number of arguments excluding receiver 22 // -- eax : number of arguments excluding receiver
22 // -- edi : target 23 // -- edi : target
23 // -- edx : new.target 24 // -- edx : new.target
24 // -- esp[0] : return address 25 // -- esp[0] : return address
25 // -- esp[4] : last argument 26 // -- esp[4] : last argument
26 // -- ... 27 // -- ...
27 // -- esp[4 * argc] : first argument 28 // -- esp[4 * argc] : first argument
28 // -- esp[4 * (argc +1)] : receiver 29 // -- esp[4 * (argc +1)] : receiver
29 // ----------------------------------- 30 // -----------------------------------
30 __ AssertFunction(edi); 31 __ AssertFunction(edi);
31 32
32 // Make sure we operate in the context of the called function (for example 33 // Make sure we operate in the context of the called function (for example
33 // ConstructStubs implemented in C++ will be run in the context of the caller 34 // ConstructStubs implemented in C++ will be run in the context of the caller
34 // instead of the callee, due to the way that [[Construct]] is defined for 35 // instead of the callee, due to the way that [[Construct]] is defined for
35 // ordinary functions). 36 // ordinary functions).
36 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); 37 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
37 38
38 // Insert extra arguments. 39 // Insert extra arguments.
39 const int num_extra_args = 2; 40 const int num_extra_args = 2;
40 __ PopReturnAddressTo(ecx); 41 __ PopReturnAddressTo(ecx);
41 __ Push(edi); 42 __ Push(edi);
42 __ Push(edx); 43 __ Push(edx);
43 __ PushReturnAddressFrom(ecx); 44 __ PushReturnAddressFrom(ecx);
44 45
45 // JumpToExternalReference expects eax to contain the number of arguments 46 // JumpToExternalReference expects eax to contain the number of arguments
46 // including the receiver and the extra arguments. 47 // including the receiver and the extra arguments.
47 __ add(eax, Immediate(num_extra_args + 1)); 48 __ add(eax, Immediate(num_extra_args + 1));
48 49
49 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); 50 __ JumpToExternalReference(ExternalReference(id, masm->isolate()),
51 exit_frame_type == BUILTIN_EXIT);
50 } 52 }
51 53
52 static void GenerateTailCallToReturnedCode(MacroAssembler* masm, 54 static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
53 Runtime::FunctionId function_id) { 55 Runtime::FunctionId function_id) {
54 // ----------- S t a t e ------------- 56 // ----------- S t a t e -------------
55 // -- eax : argument count (preserved for callee) 57 // -- eax : argument count (preserved for callee)
56 // -- edx : new target (preserved for callee) 58 // -- edx : new target (preserved for callee)
57 // -- edi : target function (preserved for callee) 59 // -- edi : target function (preserved for callee)
58 // ----------------------------------- 60 // -----------------------------------
59 { 61 {
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after
2979 // And "return" to the OSR entry point of the function. 2981 // And "return" to the OSR entry point of the function.
2980 __ ret(0); 2982 __ ret(0);
2981 } 2983 }
2982 2984
2983 2985
2984 #undef __ 2986 #undef __
2985 } // namespace internal 2987 } // namespace internal
2986 } // namespace v8 2988 } // namespace v8
2987 2989
2988 #endif // V8_TARGET_ARCH_IA32 2990 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/frames-inl.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698