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

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

Issue 21340002: Generate a custom OSR entrypoint for OSR compiles on all platforms, and transition to optimized cod… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remerge with recent changes. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { 1002 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
1003 // Lookup the function in the JavaScript frame and push it as an 1003 // Lookup the function in the JavaScript frame and push it as an
1004 // argument to the on-stack replacement function. 1004 // argument to the on-stack replacement function.
1005 __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1005 __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1006 { 1006 {
1007 FrameScope scope(masm, StackFrame::INTERNAL); 1007 FrameScope scope(masm, StackFrame::INTERNAL);
1008 __ push(a0); 1008 __ push(a0);
1009 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); 1009 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1);
1010 } 1010 }
1011 1011
1012 // If the result was -1 it means that we couldn't optimize the 1012 // If the code object is null, just return to the unoptimized code.
1013 // function. Just return and continue in the unoptimized version. 1013 __ Ret(eq, v0, Operand(Smi::FromInt(0)));
1014 __ Ret(eq, v0, Operand(Smi::FromInt(-1)));
1015 1014
1016 // Untag the AST id and push it on the stack. 1015 // Load deoptimization data from the code object.
1017 __ SmiUntag(v0); 1016 // <deopt_data> = <code>[#deoptimization_data_offset]
1018 __ push(v0); 1017 __ lw(a1, MemOperand(v0, Code::kDeoptimizationDataOffset - kHeapObjectTag));
1019 1018
1020 // Generate the code for doing the frame-to-frame translation using 1019 // Load the OSR entrypoint offset from the deoptimization data.
1021 // the deoptimizer infrastructure. 1020 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
1022 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1021 __ lw(a1, MemOperand(a1, FixedArray::OffsetOfElementAt(
1023 generator.Generate(); 1022 DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag));
1023 __ SmiUntag(a1);
1024
1025 // Compute the target address = code_obj + header_size + osr_offset
1026 // <entry_addr> = <code_obj> + #header_size + <osr_offset>
1027 __ addu(v0, v0, a1);
1028 __ addiu(ra, v0, Code::kHeaderSize - kHeapObjectTag);
1029
1030 // And "return" to the OSR entry point of the function.
1031 __ Ret();
1024 } 1032 }
1025 1033
1026 1034
1027 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { 1035 void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
1028 // 1. Make sure we have at least one argument. 1036 // 1. Make sure we have at least one argument.
1029 // a0: actual number of arguments 1037 // a0: actual number of arguments
1030 { Label done; 1038 { Label done;
1031 __ Branch(&done, ne, a0, Operand(zero_reg)); 1039 __ Branch(&done, ne, a0, Operand(zero_reg));
1032 __ LoadRoot(t2, Heap::kUndefinedValueRootIndex); 1040 __ LoadRoot(t2, Heap::kUndefinedValueRootIndex);
1033 __ push(t2); 1041 __ push(t2);
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 __ bind(&dont_adapt_arguments); 1523 __ bind(&dont_adapt_arguments);
1516 __ Jump(a3); 1524 __ Jump(a3);
1517 } 1525 }
1518 1526
1519 1527
1520 #undef __ 1528 #undef __
1521 1529
1522 } } // namespace v8::internal 1530 } } // namespace v8::internal
1523 1531
1524 #endif // V8_TARGET_ARCH_MIPS 1532 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698