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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 14 matching lines...) Expand all Loading... |
25 class SafepointGenerator FINAL : public CallWrapper { | 25 class SafepointGenerator FINAL : public CallWrapper { |
26 public: | 26 public: |
27 SafepointGenerator(LCodeGen* codegen, | 27 SafepointGenerator(LCodeGen* codegen, |
28 LPointerMap* pointers, | 28 LPointerMap* pointers, |
29 Safepoint::DeoptMode mode) | 29 Safepoint::DeoptMode mode) |
30 : codegen_(codegen), | 30 : codegen_(codegen), |
31 pointers_(pointers), | 31 pointers_(pointers), |
32 deopt_mode_(mode) {} | 32 deopt_mode_(mode) {} |
33 virtual ~SafepointGenerator() {} | 33 virtual ~SafepointGenerator() {} |
34 | 34 |
35 virtual void BeforeCall(int call_size) const OVERRIDE {} | 35 void BeforeCall(int call_size) const OVERRIDE {} |
36 | 36 |
37 virtual void AfterCall() const OVERRIDE { | 37 void AfterCall() const OVERRIDE { |
38 codegen_->RecordSafepoint(pointers_, deopt_mode_); | 38 codegen_->RecordSafepoint(pointers_, deopt_mode_); |
39 } | 39 } |
40 | 40 |
41 private: | 41 private: |
42 LCodeGen* codegen_; | 42 LCodeGen* codegen_; |
43 LPointerMap* pointers_; | 43 LPointerMap* pointers_; |
44 Safepoint::DeoptMode deopt_mode_; | 44 Safepoint::DeoptMode deopt_mode_; |
45 }; | 45 }; |
46 | 46 |
47 | 47 |
(...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2917 } | 2917 } |
2918 | 2918 |
2919 | 2919 |
2920 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 2920 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
2921 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { | 2921 class DeferredInstanceOfKnownGlobal FINAL : public LDeferredCode { |
2922 public: | 2922 public: |
2923 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 2923 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
2924 LInstanceOfKnownGlobal* instr, | 2924 LInstanceOfKnownGlobal* instr, |
2925 const X87Stack& x87_stack) | 2925 const X87Stack& x87_stack) |
2926 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 2926 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
2927 virtual void Generate() OVERRIDE { | 2927 void Generate() OVERRIDE { |
2928 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); | 2928 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); |
2929 } | 2929 } |
2930 virtual LInstruction* instr() OVERRIDE { return instr_; } | 2930 LInstruction* instr() OVERRIDE { return instr_; } |
2931 Label* map_check() { return &map_check_; } | 2931 Label* map_check() { return &map_check_; } |
2932 private: | 2932 private: |
2933 LInstanceOfKnownGlobal* instr_; | 2933 LInstanceOfKnownGlobal* instr_; |
2934 Label map_check_; | 2934 Label map_check_; |
2935 }; | 2935 }; |
2936 | 2936 |
2937 DeferredInstanceOfKnownGlobal* deferred; | 2937 DeferredInstanceOfKnownGlobal* deferred; |
2938 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr, x87_stack_); | 2938 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr, x87_stack_); |
2939 | 2939 |
2940 Label done, false_result; | 2940 Label done, false_result; |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3866 | 3866 |
3867 | 3867 |
3868 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3868 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
3869 // Class for deferred case. | 3869 // Class for deferred case. |
3870 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { | 3870 class DeferredMathAbsTaggedHeapNumber FINAL : public LDeferredCode { |
3871 public: | 3871 public: |
3872 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, | 3872 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, |
3873 LMathAbs* instr, | 3873 LMathAbs* instr, |
3874 const X87Stack& x87_stack) | 3874 const X87Stack& x87_stack) |
3875 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 3875 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
3876 virtual void Generate() OVERRIDE { | 3876 void Generate() OVERRIDE { |
3877 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); | 3877 codegen()->DoDeferredMathAbsTaggedHeapNumber(instr_); |
3878 } | 3878 } |
3879 virtual LInstruction* instr() OVERRIDE { return instr_; } | 3879 LInstruction* instr() OVERRIDE { return instr_; } |
| 3880 |
3880 private: | 3881 private: |
3881 LMathAbs* instr_; | 3882 LMathAbs* instr_; |
3882 }; | 3883 }; |
3883 | 3884 |
3884 DCHECK(instr->value()->Equals(instr->result())); | 3885 DCHECK(instr->value()->Equals(instr->result())); |
3885 Representation r = instr->hydrogen()->value()->representation(); | 3886 Representation r = instr->hydrogen()->value()->representation(); |
3886 | 3887 |
3887 if (r.IsDouble()) { | 3888 if (r.IsDouble()) { |
3888 X87Register value = ToX87Register(instr->value()); | 3889 X87Register value = ToX87Register(instr->value()); |
3889 X87Fxch(value); | 3890 X87Fxch(value); |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4774 } | 4775 } |
4775 | 4776 |
4776 | 4777 |
4777 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4778 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
4778 class DeferredStringCharCodeAt FINAL : public LDeferredCode { | 4779 class DeferredStringCharCodeAt FINAL : public LDeferredCode { |
4779 public: | 4780 public: |
4780 DeferredStringCharCodeAt(LCodeGen* codegen, | 4781 DeferredStringCharCodeAt(LCodeGen* codegen, |
4781 LStringCharCodeAt* instr, | 4782 LStringCharCodeAt* instr, |
4782 const X87Stack& x87_stack) | 4783 const X87Stack& x87_stack) |
4783 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 4784 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
4784 virtual void Generate() OVERRIDE { | 4785 void Generate() OVERRIDE { codegen()->DoDeferredStringCharCodeAt(instr_); } |
4785 codegen()->DoDeferredStringCharCodeAt(instr_); | 4786 LInstruction* instr() OVERRIDE { return instr_; } |
4786 } | 4787 |
4787 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
4788 private: | 4788 private: |
4789 LStringCharCodeAt* instr_; | 4789 LStringCharCodeAt* instr_; |
4790 }; | 4790 }; |
4791 | 4791 |
4792 DeferredStringCharCodeAt* deferred = | 4792 DeferredStringCharCodeAt* deferred = |
4793 new(zone()) DeferredStringCharCodeAt(this, instr, x87_stack_); | 4793 new(zone()) DeferredStringCharCodeAt(this, instr, x87_stack_); |
4794 | 4794 |
4795 StringCharLoadGenerator::Generate(masm(), | 4795 StringCharLoadGenerator::Generate(masm(), |
4796 factory(), | 4796 factory(), |
4797 ToRegister(instr->string()), | 4797 ToRegister(instr->string()), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4833 } | 4833 } |
4834 | 4834 |
4835 | 4835 |
4836 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { | 4836 void LCodeGen::DoStringCharFromCode(LStringCharFromCode* instr) { |
4837 class DeferredStringCharFromCode FINAL : public LDeferredCode { | 4837 class DeferredStringCharFromCode FINAL : public LDeferredCode { |
4838 public: | 4838 public: |
4839 DeferredStringCharFromCode(LCodeGen* codegen, | 4839 DeferredStringCharFromCode(LCodeGen* codegen, |
4840 LStringCharFromCode* instr, | 4840 LStringCharFromCode* instr, |
4841 const X87Stack& x87_stack) | 4841 const X87Stack& x87_stack) |
4842 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 4842 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
4843 virtual void Generate() OVERRIDE { | 4843 void Generate() OVERRIDE { |
4844 codegen()->DoDeferredStringCharFromCode(instr_); | 4844 codegen()->DoDeferredStringCharFromCode(instr_); |
4845 } | 4845 } |
4846 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4846 LInstruction* instr() OVERRIDE { return instr_; } |
| 4847 |
4847 private: | 4848 private: |
4848 LStringCharFromCode* instr_; | 4849 LStringCharFromCode* instr_; |
4849 }; | 4850 }; |
4850 | 4851 |
4851 DeferredStringCharFromCode* deferred = | 4852 DeferredStringCharFromCode* deferred = |
4852 new(zone()) DeferredStringCharFromCode(this, instr, x87_stack_); | 4853 new(zone()) DeferredStringCharFromCode(this, instr, x87_stack_); |
4853 | 4854 |
4854 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); | 4855 DCHECK(instr->hydrogen()->value()->representation().IsInteger32()); |
4855 Register char_code = ToRegister(instr->char_code()); | 4856 Register char_code = ToRegister(instr->char_code()); |
4856 Register result = ToRegister(instr->result()); | 4857 Register result = ToRegister(instr->result()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4922 } | 4923 } |
4923 | 4924 |
4924 | 4925 |
4925 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4926 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
4926 class DeferredNumberTagI FINAL : public LDeferredCode { | 4927 class DeferredNumberTagI FINAL : public LDeferredCode { |
4927 public: | 4928 public: |
4928 DeferredNumberTagI(LCodeGen* codegen, | 4929 DeferredNumberTagI(LCodeGen* codegen, |
4929 LNumberTagI* instr, | 4930 LNumberTagI* instr, |
4930 const X87Stack& x87_stack) | 4931 const X87Stack& x87_stack) |
4931 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 4932 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
4932 virtual void Generate() OVERRIDE { | 4933 void Generate() OVERRIDE { |
4933 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp(), | 4934 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp(), |
4934 SIGNED_INT32); | 4935 SIGNED_INT32); |
4935 } | 4936 } |
4936 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4937 LInstruction* instr() OVERRIDE { return instr_; } |
| 4938 |
4937 private: | 4939 private: |
4938 LNumberTagI* instr_; | 4940 LNumberTagI* instr_; |
4939 }; | 4941 }; |
4940 | 4942 |
4941 LOperand* input = instr->value(); | 4943 LOperand* input = instr->value(); |
4942 DCHECK(input->IsRegister() && input->Equals(instr->result())); | 4944 DCHECK(input->IsRegister() && input->Equals(instr->result())); |
4943 Register reg = ToRegister(input); | 4945 Register reg = ToRegister(input); |
4944 | 4946 |
4945 DeferredNumberTagI* deferred = | 4947 DeferredNumberTagI* deferred = |
4946 new(zone()) DeferredNumberTagI(this, instr, x87_stack_); | 4948 new(zone()) DeferredNumberTagI(this, instr, x87_stack_); |
4947 __ SmiTag(reg); | 4949 __ SmiTag(reg); |
4948 __ j(overflow, deferred->entry()); | 4950 __ j(overflow, deferred->entry()); |
4949 __ bind(deferred->exit()); | 4951 __ bind(deferred->exit()); |
4950 } | 4952 } |
4951 | 4953 |
4952 | 4954 |
4953 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4955 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
4954 class DeferredNumberTagU FINAL : public LDeferredCode { | 4956 class DeferredNumberTagU FINAL : public LDeferredCode { |
4955 public: | 4957 public: |
4956 DeferredNumberTagU(LCodeGen* codegen, | 4958 DeferredNumberTagU(LCodeGen* codegen, |
4957 LNumberTagU* instr, | 4959 LNumberTagU* instr, |
4958 const X87Stack& x87_stack) | 4960 const X87Stack& x87_stack) |
4959 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 4961 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
4960 virtual void Generate() OVERRIDE { | 4962 void Generate() OVERRIDE { |
4961 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp(), | 4963 codegen()->DoDeferredNumberTagIU(instr_, instr_->value(), instr_->temp(), |
4962 UNSIGNED_INT32); | 4964 UNSIGNED_INT32); |
4963 } | 4965 } |
4964 virtual LInstruction* instr() OVERRIDE { return instr_; } | 4966 LInstruction* instr() OVERRIDE { return instr_; } |
| 4967 |
4965 private: | 4968 private: |
4966 LNumberTagU* instr_; | 4969 LNumberTagU* instr_; |
4967 }; | 4970 }; |
4968 | 4971 |
4969 LOperand* input = instr->value(); | 4972 LOperand* input = instr->value(); |
4970 DCHECK(input->IsRegister() && input->Equals(instr->result())); | 4973 DCHECK(input->IsRegister() && input->Equals(instr->result())); |
4971 Register reg = ToRegister(input); | 4974 Register reg = ToRegister(input); |
4972 | 4975 |
4973 DeferredNumberTagU* deferred = | 4976 DeferredNumberTagU* deferred = |
4974 new(zone()) DeferredNumberTagU(this, instr, x87_stack_); | 4977 new(zone()) DeferredNumberTagU(this, instr, x87_stack_); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5039 } | 5042 } |
5040 | 5043 |
5041 | 5044 |
5042 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { | 5045 void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
5043 class DeferredNumberTagD FINAL : public LDeferredCode { | 5046 class DeferredNumberTagD FINAL : public LDeferredCode { |
5044 public: | 5047 public: |
5045 DeferredNumberTagD(LCodeGen* codegen, | 5048 DeferredNumberTagD(LCodeGen* codegen, |
5046 LNumberTagD* instr, | 5049 LNumberTagD* instr, |
5047 const X87Stack& x87_stack) | 5050 const X87Stack& x87_stack) |
5048 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5051 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
5049 virtual void Generate() OVERRIDE { | 5052 void Generate() OVERRIDE { codegen()->DoDeferredNumberTagD(instr_); } |
5050 codegen()->DoDeferredNumberTagD(instr_); | 5053 LInstruction* instr() OVERRIDE { return instr_; } |
5051 } | 5054 |
5052 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5053 private: | 5055 private: |
5054 LNumberTagD* instr_; | 5056 LNumberTagD* instr_; |
5055 }; | 5057 }; |
5056 | 5058 |
5057 Register reg = ToRegister(instr->result()); | 5059 Register reg = ToRegister(instr->result()); |
5058 | 5060 |
5059 // Put the value to the top of stack | 5061 // Put the value to the top of stack |
5060 X87Register src = ToX87Register(instr->value()); | 5062 X87Register src = ToX87Register(instr->value()); |
5061 // Don't use X87LoadForUsage here, which is only used by Instruction which | 5063 // Don't use X87LoadForUsage here, which is only used by Instruction which |
5062 // clobbers fp registers. | 5064 // clobbers fp registers. |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5285 } | 5287 } |
5286 | 5288 |
5287 | 5289 |
5288 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 5290 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
5289 class DeferredTaggedToI FINAL : public LDeferredCode { | 5291 class DeferredTaggedToI FINAL : public LDeferredCode { |
5290 public: | 5292 public: |
5291 DeferredTaggedToI(LCodeGen* codegen, | 5293 DeferredTaggedToI(LCodeGen* codegen, |
5292 LTaggedToI* instr, | 5294 LTaggedToI* instr, |
5293 const X87Stack& x87_stack) | 5295 const X87Stack& x87_stack) |
5294 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5296 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
5295 virtual void Generate() OVERRIDE { | 5297 void Generate() OVERRIDE { codegen()->DoDeferredTaggedToI(instr_, done()); } |
5296 codegen()->DoDeferredTaggedToI(instr_, done()); | 5298 LInstruction* instr() OVERRIDE { return instr_; } |
5297 } | 5299 |
5298 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5299 private: | 5300 private: |
5300 LTaggedToI* instr_; | 5301 LTaggedToI* instr_; |
5301 }; | 5302 }; |
5302 | 5303 |
5303 LOperand* input = instr->value(); | 5304 LOperand* input = instr->value(); |
5304 DCHECK(input->IsRegister()); | 5305 DCHECK(input->IsRegister()); |
5305 Register input_reg = ToRegister(input); | 5306 Register input_reg = ToRegister(input); |
5306 DCHECK(input_reg.is(ToRegister(instr->result()))); | 5307 DCHECK(input_reg.is(ToRegister(instr->result()))); |
5307 | 5308 |
5308 if (instr->hydrogen()->value()->representation().IsSmi()) { | 5309 if (instr->hydrogen()->value()->representation().IsSmi()) { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5491 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { | 5492 void LCodeGen::DoCheckMaps(LCheckMaps* instr) { |
5492 class DeferredCheckMaps FINAL : public LDeferredCode { | 5493 class DeferredCheckMaps FINAL : public LDeferredCode { |
5493 public: | 5494 public: |
5494 DeferredCheckMaps(LCodeGen* codegen, | 5495 DeferredCheckMaps(LCodeGen* codegen, |
5495 LCheckMaps* instr, | 5496 LCheckMaps* instr, |
5496 Register object, | 5497 Register object, |
5497 const X87Stack& x87_stack) | 5498 const X87Stack& x87_stack) |
5498 : LDeferredCode(codegen, x87_stack), instr_(instr), object_(object) { | 5499 : LDeferredCode(codegen, x87_stack), instr_(instr), object_(object) { |
5499 SetExit(check_maps()); | 5500 SetExit(check_maps()); |
5500 } | 5501 } |
5501 virtual void Generate() OVERRIDE { | 5502 void Generate() OVERRIDE { |
5502 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5503 codegen()->DoDeferredInstanceMigration(instr_, object_); |
5503 } | 5504 } |
5504 Label* check_maps() { return &check_maps_; } | 5505 Label* check_maps() { return &check_maps_; } |
5505 virtual LInstruction* instr() OVERRIDE { return instr_; } | 5506 LInstruction* instr() OVERRIDE { return instr_; } |
| 5507 |
5506 private: | 5508 private: |
5507 LCheckMaps* instr_; | 5509 LCheckMaps* instr_; |
5508 Label check_maps_; | 5510 Label check_maps_; |
5509 Register object_; | 5511 Register object_; |
5510 }; | 5512 }; |
5511 | 5513 |
5512 if (instr->hydrogen()->IsStabilityCheck()) { | 5514 if (instr->hydrogen()->IsStabilityCheck()) { |
5513 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5515 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
5514 for (int i = 0; i < maps->size(); ++i) { | 5516 for (int i = 0; i < maps->size(); ++i) { |
5515 AddStabilityDependency(maps->at(i).handle()); | 5517 AddStabilityDependency(maps->at(i).handle()); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5714 } | 5716 } |
5715 | 5717 |
5716 | 5718 |
5717 void LCodeGen::DoAllocate(LAllocate* instr) { | 5719 void LCodeGen::DoAllocate(LAllocate* instr) { |
5718 class DeferredAllocate FINAL : public LDeferredCode { | 5720 class DeferredAllocate FINAL : public LDeferredCode { |
5719 public: | 5721 public: |
5720 DeferredAllocate(LCodeGen* codegen, | 5722 DeferredAllocate(LCodeGen* codegen, |
5721 LAllocate* instr, | 5723 LAllocate* instr, |
5722 const X87Stack& x87_stack) | 5724 const X87Stack& x87_stack) |
5723 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5725 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
5724 virtual void Generate() OVERRIDE { | 5726 void Generate() OVERRIDE { codegen()->DoDeferredAllocate(instr_); } |
5725 codegen()->DoDeferredAllocate(instr_); | 5727 LInstruction* instr() OVERRIDE { return instr_; } |
5726 } | 5728 |
5727 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
5728 private: | 5729 private: |
5729 LAllocate* instr_; | 5730 LAllocate* instr_; |
5730 }; | 5731 }; |
5731 | 5732 |
5732 DeferredAllocate* deferred = | 5733 DeferredAllocate* deferred = |
5733 new(zone()) DeferredAllocate(this, instr, x87_stack_); | 5734 new(zone()) DeferredAllocate(this, instr, x87_stack_); |
5734 | 5735 |
5735 Register result = ToRegister(instr->result()); | 5736 Register result = ToRegister(instr->result()); |
5736 Register temp = ToRegister(instr->temp()); | 5737 Register temp = ToRegister(instr->temp()); |
5737 | 5738 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6083 } | 6084 } |
6084 | 6085 |
6085 | 6086 |
6086 void LCodeGen::DoStackCheck(LStackCheck* instr) { | 6087 void LCodeGen::DoStackCheck(LStackCheck* instr) { |
6087 class DeferredStackCheck FINAL : public LDeferredCode { | 6088 class DeferredStackCheck FINAL : public LDeferredCode { |
6088 public: | 6089 public: |
6089 DeferredStackCheck(LCodeGen* codegen, | 6090 DeferredStackCheck(LCodeGen* codegen, |
6090 LStackCheck* instr, | 6091 LStackCheck* instr, |
6091 const X87Stack& x87_stack) | 6092 const X87Stack& x87_stack) |
6092 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 6093 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
6093 virtual void Generate() OVERRIDE { | 6094 void Generate() OVERRIDE { codegen()->DoDeferredStackCheck(instr_); } |
6094 codegen()->DoDeferredStackCheck(instr_); | 6095 LInstruction* instr() OVERRIDE { return instr_; } |
6095 } | 6096 |
6096 virtual LInstruction* instr() OVERRIDE { return instr_; } | |
6097 private: | 6097 private: |
6098 LStackCheck* instr_; | 6098 LStackCheck* instr_; |
6099 }; | 6099 }; |
6100 | 6100 |
6101 DCHECK(instr->HasEnvironment()); | 6101 DCHECK(instr->HasEnvironment()); |
6102 LEnvironment* env = instr->environment(); | 6102 LEnvironment* env = instr->environment(); |
6103 // There is no LLazyBailout instruction for stack-checks. We have to | 6103 // There is no LLazyBailout instruction for stack-checks. We have to |
6104 // prepare for lazy deoptimization explicitly here. | 6104 // prepare for lazy deoptimization explicitly here. |
6105 if (instr->hydrogen()->is_function_entry()) { | 6105 if (instr->hydrogen()->is_function_entry()) { |
6106 // Perform stack overflow check. | 6106 // Perform stack overflow check. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6234 DeferredLoadMutableDouble(LCodeGen* codegen, | 6234 DeferredLoadMutableDouble(LCodeGen* codegen, |
6235 LLoadFieldByIndex* instr, | 6235 LLoadFieldByIndex* instr, |
6236 Register object, | 6236 Register object, |
6237 Register index, | 6237 Register index, |
6238 const X87Stack& x87_stack) | 6238 const X87Stack& x87_stack) |
6239 : LDeferredCode(codegen, x87_stack), | 6239 : LDeferredCode(codegen, x87_stack), |
6240 instr_(instr), | 6240 instr_(instr), |
6241 object_(object), | 6241 object_(object), |
6242 index_(index) { | 6242 index_(index) { |
6243 } | 6243 } |
6244 virtual void Generate() OVERRIDE { | 6244 void Generate() OVERRIDE { |
6245 codegen()->DoDeferredLoadMutableDouble(instr_, object_, index_); | 6245 codegen()->DoDeferredLoadMutableDouble(instr_, object_, index_); |
6246 } | 6246 } |
6247 virtual LInstruction* instr() OVERRIDE { return instr_; } | 6247 LInstruction* instr() OVERRIDE { return instr_; } |
| 6248 |
6248 private: | 6249 private: |
6249 LLoadFieldByIndex* instr_; | 6250 LLoadFieldByIndex* instr_; |
6250 Register object_; | 6251 Register object_; |
6251 Register index_; | 6252 Register index_; |
6252 }; | 6253 }; |
6253 | 6254 |
6254 Register object = ToRegister(instr->object()); | 6255 Register object = ToRegister(instr->object()); |
6255 Register index = ToRegister(instr->index()); | 6256 Register index = ToRegister(instr->index()); |
6256 | 6257 |
6257 DeferredLoadMutableDouble* deferred; | 6258 DeferredLoadMutableDouble* deferred; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6298 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6299 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6299 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6300 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6300 } | 6301 } |
6301 | 6302 |
6302 | 6303 |
6303 #undef __ | 6304 #undef __ |
6304 | 6305 |
6305 } } // namespace v8::internal | 6306 } } // namespace v8::internal |
6306 | 6307 |
6307 #endif // V8_TARGET_ARCH_X87 | 6308 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |