| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
| 8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| 11 #include "src/code-stubs.h" | 11 #include "src/code-stubs.h" |
| 12 #include "src/hydrogen-osr.h" | 12 #include "src/hydrogen-osr.h" |
| 13 #include "src/ic/ic.h" | 13 #include "src/ic/ic.h" |
| 14 #include "src/ic/stub-cache.h" | 14 #include "src/ic/stub-cache.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 | 19 |
| 20 class SafepointGenerator FINAL : public CallWrapper { | 20 class SafepointGenerator FINAL : public CallWrapper { |
| 21 public: | 21 public: |
| 22 SafepointGenerator(LCodeGen* codegen, | 22 SafepointGenerator(LCodeGen* codegen, |
| 23 LPointerMap* pointers, | 23 LPointerMap* pointers, |
| 24 Safepoint::DeoptMode mode) | 24 Safepoint::DeoptMode mode) |
| 25 : codegen_(codegen), | 25 : codegen_(codegen), |
| 26 pointers_(pointers), | 26 pointers_(pointers), |
| 27 deopt_mode_(mode) { } | 27 deopt_mode_(mode) { } |
| 28 virtual ~SafepointGenerator() {} | 28 virtual ~SafepointGenerator() {} |
| 29 | 29 |
| 30 virtual void BeforeCall(int call_size) const OVERRIDE {} | 30 void BeforeCall(int call_size) const OVERRIDE {} |
| 31 | 31 |
| 32 virtual void AfterCall() const OVERRIDE { | 32 void AfterCall() const OVERRIDE { |
| 33 codegen_->RecordSafepoint(pointers_, deopt_mode_); | 33 codegen_->RecordSafepoint(pointers_, deopt_mode_); |
| 34 } | 34 } |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 LCodeGen* codegen_; | 37 LCodeGen* codegen_; |
| 38 LPointerMap* pointers_; | 38 LPointerMap* pointers_; |
| 39 Safepoint::DeoptMode deopt_mode_; | 39 Safepoint::DeoptMode deopt_mode_; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 | 42 |
| (...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2778 __ mov(r0, Operand(factory()->true_value()), LeaveCC, eq); | 2778 __ mov(r0, Operand(factory()->true_value()), LeaveCC, eq); |
| 2779 } | 2779 } |
| 2780 | 2780 |
| 2781 | 2781 |
| 2782 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 2782 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
| 2783 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { | 2783 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { |
| 2784 public: | 2784 public: |
| 2785 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 2785 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
| 2786 LInstanceOfKnownGlobal* instr) | 2786 LInstanceOfKnownGlobal* instr) |
| 2787 : LDeferredCode(codegen), instr_(instr) { } | 2787 : LDeferredCode(codegen), instr_(instr) { } |
| 2788 virtual void Generate() OVERRIDE { | 2788 void Generate() OVERRIDE { |
| 2789 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_, | 2789 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_, |
| 2790 &load_bool_); | 2790 &load_bool_); |
| 2791 } | 2791 } |
| 2792 virtual LInstruction* instr() OVERRIDE { return instr_; } | 2792 LInstruction* instr() OVERRIDE { return instr_; } |
| 2793 Label* map_check() { return &map_check_; } | 2793 Label* map_check() { return &map_check_; } |
| 2794 Label* load_bool() { return &load_bool_; } | 2794 Label* load_bool() { return &load_bool_; } |
| 2795 | 2795 |
| 2796 private: | 2796 private: |
| 2797 LInstanceOfKnownGlobal* instr_; | 2797 LInstanceOfKnownGlobal* instr_; |
| 2798 Label map_check_; | 2798 Label map_check_; |
| 2799 Label load_bool_; | 2799 Label load_bool_; |
| 2800 }; | 2800 }; |
| 2801 | 2801 |
| 2802 DeferredInstanceOfKnownGlobal* deferred; | 2802 DeferredInstanceOfKnownGlobal* deferred; |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3754 DeoptimizeIf(vs, instr, "overflow"); | 3754 DeoptimizeIf(vs, instr, "overflow"); |
| 3755 } | 3755 } |
| 3756 | 3756 |
| 3757 | 3757 |
| 3758 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3758 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
| 3759 // Class for deferred case. | 3759 // Class for deferred case. |
| 3760 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { | 3760 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { |
| 3761 public: | 3761 public: |
| 3762 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) | 3762 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) |
| 3763 : LDeferredCode(codegen), instr_(instr) { } | 3763 : LDeferredCode(codegen), instr_(instr) { } |
| 3764 virtual void Generate() OVERRIDE { | 3764 void Generate() OVERRIDE { |
| 3765 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); | 3765 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); |
| 3766 } | 3766 } |
| 3767 virtual LInstruction* instr() OVERRIDE { return instr_; } | 3767 LInstruction* instr() OVERRIDE { return instr_; } |
| 3768 |
| 3768 private: | 3769 private: |
| 3769 LMathAbs* instr_; | 3770 LMathAbs* instr_; |
| 3770 }; | 3771 }; |
| 3771 | 3772 |
| 3772 Representation r = instr->hydrogen()->value()->representation(); | 3773 Representation r = instr->hydrogen()->value()->representation(); |
| 3773 if (r.IsDouble()) { | 3774 if (r.IsDouble()) { |
| 3774 DwVfpRegister input = ToDoubleRegister(instr->value()); | 3775 DwVfpRegister input = ToDoubleRegister(instr->value()); |
| 3775 DwVfpRegister result = ToDoubleRegister(instr->result()); | 3776 DwVfpRegister result = ToDoubleRegister(instr->result()); |
| 3776 __ vabs(result, input); | 3777 __ vabs(result, input); |
| 3777 } else if (r.IsSmiOrInteger32()) { | 3778 } else if (r.IsSmiOrInteger32()) { |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4523 instr->hydrogen()->pretenure_flag()); | 4524 instr->hydrogen()->pretenure_flag()); |
| 4524 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4525 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4525 } | 4526 } |
| 4526 | 4527 |
| 4527 | 4528 |
| 4528 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4529 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
| 4529 class DeferredStringCharCodeAt FINAL : public LDeferredCode { | 4530 class DeferredStringCharCodeAt FINAL : public LDeferredCode { |
| 4530 public: | 4531 public: |
| 4531 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 4532 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
| 4532 : LDeferredCode(codegen), instr_(instr) { } | 4533 : LDeferredCode(codegen), instr_(instr) { } |
| 4533 virtual void Generate() OVERRIDE { | 4534 void Generate() OVERRIDE { codegen()->DoDeferredStringCharCodeAt(instr_); } |
| 4534 codegen()->DoDeferredStringCharCodeAt(instr_); | 4535 LInstruction* instr() OVERRIDE { return instr_; } |
| 4535 } | 4536 |
| 4536 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
| 4537 private: | 4537 private: |
| 4538 LStringCharCodeAt* instr_; | 4538 LStringCharCodeAt* instr_; |
| 4539 }; | 4539 }; |
| 4540 | 4540 |
| 4541 DeferredStringCharCodeAt* deferred = | 4541 DeferredStringCharCodeAt* deferred = |
| 4542 new(zone()) DeferredStringCharCodeAt(this, instr); | 4542 new(zone()) DeferredStringCharCodeAt(this, instr); |
| 4543 | 4543 |
| 4544 StringCharLoadGenerator::Generate(masm(), | 4544 StringCharLoadGenerator::Generate(masm(), |
| 4545 ToRegister(instr->string()), | 4545 ToRegister(instr->string()), |
| 4546 ToRegister(instr->index()), | 4546 ToRegister(instr->index()), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4579 __ SmiUntag(r0); | 4579 __ SmiUntag(r0); |
| 4580 __ StoreToSafepointRegisterSlot(r0, result); | 4580 __ StoreToSafepointRegisterSlot(r0, result); |
| 4581 } | 4581 } |
| 4582 | 4582 |
| 4583 | 4583 |
| 4584 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4584 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
| 4585 class DeferredStringCharFromCode FINAL : public LDeferredCode { | 4585 class DeferredStringCharFromCode FINAL : public LDeferredCode { |
| 4586 public: | 4586 public: |
| 4587 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 4587 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
| 4588 : LDeferredCode(codegen), instr_(instr) { } | 4588 : LDeferredCode(codegen), instr_(instr) { } |
| 4589 virtual void Generate() OVERRIDE { | 4589 void Generate() OVERRIDE { |
| 4590 codegen()->DoDeferredStringCharFromCode(instr_); | 4590 codegen()->DoDeferredStringCharFromCode(instr_); |
| 4591 } | 4591 } |
| 4592 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4592 LInstruction* instr() OVERRIDE { return instr_; } |
| 4593 |
| 4593 private: | 4594 private: |
| 4594 LStringCharFromCode* instr_; | 4595 LStringCharFromCode* instr_; |
| 4595 }; | 4596 }; |
| 4596 | 4597 |
| 4597 DeferredStringCharFromCode* deferred = | 4598 DeferredStringCharFromCode* deferred = |
| 4598 new(zone()) DeferredStringCharFromCode(this, instr); | 4599 new(zone()) DeferredStringCharFromCode(this, instr); |
| 4599 | 4600 |
| 4600 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); | 4601 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); |
| 4601 Register char_code = ToRegister(instr->char_code()); | 4602 Register char_code = ToRegister(instr->char_code()); |
| 4602 Register result = ToRegister(instr->result()); | 4603 Register result = ToRegister(instr->result()); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4656 __ vmov(flt_scratch, ToRegister(input)); | 4657 __ vmov(flt_scratch, ToRegister(input)); |
| 4657 __ vcvt_f64_u32(ToDoubleRegister(output), flt_scratch); | 4658 __ vcvt_f64_u32(ToDoubleRegister(output), flt_scratch); |
| 4658 } | 4659 } |
| 4659 | 4660 |
| 4660 | 4661 |
| 4661 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4662 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
| 4662 class DeferredNumberTagI FINAL : public LDeferredCode { | 4663 class DeferredNumberTagI FINAL : public LDeferredCode { |
| 4663 public: | 4664 public: |
| 4664 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4665 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
| 4665 : LDeferredCode(codegen), instr_(instr) { } | 4666 : LDeferredCode(codegen), instr_(instr) { } |
| 4666 virtual void Generate() OVERRIDE { | 4667 void Generate() OVERRIDE { |
| 4667 codegen()->DoDeferredNumberTagIU(instr_, | 4668 codegen()->DoDeferredNumberTagIU(instr_, |
| 4668 instr_->value(), | 4669 instr_->value(), |
| 4669 instr_->temp1(), | 4670 instr_->temp1(), |
| 4670 instr_->temp2(), | 4671 instr_->temp2(), |
| 4671 SIGNED_INT32); | 4672 SIGNED_INT32); |
| 4672 } | 4673 } |
| 4673 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4674 LInstruction* instr() OVERRIDE { return instr_; } |
| 4675 |
| 4674 private: | 4676 private: |
| 4675 LNumberTagI* instr_; | 4677 LNumberTagI* instr_; |
| 4676 }; | 4678 }; |
| 4677 | 4679 |
| 4678 Register src = ToRegister(instr->value()); | 4680 Register src = ToRegister(instr->value()); |
| 4679 Register dst = ToRegister(instr->result()); | 4681 Register dst = ToRegister(instr->result()); |
| 4680 | 4682 |
| 4681 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); | 4683 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); |
| 4682 __ SmiTag(dst, src, SetCC); | 4684 __ SmiTag(dst, src, SetCC); |
| 4683 __ b(vs, deferred->entry()); | 4685 __ b(vs, deferred->entry()); |
| 4684 __ bind(deferred->exit()); | 4686 __ bind(deferred->exit()); |
| 4685 } | 4687 } |
| 4686 | 4688 |
| 4687 | 4689 |
| 4688 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4690 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
| 4689 class DeferredNumberTagU FINAL : public LDeferredCode { | 4691 class DeferredNumberTagU FINAL : public LDeferredCode { |
| 4690 public: | 4692 public: |
| 4691 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4693 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
| 4692 : LDeferredCode(codegen), instr_(instr) { } | 4694 : LDeferredCode(codegen), instr_(instr) { } |
| 4693 virtual void Generate() OVERRIDE { | 4695 void Generate() OVERRIDE { |
| 4694 codegen()->DoDeferredNumberTagIU(instr_, | 4696 codegen()->DoDeferredNumberTagIU(instr_, |
| 4695 instr_->value(), | 4697 instr_->value(), |
| 4696 instr_->temp1(), | 4698 instr_->temp1(), |
| 4697 instr_->temp2(), | 4699 instr_->temp2(), |
| 4698 UNSIGNED_INT32); | 4700 UNSIGNED_INT32); |
| 4699 } | 4701 } |
| 4700 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4702 LInstruction* instr() OVERRIDE { return instr_; } |
| 4703 |
| 4701 private: | 4704 private: |
| 4702 LNumberTagU* instr_; | 4705 LNumberTagU* instr_; |
| 4703 }; | 4706 }; |
| 4704 | 4707 |
| 4705 Register input = ToRegister(instr->value()); | 4708 Register input = ToRegister(instr->value()); |
| 4706 Register result = ToRegister(instr->result()); | 4709 Register result = ToRegister(instr->result()); |
| 4707 | 4710 |
| 4708 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); | 4711 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); |
| 4709 __ cmp(input, Operand(Smi::kMaxValue)); | 4712 __ cmp(input, Operand(Smi::kMaxValue)); |
| 4710 __ b(hi, deferred->entry()); | 4713 __ b(hi, deferred->entry()); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4777 __ vstr(dbl_scratch, dst, HeapNumber::kValueOffset); | 4780 __ vstr(dbl_scratch, dst, HeapNumber::kValueOffset); |
| 4778 __ add(dst, dst, Operand(kHeapObjectTag)); | 4781 __ add(dst, dst, Operand(kHeapObjectTag)); |
| 4779 } | 4782 } |
| 4780 | 4783 |
| 4781 | 4784 |
| 4782 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4785 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
| 4783 class DeferredNumberTagD FINAL : public LDeferredCode { | 4786 class DeferredNumberTagD FINAL : public LDeferredCode { |
| 4784 public: | 4787 public: |
| 4785 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4788 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
| 4786 : LDeferredCode(codegen), instr_(instr) { } | 4789 : LDeferredCode(codegen), instr_(instr) { } |
| 4787 virtual void Generate() OVERRIDE { | 4790 void Generate() OVERRIDE { codegen()->DoDeferredNumberTagD(instr_); } |
| 4788 codegen()->DoDeferredNumberTagD(instr_); | 4791 LInstruction* instr() OVERRIDE { return instr_; } |
| 4789 } | 4792 |
| 4790 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
| 4791 private: | 4793 private: |
| 4792 LNumberTagD* instr_; | 4794 LNumberTagD* instr_; |
| 4793 }; | 4795 }; |
| 4794 | 4796 |
| 4795 DwVfpRegister input_reg = ToDoubleRegister(instr->value()); | 4797 DwVfpRegister input_reg = ToDoubleRegister(instr->value()); |
| 4796 Register scratch = scratch0(); | 4798 Register scratch = scratch0(); |
| 4797 Register reg = ToRegister(instr->result()); | 4799 Register reg = ToRegister(instr->result()); |
| 4798 Register temp1 = ToRegister(instr->temp()); | 4800 Register temp1 = ToRegister(instr->temp()); |
| 4799 Register temp2 = ToRegister(instr->temp2()); | 4801 Register temp2 = ToRegister(instr->temp2()); |
| 4800 | 4802 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4996 } | 4998 } |
| 4997 __ bind(&done); | 4999 __ bind(&done); |
| 4998 } | 5000 } |
| 4999 | 5001 |
| 5000 | 5002 |
| 5001 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 5003 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
| 5002 class DeferredTaggedToI FINAL : public LDeferredCode { | 5004 class DeferredTaggedToI FINAL : public LDeferredCode { |
| 5003 public: | 5005 public: |
| 5004 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) | 5006 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) |
| 5005 : LDeferredCode(codegen), instr_(instr) { } | 5007 : LDeferredCode(codegen), instr_(instr) { } |
| 5006 virtual void Generate() OVERRIDE { | 5008 void Generate() OVERRIDE { codegen()->DoDeferredTaggedToI(instr_); } |
| 5007 codegen()->DoDeferredTaggedToI(instr_); | 5009 LInstruction* instr() OVERRIDE { return instr_; } |
| 5008 } | 5010 |
| 5009 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
| 5010 private: | 5011 private: |
| 5011 LTaggedToI* instr_; | 5012 LTaggedToI* instr_; |
| 5012 }; | 5013 }; |
| 5013 | 5014 |
| 5014 LOperand* input = instr->value(); | 5015 LOperand* input = instr->value(); |
| 5015 DCHECK(input->IsRegister()); | 5016 DCHECK(input->IsRegister()); |
| 5016 DCHECK(input->Equals(instr->result())); | 5017 DCHECK(input->Equals(instr->result())); |
| 5017 | 5018 |
| 5018 Register input_reg = ToRegister(input); | 5019 Register input_reg = ToRegister(input); |
| 5019 | 5020 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5193 } | 5194 } |
| 5194 | 5195 |
| 5195 | 5196 |
| 5196 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5197 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
| 5197 class DeferredCheckMaps FINAL : public LDeferredCode { | 5198 class DeferredCheckMaps FINAL : public LDeferredCode { |
| 5198 public: | 5199 public: |
| 5199 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) | 5200 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) |
| 5200 : LDeferredCode(codegen), instr_(instr), object_(object) { | 5201 : LDeferredCode(codegen), instr_(instr), object_(object) { |
| 5201 SetExit(check_maps()); | 5202 SetExit(check_maps()); |
| 5202 } | 5203 } |
| 5203 virtual void Generate() OVERRIDE { | 5204 void Generate() OVERRIDE { |
| 5204 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5205 codegen()->DoDeferredInstanceMigration(instr_, object_); |
| 5205 } | 5206 } |
| 5206 Label* check_maps() { return &check_maps_; } | 5207 Label* check_maps() { return &check_maps_; } |
| 5207 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5208 LInstruction* instr() OVERRIDE { return instr_; } |
| 5209 |
| 5208 private: | 5210 private: |
| 5209 LCheckMaps* instr_; | 5211 LCheckMaps* instr_; |
| 5210 Label check_maps_; | 5212 Label check_maps_; |
| 5211 Register object_; | 5213 Register object_; |
| 5212 }; | 5214 }; |
| 5213 | 5215 |
| 5214 if (instr->hydrogen()->IsStabilityCheck()) { | 5216 if (instr->hydrogen()->IsStabilityCheck()) { |
| 5215 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5217 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
| 5216 for (int i = 0; i < maps->size(); ++i) { | 5218 for (int i = 0; i < maps->size(); ++i) { |
| 5217 AddStabilityDependency(maps->at(i).handle()); | 5219 AddStabilityDependency(maps->at(i).handle()); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5321 __ VmovHigh(result_reg, hi_reg); | 5323 __ VmovHigh(result_reg, hi_reg); |
| 5322 __ VmovLow(result_reg, lo_reg); | 5324 __ VmovLow(result_reg, lo_reg); |
| 5323 } | 5325 } |
| 5324 | 5326 |
| 5325 | 5327 |
| 5326 void LCodeGen::DoAllocate(LAllocate* instr) { | 5328 void LCodeGen::DoAllocate(LAllocate* instr) { |
| 5327 class DeferredAllocate FINAL : public LDeferredCode { | 5329 class DeferredAllocate FINAL : public LDeferredCode { |
| 5328 public: | 5330 public: |
| 5329 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5331 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
| 5330 : LDeferredCode(codegen), instr_(instr) { } | 5332 : LDeferredCode(codegen), instr_(instr) { } |
| 5331 virtual void Generate() OVERRIDE { | 5333 void Generate() OVERRIDE { codegen()->DoDeferredAllocate(instr_); } |
| 5332 codegen()->DoDeferredAllocate(instr_); | 5334 LInstruction* instr() OVERRIDE { return instr_; } |
| 5333 } | 5335 |
| 5334 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
| 5335 private: | 5336 private: |
| 5336 LAllocate* instr_; | 5337 LAllocate* instr_; |
| 5337 }; | 5338 }; |
| 5338 | 5339 |
| 5339 DeferredAllocate* deferred = | 5340 DeferredAllocate* deferred = |
| 5340 new(zone()) DeferredAllocate(this, instr); | 5341 new(zone()) DeferredAllocate(this, instr); |
| 5341 | 5342 |
| 5342 Register result = ToRegister(instr->result()); | 5343 Register result = ToRegister(instr->result()); |
| 5343 Register scratch = ToRegister(instr->temp1()); | 5344 Register scratch = ToRegister(instr->temp1()); |
| 5344 Register scratch2 = ToRegister(instr->temp2()); | 5345 Register scratch2 = ToRegister(instr->temp2()); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5686 LEnvironment* env = instr->environment(); | 5687 LEnvironment* env = instr->environment(); |
| 5687 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5688 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
| 5688 } | 5689 } |
| 5689 | 5690 |
| 5690 | 5691 |
| 5691 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 5692 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
| 5692 class DeferredStackCheck FINAL : public LDeferredCode { | 5693 class DeferredStackCheck FINAL : public LDeferredCode { |
| 5693 public: | 5694 public: |
| 5694 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) | 5695 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) |
| 5695 : LDeferredCode(codegen), instr_(instr) { } | 5696 : LDeferredCode(codegen), instr_(instr) { } |
| 5696 virtual void Generate() OVERRIDE { | 5697 void Generate() OVERRIDE { codegen()->DoDeferredStackCheck(instr_); } |
| 5697 codegen()->DoDeferredStackCheck(instr_); | 5698 LInstruction* instr() OVERRIDE { return instr_; } |
| 5698 } | 5699 |
| 5699 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
| 5700 private: | 5700 private: |
| 5701 LStackCheck* instr_; | 5701 LStackCheck* instr_; |
| 5702 }; | 5702 }; |
| 5703 | 5703 |
| 5704 DCHECK(instr->HasEnvironment()); | 5704 DCHECK(instr->HasEnvironment()); |
| 5705 LEnvironment* env = instr->environment(); | 5705 LEnvironment* env = instr->environment(); |
| 5706 // There is no LLazyBailout instruction for stack-checks. We have to | 5706 // There is no LLazyBailout instruction for stack-checks. We have to |
| 5707 // prepare for lazy deoptimization explicitly here. | 5707 // prepare for lazy deoptimization explicitly here. |
| 5708 if (instr->hydrogen()->is_function_entry()) { | 5708 if (instr->hydrogen()->is_function_entry()) { |
| 5709 // Perform stack overflow check. | 5709 // Perform stack overflow check. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5842 LLoadFieldByIndex* instr, | 5842 LLoadFieldByIndex* instr, |
| 5843 Register result, | 5843 Register result, |
| 5844 Register object, | 5844 Register object, |
| 5845 Register index) | 5845 Register index) |
| 5846 : LDeferredCode(codegen), | 5846 : LDeferredCode(codegen), |
| 5847 instr_(instr), | 5847 instr_(instr), |
| 5848 result_(result), | 5848 result_(result), |
| 5849 object_(object), | 5849 object_(object), |
| 5850 index_(index) { | 5850 index_(index) { |
| 5851 } | 5851 } |
| 5852 virtual void Generate() OVERRIDE { | 5852 void Generate() OVERRIDE { |
| 5853 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); | 5853 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); |
| 5854 } | 5854 } |
| 5855 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5855 LInstruction* instr() OVERRIDE { return instr_; } |
| 5856 |
| 5856 private: | 5857 private: |
| 5857 LLoadFieldByIndex* instr_; | 5858 LLoadFieldByIndex* instr_; |
| 5858 Register result_; | 5859 Register result_; |
| 5859 Register object_; | 5860 Register object_; |
| 5860 Register index_; | 5861 Register index_; |
| 5861 }; | 5862 }; |
| 5862 | 5863 |
| 5863 Register object = ToRegister(instr->object()); | 5864 Register object = ToRegister(instr->object()); |
| 5864 Register index = ToRegister(instr->index()); | 5865 Register index = ToRegister(instr->index()); |
| 5865 Register result = ToRegister(instr->result()); | 5866 Register result = ToRegister(instr->result()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5906 __ Push(scope_info); | 5907 __ Push(scope_info); |
| 5907 __ push(ToRegister(instr->function())); | 5908 __ push(ToRegister(instr->function())); |
| 5908 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5909 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5909 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5910 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5910 } | 5911 } |
| 5911 | 5912 |
| 5912 | 5913 |
| 5913 #undef __ | 5914 #undef __ |
| 5914 | 5915 |
| 5915 } } // namespace v8::internal | 5916 } } // namespace v8::internal |
| OLD | NEW |