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

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

Issue 2106883003: [builtins] Add receiver to builtin exit frames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments 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/heap-symbols.h ('k') | src/isolate.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 18 matching lines...) Expand all
29 // -- esp[4 * (argc +1)] : receiver 29 // -- esp[4 * (argc +1)] : receiver
30 // ----------------------------------- 30 // -----------------------------------
31 __ AssertFunction(edi); 31 __ AssertFunction(edi);
32 32
33 // 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
34 // 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
35 // 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
36 // ordinary functions). 36 // ordinary functions).
37 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); 37 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
38 38
39 // JumpToExternalReference expects eax to contain the number of arguments
40 // including the receiver and the extra arguments.
41 const int num_extra_args = 3;
42 __ add(eax, Immediate(num_extra_args + 1));
43
39 // Insert extra arguments. 44 // Insert extra arguments.
40 const int num_extra_args = 2;
41 __ PopReturnAddressTo(ecx); 45 __ PopReturnAddressTo(ecx);
46 __ SmiTag(eax);
47 __ Push(eax);
48 __ SmiUntag(eax);
42 __ Push(edi); 49 __ Push(edi);
43 __ Push(edx); 50 __ Push(edx);
44 __ PushReturnAddressFrom(ecx); 51 __ PushReturnAddressFrom(ecx);
45 52
46 // JumpToExternalReference expects eax to contain the number of arguments
47 // including the receiver and the extra arguments.
48 __ add(eax, Immediate(num_extra_args + 1));
49
50 __ JumpToExternalReference(ExternalReference(id, masm->isolate()), 53 __ JumpToExternalReference(ExternalReference(id, masm->isolate()),
51 exit_frame_type == BUILTIN_EXIT); 54 exit_frame_type == BUILTIN_EXIT);
52 } 55 }
53 56
54 static void GenerateTailCallToReturnedCode(MacroAssembler* masm, 57 static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
55 Runtime::FunctionId function_id) { 58 Runtime::FunctionId function_id) {
56 // ----------- S t a t e ------------- 59 // ----------- S t a t e -------------
57 // -- eax : argument count (preserved for callee) 60 // -- eax : argument count (preserved for callee)
58 // -- edx : new target (preserved for callee) 61 // -- edx : new target (preserved for callee)
59 // -- edi : target function (preserved for callee) 62 // -- edi : target function (preserved for callee)
(...skipping 2921 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 // And "return" to the OSR entry point of the function. 2984 // And "return" to the OSR entry point of the function.
2982 __ ret(0); 2985 __ ret(0);
2983 } 2986 }
2984 2987
2985 2988
2986 #undef __ 2989 #undef __
2987 } // namespace internal 2990 } // namespace internal
2988 } // namespace v8 2991 } // namespace v8
2989 2992
2990 #endif // V8_TARGET_ARCH_IA32 2993 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap-symbols.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698