| Index: src/x64/builtins-x64.cc
|
| diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
|
| index df6acb6f0c02e61a6807cc9cd2df3719b963eff2..f65b25c6520885b4e414afe6831b16589aba99af 100644
|
| --- a/src/x64/builtins-x64.cc
|
| +++ b/src/x64/builtins-x64.cc
|
| @@ -627,6 +627,42 @@ CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
|
| #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
|
|
|
|
|
| +void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
|
| + // For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
|
| + // that make_code_young doesn't do any garbage collection which allows us to
|
| + // save/restore the registers without worrying about which of them contain
|
| + // pointers.
|
| + __ Pushad();
|
| + __ movq(arg_reg_2, ExternalReference::isolate_address(masm->isolate()));
|
| + __ movq(arg_reg_1, Operand(rsp, kNumSafepointRegisters * kPointerSize));
|
| + __ subq(arg_reg_1, Immediate(Assembler::kShortCallInstructionLength));
|
| + { // NOLINT
|
| + FrameScope scope(masm, StackFrame::MANUAL);
|
| + __ PrepareCallCFunction(1);
|
| + __ CallCFunction(
|
| + ExternalReference::get_mark_code_as_executed_function(masm->isolate()),
|
| + 1);
|
| + }
|
| + __ Popad();
|
| +
|
| + // Perform prologue operations usually performed by the young code stub.
|
| + __ PopReturnAddressTo(kScratchRegister);
|
| + __ push(rbp); // Caller's frame pointer.
|
| + __ movq(rbp, rsp);
|
| + __ push(rsi); // Callee's context.
|
| + __ push(rdi); // Callee's JS Function.
|
| + __ PushReturnAddressFrom(kScratchRegister);
|
| +
|
| + // Jump to point after the code-age stub.
|
| + __ ret(0);
|
| +}
|
| +
|
| +
|
| +void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
|
| + GenerateMakeCodeYoungAgainCommon(masm);
|
| +}
|
| +
|
| +
|
| void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
|
| // Enter an internal frame.
|
| {
|
| @@ -660,17 +696,17 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
|
| }
|
|
|
| // Get the full codegen state from the stack and untag it.
|
| - __ SmiToInteger32(r10, Operand(rsp, kPCOnStackSize));
|
| + __ SmiToInteger32(kScratchRegister, Operand(rsp, kPCOnStackSize));
|
|
|
| // Switch on the state.
|
| Label not_no_registers, not_tos_rax;
|
| - __ cmpq(r10, Immediate(FullCodeGenerator::NO_REGISTERS));
|
| + __ cmpq(kScratchRegister, Immediate(FullCodeGenerator::NO_REGISTERS));
|
| __ j(not_equal, ¬_no_registers, Label::kNear);
|
| __ ret(1 * kPointerSize); // Remove state.
|
|
|
| __ bind(¬_no_registers);
|
| __ movq(rax, Operand(rsp, kPCOnStackSize + kPointerSize));
|
| - __ cmpq(r10, Immediate(FullCodeGenerator::TOS_REG));
|
| + __ cmpq(kScratchRegister, Immediate(FullCodeGenerator::TOS_REG));
|
| __ j(not_equal, ¬_tos_rax, Label::kNear);
|
| __ ret(2 * kPointerSize); // Remove state, rax.
|
|
|
|
|