| 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 Translation translation(&translations_, frame_count, jsframe_count, | 539 Translation translation(&translations_, frame_count, jsframe_count, |
| 540 zone()); | 540 zone()); |
| 541 WriteTranslation(environment, &translation); | 541 WriteTranslation(environment, &translation); |
| 542 int deoptimization_index = deoptimizations_.length(); | 542 int deoptimization_index = deoptimizations_.length(); |
| 543 int pc_offset = masm()->pc_offset(); | 543 int pc_offset = masm()->pc_offset(); |
| 544 environment->Register(deoptimization_index, | 544 environment->Register(deoptimization_index, |
| 545 translation.index(), | 545 translation.index(), |
| 546 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); | 546 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); |
| 547 deoptimizations_.Add(environment); | 547 deoptimizations_.Add(environment, zone()); |
| 548 } | 548 } |
| 549 } | 549 } |
| 550 | 550 |
| 551 | 551 |
| 552 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { | 552 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { |
| 553 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 553 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 554 ASSERT(environment->HasBeenRegistered()); | 554 ASSERT(environment->HasBeenRegistered()); |
| 555 int id = environment->deoptimization_index(); | 555 int id = environment->deoptimization_index(); |
| 556 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); | 556 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); |
| 557 if (entry == NULL) { | 557 if (entry == NULL) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } | 632 } |
| 633 code->set_deoptimization_data(*data); | 633 code->set_deoptimization_data(*data); |
| 634 } | 634 } |
| 635 | 635 |
| 636 | 636 |
| 637 int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) { | 637 int LCodeGen::DefineDeoptimizationLiteral(Handle<Object> literal) { |
| 638 int result = deoptimization_literals_.length(); | 638 int result = deoptimization_literals_.length(); |
| 639 for (int i = 0; i < deoptimization_literals_.length(); ++i) { | 639 for (int i = 0; i < deoptimization_literals_.length(); ++i) { |
| 640 if (deoptimization_literals_[i].is_identical_to(literal)) return i; | 640 if (deoptimization_literals_[i].is_identical_to(literal)) return i; |
| 641 } | 641 } |
| 642 deoptimization_literals_.Add(literal); | 642 deoptimization_literals_.Add(literal, zone()); |
| 643 return result; | 643 return result; |
| 644 } | 644 } |
| 645 | 645 |
| 646 | 646 |
| 647 void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() { | 647 void LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions() { |
| 648 ASSERT(deoptimization_literals_.length() == 0); | 648 ASSERT(deoptimization_literals_.length() == 0); |
| 649 | 649 |
| 650 const ZoneList<Handle<JSFunction> >* inlined_closures = | 650 const ZoneList<Handle<JSFunction> >* inlined_closures = |
| 651 chunk()->inlined_closures(); | 651 chunk()->inlined_closures(); |
| 652 | 652 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 679 Safepoint::DeoptMode deopt_mode) { | 679 Safepoint::DeoptMode deopt_mode) { |
| 680 ASSERT(kind == expected_safepoint_kind_); | 680 ASSERT(kind == expected_safepoint_kind_); |
| 681 const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands(); | 681 const ZoneList<LOperand*>* operands = pointers->GetNormalizedOperands(); |
| 682 Safepoint safepoint = | 682 Safepoint safepoint = |
| 683 safepoints_.DefineSafepoint(masm(), kind, arguments, deopt_mode); | 683 safepoints_.DefineSafepoint(masm(), kind, arguments, deopt_mode); |
| 684 for (int i = 0; i < operands->length(); i++) { | 684 for (int i = 0; i < operands->length(); i++) { |
| 685 LOperand* pointer = operands->at(i); | 685 LOperand* pointer = operands->at(i); |
| 686 if (pointer->IsStackSlot()) { | 686 if (pointer->IsStackSlot()) { |
| 687 safepoint.DefinePointerSlot(pointer->index(), zone()); | 687 safepoint.DefinePointerSlot(pointer->index(), zone()); |
| 688 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { | 688 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { |
| 689 safepoint.DefinePointerRegister(ToRegister(pointer)); | 689 safepoint.DefinePointerRegister(ToRegister(pointer), zone()); |
| 690 } | 690 } |
| 691 } | 691 } |
| 692 } | 692 } |
| 693 | 693 |
| 694 | 694 |
| 695 void LCodeGen::RecordSafepoint(LPointerMap* pointers, | 695 void LCodeGen::RecordSafepoint(LPointerMap* pointers, |
| 696 Safepoint::DeoptMode mode) { | 696 Safepoint::DeoptMode mode) { |
| 697 RecordSafepoint(pointers, Safepoint::kSimple, 0, mode); | 697 RecordSafepoint(pointers, Safepoint::kSimple, 0, mode); |
| 698 } | 698 } |
| 699 | 699 |
| 700 | 700 |
| 701 void LCodeGen::RecordSafepoint(Safepoint::DeoptMode mode) { | 701 void LCodeGen::RecordSafepoint(Safepoint::DeoptMode mode) { |
| 702 LPointerMap empty_pointers(RelocInfo::kNoPosition); | 702 LPointerMap empty_pointers(RelocInfo::kNoPosition, zone()); |
| 703 RecordSafepoint(&empty_pointers, mode); | 703 RecordSafepoint(&empty_pointers, mode); |
| 704 } | 704 } |
| 705 | 705 |
| 706 | 706 |
| 707 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, | 707 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, |
| 708 int arguments, | 708 int arguments, |
| 709 Safepoint::DeoptMode mode) { | 709 Safepoint::DeoptMode mode) { |
| 710 RecordSafepoint(pointers, Safepoint::kWithRegisters, arguments, mode); | 710 RecordSafepoint(pointers, Safepoint::kWithRegisters, arguments, mode); |
| 711 } | 711 } |
| 712 | 712 |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); | 1978 codegen()->DoDeferredInstanceOfKnownGlobal(instr_, &map_check_); |
| 1979 } | 1979 } |
| 1980 virtual LInstruction* instr() { return instr_; } | 1980 virtual LInstruction* instr() { return instr_; } |
| 1981 Label* map_check() { return &map_check_; } | 1981 Label* map_check() { return &map_check_; } |
| 1982 private: | 1982 private: |
| 1983 LInstanceOfKnownGlobal* instr_; | 1983 LInstanceOfKnownGlobal* instr_; |
| 1984 Label map_check_; | 1984 Label map_check_; |
| 1985 }; | 1985 }; |
| 1986 | 1986 |
| 1987 DeferredInstanceOfKnownGlobal* deferred; | 1987 DeferredInstanceOfKnownGlobal* deferred; |
| 1988 deferred = new DeferredInstanceOfKnownGlobal(this, instr); | 1988 deferred = new(zone()) DeferredInstanceOfKnownGlobal(this, instr); |
| 1989 | 1989 |
| 1990 Label done, false_result; | 1990 Label done, false_result; |
| 1991 Register object = ToRegister(instr->InputAt(1)); | 1991 Register object = ToRegister(instr->InputAt(1)); |
| 1992 Register temp = ToRegister(instr->TempAt(0)); | 1992 Register temp = ToRegister(instr->TempAt(0)); |
| 1993 | 1993 |
| 1994 // A Smi is not an instance of anything. | 1994 // A Smi is not an instance of anything. |
| 1995 __ JumpIfSmi(object, &false_result); | 1995 __ JumpIfSmi(object, &false_result); |
| 1996 | 1996 |
| 1997 // This is the inlined call site instanceof cache. The two occurences of the | 1997 // This is the inlined call site instanceof cache. The two occurences of the |
| 1998 // hole value will be patched to the last map/result pair generated by the | 1998 // hole value will be patched to the last map/result pair generated by the |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2901 if (r.IsDouble()) { | 2901 if (r.IsDouble()) { |
| 2902 XMMRegister scratch = xmm0; | 2902 XMMRegister scratch = xmm0; |
| 2903 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 2903 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
| 2904 __ xorps(scratch, scratch); | 2904 __ xorps(scratch, scratch); |
| 2905 __ subsd(scratch, input_reg); | 2905 __ subsd(scratch, input_reg); |
| 2906 __ pand(input_reg, scratch); | 2906 __ pand(input_reg, scratch); |
| 2907 } else if (r.IsInteger32()) { | 2907 } else if (r.IsInteger32()) { |
| 2908 EmitIntegerMathAbs(instr); | 2908 EmitIntegerMathAbs(instr); |
| 2909 } else { // Tagged case. | 2909 } else { // Tagged case. |
| 2910 DeferredMathAbsTaggedHeapNumber* deferred = | 2910 DeferredMathAbsTaggedHeapNumber* deferred = |
| 2911 new DeferredMathAbsTaggedHeapNumber(this, instr); | 2911 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); |
| 2912 Register input_reg = ToRegister(instr->value()); | 2912 Register input_reg = ToRegister(instr->value()); |
| 2913 // Smi check. | 2913 // Smi check. |
| 2914 __ JumpIfNotSmi(input_reg, deferred->entry()); | 2914 __ JumpIfNotSmi(input_reg, deferred->entry()); |
| 2915 EmitIntegerMathAbs(instr); | 2915 EmitIntegerMathAbs(instr); |
| 2916 __ bind(deferred->exit()); | 2916 __ bind(deferred->exit()); |
| 2917 } | 2917 } |
| 2918 } | 2918 } |
| 2919 | 2919 |
| 2920 | 2920 |
| 2921 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { | 2921 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3103 class DeferredDoRandom: public LDeferredCode { | 3103 class DeferredDoRandom: public LDeferredCode { |
| 3104 public: | 3104 public: |
| 3105 DeferredDoRandom(LCodeGen* codegen, LRandom* instr) | 3105 DeferredDoRandom(LCodeGen* codegen, LRandom* instr) |
| 3106 : LDeferredCode(codegen), instr_(instr) { } | 3106 : LDeferredCode(codegen), instr_(instr) { } |
| 3107 virtual void Generate() { codegen()->DoDeferredRandom(instr_); } | 3107 virtual void Generate() { codegen()->DoDeferredRandom(instr_); } |
| 3108 virtual LInstruction* instr() { return instr_; } | 3108 virtual LInstruction* instr() { return instr_; } |
| 3109 private: | 3109 private: |
| 3110 LRandom* instr_; | 3110 LRandom* instr_; |
| 3111 }; | 3111 }; |
| 3112 | 3112 |
| 3113 DeferredDoRandom* deferred = new DeferredDoRandom(this, instr); | 3113 DeferredDoRandom* deferred = new(zone()) DeferredDoRandom(this, instr); |
| 3114 | 3114 |
| 3115 // Having marked this instruction as a call we can use any | 3115 // Having marked this instruction as a call we can use any |
| 3116 // registers. | 3116 // registers. |
| 3117 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); | 3117 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); |
| 3118 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); | 3118 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
| 3119 // Assert that the register size is indeed the size of each seed. | 3119 // Assert that the register size is indeed the size of each seed. |
| 3120 static const int kSeedSize = sizeof(uint32_t); | 3120 static const int kSeedSize = sizeof(uint32_t); |
| 3121 STATIC_ASSERT(kPointerSize == kSeedSize); | 3121 STATIC_ASSERT(kPointerSize == kSeedSize); |
| 3122 | 3122 |
| 3123 __ mov(eax, FieldOperand(eax, GlobalObject::kGlobalContextOffset)); | 3123 __ mov(eax, FieldOperand(eax, GlobalObject::kGlobalContextOffset)); |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3611 public: | 3611 public: |
| 3612 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 3612 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
| 3613 : LDeferredCode(codegen), instr_(instr) { } | 3613 : LDeferredCode(codegen), instr_(instr) { } |
| 3614 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } | 3614 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } |
| 3615 virtual LInstruction* instr() { return instr_; } | 3615 virtual LInstruction* instr() { return instr_; } |
| 3616 private: | 3616 private: |
| 3617 LStringCharCodeAt* instr_; | 3617 LStringCharCodeAt* instr_; |
| 3618 }; | 3618 }; |
| 3619 | 3619 |
| 3620 DeferredStringCharCodeAt* deferred = | 3620 DeferredStringCharCodeAt* deferred = |
| 3621 new DeferredStringCharCodeAt(this, instr); | 3621 new(zone()) DeferredStringCharCodeAt(this, instr); |
| 3622 | 3622 |
| 3623 StringCharLoadGenerator::Generate(masm(), | 3623 StringCharLoadGenerator::Generate(masm(), |
| 3624 factory(), | 3624 factory(), |
| 3625 ToRegister(instr->string()), | 3625 ToRegister(instr->string()), |
| 3626 ToRegister(instr->index()), | 3626 ToRegister(instr->index()), |
| 3627 ToRegister(instr->result()), | 3627 ToRegister(instr->result()), |
| 3628 deferred->entry()); | 3628 deferred->entry()); |
| 3629 __ bind(deferred->exit()); | 3629 __ bind(deferred->exit()); |
| 3630 } | 3630 } |
| 3631 | 3631 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3667 public: | 3667 public: |
| 3668 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 3668 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
| 3669 : LDeferredCode(codegen), instr_(instr) { } | 3669 : LDeferredCode(codegen), instr_(instr) { } |
| 3670 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } | 3670 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } |
| 3671 virtual LInstruction* instr() { return instr_; } | 3671 virtual LInstruction* instr() { return instr_; } |
| 3672 private: | 3672 private: |
| 3673 LStringCharFromCode* instr_; | 3673 LStringCharFromCode* instr_; |
| 3674 }; | 3674 }; |
| 3675 | 3675 |
| 3676 DeferredStringCharFromCode* deferred = | 3676 DeferredStringCharFromCode* deferred = |
| 3677 new DeferredStringCharFromCode(this, instr); | 3677 new(zone()) DeferredStringCharFromCode(this, instr); |
| 3678 | 3678 |
| 3679 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); | 3679 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); |
| 3680 Register char_code = ToRegister(instr->char_code()); | 3680 Register char_code = ToRegister(instr->char_code()); |
| 3681 Register result = ToRegister(instr->result()); | 3681 Register result = ToRegister(instr->result()); |
| 3682 ASSERT(!char_code.is(result)); | 3682 ASSERT(!char_code.is(result)); |
| 3683 | 3683 |
| 3684 __ cmp(char_code, String::kMaxAsciiCharCode); | 3684 __ cmp(char_code, String::kMaxAsciiCharCode); |
| 3685 __ j(above, deferred->entry()); | 3685 __ j(above, deferred->entry()); |
| 3686 __ Set(result, Immediate(factory()->single_character_string_cache())); | 3686 __ Set(result, Immediate(factory()->single_character_string_cache())); |
| 3687 __ mov(result, FieldOperand(result, | 3687 __ mov(result, FieldOperand(result, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3742 virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); } | 3742 virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); } |
| 3743 virtual LInstruction* instr() { return instr_; } | 3743 virtual LInstruction* instr() { return instr_; } |
| 3744 private: | 3744 private: |
| 3745 LNumberTagI* instr_; | 3745 LNumberTagI* instr_; |
| 3746 }; | 3746 }; |
| 3747 | 3747 |
| 3748 LOperand* input = instr->InputAt(0); | 3748 LOperand* input = instr->InputAt(0); |
| 3749 ASSERT(input->IsRegister() && input->Equals(instr->result())); | 3749 ASSERT(input->IsRegister() && input->Equals(instr->result())); |
| 3750 Register reg = ToRegister(input); | 3750 Register reg = ToRegister(input); |
| 3751 | 3751 |
| 3752 DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr); | 3752 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); |
| 3753 __ SmiTag(reg); | 3753 __ SmiTag(reg); |
| 3754 __ j(overflow, deferred->entry()); | 3754 __ j(overflow, deferred->entry()); |
| 3755 __ bind(deferred->exit()); | 3755 __ bind(deferred->exit()); |
| 3756 } | 3756 } |
| 3757 | 3757 |
| 3758 | 3758 |
| 3759 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { | 3759 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { |
| 3760 Label slow; | 3760 Label slow; |
| 3761 Register reg = ToRegister(instr->InputAt(0)); | 3761 Register reg = ToRegister(instr->InputAt(0)); |
| 3762 Register tmp = reg.is(eax) ? ecx : eax; | 3762 Register tmp = reg.is(eax) ? ecx : eax; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3810 virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); } | 3810 virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); } |
| 3811 virtual LInstruction* instr() { return instr_; } | 3811 virtual LInstruction* instr() { return instr_; } |
| 3812 private: | 3812 private: |
| 3813 LNumberTagD* instr_; | 3813 LNumberTagD* instr_; |
| 3814 }; | 3814 }; |
| 3815 | 3815 |
| 3816 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); | 3816 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); |
| 3817 Register reg = ToRegister(instr->result()); | 3817 Register reg = ToRegister(instr->result()); |
| 3818 Register tmp = ToRegister(instr->TempAt(0)); | 3818 Register tmp = ToRegister(instr->TempAt(0)); |
| 3819 | 3819 |
| 3820 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr); | 3820 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
| 3821 if (FLAG_inline_new) { | 3821 if (FLAG_inline_new) { |
| 3822 __ AllocateHeapNumber(reg, tmp, no_reg, deferred->entry()); | 3822 __ AllocateHeapNumber(reg, tmp, no_reg, deferred->entry()); |
| 3823 } else { | 3823 } else { |
| 3824 __ jmp(deferred->entry()); | 3824 __ jmp(deferred->entry()); |
| 3825 } | 3825 } |
| 3826 __ bind(deferred->exit()); | 3826 __ bind(deferred->exit()); |
| 3827 __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), input_reg); | 3827 __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), input_reg); |
| 3828 } | 3828 } |
| 3829 | 3829 |
| 3830 | 3830 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4010 private: | 4010 private: |
| 4011 LTaggedToI* instr_; | 4011 LTaggedToI* instr_; |
| 4012 }; | 4012 }; |
| 4013 | 4013 |
| 4014 LOperand* input = instr->InputAt(0); | 4014 LOperand* input = instr->InputAt(0); |
| 4015 ASSERT(input->IsRegister()); | 4015 ASSERT(input->IsRegister()); |
| 4016 ASSERT(input->Equals(instr->result())); | 4016 ASSERT(input->Equals(instr->result())); |
| 4017 | 4017 |
| 4018 Register input_reg = ToRegister(input); | 4018 Register input_reg = ToRegister(input); |
| 4019 | 4019 |
| 4020 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr); | 4020 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); |
| 4021 | 4021 |
| 4022 // Smi check. | 4022 // Smi check. |
| 4023 __ JumpIfNotSmi(input_reg, deferred->entry()); | 4023 __ JumpIfNotSmi(input_reg, deferred->entry()); |
| 4024 | 4024 |
| 4025 // Smi to int32 conversion | 4025 // Smi to int32 conversion |
| 4026 __ SmiUntag(input_reg); // Untag smi. | 4026 __ SmiUntag(input_reg); // Untag smi. |
| 4027 | 4027 |
| 4028 __ bind(deferred->exit()); | 4028 __ bind(deferred->exit()); |
| 4029 } | 4029 } |
| 4030 | 4030 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4351 class DeferredAllocateObject: public LDeferredCode { | 4351 class DeferredAllocateObject: public LDeferredCode { |
| 4352 public: | 4352 public: |
| 4353 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 4353 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
| 4354 : LDeferredCode(codegen), instr_(instr) { } | 4354 : LDeferredCode(codegen), instr_(instr) { } |
| 4355 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 4355 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
| 4356 virtual LInstruction* instr() { return instr_; } | 4356 virtual LInstruction* instr() { return instr_; } |
| 4357 private: | 4357 private: |
| 4358 LAllocateObject* instr_; | 4358 LAllocateObject* instr_; |
| 4359 }; | 4359 }; |
| 4360 | 4360 |
| 4361 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr); | 4361 DeferredAllocateObject* deferred = |
| 4362 new(zone()) DeferredAllocateObject(this, instr); |
| 4362 | 4363 |
| 4363 Register result = ToRegister(instr->result()); | 4364 Register result = ToRegister(instr->result()); |
| 4364 Register scratch = ToRegister(instr->TempAt(0)); | 4365 Register scratch = ToRegister(instr->TempAt(0)); |
| 4365 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); | 4366 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); |
| 4366 Handle<Map> initial_map(constructor->initial_map()); | 4367 Handle<Map> initial_map(constructor->initial_map()); |
| 4367 int instance_size = initial_map->instance_size(); | 4368 int instance_size = initial_map->instance_size(); |
| 4368 ASSERT(initial_map->pre_allocated_property_fields() + | 4369 ASSERT(initial_map->pre_allocated_property_fields() + |
| 4369 initial_map->unused_property_fields() - | 4370 initial_map->unused_property_fields() - |
| 4370 initial_map->inobject_properties() == 0); | 4371 initial_map->inobject_properties() == 0); |
| 4371 | 4372 |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4966 StackCheckStub stub; | 4967 StackCheckStub stub; |
| 4967 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4968 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4968 EnsureSpaceForLazyDeopt(); | 4969 EnsureSpaceForLazyDeopt(); |
| 4969 __ bind(&done); | 4970 __ bind(&done); |
| 4970 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 4971 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
| 4971 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 4972 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
| 4972 } else { | 4973 } else { |
| 4973 ASSERT(instr->hydrogen()->is_backwards_branch()); | 4974 ASSERT(instr->hydrogen()->is_backwards_branch()); |
| 4974 // Perform stack overflow check if this goto needs it before jumping. | 4975 // Perform stack overflow check if this goto needs it before jumping. |
| 4975 DeferredStackCheck* deferred_stack_check = | 4976 DeferredStackCheck* deferred_stack_check = |
| 4976 new DeferredStackCheck(this, instr); | 4977 new(zone()) DeferredStackCheck(this, instr); |
| 4977 ExternalReference stack_limit = | 4978 ExternalReference stack_limit = |
| 4978 ExternalReference::address_of_stack_limit(isolate()); | 4979 ExternalReference::address_of_stack_limit(isolate()); |
| 4979 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 4980 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
| 4980 __ j(below, deferred_stack_check->entry()); | 4981 __ j(below, deferred_stack_check->entry()); |
| 4981 EnsureSpaceForLazyDeopt(); | 4982 EnsureSpaceForLazyDeopt(); |
| 4982 __ bind(instr->done_label()); | 4983 __ bind(instr->done_label()); |
| 4983 deferred_stack_check->SetExit(instr->done_label()); | 4984 deferred_stack_check->SetExit(instr->done_label()); |
| 4984 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 4985 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
| 4985 // Don't record a deoptimization index for the safepoint here. | 4986 // Don't record a deoptimization index for the safepoint here. |
| 4986 // This will be done explicitly when emitting call and the safepoint in | 4987 // This will be done explicitly when emitting call and the safepoint in |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5096 FixedArray::kHeaderSize - kPointerSize)); | 5097 FixedArray::kHeaderSize - kPointerSize)); |
| 5097 __ bind(&done); | 5098 __ bind(&done); |
| 5098 } | 5099 } |
| 5099 | 5100 |
| 5100 | 5101 |
| 5101 #undef __ | 5102 #undef __ |
| 5102 | 5103 |
| 5103 } } // namespace v8::internal | 5104 } } // namespace v8::internal |
| 5104 | 5105 |
| 5105 #endif // V8_TARGET_ARCH_IA32 | 5106 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |