Index: src/mips/builtins-mips.cc |
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc |
index 1a5b3024c6067f94d9c48bedff451664a3fa4776..f27ded73480ceb38206d870741ec93b3ffdbb6c0 100644 |
--- a/src/mips/builtins-mips.cc |
+++ b/src/mips/builtins-mips.cc |
@@ -1000,13 +1000,22 @@ void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { |
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
- // Lookup the function in the JavaScript frame and push it as an |
- // argument to the on-stack replacement function. |
+ // Lookup the function in the JavaScript frame. |
__ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
+ // Lookup and calculate pc offset. |
+ __ lw(a1, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); |
+ __ lw(a2, FieldMemOperand(a0, JSFunction::kSharedFunctionInfoOffset)); |
+ __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kCodeOffset)); |
+ __ Subu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag)); |
+ __ Subu(a1, a1, a2); |
+ __ SmiTag(a1); |
+ |
+ // Pass both function and pc offset as arguments. |
__ push(a0); |
- __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
+ __ push(a1); |
+ __ CallRuntime(Runtime::kCompileForOnStackReplacement, 2); |
} |
// If the code object is null, just return to the unoptimized code. |