OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 ++jsframe_count; | 592 ++jsframe_count; |
593 } | 593 } |
594 } | 594 } |
595 Translation translation(&translations_, frame_count, jsframe_count, zone()); | 595 Translation translation(&translations_, frame_count, jsframe_count, zone()); |
596 WriteTranslation(environment, &translation); | 596 WriteTranslation(environment, &translation); |
597 int deoptimization_index = deoptimizations_.length(); | 597 int deoptimization_index = deoptimizations_.length(); |
598 int pc_offset = masm()->pc_offset(); | 598 int pc_offset = masm()->pc_offset(); |
599 environment->Register(deoptimization_index, | 599 environment->Register(deoptimization_index, |
600 translation.index(), | 600 translation.index(), |
601 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); | 601 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); |
602 deoptimizations_.Add(environment); | 602 deoptimizations_.Add(environment, zone()); |
603 } | 603 } |
604 } | 604 } |
605 | 605 |
606 | 606 |
607 void LCodeGen::DeoptimizeIf(Condition cc, | 607 void LCodeGen::DeoptimizeIf(Condition cc, |
608 LEnvironment* environment, | 608 LEnvironment* environment, |
609 Register src1, | 609 Register src1, |
610 const Operand& src2) { | 610 const Operand& src2) { |
611 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 611 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
612 ASSERT(environment->HasBeenRegistered()); | 612 ASSERT(environment->HasBeenRegistered()); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 } | 671 } |
672 code->set_deoptimization_data(*data); | 672 code->set_deoptimization_data(*data); |
673 } | 673 } |
674 | 674 |
675 | 675 |
676 int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) { | 676 int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) { |
677 int result = deoptimization_literals_.length(); | 677 int result = deoptimization_literals_.length(); |
678 for (int i = 0; i < deoptimization_literals_.length(); ++i) { | 678 for (int i = 0; i < deoptimization_literals_.length(); ++i) { |
679 if (deoptimization_literals_[i].is_identical_to(literal)) return i; | 679 if (deoptimization_literals_[i].is_identical_to(literal)) return i; |
680 } | 680 } |
681 deoptimization_literals_.Add(literal); | 681 deoptimization_literals_.Add(literal, zone()); |
682 return result; | 682 return result; |
683 } | 683 } |
684 | 684 |
685 | 685 |
686 void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() { | 686 void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() { |
687 ASSERT(deoptimization_literals_.length() == 0); | 687 ASSERT(deoptimization_literals_.length() == 0); |
688 | 688 |
689 const ZoneList<Handle<JSFunction> >* inlined_closures = | 689 const ZoneList<Handle<JSFunction> >* inlined_closures = |
690 chunk()->inlined_closures(); | 690 chunk()->inlined_closures(); |
691 | 691 |
(...skipping 27 matching lines...) Expand all Loading... |
719 ASSERT(expected_safepoint_kind_ == kind); | 719 ASSERT(expected_safepoint_kind_ == kind); |
720 | 720 |
721 const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands(); | 721 const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands(); |
722 Safepoint safepoint = safepoints_.DefineSafepoint(masm(), | 722 Safepoint safepoint = safepoints_.DefineSafepoint(masm(), |
723 kind, arguments, deopt_mode); | 723 kind, arguments, deopt_mode); |
724 for (int i = 0; i < operands->length(); i++) { | 724 for (int i = 0; i < operands->length(); i++) { |
725 LOperand* pointer = operands->at(i); | 725 LOperand* pointer = operands->at(i); |
726 if (pointer->IsStackSlot()) { | 726 if (pointer->IsStackSlot()) { |
727 safepoint.DefinePointerSlot(pointer->index(), zone()); | 727 safepoint.DefinePointerSlot(pointer->index(), zone()); |
728 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { | 728 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { |
729 safepoint.DefinePointerRegister(ToRegister(pointer)); | 729 safepoint.DefinePointerRegister(ToRegister(pointer), zone()); |
730 } | 730 } |
731 } | 731 } |
732 if (kind & Safepoint::kWithRegisters) { | 732 if (kind & Safepoint::kWithRegisters) { |
733 // Register cp always contains a pointer to the context. | 733 // Register cp always contains a pointer to the context. |
734 safepoint.DefinePointerRegister(cp); | 734 safepoint.DefinePointerRegister(cp, zone()); |
735 } | 735 } |
736 } | 736 } |
737 | 737 |
738 | 738 |
739 void LCodeGen::RecordSafepoint(LPointerMap* pointers, | 739 void LCodeGen::RecordSafepoint(LPointerMap* pointers, |
740 Safepoint::DeoptMode deopt_mode) { | 740 Safepoint::DeoptMode deopt_mode) { |
741 RecordSafepoint(pointers, Safepoint::kSimple, 0, deopt_mode); | 741 RecordSafepoint(pointers, Safepoint::kSimple, 0, deopt_mode); |
742 } | 742 } |
743 | 743 |
744 | 744 |
745 void LCodeGen::RecordSafepoint(Safepoint::DeoptMode deopt_mode) { | 745 void LCodeGen::RecordSafepoint(Safepoint::DeoptMode deopt_mode) { |
746 LPointerMap empty_pointers(RelocInfo::kNoPosition); | 746 LPointerMap empty_pointers(RelocInfo::kNoPosition, zone()); |
747 RecordSafepoint(&empty_pointers, deopt_mode); | 747 RecordSafepoint(&empty_pointers, deopt_mode); |
748 } | 748 } |
749 | 749 |
750 | 750 |
751 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, | 751 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, |
752 int arguments, | 752 int arguments, |
753 Safepoint::DeoptMode deopt_mode) { | 753 Safepoint::DeoptMode deopt_mode) { |
754 RecordSafepoint( | 754 RecordSafepoint( |
755 pointers, Safepoint::kWithRegisters, arguments, deopt_mode); | 755 pointers, Safepoint::kWithRegisters, arguments, deopt_mode); |
756 } | 756 } |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2037 } | 2037 } |
2038 virtual LInstruction* instr() { return instr_; } | 2038 virtual LInstruction* instr() { return instr_; } |
2039 Label* map_check() { return &map_check_; } | 2039 Label* map_check() { return &map_check_; } |
2040 | 2040 |
2041 private: | 2041 private: |
2042 LInstanceOfKnownGlobal* instr_; | 2042 LInstanceOfKnownGlobal* instr_; |
2043 Label map_check_; | 2043 Label map_check_; |
2044 }; | 2044 }; |
2045 | 2045 |
2046 DeferredInstanceOfKnownGlobal* deferred; | 2046 DeferredInstanceOfKnownGlobal* deferred; |
2047 deferred = new DeferredInstanceOfKnownGlobal(this, instr); | 2047 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
2048 | 2048 |
2049 Label done, false_result; | 2049 Label done, false_result; |
2050 Register object = ToRegister(instr->InputAt(0)); | 2050 Register object = ToRegister(instr->InputAt(0)); |
2051 Register temp = ToRegister(instr->TempAt(0)); | 2051 Register temp = ToRegister(instr->TempAt(0)); |
2052 Register result = ToRegister(instr->result()); | 2052 Register result = ToRegister(instr->result()); |
2053 | 2053 |
2054 ASSERT(object.is(a0)); | 2054 ASSERT(object.is(a0)); |
2055 ASSERT(result.is(v0)); | 2055 ASSERT(result.is(v0)); |
2056 | 2056 |
2057 // A Smi is not instance of anything. | 2057 // A Smi is not instance of anything. |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3018 Representation r = instr->hydrogen()->value()->representation(); | 3018 Representation r = instr->hydrogen()->value()->representation(); |
3019 if (r.IsDouble()) { | 3019 if (r.IsDouble()) { |
3020 FPURegister input = ToDoubleRegister(instr->InputAt(0)); | 3020 FPURegister input = ToDoubleRegister(instr->InputAt(0)); |
3021 FPURegister result = ToDoubleRegister(instr->result()); | 3021 FPURegister result = ToDoubleRegister(instr->result()); |
3022 __ abs_d(result, input); | 3022 __ abs_d(result, input); |
3023 } else if (r.IsInteger32()) { | 3023 } else if (r.IsInteger32()) { |
3024 EmitIntegerMathAbs(instr); | 3024 EmitIntegerMathAbs(instr); |
3025 } else { | 3025 } else { |
3026 // Representation is tagged. | 3026 // Representation is tagged. |
3027 DeferredMathAbsTaggedHeapNumber* deferred = | 3027 DeferredMathAbsTaggedHeapNumber* deferred = |
3028 new DeferredMathAbsTaggedHeapNumber(this, instr); | 3028 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); |
3029 Register input = ToRegister(instr->InputAt(0)); | 3029 Register input = ToRegister(instr->InputAt(0)); |
3030 // Smi check. | 3030 // Smi check. |
3031 __ JumpIfNotSmi(input, deferred->entry()); | 3031 __ JumpIfNotSmi(input, deferred->entry()); |
3032 // If smi, handle it directly. | 3032 // If smi, handle it directly. |
3033 EmitIntegerMathAbs(instr); | 3033 EmitIntegerMathAbs(instr); |
3034 __ bind(deferred->exit()); | 3034 __ bind(deferred->exit()); |
3035 } | 3035 } |
3036 } | 3036 } |
3037 | 3037 |
3038 | 3038 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3209 class DeferredDoRandom: public LDeferredCode { | 3209 class DeferredDoRandom: public LDeferredCode { |
3210 public: | 3210 public: |
3211 DeferredDoRandom(LCodeGen* codegen, LRandom* instr) | 3211 DeferredDoRandom(LCodeGen* codegen, LRandom* instr) |
3212 : LDeferredCode(codegen), instr_(instr) { } | 3212 : LDeferredCode(codegen), instr_(instr) { } |
3213 virtual void Generate() { codegen()->DoDeferredRandom(instr_); } | 3213 virtual void Generate() { codegen()->DoDeferredRandom(instr_); } |
3214 virtual LInstruction* instr() { return instr_; } | 3214 virtual LInstruction* instr() { return instr_; } |
3215 private: | 3215 private: |
3216 LRandom* instr_; | 3216 LRandom* instr_; |
3217 }; | 3217 }; |
3218 | 3218 |
3219 DeferredDoRandom* deferred = new DeferredDoRandom(this, instr); | 3219 DeferredDoRandom* deferred = new(zone()) DeferredDoRandom(this, instr); |
3220 // Having marked this instruction as a call we can use any | 3220 // Having marked this instruction as a call we can use any |
3221 // registers. | 3221 // registers. |
3222 ASSERT(ToDoubleRegister(instr->result()).is(f0)); | 3222 ASSERT(ToDoubleRegister(instr->result()).is(f0)); |
3223 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); | 3223 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); |
3224 | 3224 |
3225 static const int kSeedSize = sizeof(uint32_t); | 3225 static const int kSeedSize = sizeof(uint32_t); |
3226 STATIC_ASSERT(kPointerSize == kSeedSize); | 3226 STATIC_ASSERT(kPointerSize == kSeedSize); |
3227 | 3227 |
3228 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalContextOffset)); | 3228 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalContextOffset)); |
3229 static const int kRandomSeedOffset = | 3229 static const int kRandomSeedOffset = |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3770 public: | 3770 public: |
3771 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 3771 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
3772 : LDeferredCode(codegen), instr_(instr) { } | 3772 : LDeferredCode(codegen), instr_(instr) { } |
3773 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } | 3773 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } |
3774 virtual LInstruction* instr() { return instr_; } | 3774 virtual LInstruction* instr() { return instr_; } |
3775 private: | 3775 private: |
3776 LStringCharCodeAt* instr_; | 3776 LStringCharCodeAt* instr_; |
3777 }; | 3777 }; |
3778 | 3778 |
3779 DeferredStringCharCodeAt* deferred = | 3779 DeferredStringCharCodeAt* deferred = |
3780 new DeferredStringCharCodeAt(this, instr); | 3780 new(zone()) DeferredStringCharCodeAt(this, instr); |
3781 StringCharLoadGenerator::Generate(masm(), | 3781 StringCharLoadGenerator::Generate(masm(), |
3782 ToRegister(instr->string()), | 3782 ToRegister(instr->string()), |
3783 ToRegister(instr->index()), | 3783 ToRegister(instr->index()), |
3784 ToRegister(instr->result()), | 3784 ToRegister(instr->result()), |
3785 deferred->entry()); | 3785 deferred->entry()); |
3786 __ bind(deferred->exit()); | 3786 __ bind(deferred->exit()); |
3787 } | 3787 } |
3788 | 3788 |
3789 | 3789 |
3790 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { | 3790 void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3824 public: | 3824 public: |
3825 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 3825 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
3826 : LDeferredCode(codegen), instr_(instr) { } | 3826 : LDeferredCode(codegen), instr_(instr) { } |
3827 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } | 3827 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } |
3828 virtual LInstruction* instr() { return instr_; } | 3828 virtual LInstruction* instr() { return instr_; } |
3829 private: | 3829 private: |
3830 LStringCharFromCode* instr_; | 3830 LStringCharFromCode* instr_; |
3831 }; | 3831 }; |
3832 | 3832 |
3833 DeferredStringCharFromCode* deferred = | 3833 DeferredStringCharFromCode* deferred = |
3834 new DeferredStringCharFromCode(this, instr); | 3834 new(zone()) DeferredStringCharFromCode(this, instr); |
3835 | 3835 |
3836 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); | 3836 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); |
3837 Register char_code = ToRegister(instr->char_code()); | 3837 Register char_code = ToRegister(instr->char_code()); |
3838 Register result = ToRegister(instr->result()); | 3838 Register result = ToRegister(instr->result()); |
3839 Register scratch = scratch0(); | 3839 Register scratch = scratch0(); |
3840 ASSERT(!char_code.is(result)); | 3840 ASSERT(!char_code.is(result)); |
3841 | 3841 |
3842 __ Branch(deferred->entry(), hi, | 3842 __ Branch(deferred->entry(), hi, |
3843 char_code, Operand(String::kMaxAsciiCharCode)); | 3843 char_code, Operand(String::kMaxAsciiCharCode)); |
3844 __ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex); | 3844 __ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3900 virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); } | 3900 virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); } |
3901 virtual LInstruction* instr() { return instr_; } | 3901 virtual LInstruction* instr() { return instr_; } |
3902 private: | 3902 private: |
3903 LNumberTagI* instr_; | 3903 LNumberTagI* instr_; |
3904 }; | 3904 }; |
3905 | 3905 |
3906 Register src = ToRegister(instr->InputAt(0)); | 3906 Register src = ToRegister(instr->InputAt(0)); |
3907 Register dst = ToRegister(instr->result()); | 3907 Register dst = ToRegister(instr->result()); |
3908 Register overflow = scratch0(); | 3908 Register overflow = scratch0(); |
3909 | 3909 |
3910 DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr); | 3910 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); |
3911 __ SmiTagCheckOverflow(dst, src, overflow); | 3911 __ SmiTagCheckOverflow(dst, src, overflow); |
3912 __ BranchOnOverflow(deferred->entry(), overflow); | 3912 __ BranchOnOverflow(deferred->entry(), overflow); |
3913 __ bind(deferred->exit()); | 3913 __ bind(deferred->exit()); |
3914 } | 3914 } |
3915 | 3915 |
3916 | 3916 |
3917 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { | 3917 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { |
3918 Label slow; | 3918 Label slow; |
3919 Register src = ToRegister(instr->InputAt(0)); | 3919 Register src = ToRegister(instr->InputAt(0)); |
3920 Register dst = ToRegister(instr->result()); | 3920 Register dst = ToRegister(instr->result()); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3968 private: | 3968 private: |
3969 LNumberTagD* instr_; | 3969 LNumberTagD* instr_; |
3970 }; | 3970 }; |
3971 | 3971 |
3972 DoubleRegister input_reg = ToDoubleRegister(instr->InputAt(0)); | 3972 DoubleRegister input_reg = ToDoubleRegister(instr->InputAt(0)); |
3973 Register scratch = scratch0(); | 3973 Register scratch = scratch0(); |
3974 Register reg = ToRegister(instr->result()); | 3974 Register reg = ToRegister(instr->result()); |
3975 Register temp1 = ToRegister(instr->TempAt(0)); | 3975 Register temp1 = ToRegister(instr->TempAt(0)); |
3976 Register temp2 = ToRegister(instr->TempAt(1)); | 3976 Register temp2 = ToRegister(instr->TempAt(1)); |
3977 | 3977 |
3978 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr); | 3978 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
3979 if (FLAG_inline_new) { | 3979 if (FLAG_inline_new) { |
3980 __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex); | 3980 __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex); |
3981 __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry()); | 3981 __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry()); |
3982 } else { | 3982 } else { |
3983 __ Branch(deferred->entry()); | 3983 __ Branch(deferred->entry()); |
3984 } | 3984 } |
3985 __ bind(deferred->exit()); | 3985 __ bind(deferred->exit()); |
3986 __ sdc1(input_reg, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 3986 __ sdc1(input_reg, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
3987 } | 3987 } |
3988 | 3988 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4162 private: | 4162 private: |
4163 LTaggedToI* instr_; | 4163 LTaggedToI* instr_; |
4164 }; | 4164 }; |
4165 | 4165 |
4166 LOperand* input = instr->InputAt(0); | 4166 LOperand* input = instr->InputAt(0); |
4167 ASSERT(input->IsRegister()); | 4167 ASSERT(input->IsRegister()); |
4168 ASSERT(input->Equals(instr->result())); | 4168 ASSERT(input->Equals(instr->result())); |
4169 | 4169 |
4170 Register input_reg = ToRegister(input); | 4170 Register input_reg = ToRegister(input); |
4171 | 4171 |
4172 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr); | 4172 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); |
4173 | 4173 |
4174 // Let the deferred code handle the HeapObject case. | 4174 // Let the deferred code handle the HeapObject case. |
4175 __ JumpIfNotSmi(input_reg, deferred->entry()); | 4175 __ JumpIfNotSmi(input_reg, deferred->entry()); |
4176 | 4176 |
4177 // Smi to int32 conversion. | 4177 // Smi to int32 conversion. |
4178 __ SmiUntag(input_reg); | 4178 __ SmiUntag(input_reg); |
4179 __ bind(deferred->exit()); | 4179 __ bind(deferred->exit()); |
4180 } | 4180 } |
4181 | 4181 |
4182 | 4182 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4413 class DeferredAllocateObject: public LDeferredCode { | 4413 class DeferredAllocateObject: public LDeferredCode { |
4414 public: | 4414 public: |
4415 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 4415 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
4416 : LDeferredCode(codegen), instr_(instr) { } | 4416 : LDeferredCode(codegen), instr_(instr) { } |
4417 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 4417 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
4418 virtual LInstruction* instr() { return instr_; } | 4418 virtual LInstruction* instr() { return instr_; } |
4419 private: | 4419 private: |
4420 LAllocateObject* instr_; | 4420 LAllocateObject* instr_; |
4421 }; | 4421 }; |
4422 | 4422 |
4423 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr); | 4423 DeferredAllocateObject* deferred = |
| 4424 new(zone()) DeferredAllocateObject(this, instr); |
4424 | 4425 |
4425 Register result = ToRegister(instr->result()); | 4426 Register result = ToRegister(instr->result()); |
4426 Register scratch = ToRegister(instr->TempAt(0)); | 4427 Register scratch = ToRegister(instr->TempAt(0)); |
4427 Register scratch2 = ToRegister(instr->TempAt(1)); | 4428 Register scratch2 = ToRegister(instr->TempAt(1)); |
4428 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); | 4429 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); |
4429 Handle<Map> initial_map(constructor->initial_map()); | 4430 Handle<Map> initial_map(constructor->initial_map()); |
4430 int instance_size = initial_map->instance_size(); | 4431 int instance_size = initial_map->instance_size(); |
4431 ASSERT(initial_map->pre_allocated_property_fields() + | 4432 ASSERT(initial_map->pre_allocated_property_fields() + |
4432 initial_map->unused_property_fields() - | 4433 initial_map->unused_property_fields() - |
4433 initial_map->inobject_properties() == 0); | 4434 initial_map->inobject_properties() == 0); |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5058 StackCheckStub stub; | 5059 StackCheckStub stub; |
5059 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 5060 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
5060 EnsureSpaceForLazyDeopt(); | 5061 EnsureSpaceForLazyDeopt(); |
5061 __ bind(&done); | 5062 __ bind(&done); |
5062 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 5063 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
5063 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5064 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
5064 } else { | 5065 } else { |
5065 ASSERT(instr->hydrogen()->is_backwards_branch()); | 5066 ASSERT(instr->hydrogen()->is_backwards_branch()); |
5066 // Perform stack overflow check if this goto needs it before jumping. | 5067 // Perform stack overflow check if this goto needs it before jumping. |
5067 DeferredStackCheck* deferred_stack_check = | 5068 DeferredStackCheck* deferred_stack_check = |
5068 new DeferredStackCheck(this, instr); | 5069 new(zone()) DeferredStackCheck(this, instr); |
5069 __ LoadRoot(at, Heap::kStackLimitRootIndex); | 5070 __ LoadRoot(at, Heap::kStackLimitRootIndex); |
5070 __ Branch(deferred_stack_check->entry(), lo, sp, Operand(at)); | 5071 __ Branch(deferred_stack_check->entry(), lo, sp, Operand(at)); |
5071 EnsureSpaceForLazyDeopt(); | 5072 EnsureSpaceForLazyDeopt(); |
5072 __ bind(instr->done_label()); | 5073 __ bind(instr->done_label()); |
5073 deferred_stack_check->SetExit(instr->done_label()); | 5074 deferred_stack_check->SetExit(instr->done_label()); |
5074 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 5075 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
5075 // Don't record a deoptimization index for the safepoint here. | 5076 // Don't record a deoptimization index for the safepoint here. |
5076 // This will be done explicitly when emitting call and the safepoint in | 5077 // This will be done explicitly when emitting call and the safepoint in |
5077 // the deferred code. | 5078 // the deferred code. |
5078 } | 5079 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5175 __ Subu(scratch, result, scratch); | 5176 __ Subu(scratch, result, scratch); |
5176 __ lw(result, FieldMemOperand(scratch, | 5177 __ lw(result, FieldMemOperand(scratch, |
5177 FixedArray::kHeaderSize - kPointerSize)); | 5178 FixedArray::kHeaderSize - kPointerSize)); |
5178 __ bind(&done); | 5179 __ bind(&done); |
5179 } | 5180 } |
5180 | 5181 |
5181 | 5182 |
5182 #undef __ | 5183 #undef __ |
5183 | 5184 |
5184 } } // namespace v8::internal | 5185 } } // namespace v8::internal |
OLD | NEW |