Commit 0cd2f082 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[builtins] Simplify calls to kCompileForOnStackReplacement.

R=mslekova@chromium.org
BUG=v8:9810

Change-Id: Ia671189b25d4f212887e41a7b2d6a5b028f3c51c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1852771Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64233}
parent 651f4cca
......@@ -1563,14 +1563,8 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ ldr(r0, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ ldr(r0, MemOperand(r0, JavaScriptFrameConstants::kFunctionOffset));
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ push(r0);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -1765,14 +1765,8 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ Ldr(x0, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ Ldr(x0, MemOperand(x0, JavaScriptFrameConstants::kFunctionOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ PushArgument(x0);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -2602,14 +2602,8 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ mov(eax, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
__ mov(eax, Operand(eax, JavaScriptFrameConstants::kFunctionOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ push(eax);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -1528,14 +1528,8 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ lw(a0, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ lw(a0, MemOperand(a0, JavaScriptFrameConstants::kFunctionOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ push(a0);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -1545,14 +1545,8 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ Ld(a0, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ Ld(a0, MemOperand(a0, JavaScriptFrameConstants::kFunctionOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ push(a0);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -1598,14 +1598,8 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ LoadP(r3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ LoadP(r3, MemOperand(r3, JavaScriptFrameConstants::kFunctionOffset));
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ push(r3);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -1651,14 +1651,8 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ LoadP(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ LoadP(r2, MemOperand(r2, JavaScriptFrameConstants::kFunctionOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ push(r2);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -2598,14 +2598,8 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ movq(rax, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
__ movq(rax, Operand(rax, JavaScriptFrameConstants::kFunctionOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Pass function as argument.
__ Push(rax);
__ CallRuntime(Runtime::kCompileForOnStackReplacement);
}
......
......@@ -227,8 +227,7 @@ BailoutId DetermineEntryAndDisarmOSRForInterpreter(JavaScriptFrame* frame) {
RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
DCHECK_EQ(0, args.length());
// Only reachable when OST is enabled.
CHECK(FLAG_use_osr);
......@@ -236,7 +235,6 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
// Determine frame triggering OSR request.
JavaScriptFrameIterator it(isolate);
JavaScriptFrame* frame = it.frame();
DCHECK_EQ(frame->function(), *function);
DCHECK(frame->is_interpreted());
// Determine the entry point for which this OSR request has been fired and
......@@ -245,6 +243,7 @@ RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
DCHECK(!ast_id.IsNone());
MaybeHandle<Code> maybe_result;
Handle<JSFunction> function(frame->function(), isolate);
if (IsSuitableForOnStackReplacement(isolate, function)) {
if (FLAG_trace_osr) {
PrintF("[OSR - Compiling: ");
......
......@@ -99,7 +99,7 @@ namespace internal {
F(WeakCollectionSet, 4, 1)
#define FOR_EACH_INTRINSIC_COMPILER(F, I) \
F(CompileForOnStackReplacement, 1, 1) \
F(CompileForOnStackReplacement, 0, 1) \
F(CompileLazy, 1, 1) \
F(CompileOptimized_Concurrent, 1, 1) \
F(CompileOptimized_NotConcurrent, 1, 1) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment