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

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

Issue 1965343002: [Interpreter] Support compiling for baseline on return from interpreted function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | src/bailout-reason.h » ('j') | src/compiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index 1f5481bed7862c229739d420515d6fded6f40559..9c4deecc3d8c845231cb69f666ac57defcb4e1bf 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -1077,13 +1077,44 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Jump(r4);
}
-
void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
// The return value is in accumulator, which is already in r0.
- // Leave the frame (also dropping the register file).
+ // Save the interpreter frame's function and callee pc to check if it has
+ // been marked for baseline compilation on return.
+ __ ldr(r2, MemOperand(sp, -kPointerSize));
+ __ ldr(r1, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
+
+ // Leave the frame (also dropping the register file). Do this before checking
+ // for baseline compile so that we don't count as an activation on the stack.
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
+ // Check if the function has been marked for baseline compilation on return.
+ Label not_marked_for_baseline;
+ __ mov(r3, Operand(ExternalReference(
+ Builtins::kInterpreterMarkBaselineOnReturn, masm->isolate())));
+ __ ldr(r3, MemOperand(r3));
+ __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag));
+ __ cmp(r2, Operand(r3));
+ __ b(ne, &not_marked_for_baseline);
+
+ {
+ FrameScope frame_scope(masm, StackFrame::INTERNAL);
+ // Push bytecode array and r0 for return.
+ __ push(kInterpreterBytecodeArrayRegister);
+ __ push(r0);
+
+ // Push function as argument and compile for baseline.
+ __ push(r1);
+ __ CallRuntime(Runtime::kCompileBaseline);
+
+ // Restore bytecode array and r0.
+ __ pop(r0);
+ __ pop(kInterpreterBytecodeArrayRegister);
+ }
+
+ __ bind(&not_marked_for_baseline);
+
// Drop receiver + arguments and return.
__ ldr(ip, FieldMemOperand(kInterpreterBytecodeArrayRegister,
BytecodeArray::kParameterSizeOffset));
@@ -1091,6 +1122,11 @@ void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
__ Jump(lr);
}
+void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) {
+ // This builtin is only used as a marker to be checked in
+ // InterpreterExitTrampoline and should never be called itself.
+ __ Abort(kUnexpectedCallToMarkBaselineOnReturn);
+}
static void Generate_InterpreterPushArgs(MacroAssembler* masm, Register index,
Register limit, Register scratch) {
« no previous file with comments | « no previous file | src/bailout-reason.h » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698