OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2720 __ leap(rax, Operand(rax, rbx, times_1, Code::kHeaderSize - kHeapObjectTag)); | 2720 __ leap(rax, Operand(rax, rbx, times_1, Code::kHeaderSize - kHeapObjectTag)); |
2721 | 2721 |
2722 // Overwrite the return address on the stack. | 2722 // Overwrite the return address on the stack. |
2723 __ movq(StackOperandForReturnAddress(0), rax); | 2723 __ movq(StackOperandForReturnAddress(0), rax); |
2724 | 2724 |
2725 // And "return" to the OSR entry point of the function. | 2725 // And "return" to the OSR entry point of the function. |
2726 __ ret(0); | 2726 __ ret(0); |
2727 } | 2727 } |
2728 | 2728 |
2729 | 2729 |
2730 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { | |
2731 // We check the stack limit as indicator that recompilation might be done. | |
2732 Label ok; | |
2733 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); | |
2734 __ j(above_equal, &ok); | |
2735 { | |
2736 FrameScope scope(masm, StackFrame::INTERNAL); | |
2737 __ CallRuntime(Runtime::kStackGuard); | |
2738 } | |
2739 __ jmp(masm->isolate()->builtins()->OnStackReplacement(), | |
2740 RelocInfo::CODE_TARGET); | |
2741 | |
2742 __ bind(&ok); | |
2743 __ ret(0); | |
2744 } | |
2745 | |
2746 | |
2747 #undef __ | 2730 #undef __ |
2748 | 2731 |
2749 } // namespace internal | 2732 } // namespace internal |
2750 } // namespace v8 | 2733 } // namespace v8 |
2751 | 2734 |
2752 #endif // V8_TARGET_ARCH_X64 | 2735 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |