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

Unified Diff: src/s390/builtins-s390.cc

Issue 1989983002: PPC/S390: [Interpreter] Remove InterpreterExitTrampoline and replace with returning to the entry tr… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/builtins-s390.cc
diff --git a/src/s390/builtins-s390.cc b/src/s390/builtins-s390.cc
index 9b470ece6d4087e095bdc8893171c520d7c4f70b..55ec1dd18722ad4cd6cd5b7c4954921888e6bd56 100644
--- a/src/s390/builtins-s390.cc
+++ b/src/s390/builtins-s390.cc
@@ -1064,8 +1064,19 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ LoadP(ip, MemOperand(kInterpreterDispatchTableRegister, ip));
__ Call(ip);
- // Even though the first bytecode handler was called, we will never return.
- __ Abort(kUnexpectedReturnFromBytecodeHandler);
+ masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset());
+
+ // The return value is in r2.
+
+ // Get the arguments + reciever count.
+ __ LoadP(r4, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
+ __ LoadlW(r4, FieldMemOperand(r4, BytecodeArray::kParameterSizeOffset));
+
+ // Leave the frame (also dropping the register file).
+ __ LeaveFrame(StackFrame::JAVA_SCRIPT);
+
+ __ lay(sp, MemOperand(sp, r4));
+ __ Ret();
// If the bytecode array is no longer present, then the underlying function
// has been switched to a different kind of code and we heal the closure by
@@ -1080,19 +1091,6 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ JumpToJSEntry(r6);
}
-void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
- // The return value is in accumulator, which is already in r2.
-
- // Leave the frame (also dropping the register file).
- __ LeaveFrame(StackFrame::JAVA_SCRIPT);
-
- // Drop receiver + arguments and return.
- __ LoadlW(r0, FieldMemOperand(kInterpreterBytecodeArrayRegister,
- BytecodeArray::kParameterSizeOffset));
- __ AddP(sp, sp, r0);
- __ Ret();
-}
-
static void Generate_InterpreterPushArgs(MacroAssembler* masm, Register index,
Register count, Register scratch) {
Label loop;
@@ -1153,7 +1151,16 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
}
-static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
+void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
+ // Set the return address to the correct point in the interpreter entry
+ // trampoline.
+ Smi* interpreter_entry_return_pc_offset(
+ masm->isolate()->heap()->interpreter_entry_return_pc_offset());
+ DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0));
+ __ Move(r4, masm->isolate()->builtins()->InterpreterEntryTrampoline());
+ __ AddP(r14, r4, Operand(interpreter_entry_return_pc_offset->value() +
+ Code::kHeaderSize - kHeapObjectTag));
+
// Initialize the dispatch table register.
__ mov(kInterpreterDispatchTableRegister,
Operand(ExternalReference::interpreter_dispatch_table_address(
@@ -1185,51 +1192,6 @@ static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
__ Jump(ip);
}
-static void Generate_InterpreterNotifyDeoptimizedHelper(
- MacroAssembler* masm, Deoptimizer::BailoutType type) {
- // Enter an internal frame.
- {
- FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
-
- // Pass the deoptimization type to the runtime system.
- __ LoadSmiLiteral(r3, Smi::FromInt(static_cast<int>(type)));
- __ Push(r3);
- __ CallRuntime(Runtime::kNotifyDeoptimized);
- // Tear down internal frame.
- }
-
- // Drop state (we don't use these for interpreter deopts) and and pop the
- // accumulator value into the accumulator register.
- __ Drop(1);
- __ Pop(kInterpreterAccumulatorRegister);
-
- // Enter the bytecode dispatch.
- Generate_EnterBytecodeDispatch(masm);
-}
-
-void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) {
- Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
-}
-
-void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) {
- Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
-}
-
-void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) {
- Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
-}
-
-void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
- // Set the address of the interpreter entry trampoline as a return address.
- // This simulates the initial call to bytecode handlers in interpreter entry
- // trampoline. The return will never actually be taken, but our stack walker
- // uses this address to determine whether a frame is interpreted.
- __ mov(r14,
- Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline()));
-
- Generate_EnterBytecodeDispatch(masm);
-}
-
void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r2 : argument count (preserved for callee)
@@ -1517,14 +1479,17 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ SmiUntag(r8);
// Switch on the state.
Label with_tos_register, unknown_state;
- __ CmpP(r8, Operand(FullCodeGenerator::NO_REGISTERS));
+ __ CmpP(r8,
+ Operand(static_cast<int>(Deoptimizer::BailoutState::NO_REGISTERS)));
__ bne(&with_tos_register);
__ la(sp, MemOperand(sp, 1 * kPointerSize)); // Remove state.
__ Ret();
__ bind(&with_tos_register);
+ DCHECK_EQ(kInterpreterAccumulatorRegister.code(), r2.code());
__ LoadP(r2, MemOperand(sp, 1 * kPointerSize));
- __ CmpP(r8, Operand(FullCodeGenerator::TOS_REG));
+ __ CmpP(r8,
+ Operand(static_cast<int>(Deoptimizer::BailoutState::TOS_REGISTER)));
__ bne(&unknown_state);
__ la(sp, MemOperand(sp, 2 * kPointerSize)); // Remove state.
__ Ret();
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698