OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class SafepointGenerator FINAL : public CallWrapper { | 44 class SafepointGenerator FINAL : public CallWrapper { |
45 public: | 45 public: |
46 SafepointGenerator(LCodeGen* codegen, | 46 SafepointGenerator(LCodeGen* codegen, |
47 LPointerMap* pointers, | 47 LPointerMap* pointers, |
48 Safepoint::DeoptMode mode) | 48 Safepoint::DeoptMode mode) |
49 : codegen_(codegen), | 49 : codegen_(codegen), |
50 pointers_(pointers), | 50 pointers_(pointers), |
51 deopt_mode_(mode) { } | 51 deopt_mode_(mode) { } |
52 virtual ~SafepointGenerator() {} | 52 virtual ~SafepointGenerator() {} |
53 | 53 |
54 virtual void BeforeCall(int call_size) const OVERRIDE {} | 54 void BeforeCall(int call_size) const OVERRIDE {} |
55 | 55 |
56 virtual void AfterCall() const OVERRIDE { | 56 void AfterCall() const OVERRIDE { |
57 codegen_->RecordSafepoint(pointers_, deopt_mode_); | 57 codegen_->RecordSafepoint(pointers_, deopt_mode_); |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 LCodeGen* codegen_; | 61 LCodeGen* codegen_; |
62 LPointerMap* pointers_; | 62 LPointerMap* pointers_; |
63 Safepoint::DeoptMode deopt_mode_; | 63 Safepoint::DeoptMode deopt_mode_; |
64 }; | 64 }; |
65 | 65 |
66 | 66 |
(...skipping 2621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2688 __ bind(&done); | 2688 __ bind(&done); |
2689 } | 2689 } |
2690 | 2690 |
2691 | 2691 |
2692 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 2692 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
2693 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { | 2693 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { |
2694 public: | 2694 public: |
2695 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 2695 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
2696 LInstanceOfKnownGlobal* instr) | 2696 LInstanceOfKnownGlobal* instr) |
2697 : LDeferredCode(codegen), instr_(instr) { } | 2697 : LDeferredCode(codegen), instr_(instr) { } |
2698 virtual void Generate() OVERRIDE { | 2698 void Generate() OVERRIDE { |
2699 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); | 2699 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); |
2700 } | 2700 } |
2701 virtual LInstruction* instr() OVERRIDE { return instr_; } | 2701 LInstruction* instr() OVERRIDE { return instr_; } |
2702 Label* map_check() { return &map_check_; } | 2702 Label* map_check() { return &map_check_; } |
2703 | 2703 |
2704 private: | 2704 private: |
2705 LInstanceOfKnownGlobal* instr_; | 2705 LInstanceOfKnownGlobal* instr_; |
2706 Label map_check_; | 2706 Label map_check_; |
2707 }; | 2707 }; |
2708 | 2708 |
2709 DeferredInstanceOfKnownGlobal* deferred; | 2709 DeferredInstanceOfKnownGlobal* deferred; |
2710 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); | 2710 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
2711 | 2711 |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3670 __ bind(&done); | 3670 __ bind(&done); |
3671 } | 3671 } |
3672 | 3672 |
3673 | 3673 |
3674 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3674 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
3675 // Class for deferred case. | 3675 // Class for deferred case. |
3676 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { | 3676 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { |
3677 public: | 3677 public: |
3678 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) | 3678 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) |
3679 : LDeferredCode(codegen), instr_(instr) { } | 3679 : LDeferredCode(codegen), instr_(instr) { } |
3680 virtual void Generate() OVERRIDE { | 3680 void Generate() OVERRIDE { |
3681 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); | 3681 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); |
3682 } | 3682 } |
3683 virtual LInstruction* instr() OVERRIDE { return instr_; } | 3683 LInstruction* instr() OVERRIDE { return instr_; } |
| 3684 |
3684 private: | 3685 private: |
3685 LMathAbs* instr_; | 3686 LMathAbs* instr_; |
3686 }; | 3687 }; |
3687 | 3688 |
3688 Representation r = instr->hydrogen()->value()->representation(); | 3689 Representation r = instr->hydrogen()->value()->representation(); |
3689 if (r.IsDouble()) { | 3690 if (r.IsDouble()) { |
3690 FPURegister input = ToDoubleRegister(instr->value()); | 3691 FPURegister input = ToDoubleRegister(instr->value()); |
3691 FPURegister result = ToDoubleRegister(instr->result()); | 3692 FPURegister result = ToDoubleRegister(instr->result()); |
3692 __ abs_d(result, input); | 3693 __ abs_d(result, input); |
3693 } else if (r.IsSmiOrInteger32()) { | 3694 } else if (r.IsSmiOrInteger32()) { |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4486 instr->hydrogen()->pretenure_flag()); | 4487 instr->hydrogen()->pretenure_flag()); |
4487 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4488 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4488 } | 4489 } |
4489 | 4490 |
4490 | 4491 |
4491 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4492 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
4492 class DeferredStringCharCodeAt FINAL : public LDeferredCode { | 4493 class DeferredStringCharCodeAt FINAL : public LDeferredCode { |
4493 public: | 4494 public: |
4494 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 4495 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
4495 : LDeferredCode(codegen), instr_(instr) { } | 4496 : LDeferredCode(codegen), instr_(instr) { } |
4496 virtual void Generate() OVERRIDE { | 4497 void Generate() OVERRIDE { codegen()->DoDeferredStringCharCodeAt(instr_); } |
4497 codegen()->DoDeferredStringCharCodeAt(instr_); | 4498 LInstruction* instr() OVERRIDE { return instr_; } |
4498 } | 4499 |
4499 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4500 private: | 4500 private: |
4501 LStringCharCodeAt* instr_; | 4501 LStringCharCodeAt* instr_; |
4502 }; | 4502 }; |
4503 | 4503 |
4504 DeferredStringCharCodeAt* deferred = | 4504 DeferredStringCharCodeAt* deferred = |
4505 new(zone()) DeferredStringCharCodeAt(this, instr); | 4505 new(zone()) DeferredStringCharCodeAt(this, instr); |
4506 StringCharLoadGenerator::Generate(masm(), | 4506 StringCharLoadGenerator::Generate(masm(), |
4507 ToRegister(instr->string()), | 4507 ToRegister(instr->string()), |
4508 ToRegister(instr->index()), | 4508 ToRegister(instr->index()), |
4509 ToRegister(instr->result()), | 4509 ToRegister(instr->result()), |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4541 __ SmiUntag(v0); | 4541 __ SmiUntag(v0); |
4542 __ StoreToSafepointRegisterSlot(v0, result); | 4542 __ StoreToSafepointRegisterSlot(v0, result); |
4543 } | 4543 } |
4544 | 4544 |
4545 | 4545 |
4546 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4546 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4547 class DeferredStringCharFromCode FINAL : public LDeferredCode { | 4547 class DeferredStringCharFromCode FINAL : public LDeferredCode { |
4548 public: | 4548 public: |
4549 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 4549 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
4550 : LDeferredCode(codegen), instr_(instr) { } | 4550 : LDeferredCode(codegen), instr_(instr) { } |
4551 virtual void Generate() OVERRIDE { | 4551 void Generate() OVERRIDE { |
4552 codegen()->DoDeferredStringCharFromCode(instr_); | 4552 codegen()->DoDeferredStringCharFromCode(instr_); |
4553 } | 4553 } |
4554 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4554 LInstruction* instr() OVERRIDE { return instr_; } |
| 4555 |
4555 private: | 4556 private: |
4556 LStringCharFromCode* instr_; | 4557 LStringCharFromCode* instr_; |
4557 }; | 4558 }; |
4558 | 4559 |
4559 DeferredStringCharFromCode* deferred = | 4560 DeferredStringCharFromCode* deferred = |
4560 new(zone()) DeferredStringCharFromCode(this, instr); | 4561 new(zone()) DeferredStringCharFromCode(this, instr); |
4561 | 4562 |
4562 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); | 4563 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); |
4563 Register char_code = ToRegister(instr->char_code()); | 4564 Register char_code = ToRegister(instr->char_code()); |
4564 Register result = ToRegister(instr->result()); | 4565 Register result = ToRegister(instr->result()); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 __ mtc1(ToRegister(input), dbl_scratch); | 4620 __ mtc1(ToRegister(input), dbl_scratch); |
4620 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); | 4621 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); |
4621 } | 4622 } |
4622 | 4623 |
4623 | 4624 |
4624 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4625 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
4625 class DeferredNumberTagI FINAL : public LDeferredCode { | 4626 class DeferredNumberTagI FINAL : public LDeferredCode { |
4626 public: | 4627 public: |
4627 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4628 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
4628 : LDeferredCode(codegen), instr_(instr) { } | 4629 : LDeferredCode(codegen), instr_(instr) { } |
4629 virtual void Generate() OVERRIDE { | 4630 void Generate() OVERRIDE { |
4630 codegen()->DoDeferredNumberTagIU(instr_, | 4631 codegen()->DoDeferredNumberTagIU(instr_, |
4631 instr_->value(), | 4632 instr_->value(), |
4632 instr_->temp1(), | 4633 instr_->temp1(), |
4633 instr_->temp2(), | 4634 instr_->temp2(), |
4634 SIGNED_INT32); | 4635 SIGNED_INT32); |
4635 } | 4636 } |
4636 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4637 LInstruction* instr() OVERRIDE { return instr_; } |
| 4638 |
4637 private: | 4639 private: |
4638 LNumberTagI* instr_; | 4640 LNumberTagI* instr_; |
4639 }; | 4641 }; |
4640 | 4642 |
4641 Register src = ToRegister(instr->value()); | 4643 Register src = ToRegister(instr->value()); |
4642 Register dst = ToRegister(instr->result()); | 4644 Register dst = ToRegister(instr->result()); |
4643 Register overflow = scratch0(); | 4645 Register overflow = scratch0(); |
4644 | 4646 |
4645 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); | 4647 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); |
4646 __ SmiTagCheckOverflow(dst, src, overflow); | 4648 __ SmiTagCheckOverflow(dst, src, overflow); |
4647 __ BranchOnOverflow(deferred->entry(), overflow); | 4649 __ BranchOnOverflow(deferred->entry(), overflow); |
4648 __ bind(deferred->exit()); | 4650 __ bind(deferred->exit()); |
4649 } | 4651 } |
4650 | 4652 |
4651 | 4653 |
4652 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4654 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
4653 class DeferredNumberTagU FINAL : public LDeferredCode { | 4655 class DeferredNumberTagU FINAL : public LDeferredCode { |
4654 public: | 4656 public: |
4655 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4657 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
4656 : LDeferredCode(codegen), instr_(instr) { } | 4658 : LDeferredCode(codegen), instr_(instr) { } |
4657 virtual void Generate() OVERRIDE { | 4659 void Generate() OVERRIDE { |
4658 codegen()->DoDeferredNumberTagIU(instr_, | 4660 codegen()->DoDeferredNumberTagIU(instr_, |
4659 instr_->value(), | 4661 instr_->value(), |
4660 instr_->temp1(), | 4662 instr_->temp1(), |
4661 instr_->temp2(), | 4663 instr_->temp2(), |
4662 UNSIGNED_INT32); | 4664 UNSIGNED_INT32); |
4663 } | 4665 } |
4664 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4666 LInstruction* instr() OVERRIDE { return instr_; } |
| 4667 |
4665 private: | 4668 private: |
4666 LNumberTagU* instr_; | 4669 LNumberTagU* instr_; |
4667 }; | 4670 }; |
4668 | 4671 |
4669 Register input = ToRegister(instr->value()); | 4672 Register input = ToRegister(instr->value()); |
4670 Register result = ToRegister(instr->result()); | 4673 Register result = ToRegister(instr->result()); |
4671 | 4674 |
4672 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); | 4675 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); |
4673 __ Branch(deferred->entry(), hi, input, Operand(Smi::kMaxValue)); | 4676 __ Branch(deferred->entry(), hi, input, Operand(Smi::kMaxValue)); |
4674 __ SmiTag(result, input); | 4677 __ SmiTag(result, input); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4741 __ sdc1(dbl_scratch, MemOperand(dst, HeapNumber::kValueOffset)); | 4744 __ sdc1(dbl_scratch, MemOperand(dst, HeapNumber::kValueOffset)); |
4742 __ Addu(dst, dst, kHeapObjectTag); | 4745 __ Addu(dst, dst, kHeapObjectTag); |
4743 } | 4746 } |
4744 | 4747 |
4745 | 4748 |
4746 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4749 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
4747 class DeferredNumberTagD FINAL : public LDeferredCode { | 4750 class DeferredNumberTagD FINAL : public LDeferredCode { |
4748 public: | 4751 public: |
4749 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4752 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
4750 : LDeferredCode(codegen), instr_(instr) { } | 4753 : LDeferredCode(codegen), instr_(instr) { } |
4751 virtual void Generate() OVERRIDE { | 4754 void Generate() OVERRIDE { codegen()->DoDeferredNumberTagD(instr_); } |
4752 codegen()->DoDeferredNumberTagD(instr_); | 4755 LInstruction* instr() OVERRIDE { return instr_; } |
4753 } | 4756 |
4754 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4755 private: | 4757 private: |
4756 LNumberTagD* instr_; | 4758 LNumberTagD* instr_; |
4757 }; | 4759 }; |
4758 | 4760 |
4759 DoubleRegister input_reg = ToDoubleRegister(instr->value()); | 4761 DoubleRegister input_reg = ToDoubleRegister(instr->value()); |
4760 Register scratch = scratch0(); | 4762 Register scratch = scratch0(); |
4761 Register reg = ToRegister(instr->result()); | 4763 Register reg = ToRegister(instr->result()); |
4762 Register temp1 = ToRegister(instr->temp()); | 4764 Register temp1 = ToRegister(instr->temp()); |
4763 Register temp2 = ToRegister(instr->temp2()); | 4765 Register temp2 = ToRegister(instr->temp2()); |
4764 | 4766 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4967 } | 4969 } |
4968 __ bind(&done); | 4970 __ bind(&done); |
4969 } | 4971 } |
4970 | 4972 |
4971 | 4973 |
4972 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 4974 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
4973 class DeferredTaggedToI FINAL : public LDeferredCode { | 4975 class DeferredTaggedToI FINAL : public LDeferredCode { |
4974 public: | 4976 public: |
4975 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) | 4977 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) |
4976 : LDeferredCode(codegen), instr_(instr) { } | 4978 : LDeferredCode(codegen), instr_(instr) { } |
4977 virtual void Generate() OVERRIDE { | 4979 void Generate() OVERRIDE { codegen()->DoDeferredTaggedToI(instr_); } |
4978 codegen()->DoDeferredTaggedToI(instr_); | 4980 LInstruction* instr() OVERRIDE { return instr_; } |
4979 } | 4981 |
4980 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4981 private: | 4982 private: |
4982 LTaggedToI* instr_; | 4983 LTaggedToI* instr_; |
4983 }; | 4984 }; |
4984 | 4985 |
4985 LOperand* input = instr->value(); | 4986 LOperand* input = instr->value(); |
4986 DCHECK(input->IsRegister()); | 4987 DCHECK(input->IsRegister()); |
4987 DCHECK(input->Equals(instr->result())); | 4988 DCHECK(input->Equals(instr->result())); |
4988 | 4989 |
4989 Register input_reg = ToRegister(input); | 4990 Register input_reg = ToRegister(input); |
4990 | 4991 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5176 } | 5177 } |
5177 | 5178 |
5178 | 5179 |
5179 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5180 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
5180 class DeferredCheckMaps FINAL : public LDeferredCode { | 5181 class DeferredCheckMaps FINAL : public LDeferredCode { |
5181 public: | 5182 public: |
5182 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) | 5183 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) |
5183 : LDeferredCode(codegen), instr_(instr), object_(object) { | 5184 : LDeferredCode(codegen), instr_(instr), object_(object) { |
5184 SetExit(check_maps()); | 5185 SetExit(check_maps()); |
5185 } | 5186 } |
5186 virtual void Generate() OVERRIDE { | 5187 void Generate() OVERRIDE { |
5187 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5188 codegen()->DoDeferredInstanceMigration(instr_, object_); |
5188 } | 5189 } |
5189 Label* check_maps() { return &check_maps_; } | 5190 Label* check_maps() { return &check_maps_; } |
5190 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5191 LInstruction* instr() OVERRIDE { return instr_; } |
| 5192 |
5191 private: | 5193 private: |
5192 LCheckMaps* instr_; | 5194 LCheckMaps* instr_; |
5193 Label check_maps_; | 5195 Label check_maps_; |
5194 Register object_; | 5196 Register object_; |
5195 }; | 5197 }; |
5196 | 5198 |
5197 if (instr->hydrogen()->IsStabilityCheck()) { | 5199 if (instr->hydrogen()->IsStabilityCheck()) { |
5198 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5200 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
5199 for (int i = 0; i < maps->size(); ++i) { | 5201 for (int i = 0; i < maps->size(); ++i) { |
5200 AddStabilityDependency(maps->at(i).handle()); | 5202 AddStabilityDependency(maps->at(i).handle()); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5299 DoubleRegister result_reg = ToDoubleRegister(instr->result()); | 5301 DoubleRegister result_reg = ToDoubleRegister(instr->result()); |
5300 __ Move(result_reg, lo_reg, hi_reg); | 5302 __ Move(result_reg, lo_reg, hi_reg); |
5301 } | 5303 } |
5302 | 5304 |
5303 | 5305 |
5304 void LCodeGen::DoAllocate(LAllocate* instr) { | 5306 void LCodeGen::DoAllocate(LAllocate* instr) { |
5305 class DeferredAllocate FINAL : public LDeferredCode { | 5307 class DeferredAllocate FINAL : public LDeferredCode { |
5306 public: | 5308 public: |
5307 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5309 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
5308 : LDeferredCode(codegen), instr_(instr) { } | 5310 : LDeferredCode(codegen), instr_(instr) { } |
5309 virtual void Generate() OVERRIDE { | 5311 void Generate() OVERRIDE { codegen()->DoDeferredAllocate(instr_); } |
5310 codegen()->DoDeferredAllocate(instr_); | 5312 LInstruction* instr() OVERRIDE { return instr_; } |
5311 } | 5313 |
5312 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5313 private: | 5314 private: |
5314 LAllocate* instr_; | 5315 LAllocate* instr_; |
5315 }; | 5316 }; |
5316 | 5317 |
5317 DeferredAllocate* deferred = | 5318 DeferredAllocate* deferred = |
5318 new(zone()) DeferredAllocate(this, instr); | 5319 new(zone()) DeferredAllocate(this, instr); |
5319 | 5320 |
5320 Register result = ToRegister(instr->result()); | 5321 Register result = ToRegister(instr->result()); |
5321 Register scratch = ToRegister(instr->temp1()); | 5322 Register scratch = ToRegister(instr->temp1()); |
5322 Register scratch2 = ToRegister(instr->temp2()); | 5323 Register scratch2 = ToRegister(instr->temp2()); |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5712 LEnvironment* env = instr->environment(); | 5713 LEnvironment* env = instr->environment(); |
5713 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5714 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
5714 } | 5715 } |
5715 | 5716 |
5716 | 5717 |
5717 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 5718 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
5718 class DeferredStackCheck FINAL : public LDeferredCode { | 5719 class DeferredStackCheck FINAL : public LDeferredCode { |
5719 public: | 5720 public: |
5720 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) | 5721 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) |
5721 : LDeferredCode(codegen), instr_(instr) { } | 5722 : LDeferredCode(codegen), instr_(instr) { } |
5722 virtual void Generate() OVERRIDE { | 5723 void Generate() OVERRIDE { codegen()->DoDeferredStackCheck(instr_); } |
5723 codegen()->DoDeferredStackCheck(instr_); | 5724 LInstruction* instr() OVERRIDE { return instr_; } |
5724 } | 5725 |
5725 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5726 private: | 5726 private: |
5727 LStackCheck* instr_; | 5727 LStackCheck* instr_; |
5728 }; | 5728 }; |
5729 | 5729 |
5730 DCHECK(instr->HasEnvironment()); | 5730 DCHECK(instr->HasEnvironment()); |
5731 LEnvironment* env = instr->environment(); | 5731 LEnvironment* env = instr->environment(); |
5732 // There is no LLazyBailout instruction for stack-checks. We have to | 5732 // There is no LLazyBailout instruction for stack-checks. We have to |
5733 // prepare for lazy deoptimization explicitly here. | 5733 // prepare for lazy deoptimization explicitly here. |
5734 if (instr->hydrogen()->is_function_entry()) { | 5734 if (instr->hydrogen()->is_function_entry()) { |
5735 // Perform stack overflow check. | 5735 // Perform stack overflow check. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5863 LLoadFieldByIndex* instr, | 5863 LLoadFieldByIndex* instr, |
5864 Register result, | 5864 Register result, |
5865 Register object, | 5865 Register object, |
5866 Register index) | 5866 Register index) |
5867 : LDeferredCode(codegen), | 5867 : LDeferredCode(codegen), |
5868 instr_(instr), | 5868 instr_(instr), |
5869 result_(result), | 5869 result_(result), |
5870 object_(object), | 5870 object_(object), |
5871 index_(index) { | 5871 index_(index) { |
5872 } | 5872 } |
5873 virtual void Generate() OVERRIDE { | 5873 void Generate() OVERRIDE { |
5874 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); | 5874 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); |
5875 } | 5875 } |
5876 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5876 LInstruction* instr() OVERRIDE { return instr_; } |
| 5877 |
5877 private: | 5878 private: |
5878 LLoadFieldByIndex* instr_; | 5879 LLoadFieldByIndex* instr_; |
5879 Register result_; | 5880 Register result_; |
5880 Register object_; | 5881 Register object_; |
5881 Register index_; | 5882 Register index_; |
5882 }; | 5883 }; |
5883 | 5884 |
5884 Register object = ToRegister(instr->object()); | 5885 Register object = ToRegister(instr->object()); |
5885 Register index = ToRegister(instr->index()); | 5886 Register index = ToRegister(instr->index()); |
5886 Register result = ToRegister(instr->result()); | 5887 Register result = ToRegister(instr->result()); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5927 __ li(at, scope_info); | 5928 __ li(at, scope_info); |
5928 __ Push(at, ToRegister(instr->function())); | 5929 __ Push(at, ToRegister(instr->function())); |
5929 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5930 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5930 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5931 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5931 } | 5932 } |
5932 | 5933 |
5933 | 5934 |
5934 #undef __ | 5935 #undef __ |
5935 | 5936 |
5936 } } // namespace v8::internal | 5937 } } // namespace v8::internal |
OLD | NEW |