OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
11 #include "src/ic/ic.h" | 11 #include "src/ic/ic.h" |
12 #include "src/ic/stub-cache.h" | 12 #include "src/ic/stub-cache.h" |
13 #include "src/ppc/lithium-codegen-ppc.h" | 13 #include "src/ppc/lithium-codegen-ppc.h" |
14 #include "src/ppc/lithium-gap-resolver-ppc.h" | 14 #include "src/ppc/lithium-gap-resolver-ppc.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, LPointerMap* pointers, | 22 SafepointGenerator(LCodeGen* codegen, LPointerMap* pointers, |
23 Safepoint::DeoptMode mode) | 23 Safepoint::DeoptMode mode) |
24 : codegen_(codegen), pointers_(pointers), deopt_mode_(mode) {} | 24 : codegen_(codegen), pointers_(pointers), deopt_mode_(mode) {} |
25 virtual ~SafepointGenerator() {} | 25 virtual ~SafepointGenerator() {} |
26 | 26 |
27 virtual void BeforeCall(int call_size) const OVERRIDE {} | 27 void BeforeCall(int call_size) const OVERRIDE {} |
28 | 28 |
29 virtual void AfterCall() const OVERRIDE { | 29 void AfterCall() const OVERRIDE { |
30 codegen_->RecordSafepoint(pointers_, deopt_mode_); | 30 codegen_->RecordSafepoint(pointers_, deopt_mode_); |
31 } | 31 } |
32 | 32 |
33 private: | 33 private: |
34 LCodeGen* codegen_; | 34 LCodeGen* codegen_; |
35 LPointerMap* pointers_; | 35 LPointerMap* pointers_; |
36 Safepoint::DeoptMode deopt_mode_; | 36 Safepoint::DeoptMode deopt_mode_; |
37 }; | 37 }; |
38 | 38 |
39 | 39 |
(...skipping 2786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2826 __ bind(&done); | 2826 __ bind(&done); |
2827 } | 2827 } |
2828 | 2828 |
2829 | 2829 |
2830 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 2830 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
2831 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { | 2831 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { |
2832 public: | 2832 public: |
2833 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 2833 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
2834 LInstanceOfKnownGlobal* instr) | 2834 LInstanceOfKnownGlobal* instr) |
2835 : LDeferredCode(codegen), instr_(instr) {} | 2835 : LDeferredCode(codegen), instr_(instr) {} |
2836 virtual void Generate() OVERRIDE { | 2836 void Generate() OVERRIDE { |
2837 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); | 2837 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); |
2838 } | 2838 } |
2839 virtual LInstruction* instr() OVERRIDE { return instr_; } | 2839 LInstruction* instr() OVERRIDE { return instr_; } |
2840 Label* map_check() { return &map_check_; } | 2840 Label* map_check() { return &map_check_; } |
2841 | 2841 |
2842 private: | 2842 private: |
2843 LInstanceOfKnownGlobal* instr_; | 2843 LInstanceOfKnownGlobal* instr_; |
2844 Label map_check_; | 2844 Label map_check_; |
2845 }; | 2845 }; |
2846 | 2846 |
2847 DeferredInstanceOfKnownGlobal* deferred; | 2847 DeferredInstanceOfKnownGlobal* deferred; |
2848 deferred = new (zone()) DeferredInstanceOfKnownGlobal(this, instr); | 2848 deferred = new (zone()) DeferredInstanceOfKnownGlobal(this, instr); |
2849 | 2849 |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3897 } | 3897 } |
3898 #endif | 3898 #endif |
3899 | 3899 |
3900 | 3900 |
3901 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3901 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
3902 // Class for deferred case. | 3902 // Class for deferred case. |
3903 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { | 3903 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { |
3904 public: | 3904 public: |
3905 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) | 3905 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) |
3906 : LDeferredCode(codegen), instr_(instr) {} | 3906 : LDeferredCode(codegen), instr_(instr) {} |
3907 virtual void Generate() OVERRIDE { | 3907 void Generate() OVERRIDE { |
3908 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); | 3908 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); |
3909 } | 3909 } |
3910 virtual LInstruction* instr() OVERRIDE { return instr_; } | 3910 LInstruction* instr() OVERRIDE { return instr_; } |
3911 | 3911 |
3912 private: | 3912 private: |
3913 LMathAbs* instr_; | 3913 LMathAbs* instr_; |
3914 }; | 3914 }; |
3915 | 3915 |
3916 Representation r = instr->hydrogen()->value()->representation(); | 3916 Representation r = instr->hydrogen()->value()->representation(); |
3917 if (r.IsDouble()) { | 3917 if (r.IsDouble()) { |
3918 DoubleRegister input = ToDoubleRegister(instr->value()); | 3918 DoubleRegister input = ToDoubleRegister(instr->value()); |
3919 DoubleRegister result = ToDoubleRegister(instr->result()); | 3919 DoubleRegister result = ToDoubleRegister(instr->result()); |
3920 __ fabs(result, input); | 3920 __ fabs(result, input); |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4738 instr->hydrogen()->pretenure_flag()); | 4738 instr->hydrogen()->pretenure_flag()); |
4739 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4739 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4740 } | 4740 } |
4741 | 4741 |
4742 | 4742 |
4743 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4743 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
4744 class DeferredStringCharCodeAt FINAL : public LDeferredCode { | 4744 class DeferredStringCharCodeAt FINAL : public LDeferredCode { |
4745 public: | 4745 public: |
4746 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 4746 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
4747 : LDeferredCode(codegen), instr_(instr) {} | 4747 : LDeferredCode(codegen), instr_(instr) {} |
4748 virtual void Generate() OVERRIDE { | 4748 void Generate() OVERRIDE { codegen()->DoDeferredStringCharCodeAt(instr_); } |
4749 codegen()->DoDeferredStringCharCodeAt(instr_); | 4749 LInstruction* instr() OVERRIDE { return instr_; } |
4750 } | |
4751 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4752 | 4750 |
4753 private: | 4751 private: |
4754 LStringCharCodeAt* instr_; | 4752 LStringCharCodeAt* instr_; |
4755 }; | 4753 }; |
4756 | 4754 |
4757 DeferredStringCharCodeAt* deferred = | 4755 DeferredStringCharCodeAt* deferred = |
4758 new (zone()) DeferredStringCharCodeAt(this, instr); | 4756 new (zone()) DeferredStringCharCodeAt(this, instr); |
4759 | 4757 |
4760 StringCharLoadGenerator::Generate( | 4758 StringCharLoadGenerator::Generate( |
4761 masm(), ToRegister(instr->string()), ToRegister(instr->index()), | 4759 masm(), ToRegister(instr->string()), ToRegister(instr->index()), |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4793 __ SmiUntag(r3); | 4791 __ SmiUntag(r3); |
4794 __ StoreToSafepointRegisterSlot(r3, result); | 4792 __ StoreToSafepointRegisterSlot(r3, result); |
4795 } | 4793 } |
4796 | 4794 |
4797 | 4795 |
4798 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4796 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4799 class DeferredStringCharFromCode FINAL : public LDeferredCode { | 4797 class DeferredStringCharFromCode FINAL : public LDeferredCode { |
4800 public: | 4798 public: |
4801 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 4799 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
4802 : LDeferredCode(codegen), instr_(instr) {} | 4800 : LDeferredCode(codegen), instr_(instr) {} |
4803 virtual void Generate() OVERRIDE { | 4801 void Generate() OVERRIDE { |
4804 codegen()->DoDeferredStringCharFromCode(instr_); | 4802 codegen()->DoDeferredStringCharFromCode(instr_); |
4805 } | 4803 } |
4806 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4804 LInstruction* instr() OVERRIDE { return instr_; } |
4807 | 4805 |
4808 private: | 4806 private: |
4809 LStringCharFromCode* instr_; | 4807 LStringCharFromCode* instr_; |
4810 }; | 4808 }; |
4811 | 4809 |
4812 DeferredStringCharFromCode* deferred = | 4810 DeferredStringCharFromCode* deferred = |
4813 new (zone()) DeferredStringCharFromCode(this, instr); | 4811 new (zone()) DeferredStringCharFromCode(this, instr); |
4814 | 4812 |
4815 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); | 4813 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); |
4816 Register char_code = ToRegister(instr->char_code()); | 4814 Register char_code = ToRegister(instr->char_code()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4867 LOperand* output = instr->result(); | 4865 LOperand* output = instr->result(); |
4868 __ ConvertUnsignedIntToDouble(ToRegister(input), ToDoubleRegister(output)); | 4866 __ ConvertUnsignedIntToDouble(ToRegister(input), ToDoubleRegister(output)); |
4869 } | 4867 } |
4870 | 4868 |
4871 | 4869 |
4872 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4870 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
4873 class DeferredNumberTagI FINAL : public LDeferredCode { | 4871 class DeferredNumberTagI FINAL : public LDeferredCode { |
4874 public: | 4872 public: |
4875 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4873 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
4876 : LDeferredCode(codegen), instr_(instr) {} | 4874 : LDeferredCode(codegen), instr_(instr) {} |
4877 virtual void Generate() OVERRIDE { | 4875 void Generate() OVERRIDE { |
4878 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), | 4876 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), |
4879 instr_->temp2(), SIGNED_INT32); | 4877 instr_->temp2(), SIGNED_INT32); |
4880 } | 4878 } |
4881 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4879 LInstruction* instr() OVERRIDE { return instr_; } |
4882 | 4880 |
4883 private: | 4881 private: |
4884 LNumberTagI* instr_; | 4882 LNumberTagI* instr_; |
4885 }; | 4883 }; |
4886 | 4884 |
4887 Register src = ToRegister(instr->value()); | 4885 Register src = ToRegister(instr->value()); |
4888 Register dst = ToRegister(instr->result()); | 4886 Register dst = ToRegister(instr->result()); |
4889 | 4887 |
4890 DeferredNumberTagI* deferred = new (zone()) DeferredNumberTagI(this, instr); | 4888 DeferredNumberTagI* deferred = new (zone()) DeferredNumberTagI(this, instr); |
4891 #if V8_TARGET_ARCH_PPC64 | 4889 #if V8_TARGET_ARCH_PPC64 |
4892 __ SmiTag(dst, src); | 4890 __ SmiTag(dst, src); |
4893 #else | 4891 #else |
4894 __ SmiTagCheckOverflow(dst, src, r0); | 4892 __ SmiTagCheckOverflow(dst, src, r0); |
4895 __ BranchOnOverflow(deferred->entry()); | 4893 __ BranchOnOverflow(deferred->entry()); |
4896 #endif | 4894 #endif |
4897 __ bind(deferred->exit()); | 4895 __ bind(deferred->exit()); |
4898 } | 4896 } |
4899 | 4897 |
4900 | 4898 |
4901 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4899 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
4902 class DeferredNumberTagU FINAL : public LDeferredCode { | 4900 class DeferredNumberTagU FINAL : public LDeferredCode { |
4903 public: | 4901 public: |
4904 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4902 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
4905 : LDeferredCode(codegen), instr_(instr) {} | 4903 : LDeferredCode(codegen), instr_(instr) {} |
4906 virtual void Generate() OVERRIDE { | 4904 void Generate() OVERRIDE { |
4907 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), | 4905 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp1(), |
4908 instr_->temp2(), UNSIGNED_INT32); | 4906 instr_->temp2(), UNSIGNED_INT32); |
4909 } | 4907 } |
4910 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4908 LInstruction* instr() OVERRIDE { return instr_; } |
4911 | 4909 |
4912 private: | 4910 private: |
4913 LNumberTagU* instr_; | 4911 LNumberTagU* instr_; |
4914 }; | 4912 }; |
4915 | 4913 |
4916 Register input = ToRegister(instr->value()); | 4914 Register input = ToRegister(instr->value()); |
4917 Register result = ToRegister(instr->result()); | 4915 Register result = ToRegister(instr->result()); |
4918 | 4916 |
4919 DeferredNumberTagU* deferred = new (zone()) DeferredNumberTagU(this, instr); | 4917 DeferredNumberTagU* deferred = new (zone()) DeferredNumberTagU(this, instr); |
4920 __ Cmpli(input, Operand(Smi::kMaxValue), r0); | 4918 __ Cmpli(input, Operand(Smi::kMaxValue), r0); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4982 __ bind(&done); | 4980 __ bind(&done); |
4983 __ stfd(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); | 4981 __ stfd(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); |
4984 } | 4982 } |
4985 | 4983 |
4986 | 4984 |
4987 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4985 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
4988 class DeferredNumberTagD FINAL : public LDeferredCode { | 4986 class DeferredNumberTagD FINAL : public LDeferredCode { |
4989 public: | 4987 public: |
4990 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4988 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
4991 : LDeferredCode(codegen), instr_(instr) {} | 4989 : LDeferredCode(codegen), instr_(instr) {} |
4992 virtual void Generate() OVERRIDE { | 4990 void Generate() OVERRIDE { codegen()->DoDeferredNumberTagD(instr_); } |
4993 codegen()->DoDeferredNumberTagD(instr_); | 4991 LInstruction* instr() OVERRIDE { return instr_; } |
4994 } | |
4995 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4996 | 4992 |
4997 private: | 4993 private: |
4998 LNumberTagD* instr_; | 4994 LNumberTagD* instr_; |
4999 }; | 4995 }; |
5000 | 4996 |
5001 DoubleRegister input_reg = ToDoubleRegister(instr->value()); | 4997 DoubleRegister input_reg = ToDoubleRegister(instr->value()); |
5002 Register scratch = scratch0(); | 4998 Register scratch = scratch0(); |
5003 Register reg = ToRegister(instr->result()); | 4999 Register reg = ToRegister(instr->result()); |
5004 Register temp1 = ToRegister(instr->temp()); | 5000 Register temp1 = ToRegister(instr->temp()); |
5005 Register temp2 = ToRegister(instr->temp2()); | 5001 Register temp2 = ToRegister(instr->temp2()); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5212 } | 5208 } |
5213 __ bind(&done); | 5209 __ bind(&done); |
5214 } | 5210 } |
5215 | 5211 |
5216 | 5212 |
5217 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 5213 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
5218 class DeferredTaggedToI FINAL : public LDeferredCode { | 5214 class DeferredTaggedToI FINAL : public LDeferredCode { |
5219 public: | 5215 public: |
5220 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) | 5216 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) |
5221 : LDeferredCode(codegen), instr_(instr) {} | 5217 : LDeferredCode(codegen), instr_(instr) {} |
5222 virtual void Generate() OVERRIDE { codegen()->DoDeferredTaggedToI(instr_); } | 5218 void Generate() OVERRIDE { codegen()->DoDeferredTaggedToI(instr_); } |
5223 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5219 LInstruction* instr() OVERRIDE { return instr_; } |
5224 | 5220 |
5225 private: | 5221 private: |
5226 LTaggedToI* instr_; | 5222 LTaggedToI* instr_; |
5227 }; | 5223 }; |
5228 | 5224 |
5229 LOperand* input = instr->value(); | 5225 LOperand* input = instr->value(); |
5230 DCHECK(input->IsRegister()); | 5226 DCHECK(input->IsRegister()); |
5231 DCHECK(input->Equals(instr->result())); | 5227 DCHECK(input->Equals(instr->result())); |
5232 | 5228 |
5233 Register input_reg = ToRegister(input); | 5229 Register input_reg = ToRegister(input); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5421 } | 5417 } |
5422 | 5418 |
5423 | 5419 |
5424 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5420 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
5425 class DeferredCheckMaps FINAL : public LDeferredCode { | 5421 class DeferredCheckMaps FINAL : public LDeferredCode { |
5426 public: | 5422 public: |
5427 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) | 5423 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) |
5428 : LDeferredCode(codegen), instr_(instr), object_(object) { | 5424 : LDeferredCode(codegen), instr_(instr), object_(object) { |
5429 SetExit(check_maps()); | 5425 SetExit(check_maps()); |
5430 } | 5426 } |
5431 virtual void Generate() OVERRIDE { | 5427 void Generate() OVERRIDE { |
5432 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5428 codegen()->DoDeferredInstanceMigration(instr_, object_); |
5433 } | 5429 } |
5434 Label* check_maps() { return &check_maps_; } | 5430 Label* check_maps() { return &check_maps_; } |
5435 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5431 LInstruction* instr() OVERRIDE { return instr_; } |
5436 | 5432 |
5437 private: | 5433 private: |
5438 LCheckMaps* instr_; | 5434 LCheckMaps* instr_; |
5439 Label check_maps_; | 5435 Label check_maps_; |
5440 Register object_; | 5436 Register object_; |
5441 }; | 5437 }; |
5442 | 5438 |
5443 if (instr->hydrogen()->IsStabilityCheck()) { | 5439 if (instr->hydrogen()->IsStabilityCheck()) { |
5444 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5440 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
5445 for (int i = 0; i < maps->size(); ++i) { | 5441 for (int i = 0; i < maps->size(); ++i) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5554 __ MovInt64ToDouble(result_reg, hi_reg, lo_reg); | 5550 __ MovInt64ToDouble(result_reg, hi_reg, lo_reg); |
5555 #endif | 5551 #endif |
5556 } | 5552 } |
5557 | 5553 |
5558 | 5554 |
5559 void LCodeGen::DoAllocate(LAllocate* instr) { | 5555 void LCodeGen::DoAllocate(LAllocate* instr) { |
5560 class DeferredAllocate FINAL : public LDeferredCode { | 5556 class DeferredAllocate FINAL : public LDeferredCode { |
5561 public: | 5557 public: |
5562 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5558 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
5563 : LDeferredCode(codegen), instr_(instr) {} | 5559 : LDeferredCode(codegen), instr_(instr) {} |
5564 virtual void Generate() OVERRIDE { codegen()->DoDeferredAllocate(instr_); } | 5560 void Generate() OVERRIDE { codegen()->DoDeferredAllocate(instr_); } |
5565 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5561 LInstruction* instr() OVERRIDE { return instr_; } |
5566 | 5562 |
5567 private: | 5563 private: |
5568 LAllocate* instr_; | 5564 LAllocate* instr_; |
5569 }; | 5565 }; |
5570 | 5566 |
5571 DeferredAllocate* deferred = new (zone()) DeferredAllocate(this, instr); | 5567 DeferredAllocate* deferred = new (zone()) DeferredAllocate(this, instr); |
5572 | 5568 |
5573 Register result = ToRegister(instr->result()); | 5569 Register result = ToRegister(instr->result()); |
5574 Register scratch = ToRegister(instr->temp1()); | 5570 Register scratch = ToRegister(instr->temp1()); |
5575 Register scratch2 = ToRegister(instr->temp2()); | 5571 Register scratch2 = ToRegister(instr->temp2()); |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5920 LEnvironment* env = instr->environment(); | 5916 LEnvironment* env = instr->environment(); |
5921 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5917 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
5922 } | 5918 } |
5923 | 5919 |
5924 | 5920 |
5925 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 5921 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
5926 class DeferredStackCheck FINAL : public LDeferredCode { | 5922 class DeferredStackCheck FINAL : public LDeferredCode { |
5927 public: | 5923 public: |
5928 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) | 5924 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) |
5929 : LDeferredCode(codegen), instr_(instr) {} | 5925 : LDeferredCode(codegen), instr_(instr) {} |
5930 virtual void Generate() OVERRIDE { | 5926 void Generate() OVERRIDE { codegen()->DoDeferredStackCheck(instr_); } |
5931 codegen()->DoDeferredStackCheck(instr_); | 5927 LInstruction* instr() OVERRIDE { return instr_; } |
5932 } | |
5933 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5934 | 5928 |
5935 private: | 5929 private: |
5936 LStackCheck* instr_; | 5930 LStackCheck* instr_; |
5937 }; | 5931 }; |
5938 | 5932 |
5939 DCHECK(instr->HasEnvironment()); | 5933 DCHECK(instr->HasEnvironment()); |
5940 LEnvironment* env = instr->environment(); | 5934 LEnvironment* env = instr->environment(); |
5941 // There is no LLazyBailout instruction for stack-checks. We have to | 5935 // There is no LLazyBailout instruction for stack-checks. We have to |
5942 // prepare for lazy deoptimization explicitly here. | 5936 // prepare for lazy deoptimization explicitly here. |
5943 if (instr->hydrogen()->is_function_entry()) { | 5937 if (instr->hydrogen()->is_function_entry()) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6067 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { | 6061 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { |
6068 class DeferredLoadMutableDouble FINAL : public LDeferredCode { | 6062 class DeferredLoadMutableDouble FINAL : public LDeferredCode { |
6069 public: | 6063 public: |
6070 DeferredLoadMutableDouble(LCodeGen* codegen, LLoadFieldByIndex* instr, | 6064 DeferredLoadMutableDouble(LCodeGen* codegen, LLoadFieldByIndex* instr, |
6071 Register result, Register object, Register index) | 6065 Register result, Register object, Register index) |
6072 : LDeferredCode(codegen), | 6066 : LDeferredCode(codegen), |
6073 instr_(instr), | 6067 instr_(instr), |
6074 result_(result), | 6068 result_(result), |
6075 object_(object), | 6069 object_(object), |
6076 index_(index) {} | 6070 index_(index) {} |
6077 virtual void Generate() OVERRIDE { | 6071 void Generate() OVERRIDE { |
6078 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); | 6072 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); |
6079 } | 6073 } |
6080 virtual LInstruction* instr() OVERRIDE { return instr_; } | 6074 LInstruction* instr() OVERRIDE { return instr_; } |
6081 | 6075 |
6082 private: | 6076 private: |
6083 LLoadFieldByIndex* instr_; | 6077 LLoadFieldByIndex* instr_; |
6084 Register result_; | 6078 Register result_; |
6085 Register object_; | 6079 Register object_; |
6086 Register index_; | 6080 Register index_; |
6087 }; | 6081 }; |
6088 | 6082 |
6089 Register object = ToRegister(instr->object()); | 6083 Register object = ToRegister(instr->object()); |
6090 Register index = ToRegister(instr->index()); | 6084 Register index = ToRegister(instr->index()); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6133 __ Push(scope_info); | 6127 __ Push(scope_info); |
6134 __ push(ToRegister(instr->function())); | 6128 __ push(ToRegister(instr->function())); |
6135 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6129 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6136 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6130 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6137 } | 6131 } |
6138 | 6132 |
6139 | 6133 |
6140 #undef __ | 6134 #undef __ |
6141 } | 6135 } |
6142 } // namespace v8::internal | 6136 } // namespace v8::internal |
OLD | NEW |