Chromium Code Reviews| Index: src/builtins/ia32/builtins-ia32.cc |
| diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc |
| index c907fa8dfe9e941688f912f5bab84e3313ed24fb..4868cc62c5c15d0d3b8b498bba20be0f42d1bfd4 100644 |
| --- a/src/builtins/ia32/builtins-ia32.cc |
| +++ b/src/builtins/ia32/builtins-ia32.cc |
| @@ -1395,6 +1395,60 @@ void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { |
| Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); |
| } |
| +void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) { |
| + // Enter an internal frame. |
| + { |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + |
| + // Preserve registers across notification, this is important for compiled |
| + // stubs that tail call the runtime on deopts passing their parameters in |
| + // registers. |
| + __ pushad(); |
| + __ CallRuntime(Runtime::kNotifyStubFailure, false); |
| + __ popad(); |
| + // Tear down internal frame. |
| + } |
| + |
| + __ pop(MemOperand(esp, 0)); // Ignore state offset |
| + __ ret(0); // Return to IC Miss stub, continuation still on stack. |
| +} |
| + |
| +namespace { |
| +static void Generate_ContinueToBuiltinHelper(MacroAssembler* masm, |
|
Benedikt Meurer
2017/05/18 06:32:52
Nit: No static inside anonymous namespace.
danno
2017/05/22 10:28:10
Done.
|
| + bool java_script_builtin, |
| + bool with_result) { |
| + const RegisterConfiguration* config(RegisterConfiguration::Turbofan()); |
| + int allocatable_register_count = config->num_allocatable_general_registers(); |
| + if (with_result) { |
| + __ mov(Operand(esp, |
| + config->num_allocatable_general_registers() * kPointerSize + |
| + TYPED_FRAME_SIZE(1)), |
| + eax); |
| + } |
| + for (int i = allocatable_register_count - 1; i >= 0; --i) { |
| + int code = config->GetAllocatableGeneralCode(i); |
| + __ pop(Register::from_code(code)); |
| + if (java_script_builtin && code == kJavaScriptCallArgCountRegister.code()) { |
| + __ SmiUntag(Register::from_code(code)); |
| + } |
| + } |
| + __ mov(ebp, Operand(esp, 2 * kPointerSize)); |
| + __ pop(Operand(esp, TYPED_FRAME_SIZE_FROM_SP(0))); |
| + __ add(esp, Immediate(kPointerSize)); |
| + __ add(Operand(esp, 0), Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| + __ ret(0); |
| +} |
| +} // namespace |
| + |
| +void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) { |
| + Generate_ContinueToBuiltinHelper(masm, true, false); |
| +} |
| + |
| +void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult( |
| + MacroAssembler* masm) { |
| + Generate_ContinueToBuiltinHelper(masm, true, true); |
| +} |
| + |
| static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
| Deoptimizer::BailoutType type) { |
| { |