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-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 __ j(not_equal, miss); | 1596 __ j(not_equal, miss); |
1597 | 1597 |
1598 __ mov(eax, arg_count()); | 1598 __ mov(eax, arg_count()); |
1599 // Reload ecx. | 1599 // Reload ecx. |
1600 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, | 1600 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
1601 FixedArray::kHeaderSize)); | 1601 FixedArray::kHeaderSize)); |
1602 | 1602 |
1603 // Increment the call count for monomorphic function calls. | 1603 // Increment the call count for monomorphic function calls. |
1604 __ add(FieldOperand(ebx, edx, times_half_pointer_size, | 1604 __ add(FieldOperand(ebx, edx, times_half_pointer_size, |
1605 FixedArray::kHeaderSize + kPointerSize), | 1605 FixedArray::kHeaderSize + kPointerSize), |
1606 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 1606 Immediate(Smi::FromInt(1))); |
1607 | 1607 |
1608 __ mov(ebx, ecx); | 1608 __ mov(ebx, ecx); |
1609 __ mov(edx, edi); | 1609 __ mov(edx, edi); |
1610 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 1610 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
1611 __ TailCallStub(&stub); | 1611 __ TailCallStub(&stub); |
1612 | 1612 |
1613 // Unreachable. | 1613 // Unreachable. |
1614 } | 1614 } |
1615 | 1615 |
1616 | 1616 |
(...skipping 27 matching lines...) Expand all Loading... |
1644 __ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); | 1644 __ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); |
1645 __ j(not_equal, &extra_checks_or_miss); | 1645 __ j(not_equal, &extra_checks_or_miss); |
1646 | 1646 |
1647 // The compare above could have been a SMI/SMI comparison. Guard against this | 1647 // The compare above could have been a SMI/SMI comparison. Guard against this |
1648 // convincing us that we have a monomorphic JSFunction. | 1648 // convincing us that we have a monomorphic JSFunction. |
1649 __ JumpIfSmi(edi, &extra_checks_or_miss); | 1649 __ JumpIfSmi(edi, &extra_checks_or_miss); |
1650 | 1650 |
1651 // Increment the call count for monomorphic function calls. | 1651 // Increment the call count for monomorphic function calls. |
1652 __ add(FieldOperand(ebx, edx, times_half_pointer_size, | 1652 __ add(FieldOperand(ebx, edx, times_half_pointer_size, |
1653 FixedArray::kHeaderSize + kPointerSize), | 1653 FixedArray::kHeaderSize + kPointerSize), |
1654 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 1654 Immediate(Smi::FromInt(1))); |
1655 | 1655 |
1656 __ bind(&call_function); | 1656 __ bind(&call_function); |
1657 __ Set(eax, argc); | 1657 __ Set(eax, argc); |
1658 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), | 1658 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
1659 tail_call_mode()), | 1659 tail_call_mode()), |
1660 RelocInfo::CODE_TARGET); | 1660 RelocInfo::CODE_TARGET); |
1661 | 1661 |
1662 __ bind(&extra_checks_or_miss); | 1662 __ bind(&extra_checks_or_miss); |
1663 Label uninitialized, miss, not_allocation_site; | 1663 Label uninitialized, miss, not_allocation_site; |
1664 | 1664 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 | 1715 |
1716 // Make sure the function belongs to the same native context. | 1716 // Make sure the function belongs to the same native context. |
1717 __ mov(ecx, FieldOperand(edi, JSFunction::kContextOffset)); | 1717 __ mov(ecx, FieldOperand(edi, JSFunction::kContextOffset)); |
1718 __ mov(ecx, ContextOperand(ecx, Context::NATIVE_CONTEXT_INDEX)); | 1718 __ mov(ecx, ContextOperand(ecx, Context::NATIVE_CONTEXT_INDEX)); |
1719 __ cmp(ecx, NativeContextOperand()); | 1719 __ cmp(ecx, NativeContextOperand()); |
1720 __ j(not_equal, &miss); | 1720 __ j(not_equal, &miss); |
1721 | 1721 |
1722 // Initialize the call counter. | 1722 // Initialize the call counter. |
1723 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, | 1723 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
1724 FixedArray::kHeaderSize + kPointerSize), | 1724 FixedArray::kHeaderSize + kPointerSize), |
1725 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); | 1725 Immediate(Smi::FromInt(1))); |
1726 | 1726 |
1727 // Store the function. Use a stub since we need a frame for allocation. | 1727 // Store the function. Use a stub since we need a frame for allocation. |
1728 // ebx - vector | 1728 // ebx - vector |
1729 // edx - slot | 1729 // edx - slot |
1730 // edi - function | 1730 // edi - function |
1731 { | 1731 { |
1732 FrameScope scope(masm, StackFrame::INTERNAL); | 1732 FrameScope scope(masm, StackFrame::INTERNAL); |
1733 CreateWeakCellStub create_stub(isolate); | 1733 CreateWeakCellStub create_stub(isolate); |
1734 __ push(edi); | 1734 __ push(edi); |
1735 __ CallStub(&create_stub); | 1735 __ CallStub(&create_stub); |
(...skipping 3981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5717 kStackUnwindSpace, nullptr, return_value_operand, | 5717 kStackUnwindSpace, nullptr, return_value_operand, |
5718 NULL); | 5718 NULL); |
5719 } | 5719 } |
5720 | 5720 |
5721 #undef __ | 5721 #undef __ |
5722 | 5722 |
5723 } // namespace internal | 5723 } // namespace internal |
5724 } // namespace v8 | 5724 } // namespace v8 |
5725 | 5725 |
5726 #endif // V8_TARGET_ARCH_IA32 | 5726 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |