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

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

Issue 145713002: A64: Implement LOsrEntry and LUnknownOSRValue (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: updates Created 6 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 | « src/a64/assembler-a64.h ('k') | src/a64/deoptimizer-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/builtins-a64.cc
diff --git a/src/a64/builtins-a64.cc b/src/a64/builtins-a64.cc
index a83bcc586b41f65844e20e2adfc9390a7b4c4818..ad328067f854e9d64793ca815f818ae20c585c6d 100644
--- a/src/a64/builtins-a64.cc
+++ b/src/a64/builtins-a64.cc
@@ -919,12 +919,50 @@ void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
void Builtins::Generate_NotifyOSR(MacroAssembler* masm) {
- ASM_UNIMPLEMENTED_BREAK("Implement Generate_NotifyOSR");
+ // For now, we are relying on the fact that Runtime::NotifyOSR
+ // doesn't do any garbage collection which allows us to save/restore
+ // the registers without worrying about which of them contain
+ // pointers. This seems a bit fragile.
+ //
+ // TODO(jochen): Is it correct (and appropriate) to use safepoint
+ // registers here? According to the comment above, we should only need to
+ // preserve the registers with parameters.
+ __ PushXRegList(kSafepointSavedRegisters);
+ {
+ FrameScope scope(masm, StackFrame::INTERNAL);
+ __ CallRuntime(Runtime::kNotifyOSR, 0);
+ }
+ __ PopXRegList(kSafepointSavedRegisters);
+ __ Ret();
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
- ASM_UNIMPLEMENTED_BREAK("Implement Generate_OnStackReplacement");
+ // Lookup the function in the JavaScript frame and push it as an
+ // argument to the on-stack replacement function.
+ __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ {
+ FrameScope scope(masm, StackFrame::INTERNAL);
+ __ Push(x0);
+ __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1);
+ }
+
+ // If the result was -1 it means that we couldn't optimize the
+ // function. Just return and continue in the unoptimized version.
+ Label skip;
+ __ Cmp(x0, Operand(Smi::FromInt(-1)));
+ __ B(ne, &skip);
+ __ Ret();
+
+ __ Bind(&skip);
+ // Untag the AST id and push it on the stack.
+ __ SmiUntag(x0);
+ __ Push(x0);
+
+ // Generate the code for doing the frame-to-frame translation using
+ // the deoptimizer infrastructure.
+ Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
+ generator.Generate();
}
« no previous file with comments | « src/a64/assembler-a64.h ('k') | src/a64/deoptimizer-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698