| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2665 __ lea(eax, Operand(eax, ebx, times_1, Code::kHeaderSize - kHeapObjectTag)); | 2665 __ lea(eax, Operand(eax, ebx, times_1, Code::kHeaderSize - kHeapObjectTag)); |
| 2666 | 2666 |
| 2667 // Overwrite the return address on the stack. | 2667 // Overwrite the return address on the stack. |
| 2668 __ mov(Operand(esp, 0), eax); | 2668 __ mov(Operand(esp, 0), eax); |
| 2669 | 2669 |
| 2670 // And "return" to the OSR entry point of the function. | 2670 // And "return" to the OSR entry point of the function. |
| 2671 __ ret(0); | 2671 __ ret(0); |
| 2672 } | 2672 } |
| 2673 | 2673 |
| 2674 | 2674 |
| 2675 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { | |
| 2676 // We check the stack limit as indicator that recompilation might be done. | |
| 2677 Label ok; | |
| 2678 ExternalReference stack_limit = | |
| 2679 ExternalReference::address_of_stack_limit(masm->isolate()); | |
| 2680 __ cmp(esp, Operand::StaticVariable(stack_limit)); | |
| 2681 __ j(above_equal, &ok, Label::kNear); | |
| 2682 { | |
| 2683 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 2684 __ CallRuntime(Runtime::kStackGuard); | |
| 2685 } | |
| 2686 __ jmp(masm->isolate()->builtins()->OnStackReplacement(), | |
| 2687 RelocInfo::CODE_TARGET); | |
| 2688 | |
| 2689 __ bind(&ok); | |
| 2690 __ ret(0); | |
| 2691 } | |
| 2692 | |
| 2693 #undef __ | 2675 #undef __ |
| 2694 } // namespace internal | 2676 } // namespace internal |
| 2695 } // namespace v8 | 2677 } // namespace v8 |
| 2696 | 2678 |
| 2697 #endif // V8_TARGET_ARCH_X87 | 2679 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |