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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 // Check if the arguments will overflow the stack. | 515 // Check if the arguments will overflow the stack. |
516 __ cmp(ecx, edx); | 516 __ cmp(ecx, edx); |
517 __ j(greater, &okay); // Signed comparison. | 517 __ j(greater, &okay); // Signed comparison. |
518 | 518 |
519 // Out of stack space. | 519 // Out of stack space. |
520 __ push(Operand(ebp, calleeOffset)); // push this | 520 __ push(Operand(ebp, calleeOffset)); // push this |
521 if (eax_is_tagged == kEaxIsUntaggedInt) { | 521 if (eax_is_tagged == kEaxIsUntaggedInt) { |
522 __ SmiTag(eax); | 522 __ SmiTag(eax); |
523 } | 523 } |
524 __ push(eax); | 524 __ push(eax); |
525 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 525 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
526 | 526 |
527 __ bind(&okay); | 527 __ bind(&okay); |
528 } | 528 } |
529 | 529 |
530 | 530 |
531 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, | 531 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, |
532 bool is_construct) { | 532 bool is_construct) { |
533 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 533 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
534 | 534 |
535 // Clear the context before we push it when entering the internal frame. | 535 // Clear the context before we push it when entering the internal frame. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 BytecodeArray::kFrameSizeOffset)); | 653 BytecodeArray::kFrameSizeOffset)); |
654 | 654 |
655 // Do a stack check to ensure we don't go over the limit. | 655 // Do a stack check to ensure we don't go over the limit. |
656 Label ok; | 656 Label ok; |
657 __ mov(ecx, esp); | 657 __ mov(ecx, esp); |
658 __ sub(ecx, ebx); | 658 __ sub(ecx, ebx); |
659 ExternalReference stack_limit = | 659 ExternalReference stack_limit = |
660 ExternalReference::address_of_real_stack_limit(masm->isolate()); | 660 ExternalReference::address_of_real_stack_limit(masm->isolate()); |
661 __ cmp(ecx, Operand::StaticVariable(stack_limit)); | 661 __ cmp(ecx, Operand::StaticVariable(stack_limit)); |
662 __ j(above_equal, &ok); | 662 __ j(above_equal, &ok); |
663 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 663 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
664 __ bind(&ok); | 664 __ bind(&ok); |
665 | 665 |
666 // If ok, push undefined as the initial value for all register file entries. | 666 // If ok, push undefined as the initial value for all register file entries. |
667 Label loop_header; | 667 Label loop_header; |
668 Label loop_check; | 668 Label loop_check; |
669 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); | 669 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); |
670 __ jmp(&loop_check); | 670 __ jmp(&loop_check); |
671 __ bind(&loop_header); | 671 __ bind(&loop_header); |
672 // TODO(rmcilroy): Consider doing more than one push per loop iteration. | 672 // TODO(rmcilroy): Consider doing more than one push per loop iteration. |
673 __ push(eax); | 673 __ push(eax); |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 // ------------------------------------------- | 1692 // ------------------------------------------- |
1693 // Dont adapt arguments. | 1693 // Dont adapt arguments. |
1694 // ------------------------------------------- | 1694 // ------------------------------------------- |
1695 __ bind(&dont_adapt_arguments); | 1695 __ bind(&dont_adapt_arguments); |
1696 __ jmp(edx); | 1696 __ jmp(edx); |
1697 | 1697 |
1698 __ bind(&stack_overflow); | 1698 __ bind(&stack_overflow); |
1699 { | 1699 { |
1700 FrameScope frame(masm, StackFrame::MANUAL); | 1700 FrameScope frame(masm, StackFrame::MANUAL); |
1701 EnterArgumentsAdaptorFrame(masm); | 1701 EnterArgumentsAdaptorFrame(masm); |
1702 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 1702 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
1703 __ int3(); | 1703 __ int3(); |
1704 } | 1704 } |
1705 } | 1705 } |
1706 | 1706 |
1707 | 1707 |
1708 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 1708 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
1709 // Lookup the function in the JavaScript frame. | 1709 // Lookup the function in the JavaScript frame. |
1710 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1710 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1711 { | 1711 { |
1712 FrameScope scope(masm, StackFrame::INTERNAL); | 1712 FrameScope scope(masm, StackFrame::INTERNAL); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 | 1758 |
1759 __ bind(&ok); | 1759 __ bind(&ok); |
1760 __ ret(0); | 1760 __ ret(0); |
1761 } | 1761 } |
1762 | 1762 |
1763 #undef __ | 1763 #undef __ |
1764 } // namespace internal | 1764 } // namespace internal |
1765 } // namespace v8 | 1765 } // namespace v8 |
1766 | 1766 |
1767 #endif // V8_TARGET_ARCH_IA32 | 1767 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |