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

Side by Side Diff: src/mips/builtins-mips.cc

Issue 99013003: Fix incorrect patching for OSR. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comment Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { 962 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
963 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); 963 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
964 } 964 }
965 965
966 966
967 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { 967 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
968 // Lookup the function in the JavaScript frame. 968 // Lookup the function in the JavaScript frame.
969 __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 969 __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
970 { 970 {
971 FrameScope scope(masm, StackFrame::INTERNAL); 971 FrameScope scope(masm, StackFrame::INTERNAL);
972 // Lookup and calculate pc offset. 972 // Pass function as argument.
973 __ lw(a1, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
974 __ lw(a2, FieldMemOperand(a0, JSFunction::kSharedFunctionInfoOffset));
975 __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kCodeOffset));
976 __ Subu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
977 __ Subu(a1, a1, a2);
978 __ SmiTag(a1);
979
980 // Pass both function and pc offset as arguments.
981 __ push(a0); 973 __ push(a0);
982 __ push(a1); 974 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1);
983 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 2);
984 } 975 }
985 976
986 // If the code object is null, just return to the unoptimized code. 977 // If the code object is null, just return to the unoptimized code.
987 __ Ret(eq, v0, Operand(Smi::FromInt(0))); 978 __ Ret(eq, v0, Operand(Smi::FromInt(0)));
988 979
989 // Load deoptimization data from the code object. 980 // Load deoptimization data from the code object.
990 // <deopt_data> = <code>[#deoptimization_data_offset] 981 // <deopt_data> = <code>[#deoptimization_data_offset]
991 __ lw(a1, MemOperand(v0, Code::kDeoptimizationDataOffset - kHeapObjectTag)); 982 __ lw(a1, MemOperand(v0, Code::kDeoptimizationDataOffset - kHeapObjectTag));
992 983
993 // Load the OSR entrypoint offset from the deoptimization data. 984 // Load the OSR entrypoint offset from the deoptimization data.
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 __ bind(&dont_adapt_arguments); 1509 __ bind(&dont_adapt_arguments);
1519 __ Jump(a3); 1510 __ Jump(a3);
1520 } 1511 }
1521 1512
1522 1513
1523 #undef __ 1514 #undef __
1524 1515
1525 } } // namespace v8::internal 1516 } } // namespace v8::internal
1526 1517
1527 #endif // V8_TARGET_ARCH_MIPS 1518 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698