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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 __ lea(eax, Operand(eax, ebx, times_1, Code::kHeaderSize - kHeapObjectTag)); | 2639 __ lea(eax, Operand(eax, ebx, times_1, Code::kHeaderSize - kHeapObjectTag)); |
2640 | 2640 |
2641 // Overwrite the return address on the stack. | 2641 // Overwrite the return address on the stack. |
2642 __ mov(Operand(esp, 0), eax); | 2642 __ mov(Operand(esp, 0), eax); |
2643 | 2643 |
2644 // And "return" to the OSR entry point of the function. | 2644 // And "return" to the OSR entry point of the function. |
2645 __ ret(0); | 2645 __ ret(0); |
2646 } | 2646 } |
2647 | 2647 |
2648 | 2648 |
2649 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { | |
2650 // We check the stack limit as indicator that recompilation might be done. | |
2651 Label ok; | |
2652 ExternalReference stack_limit = | |
2653 ExternalReference::address_of_stack_limit(masm->isolate()); | |
2654 __ cmp(esp, Operand::StaticVariable(stack_limit)); | |
2655 __ j(above_equal, &ok, Label::kNear); | |
2656 { | |
2657 FrameScope scope(masm, StackFrame::INTERNAL); | |
2658 __ CallRuntime(Runtime::kStackGuard); | |
2659 } | |
2660 __ jmp(masm->isolate()->builtins()->OnStackReplacement(), | |
2661 RelocInfo::CODE_TARGET); | |
2662 | |
2663 __ bind(&ok); | |
2664 __ ret(0); | |
2665 } | |
2666 | |
2667 #undef __ | 2649 #undef __ |
2668 } // namespace internal | 2650 } // namespace internal |
2669 } // namespace v8 | 2651 } // namespace v8 |
2670 | 2652 |
2671 #endif // V8_TARGET_ARCH_IA32 | 2653 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |