| Index: src/a64/builtins-a64.cc
|
| diff --git a/src/a64/builtins-a64.cc b/src/a64/builtins-a64.cc
|
| index 16e1ab4a3c6b6b98f604d38dde26133391a5271f..e64237dc83b6338213032e3313aaf8d15bb3b903 100644
|
| --- a/src/a64/builtins-a64.cc
|
| +++ b/src/a64/builtins-a64.cc
|
| @@ -948,22 +948,29 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
|
| __ 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.
|
| + // If the code object is null, just return to the unoptimized code.
|
| Label skip;
|
| - __ Cmp(x0, Operand(Smi::FromInt(-1)));
|
| - __ B(ne, &skip);
|
| + __ CompareAndBranch(x0, Operand(Smi::FromInt(0)), 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();
|
| +
|
| + // Load deoptimization data from the code object.
|
| + // <deopt_data> = <code>[#deoptimization_data_offset]
|
| + __ Ldr(x1, MemOperand(x0, Code::kDeoptimizationDataOffset - kHeapObjectTag));
|
| +
|
| + // Load the OSR entrypoint offset from the deoptimization data.
|
| + // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
|
| + __ Ldrsw(w1, UntagSmiFieldMemOperand(x1, FixedArray::OffsetOfElementAt(
|
| + DeoptimizationInputData::kOsrPcOffsetIndex)));
|
| +
|
| + // Compute the target address = code_obj + header_size + osr_offset
|
| + // <entry_addr> = <code_obj> + #header_size + <osr_offset>
|
| + __ Add(x0, x0, x1);
|
| + __ Add(lr, x0, Code::kHeaderSize - kHeapObjectTag);
|
| +
|
| + // And "return" to the OSR entry point of the function.
|
| + __ Ret();
|
| }
|
|
|
|
|
|
|