OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2657 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 2657 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
2658 // ----------- S t a t e ------------- | 2658 // ----------- S t a t e ------------- |
2659 // -- rdx : left | 2659 // -- rdx : left |
2660 // -- rax : right | 2660 // -- rax : right |
2661 // -- rsp[0] : return address | 2661 // -- rsp[0] : return address |
2662 // ----------------------------------- | 2662 // ----------------------------------- |
2663 | 2663 |
2664 // Load rcx with the allocation site. We stick an undefined dummy value here | 2664 // Load rcx with the allocation site. We stick an undefined dummy value here |
2665 // and replace it with the real allocation site later when we instantiate this | 2665 // and replace it with the real allocation site later when we instantiate this |
2666 // stub in BinaryOpICWithAllocationSiteStub::GetCodeCopyFromTemplate(). | 2666 // stub in BinaryOpICWithAllocationSiteStub::GetCodeCopyFromTemplate(). |
2667 __ Move(rcx, handle(isolate()->heap()->undefined_value())); | 2667 __ Move(rcx, isolate()->factory()->undefined_value()); |
2668 | 2668 |
2669 // Make sure that we actually patched the allocation site. | 2669 // Make sure that we actually patched the allocation site. |
2670 if (FLAG_debug_code) { | 2670 if (FLAG_debug_code) { |
2671 __ testb(rcx, Immediate(kSmiTagMask)); | 2671 __ testb(rcx, Immediate(kSmiTagMask)); |
2672 __ Assert(not_equal, kExpectedAllocationSite); | 2672 __ Assert(not_equal, kExpectedAllocationSite); |
2673 __ Cmp(FieldOperand(rcx, HeapObject::kMapOffset), | 2673 __ Cmp(FieldOperand(rcx, HeapObject::kMapOffset), |
2674 isolate()->factory()->allocation_site_map()); | 2674 isolate()->factory()->allocation_site_map()); |
2675 __ Assert(equal, kExpectedAllocationSite); | 2675 __ Assert(equal, kExpectedAllocationSite); |
2676 } | 2676 } |
2677 | 2677 |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3955 | 3955 |
3956 | 3956 |
3957 static void CreateArrayDispatchOneArgument(MacroAssembler* masm, | 3957 static void CreateArrayDispatchOneArgument(MacroAssembler* masm, |
3958 AllocationSiteOverrideMode mode) { | 3958 AllocationSiteOverrideMode mode) { |
3959 // rbx - allocation site (if mode != DISABLE_ALLOCATION_SITES) | 3959 // rbx - allocation site (if mode != DISABLE_ALLOCATION_SITES) |
3960 // rdx - kind (if mode != DISABLE_ALLOCATION_SITES) | 3960 // rdx - kind (if mode != DISABLE_ALLOCATION_SITES) |
3961 // rax - number of arguments | 3961 // rax - number of arguments |
3962 // rdi - constructor? | 3962 // rdi - constructor? |
3963 // rsp[0] - return address | 3963 // rsp[0] - return address |
3964 // rsp[8] - last argument | 3964 // rsp[8] - last argument |
3965 Handle<Object> undefined_sentinel( | |
3966 masm->isolate()->heap()->undefined_value(), | |
3967 masm->isolate()); | |
3968 | 3965 |
3969 Label normal_sequence; | 3966 Label normal_sequence; |
3970 if (mode == DONT_OVERRIDE) { | 3967 if (mode == DONT_OVERRIDE) { |
3971 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); | 3968 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); |
3972 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); | 3969 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); |
3973 STATIC_ASSERT(FAST_ELEMENTS == 2); | 3970 STATIC_ASSERT(FAST_ELEMENTS == 2); |
3974 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3); | 3971 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3); |
3975 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS == 4); | 3972 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS == 4); |
3976 STATIC_ASSERT(FAST_HOLEY_DOUBLE_ELEMENTS == 5); | 3973 STATIC_ASSERT(FAST_HOLEY_DOUBLE_ELEMENTS == 5); |
3977 | 3974 |
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5443 kStackUnwindSpace, nullptr, return_value_operand, | 5440 kStackUnwindSpace, nullptr, return_value_operand, |
5444 NULL); | 5441 NULL); |
5445 } | 5442 } |
5446 | 5443 |
5447 #undef __ | 5444 #undef __ |
5448 | 5445 |
5449 } // namespace internal | 5446 } // namespace internal |
5450 } // namespace v8 | 5447 } // namespace v8 |
5451 | 5448 |
5452 #endif // V8_TARGET_ARCH_X64 | 5449 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |