| 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/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
| 9 #include "src/mips64/lithium-codegen-mips64.h" | 9 #include "src/mips64/lithium-codegen-mips64.h" |
| 10 #include "src/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/mips64/lithium-gap-resolver-mips64.h" |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 | 15 |
| 16 class SafepointGenerator V8_FINAL : public CallWrapper { | 16 class SafepointGenerator FINAL : public CallWrapper { |
| 17 public: | 17 public: |
| 18 SafepointGenerator(LCodeGen* codegen, | 18 SafepointGenerator(LCodeGen* codegen, |
| 19 LPointerMap* pointers, | 19 LPointerMap* pointers, |
| 20 Safepoint::DeoptMode mode) | 20 Safepoint::DeoptMode mode) |
| 21 : codegen_(codegen), | 21 : codegen_(codegen), |
| 22 pointers_(pointers), | 22 pointers_(pointers), |
| 23 deopt_mode_(mode) { } | 23 deopt_mode_(mode) { } |
| 24 virtual ~SafepointGenerator() {} | 24 virtual ~SafepointGenerator() {} |
| 25 | 25 |
| 26 virtual void BeforeCall(int call_size) const V8_OVERRIDE {} | 26 virtual void BeforeCall(int call_size) const OVERRIDE {} |
| 27 | 27 |
| 28 virtual void AfterCall() const V8_OVERRIDE { | 28 virtual void AfterCall() const OVERRIDE { |
| 29 codegen_->RecordSafepoint(pointers_, deopt_mode_); | 29 codegen_->RecordSafepoint(pointers_, deopt_mode_); |
| 30 } | 30 } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 LCodeGen* codegen_; | 33 LCodeGen* codegen_; |
| 34 LPointerMap* pointers_; | 34 LPointerMap* pointers_; |
| 35 Safepoint::DeoptMode deopt_mode_; | 35 Safepoint::DeoptMode deopt_mode_; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 | 38 |
| (...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2664 __ Branch(&true_label, eq, result, Operand(zero_reg)); | 2664 __ Branch(&true_label, eq, result, Operand(zero_reg)); |
| 2665 __ li(result, Operand(factory()->false_value())); | 2665 __ li(result, Operand(factory()->false_value())); |
| 2666 __ Branch(&done); | 2666 __ Branch(&done); |
| 2667 __ bind(&true_label); | 2667 __ bind(&true_label); |
| 2668 __ li(result, Operand(factory()->true_value())); | 2668 __ li(result, Operand(factory()->true_value())); |
| 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 V8_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() V8_OVERRIDE { | 2679 virtual void Generate() OVERRIDE { |
| 2680 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); | 2680 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); |
| 2681 } | 2681 } |
| 2682 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 2682 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 2683 Label* map_check() { return &map_check_; } | 2683 Label* map_check() { return &map_check_; } |
| 2684 | 2684 |
| 2685 private: | 2685 private: |
| 2686 LInstanceOfKnownGlobal* instr_; | 2686 LInstanceOfKnownGlobal* instr_; |
| 2687 Label map_check_; | 2687 Label map_check_; |
| 2688 }; | 2688 }; |
| 2689 | 2689 |
| 2690 DeferredInstanceOfKnownGlobal* deferred; | 2690 DeferredInstanceOfKnownGlobal* deferred; |
| 2691 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); | 2691 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
| 2692 | 2692 |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3702 __ mov(result, input); | 3702 __ mov(result, input); |
| 3703 __ dsubu(result, zero_reg, input); | 3703 __ dsubu(result, zero_reg, input); |
| 3704 // Overflow if result is still negative, i.e. 0x80000000. | 3704 // Overflow if result is still negative, i.e. 0x80000000. |
| 3705 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); | 3705 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); |
| 3706 __ bind(&done); | 3706 __ bind(&done); |
| 3707 } | 3707 } |
| 3708 | 3708 |
| 3709 | 3709 |
| 3710 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3710 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
| 3711 // Class for deferred case. | 3711 // Class for deferred case. |
| 3712 class DeferredMathAbsTaggedHeapNumber V8_FINAL : public LDeferredCode { | 3712 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { |
| 3713 public: | 3713 public: |
| 3714 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) | 3714 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, LMathAbs* instr) |
| 3715 : LDeferredCode(codegen), instr_(instr) { } | 3715 : LDeferredCode(codegen), instr_(instr) { } |
| 3716 virtual void Generate() V8_OVERRIDE { | 3716 virtual void Generate() OVERRIDE { |
| 3717 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); | 3717 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); |
| 3718 } | 3718 } |
| 3719 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 3719 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 3720 private: | 3720 private: |
| 3721 LMathAbs* instr_; | 3721 LMathAbs* instr_; |
| 3722 }; | 3722 }; |
| 3723 | 3723 |
| 3724 Representation r = instr->hydrogen()->value()->representation(); | 3724 Representation r = instr->hydrogen()->value()->representation(); |
| 3725 if (r.IsDouble()) { | 3725 if (r.IsDouble()) { |
| 3726 FPURegister input = ToDoubleRegister(instr->value()); | 3726 FPURegister input = ToDoubleRegister(instr->value()); |
| 3727 FPURegister result = ToDoubleRegister(instr->result()); | 3727 FPURegister result = ToDoubleRegister(instr->result()); |
| 3728 __ abs_d(result, input); | 3728 __ abs_d(result, input); |
| 3729 } else if (r.IsSmiOrInteger32()) { | 3729 } else if (r.IsSmiOrInteger32()) { |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4523 DCHECK(ToRegister(instr->left()).is(a1)); | 4523 DCHECK(ToRegister(instr->left()).is(a1)); |
| 4524 DCHECK(ToRegister(instr->right()).is(a0)); | 4524 DCHECK(ToRegister(instr->right()).is(a0)); |
| 4525 StringAddStub stub(isolate(), | 4525 StringAddStub stub(isolate(), |
| 4526 instr->hydrogen()->flags(), | 4526 instr->hydrogen()->flags(), |
| 4527 instr->hydrogen()->pretenure_flag()); | 4527 instr->hydrogen()->pretenure_flag()); |
| 4528 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4528 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4529 } | 4529 } |
| 4530 | 4530 |
| 4531 | 4531 |
| 4532 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4532 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
| 4533 class DeferredStringCharCodeAt V8_FINAL : public LDeferredCode { | 4533 class DeferredStringCharCodeAt FINAL : public LDeferredCode { |
| 4534 public: | 4534 public: |
| 4535 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 4535 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
| 4536 : LDeferredCode(codegen), instr_(instr) { } | 4536 : LDeferredCode(codegen), instr_(instr) { } |
| 4537 virtual void Generate() V8_OVERRIDE { | 4537 virtual void Generate() OVERRIDE { |
| 4538 codegen()->DoDeferredStringCharCodeAt(instr_); | 4538 codegen()->DoDeferredStringCharCodeAt(instr_); |
| 4539 } | 4539 } |
| 4540 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 4540 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 4541 private: | 4541 private: |
| 4542 LStringCharCodeAt* instr_; | 4542 LStringCharCodeAt* instr_; |
| 4543 }; | 4543 }; |
| 4544 | 4544 |
| 4545 DeferredStringCharCodeAt* deferred = | 4545 DeferredStringCharCodeAt* deferred = |
| 4546 new(zone()) DeferredStringCharCodeAt(this, instr); | 4546 new(zone()) DeferredStringCharCodeAt(this, instr); |
| 4547 StringCharLoadGenerator::Generate(masm(), | 4547 StringCharLoadGenerator::Generate(masm(), |
| 4548 ToRegister(instr->string()), | 4548 ToRegister(instr->string()), |
| 4549 ToRegister(instr->index()), | 4549 ToRegister(instr->index()), |
| 4550 ToRegister(instr->result()), | 4550 ToRegister(instr->result()), |
| (...skipping 27 matching lines...) Expand all Loading... |
| 4578 } | 4578 } |
| 4579 CallRuntimeFromDeferred(Runtime::kStringCharCodeAtRT, 2, instr, | 4579 CallRuntimeFromDeferred(Runtime::kStringCharCodeAtRT, 2, instr, |
| 4580 instr->context()); | 4580 instr->context()); |
| 4581 __ AssertSmi(v0); | 4581 __ AssertSmi(v0); |
| 4582 __ SmiUntag(v0); | 4582 __ SmiUntag(v0); |
| 4583 __ StoreToSafepointRegisterSlot(v0, result); | 4583 __ StoreToSafepointRegisterSlot(v0, result); |
| 4584 } | 4584 } |
| 4585 | 4585 |
| 4586 | 4586 |
| 4587 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4587 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
| 4588 class DeferredStringCharFromCode V8_FINAL : public LDeferredCode { | 4588 class DeferredStringCharFromCode FINAL : public LDeferredCode { |
| 4589 public: | 4589 public: |
| 4590 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 4590 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
| 4591 : LDeferredCode(codegen), instr_(instr) { } | 4591 : LDeferredCode(codegen), instr_(instr) { } |
| 4592 virtual void Generate() V8_OVERRIDE { | 4592 virtual void Generate() OVERRIDE { |
| 4593 codegen()->DoDeferredStringCharFromCode(instr_); | 4593 codegen()->DoDeferredStringCharFromCode(instr_); |
| 4594 } | 4594 } |
| 4595 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 4595 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 4596 private: | 4596 private: |
| 4597 LStringCharFromCode* instr_; | 4597 LStringCharFromCode* instr_; |
| 4598 }; | 4598 }; |
| 4599 | 4599 |
| 4600 DeferredStringCharFromCode* deferred = | 4600 DeferredStringCharFromCode* deferred = |
| 4601 new(zone()) DeferredStringCharFromCode(this, instr); | 4601 new(zone()) DeferredStringCharFromCode(this, instr); |
| 4602 | 4602 |
| 4603 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); | 4603 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); |
| 4604 Register char_code = ToRegister(instr->char_code()); | 4604 Register char_code = ToRegister(instr->char_code()); |
| 4605 Register result = ToRegister(instr->result()); | 4605 Register result = ToRegister(instr->result()); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4656 LOperand* input = instr->value(); | 4656 LOperand* input = instr->value(); |
| 4657 LOperand* output = instr->result(); | 4657 LOperand* output = instr->result(); |
| 4658 | 4658 |
| 4659 FPURegister dbl_scratch = double_scratch0(); | 4659 FPURegister dbl_scratch = double_scratch0(); |
| 4660 __ mtc1(ToRegister(input), dbl_scratch); | 4660 __ mtc1(ToRegister(input), dbl_scratch); |
| 4661 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); // TODO(plind): f22? | 4661 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); // TODO(plind): f22? |
| 4662 } | 4662 } |
| 4663 | 4663 |
| 4664 | 4664 |
| 4665 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4665 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
| 4666 class DeferredNumberTagU V8_FINAL : public LDeferredCode { | 4666 class DeferredNumberTagU FINAL : public LDeferredCode { |
| 4667 public: | 4667 public: |
| 4668 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4668 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
| 4669 : LDeferredCode(codegen), instr_(instr) { } | 4669 : LDeferredCode(codegen), instr_(instr) { } |
| 4670 virtual void Generate() V8_OVERRIDE { | 4670 virtual void Generate() OVERRIDE { |
| 4671 codegen()->DoDeferredNumberTagIU(instr_, | 4671 codegen()->DoDeferredNumberTagIU(instr_, |
| 4672 instr_->value(), | 4672 instr_->value(), |
| 4673 instr_->temp1(), | 4673 instr_->temp1(), |
| 4674 instr_->temp2(), | 4674 instr_->temp2(), |
| 4675 UNSIGNED_INT32); | 4675 UNSIGNED_INT32); |
| 4676 } | 4676 } |
| 4677 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 4677 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 4678 private: | 4678 private: |
| 4679 LNumberTagU* instr_; | 4679 LNumberTagU* instr_; |
| 4680 }; | 4680 }; |
| 4681 | 4681 |
| 4682 Register input = ToRegister(instr->value()); | 4682 Register input = ToRegister(instr->value()); |
| 4683 Register result = ToRegister(instr->result()); | 4683 Register result = ToRegister(instr->result()); |
| 4684 | 4684 |
| 4685 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); | 4685 DeferredNumberTagU* deferred = new(zone()) DeferredNumberTagU(this, instr); |
| 4686 __ Branch(deferred->entry(), hi, input, Operand(Smi::kMaxValue)); | 4686 __ Branch(deferred->entry(), hi, input, Operand(Smi::kMaxValue)); |
| 4687 __ SmiTag(result, input); | 4687 __ SmiTag(result, input); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4746 } | 4746 } |
| 4747 | 4747 |
| 4748 // Done. Put the value in dbl_scratch into the value of the allocated heap | 4748 // Done. Put the value in dbl_scratch into the value of the allocated heap |
| 4749 // number. | 4749 // number. |
| 4750 __ bind(&done); | 4750 __ bind(&done); |
| 4751 __ sdc1(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); | 4751 __ sdc1(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); |
| 4752 } | 4752 } |
| 4753 | 4753 |
| 4754 | 4754 |
| 4755 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4755 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
| 4756 class DeferredNumberTagD V8_FINAL : public LDeferredCode { | 4756 class DeferredNumberTagD FINAL : public LDeferredCode { |
| 4757 public: | 4757 public: |
| 4758 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4758 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
| 4759 : LDeferredCode(codegen), instr_(instr) { } | 4759 : LDeferredCode(codegen), instr_(instr) { } |
| 4760 virtual void Generate() V8_OVERRIDE { | 4760 virtual void Generate() OVERRIDE { |
| 4761 codegen()->DoDeferredNumberTagD(instr_); | 4761 codegen()->DoDeferredNumberTagD(instr_); |
| 4762 } | 4762 } |
| 4763 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 4763 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 4764 private: | 4764 private: |
| 4765 LNumberTagD* instr_; | 4765 LNumberTagD* instr_; |
| 4766 }; | 4766 }; |
| 4767 | 4767 |
| 4768 DoubleRegister input_reg = ToDoubleRegister(instr->value()); | 4768 DoubleRegister input_reg = ToDoubleRegister(instr->value()); |
| 4769 Register scratch = scratch0(); | 4769 Register scratch = scratch0(); |
| 4770 Register reg = ToRegister(instr->result()); | 4770 Register reg = ToRegister(instr->result()); |
| 4771 Register temp1 = ToRegister(instr->temp()); | 4771 Register temp1 = ToRegister(instr->temp()); |
| 4772 Register temp2 = ToRegister(instr->temp2()); | 4772 Register temp2 = ToRegister(instr->temp2()); |
| 4773 | 4773 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4969 __ mfhc1(scratch1, double_scratch); // Get exponent/sign bits. | 4969 __ mfhc1(scratch1, double_scratch); // Get exponent/sign bits. |
| 4970 __ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); | 4970 __ And(scratch1, scratch1, Operand(HeapNumber::kSignMask)); |
| 4971 DeoptimizeIf(ne, instr->environment(), scratch1, Operand(zero_reg)); | 4971 DeoptimizeIf(ne, instr->environment(), scratch1, Operand(zero_reg)); |
| 4972 } | 4972 } |
| 4973 } | 4973 } |
| 4974 __ bind(&done); | 4974 __ bind(&done); |
| 4975 } | 4975 } |
| 4976 | 4976 |
| 4977 | 4977 |
| 4978 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 4978 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
| 4979 class DeferredTaggedToI V8_FINAL : public LDeferredCode { | 4979 class DeferredTaggedToI FINAL : public LDeferredCode { |
| 4980 public: | 4980 public: |
| 4981 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) | 4981 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) |
| 4982 : LDeferredCode(codegen), instr_(instr) { } | 4982 : LDeferredCode(codegen), instr_(instr) { } |
| 4983 virtual void Generate() V8_OVERRIDE { | 4983 virtual void Generate() OVERRIDE { |
| 4984 codegen()->DoDeferredTaggedToI(instr_); | 4984 codegen()->DoDeferredTaggedToI(instr_); |
| 4985 } | 4985 } |
| 4986 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 4986 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 4987 private: | 4987 private: |
| 4988 LTaggedToI* instr_; | 4988 LTaggedToI* instr_; |
| 4989 }; | 4989 }; |
| 4990 | 4990 |
| 4991 LOperand* input = instr->value(); | 4991 LOperand* input = instr->value(); |
| 4992 DCHECK(input->IsRegister()); | 4992 DCHECK(input->IsRegister()); |
| 4993 DCHECK(input->Equals(instr->result())); | 4993 DCHECK(input->Equals(instr->result())); |
| 4994 | 4994 |
| 4995 Register input_reg = ToRegister(input); | 4995 Register input_reg = ToRegister(input); |
| 4996 | 4996 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5179 RecordSafepointWithRegisters( | 5179 RecordSafepointWithRegisters( |
| 5180 instr->pointer_map(), 1, Safepoint::kNoLazyDeopt); | 5180 instr->pointer_map(), 1, Safepoint::kNoLazyDeopt); |
| 5181 __ StoreToSafepointRegisterSlot(v0, scratch0()); | 5181 __ StoreToSafepointRegisterSlot(v0, scratch0()); |
| 5182 } | 5182 } |
| 5183 __ SmiTst(scratch0(), at); | 5183 __ SmiTst(scratch0(), at); |
| 5184 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg)); | 5184 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg)); |
| 5185 } | 5185 } |
| 5186 | 5186 |
| 5187 | 5187 |
| 5188 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5188 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
| 5189 class DeferredCheckMaps V8_FINAL : public LDeferredCode { | 5189 class DeferredCheckMaps FINAL : public LDeferredCode { |
| 5190 public: | 5190 public: |
| 5191 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) | 5191 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) |
| 5192 : LDeferredCode(codegen), instr_(instr), object_(object) { | 5192 : LDeferredCode(codegen), instr_(instr), object_(object) { |
| 5193 SetExit(check_maps()); | 5193 SetExit(check_maps()); |
| 5194 } | 5194 } |
| 5195 virtual void Generate() V8_OVERRIDE { | 5195 virtual void Generate() OVERRIDE { |
| 5196 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5196 codegen()->DoDeferredInstanceMigration(instr_, object_); |
| 5197 } | 5197 } |
| 5198 Label* check_maps() { return &check_maps_; } | 5198 Label* check_maps() { return &check_maps_; } |
| 5199 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5199 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 5200 private: | 5200 private: |
| 5201 LCheckMaps* instr_; | 5201 LCheckMaps* instr_; |
| 5202 Label check_maps_; | 5202 Label check_maps_; |
| 5203 Register object_; | 5203 Register object_; |
| 5204 }; | 5204 }; |
| 5205 | 5205 |
| 5206 if (instr->hydrogen()->IsStabilityCheck()) { | 5206 if (instr->hydrogen()->IsStabilityCheck()) { |
| 5207 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5207 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
| 5208 for (int i = 0; i < maps->size(); ++i) { | 5208 for (int i = 0; i < maps->size(); ++i) { |
| 5209 AddStabilityDependency(maps->at(i).handle()); | 5209 AddStabilityDependency(maps->at(i).handle()); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5304 | 5304 |
| 5305 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { | 5305 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { |
| 5306 Register hi_reg = ToRegister(instr->hi()); | 5306 Register hi_reg = ToRegister(instr->hi()); |
| 5307 Register lo_reg = ToRegister(instr->lo()); | 5307 Register lo_reg = ToRegister(instr->lo()); |
| 5308 DoubleRegister result_reg = ToDoubleRegister(instr->result()); | 5308 DoubleRegister result_reg = ToDoubleRegister(instr->result()); |
| 5309 __ Move(result_reg, lo_reg, hi_reg); | 5309 __ Move(result_reg, lo_reg, hi_reg); |
| 5310 } | 5310 } |
| 5311 | 5311 |
| 5312 | 5312 |
| 5313 void LCodeGen::DoAllocate(LAllocate* instr) { | 5313 void LCodeGen::DoAllocate(LAllocate* instr) { |
| 5314 class DeferredAllocate V8_FINAL : public LDeferredCode { | 5314 class DeferredAllocate FINAL : public LDeferredCode { |
| 5315 public: | 5315 public: |
| 5316 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5316 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
| 5317 : LDeferredCode(codegen), instr_(instr) { } | 5317 : LDeferredCode(codegen), instr_(instr) { } |
| 5318 virtual void Generate() V8_OVERRIDE { | 5318 virtual void Generate() OVERRIDE { |
| 5319 codegen()->DoDeferredAllocate(instr_); | 5319 codegen()->DoDeferredAllocate(instr_); |
| 5320 } | 5320 } |
| 5321 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5321 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 5322 private: | 5322 private: |
| 5323 LAllocate* instr_; | 5323 LAllocate* instr_; |
| 5324 }; | 5324 }; |
| 5325 | 5325 |
| 5326 DeferredAllocate* deferred = | 5326 DeferredAllocate* deferred = |
| 5327 new(zone()) DeferredAllocate(this, instr); | 5327 new(zone()) DeferredAllocate(this, instr); |
| 5328 | 5328 |
| 5329 Register result = ToRegister(instr->result()); | 5329 Register result = ToRegister(instr->result()); |
| 5330 Register scratch = ToRegister(instr->temp1()); | 5330 Register scratch = ToRegister(instr->temp1()); |
| 5331 Register scratch2 = ToRegister(instr->temp2()); | 5331 Register scratch2 = ToRegister(instr->temp2()); |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5720 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); | 5720 __ CallRuntimeSaveDoubles(Runtime::kStackGuard); |
| 5721 RecordSafepointWithLazyDeopt( | 5721 RecordSafepointWithLazyDeopt( |
| 5722 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); | 5722 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); |
| 5723 DCHECK(instr->HasEnvironment()); | 5723 DCHECK(instr->HasEnvironment()); |
| 5724 LEnvironment* env = instr->environment(); | 5724 LEnvironment* env = instr->environment(); |
| 5725 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5725 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
| 5726 } | 5726 } |
| 5727 | 5727 |
| 5728 | 5728 |
| 5729 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 5729 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
| 5730 class DeferredStackCheck V8_FINAL : public LDeferredCode { | 5730 class DeferredStackCheck FINAL : public LDeferredCode { |
| 5731 public: | 5731 public: |
| 5732 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) | 5732 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) |
| 5733 : LDeferredCode(codegen), instr_(instr) { } | 5733 : LDeferredCode(codegen), instr_(instr) { } |
| 5734 virtual void Generate() V8_OVERRIDE { | 5734 virtual void Generate() OVERRIDE { |
| 5735 codegen()->DoDeferredStackCheck(instr_); | 5735 codegen()->DoDeferredStackCheck(instr_); |
| 5736 } | 5736 } |
| 5737 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5737 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 5738 private: | 5738 private: |
| 5739 LStackCheck* instr_; | 5739 LStackCheck* instr_; |
| 5740 }; | 5740 }; |
| 5741 | 5741 |
| 5742 DCHECK(instr->HasEnvironment()); | 5742 DCHECK(instr->HasEnvironment()); |
| 5743 LEnvironment* env = instr->environment(); | 5743 LEnvironment* env = instr->environment(); |
| 5744 // There is no LLazyBailout instruction for stack-checks. We have to | 5744 // There is no LLazyBailout instruction for stack-checks. We have to |
| 5745 // prepare for lazy deoptimization explicitly here. | 5745 // prepare for lazy deoptimization explicitly here. |
| 5746 if (instr->hydrogen()->is_function_entry()) { | 5746 if (instr->hydrogen()->is_function_entry()) { |
| 5747 // Perform stack overflow check. | 5747 // Perform stack overflow check. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5861 __ Push(object, index); | 5861 __ Push(object, index); |
| 5862 __ mov(cp, zero_reg); | 5862 __ mov(cp, zero_reg); |
| 5863 __ CallRuntimeSaveDoubles(Runtime::kLoadMutableDouble); | 5863 __ CallRuntimeSaveDoubles(Runtime::kLoadMutableDouble); |
| 5864 RecordSafepointWithRegisters( | 5864 RecordSafepointWithRegisters( |
| 5865 instr->pointer_map(), 2, Safepoint::kNoLazyDeopt); | 5865 instr->pointer_map(), 2, Safepoint::kNoLazyDeopt); |
| 5866 __ StoreToSafepointRegisterSlot(v0, result); | 5866 __ StoreToSafepointRegisterSlot(v0, result); |
| 5867 } | 5867 } |
| 5868 | 5868 |
| 5869 | 5869 |
| 5870 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { | 5870 void LCodeGen::DoLoadFieldByIndex(LLoadFieldByIndex* instr) { |
| 5871 class DeferredLoadMutableDouble V8_FINAL : public LDeferredCode { | 5871 class DeferredLoadMutableDouble FINAL : public LDeferredCode { |
| 5872 public: | 5872 public: |
| 5873 DeferredLoadMutableDouble(LCodeGen* codegen, | 5873 DeferredLoadMutableDouble(LCodeGen* codegen, |
| 5874 LLoadFieldByIndex* instr, | 5874 LLoadFieldByIndex* instr, |
| 5875 Register result, | 5875 Register result, |
| 5876 Register object, | 5876 Register object, |
| 5877 Register index) | 5877 Register index) |
| 5878 : LDeferredCode(codegen), | 5878 : LDeferredCode(codegen), |
| 5879 instr_(instr), | 5879 instr_(instr), |
| 5880 result_(result), | 5880 result_(result), |
| 5881 object_(object), | 5881 object_(object), |
| 5882 index_(index) { | 5882 index_(index) { |
| 5883 } | 5883 } |
| 5884 virtual void Generate() V8_OVERRIDE { | 5884 virtual void Generate() OVERRIDE { |
| 5885 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); | 5885 codegen()->DoDeferredLoadMutableDouble(instr_, result_, object_, index_); |
| 5886 } | 5886 } |
| 5887 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5887 virtual LInstruction* instr() OVERRIDE { return instr_; } |
| 5888 private: | 5888 private: |
| 5889 LLoadFieldByIndex* instr_; | 5889 LLoadFieldByIndex* instr_; |
| 5890 Register result_; | 5890 Register result_; |
| 5891 Register object_; | 5891 Register object_; |
| 5892 Register index_; | 5892 Register index_; |
| 5893 }; | 5893 }; |
| 5894 | 5894 |
| 5895 Register object = ToRegister(instr->object()); | 5895 Register object = ToRegister(instr->object()); |
| 5896 Register index = ToRegister(instr->index()); | 5896 Register index = ToRegister(instr->index()); |
| 5897 Register result = ToRegister(instr->result()); | 5897 Register result = ToRegister(instr->result()); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5936 __ li(at, scope_info); | 5936 __ li(at, scope_info); |
| 5937 __ Push(at, ToRegister(instr->function())); | 5937 __ Push(at, ToRegister(instr->function())); |
| 5938 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5938 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5939 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5939 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5940 } | 5940 } |
| 5941 | 5941 |
| 5942 | 5942 |
| 5943 #undef __ | 5943 #undef __ |
| 5944 | 5944 |
| 5945 } } // namespace v8::internal | 5945 } } // namespace v8::internal |
| OLD | NEW |