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 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class SafepointGenerator FINAL : public CallWrapper { | 24 class SafepointGenerator FINAL : public CallWrapper { |
25 public: | 25 public: |
26 SafepointGenerator(LCodeGen* codegen, | 26 SafepointGenerator(LCodeGen* codegen, |
27 LPointerMap* pointers, | 27 LPointerMap* pointers, |
28 Safepoint::DeoptMode mode) | 28 Safepoint::DeoptMode mode) |
29 : codegen_(codegen), | 29 : codegen_(codegen), |
30 pointers_(pointers), | 30 pointers_(pointers), |
31 deopt_mode_(mode) {} | 31 deopt_mode_(mode) {} |
32 virtual ~SafepointGenerator() {} | 32 virtual ~SafepointGenerator() {} |
33 | 33 |
34 virtual void BeforeCall(int call_size) const OVERRIDE {} | 34 void BeforeCall(int call_size) const OVERRIDE {} |
35 | 35 |
36 virtual void AfterCall() const OVERRIDE { | 36 void AfterCall() const OVERRIDE { |
37 codegen_->RecordSafepoint(pointers_, deopt_mode_); | 37 codegen_->RecordSafepoint(pointers_, deopt_mode_); |
38 } | 38 } |
39 | 39 |
40 private: | 40 private: |
41 LCodeGen* codegen_; | 41 LCodeGen* codegen_; |
42 LPointerMap* pointers_; | 42 LPointerMap* pointers_; |
43 Safepoint::DeoptMode deopt_mode_; | 43 Safepoint::DeoptMode deopt_mode_; |
44 }; | 44 }; |
45 | 45 |
46 | 46 |
(...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2620 __ bind(&done); | 2620 __ bind(&done); |
2621 } | 2621 } |
2622 | 2622 |
2623 | 2623 |
2624 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 2624 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
2625 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { | 2625 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { |
2626 public: | 2626 public: |
2627 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 2627 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
2628 LInstanceOfKnownGlobal* instr) | 2628 LInstanceOfKnownGlobal* instr) |
2629 : LDeferredCode(codegen), instr_(instr) { } | 2629 : LDeferredCode(codegen), instr_(instr) { } |
2630 virtual void Generate() OVERRIDE { | 2630 void Generate() OVERRIDE { |
2631 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); | 2631 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); |
2632 } | 2632 } |
2633 virtual LInstruction* instr() OVERRIDE { return instr_; } | 2633 LInstruction* instr() OVERRIDE { return instr_; } |
2634 Label* map_check() { return &map_check_; } | 2634 Label* map_check() { return &map_check_; } |
2635 private: | 2635 private: |
2636 LInstanceOfKnownGlobal* instr_; | 2636 LInstanceOfKnownGlobal* instr_; |
2637 Label map_check_; | 2637 Label map_check_; |
2638 }; | 2638 }; |
2639 | 2639 |
2640 DeferredInstanceOfKnownGlobal* deferred; | 2640 DeferredInstanceOfKnownGlobal* deferred; |
2641 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); | 2641 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
2642 | 2642 |
2643 Label done, false_result; | 2643 Label done, false_result; |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 } | 3579 } |
3580 | 3580 |
3581 | 3581 |
3582 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3582 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
3583 // Class for deferred case. | 3583 // Class for deferred case. |
3584 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { | 3584 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { |
3585 public: | 3585 public: |
3586 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, | 3586 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, |
3587 LMathAbs* instr) | 3587 LMathAbs* instr) |
3588 : LDeferredCode(codegen), instr_(instr) { } | 3588 : LDeferredCode(codegen), instr_(instr) { } |
3589 virtual void Generate() OVERRIDE { | 3589 void Generate() OVERRIDE { |
3590 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); | 3590 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); |
3591 } | 3591 } |
3592 virtual LInstruction* instr() OVERRIDE { return instr_; } | 3592 LInstruction* instr() OVERRIDE { return instr_; } |
| 3593 |
3593 private: | 3594 private: |
3594 LMathAbs* instr_; | 3595 LMathAbs* instr_; |
3595 }; | 3596 }; |
3596 | 3597 |
3597 DCHECK(instr->value()->Equals(instr->result())); | 3598 DCHECK(instr->value()->Equals(instr->result())); |
3598 Representation r = instr->hydrogen()->value()->representation(); | 3599 Representation r = instr->hydrogen()->value()->representation(); |
3599 | 3600 |
3600 if (r.IsDouble()) { | 3601 if (r.IsDouble()) { |
3601 XMMRegister scratch = double_scratch0(); | 3602 XMMRegister scratch = double_scratch0(); |
3602 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3603 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 __ bind(¬_applicable); | 4334 __ bind(¬_applicable); |
4334 } | 4335 } |
4335 | 4336 |
4336 | 4337 |
4337 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4338 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
4338 class DeferredStringCharCodeAt FINAL : public LDeferredCode { | 4339 class DeferredStringCharCodeAt FINAL : public LDeferredCode { |
4339 public: | 4340 public: |
4340 DeferredStringCharCodeAt(LCodeGen* codegen, | 4341 DeferredStringCharCodeAt(LCodeGen* codegen, |
4341 LStringCharCodeAt* instr) | 4342 LStringCharCodeAt* instr) |
4342 : LDeferredCode(codegen), instr_(instr) { } | 4343 : LDeferredCode(codegen), instr_(instr) { } |
4343 virtual void Generate() OVERRIDE { | 4344 void Generate() OVERRIDE { codegen()->DoDeferredStringCharCodeAt(instr_); } |
4344 codegen()->DoDeferredStringCharCodeAt(instr_); | 4345 LInstruction* instr() OVERRIDE { return instr_; } |
4345 } | 4346 |
4346 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4347 private: | 4347 private: |
4348 LStringCharCodeAt* instr_; | 4348 LStringCharCodeAt* instr_; |
4349 }; | 4349 }; |
4350 | 4350 |
4351 DeferredStringCharCodeAt* deferred = | 4351 DeferredStringCharCodeAt* deferred = |
4352 new(zone()) DeferredStringCharCodeAt(this, instr); | 4352 new(zone()) DeferredStringCharCodeAt(this, instr); |
4353 | 4353 |
4354 StringCharLoadGenerator::Generate(masm(), | 4354 StringCharLoadGenerator::Generate(masm(), |
4355 factory(), | 4355 factory(), |
4356 ToRegister(instr->string()), | 4356 ToRegister(instr->string()), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4391 __ StoreToSafepointRegisterSlot(result, eax); | 4391 __ StoreToSafepointRegisterSlot(result, eax); |
4392 } | 4392 } |
4393 | 4393 |
4394 | 4394 |
4395 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4395 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4396 class DeferredStringCharFromCode FINAL : public LDeferredCode { | 4396 class DeferredStringCharFromCode FINAL : public LDeferredCode { |
4397 public: | 4397 public: |
4398 DeferredStringCharFromCode(LCodeGen* codegen, | 4398 DeferredStringCharFromCode(LCodeGen* codegen, |
4399 LStringCharFromCode* instr) | 4399 LStringCharFromCode* instr) |
4400 : LDeferredCode(codegen), instr_(instr) { } | 4400 : LDeferredCode(codegen), instr_(instr) { } |
4401 virtual void Generate() OVERRIDE { | 4401 void Generate() OVERRIDE { |
4402 codegen()->DoDeferredStringCharFromCode(instr_); | 4402 codegen()->DoDeferredStringCharFromCode(instr_); |
4403 } | 4403 } |
4404 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4404 LInstruction* instr() OVERRIDE { return instr_; } |
| 4405 |
4405 private: | 4406 private: |
4406 LStringCharFromCode* instr_; | 4407 LStringCharFromCode* instr_; |
4407 }; | 4408 }; |
4408 | 4409 |
4409 DeferredStringCharFromCode* deferred = | 4410 DeferredStringCharFromCode* deferred = |
4410 new(zone()) DeferredStringCharFromCode(this, instr); | 4411 new(zone()) DeferredStringCharFromCode(this, instr); |
4411 | 4412 |
4412 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); | 4413 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); |
4413 Register char_code = ToRegister(instr->char_code()); | 4414 Register char_code = ToRegister(instr->char_code()); |
4414 Register result = ToRegister(instr->result()); | 4415 Register result = ToRegister(instr->result()); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4469 __ LoadUint32(ToDoubleRegister(output), ToRegister(input)); | 4470 __ LoadUint32(ToDoubleRegister(output), ToRegister(input)); |
4470 } | 4471 } |
4471 | 4472 |
4472 | 4473 |
4473 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4474 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
4474 class DeferredNumberTagI FINAL : public LDeferredCode { | 4475 class DeferredNumberTagI FINAL : public LDeferredCode { |
4475 public: | 4476 public: |
4476 DeferredNumberTagI(LCodeGen* codegen, | 4477 DeferredNumberTagI(LCodeGen* codegen, |
4477 LNumberTagI* instr) | 4478 LNumberTagI* instr) |
4478 : LDeferredCode(codegen), instr_(instr) { } | 4479 : LDeferredCode(codegen), instr_(instr) { } |
4479 virtual void Generate() OVERRIDE { | 4480 void Generate() OVERRIDE { |
4480 codegen()->DoDeferredNumberTagIU( | 4481 codegen()->DoDeferredNumberTagIU( |
4481 instr_, instr_->value(), instr_->temp(), SIGNED_INT32); | 4482 instr_, instr_->value(), instr_->temp(), SIGNED_INT32); |
4482 } | 4483 } |
4483 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4484 LInstruction* instr() OVERRIDE { return instr_; } |
| 4485 |
4484 private: | 4486 private: |
4485 LNumberTagI* instr_; | 4487 LNumberTagI* instr_; |
4486 }; | 4488 }; |
4487 | 4489 |
4488 LOperand* input = instr->value(); | 4490 LOperand* input = instr->value(); |
4489 DCHECK(input->IsRegister() && input->Equals(instr->result())); | 4491 DCHECK(input->IsRegister() && input->Equals(instr->result())); |
4490 Register reg = ToRegister(input); | 4492 Register reg = ToRegister(input); |
4491 | 4493 |
4492 DeferredNumberTagI* deferred = | 4494 DeferredNumberTagI* deferred = |
4493 new(zone()) DeferredNumberTagI(this, instr); | 4495 new(zone()) DeferredNumberTagI(this, instr); |
4494 __ SmiTag(reg); | 4496 __ SmiTag(reg); |
4495 __ j(overflow, deferred->entry()); | 4497 __ j(overflow, deferred->entry()); |
4496 __ bind(deferred->exit()); | 4498 __ bind(deferred->exit()); |
4497 } | 4499 } |
4498 | 4500 |
4499 | 4501 |
4500 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4502 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
4501 class DeferredNumberTagU FINAL : public LDeferredCode { | 4503 class DeferredNumberTagU FINAL : public LDeferredCode { |
4502 public: | 4504 public: |
4503 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4505 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
4504 : LDeferredCode(codegen), instr_(instr) { } | 4506 : LDeferredCode(codegen), instr_(instr) { } |
4505 virtual void Generate() OVERRIDE { | 4507 void Generate() OVERRIDE { |
4506 codegen()->DoDeferredNumberTagIU( | 4508 codegen()->DoDeferredNumberTagIU( |
4507 instr_, instr_->value(), instr_->temp(), UNSIGNED_INT32); | 4509 instr_, instr_->value(), instr_->temp(), UNSIGNED_INT32); |
4508 } | 4510 } |
4509 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4511 LInstruction* instr() OVERRIDE { return instr_; } |
| 4512 |
4510 private: | 4513 private: |
4511 LNumberTagU* instr_; | 4514 LNumberTagU* instr_; |
4512 }; | 4515 }; |
4513 | 4516 |
4514 LOperand* input = instr->value(); | 4517 LOperand* input = instr->value(); |
4515 DCHECK(input->IsRegister() && input->Equals(instr->result())); | 4518 DCHECK(input->IsRegister() && input->Equals(instr->result())); |
4516 Register reg = ToRegister(input); | 4519 Register reg = ToRegister(input); |
4517 | 4520 |
4518 DeferredNumberTagU* deferred = | 4521 DeferredNumberTagU* deferred = |
4519 new(zone()) DeferredNumberTagU(this, instr); | 4522 new(zone()) DeferredNumberTagU(this, instr); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4577 __ bind(&done); | 4580 __ bind(&done); |
4578 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm_scratch); | 4581 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm_scratch); |
4579 } | 4582 } |
4580 | 4583 |
4581 | 4584 |
4582 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 4585 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
4583 class DeferredNumberTagD FINAL : public LDeferredCode { | 4586 class DeferredNumberTagD FINAL : public LDeferredCode { |
4584 public: | 4587 public: |
4585 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) | 4588 DeferredNumberTagD(LCodeGen* codegen, LNumberTagD* instr) |
4586 : LDeferredCode(codegen), instr_(instr) { } | 4589 : LDeferredCode(codegen), instr_(instr) { } |
4587 virtual void Generate() OVERRIDE { | 4590 void Generate() OVERRIDE { codegen()->DoDeferredNumberTagD(instr_); } |
4588 codegen()->DoDeferredNumberTagD(instr_); | 4591 LInstruction* instr() OVERRIDE { return instr_; } |
4589 } | 4592 |
4590 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4591 private: | 4593 private: |
4592 LNumberTagD* instr_; | 4594 LNumberTagD* instr_; |
4593 }; | 4595 }; |
4594 | 4596 |
4595 Register reg = ToRegister(instr->result()); | 4597 Register reg = ToRegister(instr->result()); |
4596 | 4598 |
4597 DeferredNumberTagD* deferred = | 4599 DeferredNumberTagD* deferred = |
4598 new(zone()) DeferredNumberTagD(this, instr); | 4600 new(zone()) DeferredNumberTagD(this, instr); |
4599 if (FLAG_inline_new) { | 4601 if (FLAG_inline_new) { |
4600 Register tmp = ToRegister(instr->temp()); | 4602 Register tmp = ToRegister(instr->temp()); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 } | 4779 } |
4778 } | 4780 } |
4779 } | 4781 } |
4780 | 4782 |
4781 | 4783 |
4782 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 4784 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
4783 class DeferredTaggedToI FINAL : public LDeferredCode { | 4785 class DeferredTaggedToI FINAL : public LDeferredCode { |
4784 public: | 4786 public: |
4785 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) | 4787 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) |
4786 : LDeferredCode(codegen), instr_(instr) { } | 4788 : LDeferredCode(codegen), instr_(instr) { } |
4787 virtual void Generate() OVERRIDE { | 4789 void Generate() OVERRIDE { codegen()->DoDeferredTaggedToI(instr_, done()); } |
4788 codegen()->DoDeferredTaggedToI(instr_, done()); | 4790 LInstruction* instr() OVERRIDE { return instr_; } |
4789 } | 4791 |
4790 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4791 private: | 4792 private: |
4792 LTaggedToI* instr_; | 4793 LTaggedToI* instr_; |
4793 }; | 4794 }; |
4794 | 4795 |
4795 LOperand* input = instr->value(); | 4796 LOperand* input = instr->value(); |
4796 DCHECK(input->IsRegister()); | 4797 DCHECK(input->IsRegister()); |
4797 Register input_reg = ToRegister(input); | 4798 Register input_reg = ToRegister(input); |
4798 DCHECK(input_reg.is(ToRegister(instr->result()))); | 4799 DCHECK(input_reg.is(ToRegister(instr->result()))); |
4799 | 4800 |
4800 if (instr->hydrogen()->value()->representation().IsSmi()) { | 4801 if (instr->hydrogen()->value()->representation().IsSmi()) { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4981 } | 4982 } |
4982 | 4983 |
4983 | 4984 |
4984 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 4985 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
4985 class DeferredCheckMaps FINAL : public LDeferredCode { | 4986 class DeferredCheckMaps FINAL : public LDeferredCode { |
4986 public: | 4987 public: |
4987 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) | 4988 DeferredCheckMaps(LCodeGen* codegen, LCheckMaps* instr, Register object) |
4988 : LDeferredCode(codegen), instr_(instr), object_(object) { | 4989 : LDeferredCode(codegen), instr_(instr), object_(object) { |
4989 SetExit(check_maps()); | 4990 SetExit(check_maps()); |
4990 } | 4991 } |
4991 virtual void Generate() OVERRIDE { | 4992 void Generate() OVERRIDE { |
4992 codegen()->DoDeferredInstanceMigration(instr_, object_); | 4993 codegen()->DoDeferredInstanceMigration(instr_, object_); |
4993 } | 4994 } |
4994 Label* check_maps() { return &check_maps_; } | 4995 Label* check_maps() { return &check_maps_; } |
4995 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4996 LInstruction* instr() OVERRIDE { return instr_; } |
| 4997 |
4996 private: | 4998 private: |
4997 LCheckMaps* instr_; | 4999 LCheckMaps* instr_; |
4998 Label check_maps_; | 5000 Label check_maps_; |
4999 Register object_; | 5001 Register object_; |
5000 }; | 5002 }; |
5001 | 5003 |
5002 if (instr->hydrogen()->IsStabilityCheck()) { | 5004 if (instr->hydrogen()->IsStabilityCheck()) { |
5003 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5005 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
5004 for (int i = 0; i < maps->size(); ++i) { | 5006 for (int i = 0; i < maps->size(); ++i) { |
5005 AddStabilityDependency(maps->at(i).handle()); | 5007 AddStabilityDependency(maps->at(i).handle()); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5122 __ orps(result_reg, xmm_scratch); | 5124 __ orps(result_reg, xmm_scratch); |
5123 } | 5125 } |
5124 } | 5126 } |
5125 | 5127 |
5126 | 5128 |
5127 void LCodeGen::DoAllocate(LAllocate* instr) { | 5129 void LCodeGen::DoAllocate(LAllocate* instr) { |
5128 class DeferredAllocate FINAL : public LDeferredCode { | 5130 class DeferredAllocate FINAL : public LDeferredCode { |
5129 public: | 5131 public: |
5130 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5132 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
5131 : LDeferredCode(codegen), instr_(instr) { } | 5133 : LDeferredCode(codegen), instr_(instr) { } |
5132 virtual void Generate() OVERRIDE { | 5134 void Generate() OVERRIDE { codegen()->DoDeferredAllocate(instr_); } |
5133 codegen()->DoDeferredAllocate(instr_); | 5135 LInstruction* instr() OVERRIDE { return instr_; } |
5134 } | 5136 |
5135 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5136 private: | 5137 private: |
5137 LAllocate* instr_; | 5138 LAllocate* instr_; |
5138 }; | 5139 }; |
5139 | 5140 |
5140 DeferredAllocate* deferred = new(zone()) DeferredAllocate(this, instr); | 5141 DeferredAllocate* deferred = new(zone()) DeferredAllocate(this, instr); |
5141 | 5142 |
5142 Register result = ToRegister(instr->result()); | 5143 Register result = ToRegister(instr->result()); |
5143 Register temp = ToRegister(instr->temp()); | 5144 Register temp = ToRegister(instr->temp()); |
5144 | 5145 |
5145 // Allocate memory for the object. | 5146 // Allocate memory for the object. |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5488 LEnvironment* env = instr->environment(); | 5489 LEnvironment* env = instr->environment(); |
5489 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5490 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
5490 } | 5491 } |
5491 | 5492 |
5492 | 5493 |
5493 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 5494 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
5494 class DeferredStackCheck FINAL : public LDeferredCode { | 5495 class DeferredStackCheck FINAL : public LDeferredCode { |
5495 public: | 5496 public: |
5496 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) | 5497 DeferredStackCheck(LCodeGen* codegen, LStackCheck* instr) |
5497 : LDeferredCode(codegen), instr_(instr) { } | 5498 : LDeferredCode(codegen), instr_(instr) { } |
5498 virtual void Generate() OVERRIDE { | 5499 void Generate() OVERRIDE { codegen()->DoDeferredStackCheck(instr_); } |
5499 codegen()->DoDeferredStackCheck(instr_); | 5500 LInstruction* instr() OVERRIDE { return instr_; } |
5500 } | 5501 |
5501 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5502 private: | 5502 private: |
5503 LStackCheck* instr_; | 5503 LStackCheck* instr_; |
5504 }; | 5504 }; |
5505 | 5505 |
5506 DCHECK(instr->HasEnvironment()); | 5506 DCHECK(instr->HasEnvironment()); |
5507 LEnvironment* env = instr->environment(); | 5507 LEnvironment* env = instr->environment(); |
5508 // There is no LLazyBailout instruction for stack-checks. We have to | 5508 // There is no LLazyBailout instruction for stack-checks. We have to |
5509 // prepare for lazy deoptimization explicitly here. | 5509 // prepare for lazy deoptimization explicitly here. |
5510 if (instr->hydrogen()->is_function_entry()) { | 5510 if (instr->hydrogen()->is_function_entry()) { |
5511 // Perform stack overflow check. | 5511 // Perform stack overflow check. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5638 public: | 5638 public: |
5639 DeferredLoadMutableDouble(LCodeGen* codegen, | 5639 DeferredLoadMutableDouble(LCodeGen* codegen, |
5640 LLoadFieldByIndex* instr, | 5640 LLoadFieldByIndex* instr, |
5641 Register object, | 5641 Register object, |
5642 Register index) | 5642 Register index) |
5643 : LDeferredCode(codegen), | 5643 : LDeferredCode(codegen), |
5644 instr_(instr), | 5644 instr_(instr), |
5645 object_(object), | 5645 object_(object), |
5646 index_(index) { | 5646 index_(index) { |
5647 } | 5647 } |
5648 virtual void Generate() OVERRIDE { | 5648 void Generate() OVERRIDE { |
5649 codegen()->DoDeferredLoadMutableDouble(instr_, object_, index_); | 5649 codegen()->DoDeferredLoadMutableDouble(instr_, object_, index_); |
5650 } | 5650 } |
5651 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5651 LInstruction* instr() OVERRIDE { return instr_; } |
| 5652 |
5652 private: | 5653 private: |
5653 LLoadFieldByIndex* instr_; | 5654 LLoadFieldByIndex* instr_; |
5654 Register object_; | 5655 Register object_; |
5655 Register index_; | 5656 Register index_; |
5656 }; | 5657 }; |
5657 | 5658 |
5658 Register object = ToRegister(instr->object()); | 5659 Register object = ToRegister(instr->object()); |
5659 Register index = ToRegister(instr->index()); | 5660 Register index = ToRegister(instr->index()); |
5660 | 5661 |
5661 DeferredLoadMutableDouble* deferred; | 5662 DeferredLoadMutableDouble* deferred; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5702 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5703 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5703 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5704 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5704 } | 5705 } |
5705 | 5706 |
5706 | 5707 |
5707 #undef __ | 5708 #undef __ |
5708 | 5709 |
5709 } } // namespace v8::internal | 5710 } } // namespace v8::internal |
5710 | 5711 |
5711 #endif // V8_TARGET_ARCH_IA32 | 5712 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |