| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 // Check if the arguments will overflow the stack. | 518 // Check if the arguments will overflow the stack. |
| 519 __ cmpp(rcx, rdx); | 519 __ cmpp(rcx, rdx); |
| 520 __ j(greater, &okay); // Signed comparison. | 520 __ j(greater, &okay); // Signed comparison. |
| 521 | 521 |
| 522 // Out of stack space. | 522 // Out of stack space. |
| 523 __ Push(Operand(rbp, calleeOffset)); | 523 __ Push(Operand(rbp, calleeOffset)); |
| 524 if (rax_is_tagged == kRaxIsUntaggedInt) { | 524 if (rax_is_tagged == kRaxIsUntaggedInt) { |
| 525 __ Integer32ToSmi(rax, rax); | 525 __ Integer32ToSmi(rax, rax); |
| 526 } | 526 } |
| 527 __ Push(rax); | 527 __ Push(rax); |
| 528 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 528 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
| 529 | 529 |
| 530 __ bind(&okay); | 530 __ bind(&okay); |
| 531 } | 531 } |
| 532 | 532 |
| 533 | 533 |
| 534 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, | 534 static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, |
| 535 bool is_construct) { | 535 bool is_construct) { |
| 536 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 536 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 537 | 537 |
| 538 // Expects five C++ function parameters. | 538 // Expects five C++ function parameters. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 // Load frame size from the BytecodeArray object. | 711 // Load frame size from the BytecodeArray object. |
| 712 __ movl(rcx, FieldOperand(kInterpreterBytecodeArrayRegister, | 712 __ movl(rcx, FieldOperand(kInterpreterBytecodeArrayRegister, |
| 713 BytecodeArray::kFrameSizeOffset)); | 713 BytecodeArray::kFrameSizeOffset)); |
| 714 | 714 |
| 715 // Do a stack check to ensure we don't go over the limit. | 715 // Do a stack check to ensure we don't go over the limit. |
| 716 Label ok; | 716 Label ok; |
| 717 __ movp(rdx, rsp); | 717 __ movp(rdx, rsp); |
| 718 __ subp(rdx, rcx); | 718 __ subp(rdx, rcx); |
| 719 __ CompareRoot(rdx, Heap::kRealStackLimitRootIndex); | 719 __ CompareRoot(rdx, Heap::kRealStackLimitRootIndex); |
| 720 __ j(above_equal, &ok, Label::kNear); | 720 __ j(above_equal, &ok, Label::kNear); |
| 721 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 721 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
| 722 __ bind(&ok); | 722 __ bind(&ok); |
| 723 | 723 |
| 724 // If ok, push undefined as the initial value for all register file entries. | 724 // If ok, push undefined as the initial value for all register file entries. |
| 725 Label loop_header; | 725 Label loop_header; |
| 726 Label loop_check; | 726 Label loop_check; |
| 727 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); | 727 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); |
| 728 __ j(always, &loop_check); | 728 __ j(always, &loop_check); |
| 729 __ bind(&loop_header); | 729 __ bind(&loop_header); |
| 730 // TODO(rmcilroy): Consider doing more than one push per loop iteration. | 730 // TODO(rmcilroy): Consider doing more than one push per loop iteration. |
| 731 __ Push(rdx); | 731 __ Push(rdx); |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 // ------------------------------------------- | 1612 // ------------------------------------------- |
| 1613 // Dont adapt arguments. | 1613 // Dont adapt arguments. |
| 1614 // ------------------------------------------- | 1614 // ------------------------------------------- |
| 1615 __ bind(&dont_adapt_arguments); | 1615 __ bind(&dont_adapt_arguments); |
| 1616 __ jmp(rdx); | 1616 __ jmp(rdx); |
| 1617 | 1617 |
| 1618 __ bind(&stack_overflow); | 1618 __ bind(&stack_overflow); |
| 1619 { | 1619 { |
| 1620 FrameScope frame(masm, StackFrame::MANUAL); | 1620 FrameScope frame(masm, StackFrame::MANUAL); |
| 1621 EnterArgumentsAdaptorFrame(masm); | 1621 EnterArgumentsAdaptorFrame(masm); |
| 1622 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 1622 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
| 1623 __ int3(); | 1623 __ int3(); |
| 1624 } | 1624 } |
| 1625 } | 1625 } |
| 1626 | 1626 |
| 1627 | 1627 |
| 1628 // static | 1628 // static |
| 1629 void Builtins::Generate_CallFunction(MacroAssembler* masm) { | 1629 void Builtins::Generate_CallFunction(MacroAssembler* masm) { |
| 1630 // ----------- S t a t e ------------- | 1630 // ----------- S t a t e ------------- |
| 1631 // -- rax : the number of arguments (not including the receiver) | 1631 // -- rax : the number of arguments (not including the receiver) |
| 1632 // -- rdi : the function to call (checked to be a JSFunction) | 1632 // -- rdi : the function to call (checked to be a JSFunction) |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1818 __ ret(0); | 1818 __ ret(0); |
| 1819 } | 1819 } |
| 1820 | 1820 |
| 1821 | 1821 |
| 1822 #undef __ | 1822 #undef __ |
| 1823 | 1823 |
| 1824 } // namespace internal | 1824 } // namespace internal |
| 1825 } // namespace v8 | 1825 } // namespace v8 |
| 1826 | 1826 |
| 1827 #endif // V8_TARGET_ARCH_X64 | 1827 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |