| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/x64/lithium-codegen-x64.h" | 9 #include "src/x64/lithium-codegen-x64.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Reserve space for the stack slots needed by the code. | 160 // Reserve space for the stack slots needed by the code. |
| 161 int slots = GetStackSlotCount(); | 161 int slots = GetStackSlotCount(); |
| 162 if (slots > 0) { | 162 if (slots > 0) { |
| 163 if (FLAG_debug_code) { | 163 if (FLAG_debug_code) { |
| 164 __ subp(rsp, Immediate(slots * kPointerSize)); | 164 __ subp(rsp, Immediate(slots * kPointerSize)); |
| 165 #ifdef _MSC_VER | 165 #ifdef _MSC_VER |
| 166 MakeSureStackPagesMapped(slots * kPointerSize); | 166 MakeSureStackPagesMapped(slots * kPointerSize); |
| 167 #endif | 167 #endif |
| 168 __ Push(rax); | 168 __ Push(rax); |
| 169 __ Set(rax, slots); | 169 __ Set(rax, slots); |
| 170 __ movq(kScratchRegister, kSlotsZapValue); | 170 __ Set(kScratchRegister, kSlotsZapValue); |
| 171 Label loop; | 171 Label loop; |
| 172 __ bind(&loop); | 172 __ bind(&loop); |
| 173 __ movp(MemOperand(rsp, rax, times_pointer_size, 0), | 173 __ movp(MemOperand(rsp, rax, times_pointer_size, 0), |
| 174 kScratchRegister); | 174 kScratchRegister); |
| 175 __ decl(rax); | 175 __ decl(rax); |
| 176 __ j(not_zero, &loop); | 176 __ j(not_zero, &loop); |
| 177 __ Pop(rax); | 177 __ Pop(rax); |
| 178 } else { | 178 } else { |
| 179 __ subp(rsp, Immediate(slots * kPointerSize)); | 179 __ subp(rsp, Immediate(slots * kPointerSize)); |
| 180 #ifdef _MSC_VER | 180 #ifdef _MSC_VER |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 737 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 738 if (entry == NULL) { | 738 if (entry == NULL) { |
| 739 Abort(kBailoutWasNotPrepared); | 739 Abort(kBailoutWasNotPrepared); |
| 740 return; | 740 return; |
| 741 } | 741 } |
| 742 | 742 |
| 743 if (DeoptEveryNTimes()) { | 743 if (DeoptEveryNTimes()) { |
| 744 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); | 744 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
| 745 Label no_deopt; | 745 Label no_deopt; |
| 746 __ pushfq(); | 746 __ pushfq(); |
| 747 __ Push(rax); | 747 __ pushq(rax); |
| 748 Operand count_operand = masm()->ExternalOperand(count, kScratchRegister); | 748 Operand count_operand = masm()->ExternalOperand(count, kScratchRegister); |
| 749 __ movl(rax, count_operand); | 749 __ movl(rax, count_operand); |
| 750 __ subl(rax, Immediate(1)); | 750 __ subl(rax, Immediate(1)); |
| 751 __ j(not_zero, &no_deopt, Label::kNear); | 751 __ j(not_zero, &no_deopt, Label::kNear); |
| 752 if (FLAG_trap_on_deopt) __ int3(); | 752 if (FLAG_trap_on_deopt) __ int3(); |
| 753 __ movl(rax, Immediate(FLAG_deopt_every_n_times)); | 753 __ movl(rax, Immediate(FLAG_deopt_every_n_times)); |
| 754 __ movl(count_operand, rax); | 754 __ movl(count_operand, rax); |
| 755 __ Pop(rax); | 755 __ popq(rax); |
| 756 __ popfq(); | 756 __ popfq(); |
| 757 ASSERT(frame_is_built_); | 757 ASSERT(frame_is_built_); |
| 758 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 758 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
| 759 __ bind(&no_deopt); | 759 __ bind(&no_deopt); |
| 760 __ movl(count_operand, rax); | 760 __ movl(count_operand, rax); |
| 761 __ Pop(rax); | 761 __ popq(rax); |
| 762 __ popfq(); | 762 __ popfq(); |
| 763 } | 763 } |
| 764 | 764 |
| 765 if (info()->ShouldTrapOnDeopt()) { | 765 if (info()->ShouldTrapOnDeopt()) { |
| 766 Label done; | 766 Label done; |
| 767 if (cc != no_condition) { | 767 if (cc != no_condition) { |
| 768 __ j(NegateCondition(cc), &done, Label::kNear); | 768 __ j(NegateCondition(cc), &done, Label::kNear); |
| 769 } | 769 } |
| 770 __ int3(); | 770 __ int3(); |
| 771 __ bind(&done); | 771 __ bind(&done); |
| (...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2739 Label* map_check) { | 2739 Label* map_check) { |
| 2740 { | 2740 { |
| 2741 PushSafepointRegistersScope scope(this); | 2741 PushSafepointRegistersScope scope(this); |
| 2742 InstanceofStub::Flags flags = static_cast<InstanceofStub::Flags>( | 2742 InstanceofStub::Flags flags = static_cast<InstanceofStub::Flags>( |
| 2743 InstanceofStub::kNoFlags | InstanceofStub::kCallSiteInlineCheck); | 2743 InstanceofStub::kNoFlags | InstanceofStub::kCallSiteInlineCheck); |
| 2744 InstanceofStub stub(isolate(), flags); | 2744 InstanceofStub stub(isolate(), flags); |
| 2745 | 2745 |
| 2746 __ Push(ToRegister(instr->value())); | 2746 __ Push(ToRegister(instr->value())); |
| 2747 __ Push(instr->function()); | 2747 __ Push(instr->function()); |
| 2748 | 2748 |
| 2749 static const int kAdditionalDelta = 10; | 2749 static const int kAdditionalDelta = kPointerSize == kInt64Size ? 10 : 16; |
| 2750 int delta = | 2750 int delta = |
| 2751 masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalDelta; | 2751 masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalDelta; |
| 2752 ASSERT(delta >= 0); | 2752 ASSERT(delta >= 0); |
| 2753 __ PushImm32(delta); | 2753 __ PushImm32(delta); |
| 2754 | 2754 |
| 2755 // We are pushing three values on the stack but recording a | 2755 // We are pushing three values on the stack but recording a |
| 2756 // safepoint with two arguments because stub is going to | 2756 // safepoint with two arguments because stub is going to |
| 2757 // remove the third argument from the stack before jumping | 2757 // remove the third argument from the stack before jumping |
| 2758 // to instanceof builtin on the slow path. | 2758 // to instanceof builtin on the slow path. |
| 2759 CallCodeGeneric(stub.GetCode(), | 2759 CallCodeGeneric(stub.GetCode(), |
| (...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4708 __ SmiToInteger32(reg, reg); | 4708 __ SmiToInteger32(reg, reg); |
| 4709 __ xorl(reg, Immediate(0x80000000)); | 4709 __ xorl(reg, Immediate(0x80000000)); |
| 4710 __ cvtlsi2sd(temp_xmm, reg); | 4710 __ cvtlsi2sd(temp_xmm, reg); |
| 4711 } else { | 4711 } else { |
| 4712 ASSERT(signedness == UNSIGNED_INT32); | 4712 ASSERT(signedness == UNSIGNED_INT32); |
| 4713 __ LoadUint32(temp_xmm, reg); | 4713 __ LoadUint32(temp_xmm, reg); |
| 4714 } | 4714 } |
| 4715 | 4715 |
| 4716 if (FLAG_inline_new) { | 4716 if (FLAG_inline_new) { |
| 4717 __ AllocateHeapNumber(reg, tmp, &slow); | 4717 __ AllocateHeapNumber(reg, tmp, &slow); |
| 4718 __ jmp(&done, Label::kNear); | 4718 __ jmp(&done, kPointerSize == kInt64Size ? Label::kNear : Label::kFar); |
| 4719 } | 4719 } |
| 4720 | 4720 |
| 4721 // Slow case: Call the runtime system to do the number allocation. | 4721 // Slow case: Call the runtime system to do the number allocation. |
| 4722 __ bind(&slow); | 4722 __ bind(&slow); |
| 4723 { | 4723 { |
| 4724 // Put a valid pointer value in the stack slot where the result | 4724 // Put a valid pointer value in the stack slot where the result |
| 4725 // register is stored, as this register is in the pointer map, but contains | 4725 // register is stored, as this register is in the pointer map, but contains |
| 4726 // an integer value. | 4726 // an integer value. |
| 4727 __ Set(reg, 0); | 4727 __ Set(reg, 0); |
| 4728 | 4728 |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5843 CallRuntime(Runtime::kHiddenPushBlockContext, 2, instr); | 5843 CallRuntime(Runtime::kHiddenPushBlockContext, 2, instr); |
| 5844 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5844 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5845 } | 5845 } |
| 5846 | 5846 |
| 5847 | 5847 |
| 5848 #undef __ | 5848 #undef __ |
| 5849 | 5849 |
| 5850 } } // namespace v8::internal | 5850 } } // namespace v8::internal |
| 5851 | 5851 |
| 5852 #endif // V8_TARGET_ARCH_X64 | 5852 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |