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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class SafepointGenerator FINAL : public CallWrapper { | 23 class SafepointGenerator FINAL : public CallWrapper { |
24 public: | 24 public: |
25 SafepointGenerator(LCodeGen* codegen, | 25 SafepointGenerator(LCodeGen* codegen, |
26 LPointerMap* pointers, | 26 LPointerMap* pointers, |
27 Safepoint::DeoptMode mode) | 27 Safepoint::DeoptMode mode) |
28 : codegen_(codegen), | 28 : codegen_(codegen), |
29 pointers_(pointers), | 29 pointers_(pointers), |
30 deopt_mode_(mode) { } | 30 deopt_mode_(mode) { } |
31 virtual ~SafepointGenerator() {} | 31 virtual ~SafepointGenerator() {} |
32 | 32 |
33 virtual void BeforeCall(int call_size) const OVERRIDE {} | 33 void BeforeCall(int call_size) const OVERRIDE {} |
34 | 34 |
35 virtual void AfterCall() const OVERRIDE { | 35 void AfterCall() const OVERRIDE { |
36 codegen_->RecordSafepoint(pointers_, deopt_mode_); | 36 codegen_->RecordSafepoint(pointers_, deopt_mode_); |
37 } | 37 } |
38 | 38 |
39 private: | 39 private: |
40 LCodeGen* codegen_; | 40 LCodeGen* codegen_; |
41 LPointerMap* pointers_; | 41 LPointerMap* pointers_; |
42 Safepoint::DeoptMode deopt_mode_; | 42 Safepoint::DeoptMode deopt_mode_; |
43 }; | 43 }; |
44 | 44 |
45 | 45 |
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 __ bind(&done); | 2669 __ bind(&done); |
2670 } | 2670 } |
2671 | 2671 |
2672 | 2672 |
2673 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 2673 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
2674 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { | 2674 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { |
2675 public: | 2675 public: |
2676 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 2676 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
2677 LInstanceOfKnownGlobal* instr) | 2677 LInstanceOfKnownGlobal* instr) |
2678 : LDeferredCode(codegen), instr_(instr) { } | 2678 : LDeferredCode(codegen), instr_(instr) { } |
2679 virtual void Generate() OVERRIDE { | 2679 void Generate() OVERRIDE { |
2680 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); | 2680 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); |
2681 } | 2681 } |
2682 virtual LInstruction* instr() OVERRIDE { return instr_; } | 2682 LInstruction* instr() OVERRIDE { return instr_; } |
2683 Label* map_check() { return &map_check_; } | 2683 Label* map_check() { return &map_check_; } |
2684 private: | 2684 private: |
2685 LInstanceOfKnownGlobal* instr_; | 2685 LInstanceOfKnownGlobal* instr_; |
2686 Label map_check_; | 2686 Label map_check_; |
2687 }; | 2687 }; |
2688 | 2688 |
2689 DCHECK(ToRegister(instr->context()).is(rsi)); | 2689 DCHECK(ToRegister(instr->context()).is(rsi)); |
2690 DeferredInstanceOfKnownGlobal* deferred; | 2690 DeferredInstanceOfKnownGlobal* deferred; |
2691 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); | 2691 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
2692 | 2692 |
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3677 __ bind(&is_positive); | 3677 __ bind(&is_positive); |
3678 } | 3678 } |
3679 | 3679 |
3680 | 3680 |
3681 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3681 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
3682 // Class for deferred case. | 3682 // Class for deferred case. |
3683 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { | 3683 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { |
3684 public: | 3684 public: |
3685 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) | 3685 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) |
3686 : LDeferredCode(codegen), instr_(instr) { } | 3686 : LDeferredCode(codegen), instr_(instr) { } |
3687 virtual void Generate() OVERRIDE { | 3687 void Generate() OVERRIDE { |
3688 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); | 3688 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); |
3689 } | 3689 } |
3690 virtual LInstruction* instr() OVERRIDE { return instr_; } | 3690 LInstruction* instr() OVERRIDE { return instr_; } |
| 3691 |
3691 private: | 3692 private: |
3692 LMathAbs* instr_; | 3693 LMathAbs* instr_; |
3693 }; | 3694 }; |
3694 | 3695 |
3695 DCHECK(instr->value()->Equals(instr->result())); | 3696 DCHECK(instr->value()->Equals(instr->result())); |
3696 Representation r = instr->hydrogen()->value()->representation(); | 3697 Representation r = instr->hydrogen()->value()->representation(); |
3697 | 3698 |
3698 if (r.IsDouble()) { | 3699 if (r.IsDouble()) { |
3699 XMMRegister scratch = double_scratch0(); | 3700 XMMRegister scratch = double_scratch0(); |
3700 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3701 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4545 instr->hydrogen()->pretenure_flag()); | 4546 instr->hydrogen()->pretenure_flag()); |
4546 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4547 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4547 } | 4548 } |
4548 | 4549 |
4549 | 4550 |
4550 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4551 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
4551 class DeferredStringCharCodeAt FINAL : public LDeferredCode { | 4552 class DeferredStringCharCodeAt FINAL : public LDeferredCode { |
4552 public: | 4553 public: |
4553 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 4554 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
4554 : LDeferredCode(codegen), instr_(instr) { } | 4555 : LDeferredCode(codegen), instr_(instr) { } |
4555 virtual void Generate() OVERRIDE { | 4556 void Generate() OVERRIDE { codegen()->DoDeferredStringCharCodeAt(instr_); } |
4556 codegen()->DoDeferredStringCharCodeAt(instr_); | 4557 LInstruction* instr() OVERRIDE { return instr_; } |
4557 } | 4558 |
4558 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4559 private: | 4559 private: |
4560 LStringCharCodeAt* instr_; | 4560 LStringCharCodeAt* instr_; |
4561 }; | 4561 }; |
4562 | 4562 |
4563 DeferredStringCharCodeAt* deferred = | 4563 DeferredStringCharCodeAt* deferred = |
4564 new(zone()) DeferredStringCharCodeAt(this, instr); | 4564 new(zone()) DeferredStringCharCodeAt(this, instr); |
4565 | 4565 |
4566 StringCharLoadGenerator::Generate(masm(), | 4566 StringCharLoadGenerator::Generate(masm(), |
4567 ToRegister(instr->string()), | 4567 ToRegister(instr->string()), |
4568 ToRegister(instr->index()), | 4568 ToRegister(instr->index()), |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4600 __ SmiToInteger32(rax, rax); | 4600 __ SmiToInteger32(rax, rax); |
4601 __ StoreToSafepointRegisterSlot(result, rax); | 4601 __ StoreToSafepointRegisterSlot(result, rax); |
4602 } | 4602 } |
4603 | 4603 |
4604 | 4604 |
4605 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4605 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4606 class DeferredStringCharFromCode FINAL : public LDeferredCode { | 4606 class DeferredStringCharFromCode FINAL : public LDeferredCode { |
4607 public: | 4607 public: |
4608 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 4608 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
4609 : LDeferredCode(codegen), instr_(instr) { } | 4609 : LDeferredCode(codegen), instr_(instr) { } |
4610 virtual void Generate() OVERRIDE { | 4610 void Generate() OVERRIDE { |
4611 codegen()->DoDeferredStringCharFromCode(instr_); | 4611 codegen()->DoDeferredStringCharFromCode(instr_); |
4612 } | 4612 } |
4613 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4613 LInstruction* instr() OVERRIDE { return instr_; } |
| 4614 |
4614 private: | 4615 private: |
4615 LStringCharFromCode* instr_; | 4616 LStringCharFromCode* instr_; |
4616 }; | 4617 }; |
4617 | 4618 |
4618 DeferredStringCharFromCode* deferred = | 4619 DeferredStringCharFromCode* deferred = |
4619 new(zone()) DeferredStringCharFromCode(this, instr); | 4620 new(zone()) DeferredStringCharFromCode(this, instr); |
4620 | 4621 |
4621 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); | 4622 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); |
4622 Register char_code = ToRegister(instr->char_code()); | 4623 Register char_code = ToRegister(instr->char_code()); |
4623 Register result = ToRegister(instr->result()); | 4624 Register result = ToRegister(instr->result()); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4672 | 4673 |
4673 __ LoadUint32(ToDoubleRegister(output), ToRegister(input)); | 4674 __ LoadUint32(ToDoubleRegister(output), ToRegister(input)); |
4674 } | 4675 } |
4675 | 4676 |
4676 | 4677 |
4677 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4678 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
4678 class DeferredNumberTagI FINAL : public LDeferredCode { | 4679 class DeferredNumberTagI FINAL : public LDeferredCode { |
4679 public: | 4680 public: |
4680 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4681 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
4681 : LDeferredCode(codegen), instr_(instr) { } | 4682 : LDeferredCode(codegen), instr_(instr) { } |
4682 virtual void Generate() OVERRIDE { | 4683 void Generate() OVERRIDE { |
4683 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), | 4684 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), |
4684 instr_->temp2(), SIGNED_INT32); | 4685 instr_->temp2(), SIGNED_INT32); |
4685 } | 4686 } |
4686 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4687 LInstruction* instr() OVERRIDE { return instr_; } |
| 4688 |
4687 private: | 4689 private: |
4688 LNumberTagI* instr_; | 4690 LNumberTagI* instr_; |
4689 }; | 4691 }; |
4690 | 4692 |
4691 LOperand* input = instr->value(); | 4693 LOperand* input = instr->value(); |
4692 DCHECK(input->IsRegister() && input->Equals(instr->result())); | 4694 DCHECK(input->IsRegister() && input->Equals(instr->result())); |
4693 Register reg = ToRegister(input); | 4695 Register reg = ToRegister(input); |
4694 | 4696 |
4695 if (SmiValuesAre32Bits()) { | 4697 if (SmiValuesAre32Bits()) { |
4696 __ Integer32ToSmi(reg, reg); | 4698 __ Integer32ToSmi(reg, reg); |
4697 } else { | 4699 } else { |
4698 DCHECK(SmiValuesAre31Bits()); | 4700 DCHECK(SmiValuesAre31Bits()); |
4699 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); | 4701 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); |
4700 __ Integer32ToSmi(reg, reg); | 4702 __ Integer32ToSmi(reg, reg); |
4701 __ j(overflow, deferred->entry()); | 4703 __ j(overflow, deferred->entry()); |
4702 __ bind(deferred->exit()); | 4704 __ bind(deferred->exit()); |
4703 } | 4705 } |
4704 } | 4706 } |
4705 | 4707 |
4706 | 4708 |
4707 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4709 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
4708 class DeferredNumberTagU FINAL : public LDeferredCode { | 4710 class DeferredNumberTagU FINAL : public LDeferredCode { |
4709 public: | 4711 public: |
4710 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4712 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
4711 : LDeferredCode(codegen), instr_(instr) { } | 4713 : LDeferredCode(codegen), instr_(instr) { } |
4712 virtual void Generate() OVERRIDE { | 4714 void Generate() OVERRIDE { |
4713 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), | 4715 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), |
4714 instr_->temp2(), UNSIGNED_INT32); | 4716 instr_->temp2(), UNSIGNED_INT32); |
4715 } | 4717 } |
4716 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4718 LInstruction* instr() OVERRIDE { return instr_; } |
| 4719 |
4717 private: | 4720 private: |
4718 LNumberTagU* instr_; | 4721 LNumberTagU* instr_; |
4719 }; | 4722 }; |
4720 | 4723 |
4721 LOperand* input = instr->value(); | 4724 LOperand* input = instr->value(); |
4722 DCHECK(input->IsRegister() && input->Equals(instr->result())); | 4725 DCHECK(input->IsRegister() && input->Equals(instr->result())); |
4723 Register reg = ToRegister(input); | 4726 Register reg = ToRegister(input); |
4724 | 4727 |
4725 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); | 4728 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); |
4726 __ cmpl(reg, Immediate(Smi::kMaxValue)); | 4729 __ cmpl(reg, Immediate(Smi::kMaxValue)); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4789 __ bind(&done); | 4792 __ bind(&done); |
4790 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm); | 4793 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), temp_xmm); |
4791 } | 4794 } |
4792 | 4795 |
4793 | 4796 |
4794 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4797 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
4795 class DeferredNumberTagD FINAL : public LDeferredCode { | 4798 class DeferredNumberTagD FINAL : public LDeferredCode { |
4796 public: | 4799 public: |
4797 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4800 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
4798 : LDeferredCode(codegen), instr_(instr) { } | 4801 : LDeferredCode(codegen), instr_(instr) { } |
4799 virtual void Generate() OVERRIDE { | 4802 void Generate() OVERRIDE { codegen()->DoDeferredNumberTagD(instr_); } |
4800 codegen()->DoDeferredNumberTagD(instr_); | 4803 LInstruction* instr() OVERRIDE { return instr_; } |
4801 } | 4804 |
4802 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4803 private: | 4805 private: |
4804 LNumberTagD* instr_; | 4806 LNumberTagD* instr_; |
4805 }; | 4807 }; |
4806 | 4808 |
4807 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 4809 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
4808 Register reg = ToRegister(instr->result()); | 4810 Register reg = ToRegister(instr->result()); |
4809 Register tmp = ToRegister(instr->temp()); | 4811 Register tmp = ToRegister(instr->temp()); |
4810 | 4812 |
4811 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); | 4813 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
4812 if (FLAG_inline_new) { | 4814 if (FLAG_inline_new) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4985 } | 4987 } |
4986 } | 4988 } |
4987 } | 4989 } |
4988 | 4990 |
4989 | 4991 |
4990 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 4992 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
4991 class DeferredTaggedToI FINAL : public LDeferredCode { | 4993 class DeferredTaggedToI FINAL : public LDeferredCode { |
4992 public: | 4994 public: |
4993 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) | 4995 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) |
4994 : LDeferredCode(codegen), instr_(instr) { } | 4996 : LDeferredCode(codegen), instr_(instr) { } |
4995 virtual void Generate() OVERRIDE { | 4997 void Generate() OVERRIDE { codegen()->DoDeferredTaggedToI(instr_, done()); } |
4996 codegen()->DoDeferredTaggedToI(instr_, done()); | 4998 LInstruction* instr() OVERRIDE { return instr_; } |
4997 } | 4999 |
4998 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4999 private: | 5000 private: |
5000 LTaggedToI* instr_; | 5001 LTaggedToI* instr_; |
5001 }; | 5002 }; |
5002 | 5003 |
5003 LOperand* input = instr->value(); | 5004 LOperand* input = instr->value(); |
5004 DCHECK(input->IsRegister()); | 5005 DCHECK(input->IsRegister()); |
5005 DCHECK(input->Equals(instr->result())); | 5006 DCHECK(input->Equals(instr->result())); |
5006 Register input_reg = ToRegister(input); | 5007 Register input_reg = ToRegister(input); |
5007 | 5008 |
5008 if (instr->hydrogen()->value()->representation().IsSmi()) { | 5009 if (instr->hydrogen()->value()->representation().IsSmi()) { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5175 } | 5176 } |
5176 | 5177 |
5177 | 5178 |
5178 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5179 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
5179 class DeferredCheckMaps FINAL : public LDeferredCode { | 5180 class DeferredCheckMaps FINAL : public LDeferredCode { |
5180 public: | 5181 public: |
5181 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) | 5182 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) |
5182 : LDeferredCode(codegen), instr_(instr), object_(object) { | 5183 : LDeferredCode(codegen), instr_(instr), object_(object) { |
5183 SetExit(check_maps()); | 5184 SetExit(check_maps()); |
5184 } | 5185 } |
5185 virtual void Generate() OVERRIDE { | 5186 void Generate() OVERRIDE { |
5186 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5187 codegen()->DoDeferredInstanceMigration(instr_, object_); |
5187 } | 5188 } |
5188 Label* check_maps() { return &check_maps_; } | 5189 Label* check_maps() { return &check_maps_; } |
5189 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5190 LInstruction* instr() OVERRIDE { return instr_; } |
| 5191 |
5190 private: | 5192 private: |
5191 LCheckMaps* instr_; | 5193 LCheckMaps* instr_; |
5192 Label check_maps_; | 5194 Label check_maps_; |
5193 Register object_; | 5195 Register object_; |
5194 }; | 5196 }; |
5195 | 5197 |
5196 if (instr->hydrogen()->IsStabilityCheck()) { | 5198 if (instr->hydrogen()->IsStabilityCheck()) { |
5197 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5199 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
5198 for (int i = 0; i < maps->size(); ++i) { | 5200 for (int i = 0; i < maps->size(); ++i) { |
5199 AddStabilityDependency(maps->at(i).handle()); | 5201 AddStabilityDependency(maps->at(i).handle()); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5304 __ movd(xmm_scratch, lo_reg); | 5306 __ movd(xmm_scratch, lo_reg); |
5305 __ orps(result_reg, xmm_scratch); | 5307 __ orps(result_reg, xmm_scratch); |
5306 } | 5308 } |
5307 | 5309 |
5308 | 5310 |
5309 void LCodeGen::DoAllocate(LAllocate* instr) { | 5311 void LCodeGen::DoAllocate(LAllocate* instr) { |
5310 class DeferredAllocate FINAL : public LDeferredCode { | 5312 class DeferredAllocate FINAL : public LDeferredCode { |
5311 public: | 5313 public: |
5312 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5314 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
5313 : LDeferredCode(codegen), instr_(instr) { } | 5315 : LDeferredCode(codegen), instr_(instr) { } |
5314 virtual void Generate() OVERRIDE { | 5316 void Generate() OVERRIDE { codegen()->DoDeferredAllocate(instr_); } |
5315 codegen()->DoDeferredAllocate(instr_); | 5317 LInstruction* instr() OVERRIDE { return instr_; } |
5316 } | 5318 |
5317 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5318 private: | 5319 private: |
5319 LAllocate* instr_; | 5320 LAllocate* instr_; |
5320 }; | 5321 }; |
5321 | 5322 |
5322 DeferredAllocate* deferred = | 5323 DeferredAllocate* deferred = |
5323 new(zone()) DeferredAllocate(this, instr); | 5324 new(zone()) DeferredAllocate(this, instr); |
5324 | 5325 |
5325 Register result = ToRegister(instr->result()); | 5326 Register result = ToRegister(instr->result()); |
5326 Register temp = ToRegister(instr->temp()); | 5327 Register temp = ToRegister(instr->temp()); |
5327 | 5328 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5677 LEnvironment* env = instr->environment(); | 5678 LEnvironment* env = instr->environment(); |
5678 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5679 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
5679 } | 5680 } |
5680 | 5681 |
5681 | 5682 |
5682 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 5683 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
5683 class DeferredStackCheck FINAL : public LDeferredCode { | 5684 class DeferredStackCheck FINAL : public LDeferredCode { |
5684 public: | 5685 public: |
5685 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) | 5686 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) |
5686 : LDeferredCode(codegen), instr_(instr) { } | 5687 : LDeferredCode(codegen), instr_(instr) { } |
5687 virtual void Generate() OVERRIDE { | 5688 void Generate() OVERRIDE { codegen()->DoDeferredStackCheck(instr_); } |
5688 codegen()->DoDeferredStackCheck(instr_); | 5689 LInstruction* instr() OVERRIDE { return instr_; } |
5689 } | 5690 |
5690 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5691 private: | 5691 private: |
5692 LStackCheck* instr_; | 5692 LStackCheck* instr_; |
5693 }; | 5693 }; |
5694 | 5694 |
5695 DCHECK(instr->HasEnvironment()); | 5695 DCHECK(instr->HasEnvironment()); |
5696 LEnvironment* env = instr->environment(); | 5696 LEnvironment* env = instr->environment(); |
5697 // There is no LLazyBailout instruction for stack-checks. We have to | 5697 // There is no LLazyBailout instruction for stack-checks. We have to |
5698 // prepare for lazy deoptimization explicitly here. | 5698 // prepare for lazy deoptimization explicitly here. |
5699 if (instr->hydrogen()->is_function_entry()) { | 5699 if (instr->hydrogen()->is_function_entry()) { |
5700 // Perform stack overflow check. | 5700 // Perform stack overflow check. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5824 public: | 5824 public: |
5825 DeferredLoadMutableDouble(LCodeGen* codegen, | 5825 DeferredLoadMutableDouble(LCodeGen* codegen, |
5826 LLoadFieldByIndex* instr, | 5826 LLoadFieldByIndex* instr, |
5827 Register object, | 5827 Register object, |
5828 Register index) | 5828 Register index) |
5829 : LDeferredCode(codegen), | 5829 : LDeferredCode(codegen), |
5830 instr_(instr), | 5830 instr_(instr), |
5831 object_(object), | 5831 object_(object), |
5832 index_(index) { | 5832 index_(index) { |
5833 } | 5833 } |
5834 virtual void Generate() OVERRIDE { | 5834 void Generate() OVERRIDE { |
5835 codegen()->DoDeferredLoadMutableDouble(instr_, object_, index_); | 5835 codegen()->DoDeferredLoadMutableDouble(instr_, object_, index_); |
5836 } | 5836 } |
5837 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5837 LInstruction* instr() OVERRIDE { return instr_; } |
| 5838 |
5838 private: | 5839 private: |
5839 LLoadFieldByIndex* instr_; | 5840 LLoadFieldByIndex* instr_; |
5840 Register object_; | 5841 Register object_; |
5841 Register index_; | 5842 Register index_; |
5842 }; | 5843 }; |
5843 | 5844 |
5844 Register object = ToRegister(instr->object()); | 5845 Register object = ToRegister(instr->object()); |
5845 Register index = ToRegister(instr->index()); | 5846 Register index = ToRegister(instr->index()); |
5846 | 5847 |
5847 DeferredLoadMutableDouble* deferred; | 5848 DeferredLoadMutableDouble* deferred; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5889 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5890 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5890 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5891 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5891 } | 5892 } |
5892 | 5893 |
5893 | 5894 |
5894 #undef __ | 5895 #undef __ |
5895 | 5896 |
5896 } } // namespace v8::internal | 5897 } } // namespace v8::internal |
5897 | 5898 |
5898 #endif // V8_TARGET_ARCH_X64 | 5899 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |