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

Unified Diff: src/x87/builtins-x87.cc

Issue 1756743002: X87: [Interpreter] Fixes PushArgsAndConstruct builtin to not store any data outside esp. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/builtins-x87.cc
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc
index 8a4272ada80ddef80f7680ce3ba6bf54abd665e1..317166b294c433a5187f7e5251fb56aa6f2812ff 100644
--- a/src/x87/builtins-x87.cc
+++ b/src/x87/builtins-x87.cc
@@ -603,27 +603,24 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
// they are to be pushed onto the stack.
// -----------------------------------
- // Save number of arguments on the stack below where arguments are going
- // to be pushed.
- __ mov(ecx, eax);
- __ neg(ecx);
- __ mov(Operand(esp, ecx, times_pointer_size, -kPointerSize), eax);
- __ mov(eax, ecx);
-
// Pop return address to allow tail-call after pushing arguments.
__ Pop(ecx);
- // Find the address of the last argument.
- __ shl(eax, kPointerSizeLog2);
- __ add(eax, ebx);
+ // Push edi in the slot meant for receiver. We need an extra register
+ // so store edi temporarily on stack.
+ __ Push(edi);
- // Push padding for receiver.
- __ Push(Immediate(0));
+ // Find the address of the last argument.
+ __ mov(edi, eax);
+ __ neg(edi);
+ __ shl(edi, kPointerSizeLog2);
+ __ add(edi, ebx);
- Generate_InterpreterPushArgs(masm, eax);
+ Generate_InterpreterPushArgs(masm, edi);
- // Restore number of arguments from slot on stack.
- __ mov(eax, Operand(esp, -kPointerSize));
+ // Restore the constructor from slot on stack. It was pushed at the slot
+ // meant for receiver.
+ __ mov(edi, Operand(esp, eax, times_pointer_size, 0));
// Re-push return address.
__ Push(ecx);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698