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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 11783066: Optimize function at its entry instead of at exit. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 16874)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -1984,17 +1984,24 @@
}
// Calls to the runtime to optimize the given function.
-// RDX: function to be reoptimized.
-// RAX: result of function being optimized (preserved).
+// RDI: function to be reoptimized.
+// R10: argument descriptor (preserved).
void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
+ const Immediate raw_null =
+ Immediate(reinterpret_cast<intptr_t>(Object::null()));
AssemblerMacros::EnterStubFrame(assembler);
- __ pushq(RAX);
- __ pushq(RDX);
+ __ pushq(R10);
+ __ pushq(raw_null); // Setup space on stack for return value.
+ __ pushq(RDI);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
- __ popq(RDX);
- __ popq(RAX);
+ __ popq(RAX); // Disard argument.
+ __ popq(RAX); // Get Code object.
+ __ popq(R10); // Restore argument descriptor.
+ __ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
+ __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ LeaveFrame();
- __ ret();
+ __ jmp(RAX);
+ __ int3();
}
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698