| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3619 public: | 3619 public: |
| 3620 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 3620 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
| 3621 : LDeferredCode(codegen), instr_(instr) { } | 3621 : LDeferredCode(codegen), instr_(instr) { } |
| 3622 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } | 3622 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } |
| 3623 virtual LInstruction* instr() { return instr_; } | 3623 virtual LInstruction* instr() { return instr_; } |
| 3624 private: | 3624 private: |
| 3625 LStringCharCodeAt* instr_; | 3625 LStringCharCodeAt* instr_; |
| 3626 }; | 3626 }; |
| 3627 | 3627 |
| 3628 DeferredStringCharCodeAt* deferred = | 3628 DeferredStringCharCodeAt* deferred = |
| 3629 new DeferredStringCharCodeAt(this, instr); | 3629 new(zone()) DeferredStringCharCodeAt(this, instr); |
| 3630 | 3630 |
| 3631 StringCharLoadGenerator::Generate(masm(), | 3631 StringCharLoadGenerator::Generate(masm(), |
| 3632 factory(), | 3632 factory(), |
| 3633 ToRegister(instr->string()), | 3633 ToRegister(instr->string()), |
| 3634 ToRegister(instr->index()), | 3634 ToRegister(instr->index()), |
| 3635 ToRegister(instr->result()), | 3635 ToRegister(instr->result()), |
| 3636 deferred->entry()); | 3636 deferred->entry()); |
| 3637 __ bind(deferred->exit()); | 3637 __ bind(deferred->exit()); |
| 3638 } | 3638 } |
| 3639 | 3639 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3675 public: | 3675 public: |
| 3676 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) | 3676 DeferredStringCharFromCode(LCodeGen* codegen, LStringCharFromCode* instr) |
| 3677 : LDeferredCode(codegen), instr_(instr) { } | 3677 : LDeferredCode(codegen), instr_(instr) { } |
| 3678 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } | 3678 virtual void Generate() { codegen()->DoDeferredStringCharFromCode(instr_); } |
| 3679 virtual LInstruction* instr() { return instr_; } | 3679 virtual LInstruction* instr() { return instr_; } |
| 3680 private: | 3680 private: |
| 3681 LStringCharFromCode* instr_; | 3681 LStringCharFromCode* instr_; |
| 3682 }; | 3682 }; |
| 3683 | 3683 |
| 3684 DeferredStringCharFromCode* deferred = | 3684 DeferredStringCharFromCode* deferred = |
| 3685 new DeferredStringCharFromCode(this, instr); | 3685 new(zone()) DeferredStringCharFromCode(this, instr); |
| 3686 | 3686 |
| 3687 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); | 3687 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); |
| 3688 Register char_code = ToRegister(instr->char_code()); | 3688 Register char_code = ToRegister(instr->char_code()); |
| 3689 Register result = ToRegister(instr->result()); | 3689 Register result = ToRegister(instr->result()); |
| 3690 ASSERT(!char_code.is(result)); | 3690 ASSERT(!char_code.is(result)); |
| 3691 | 3691 |
| 3692 __ cmp(char_code, String::kMaxAsciiCharCode); | 3692 __ cmp(char_code, String::kMaxAsciiCharCode); |
| 3693 __ j(above, deferred->entry()); | 3693 __ j(above, deferred->entry()); |
| 3694 __ Set(result, Immediate(factory()->single_character_string_cache())); | 3694 __ Set(result, Immediate(factory()->single_character_string_cache())); |
| 3695 __ mov(result, FieldOperand(result, | 3695 __ mov(result, FieldOperand(result, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3750 virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); } | 3750 virtual void Generate() { codegen()->DoDeferredNumberTagI(instr_); } |
| 3751 virtual LInstruction* instr() { return instr_; } | 3751 virtual LInstruction* instr() { return instr_; } |
| 3752 private: | 3752 private: |
| 3753 LNumberTagI* instr_; | 3753 LNumberTagI* instr_; |
| 3754 }; | 3754 }; |
| 3755 | 3755 |
| 3756 LOperand* input = instr->InputAt(0); | 3756 LOperand* input = instr->InputAt(0); |
| 3757 ASSERT(input->IsRegister() && input->Equals(instr->result())); | 3757 ASSERT(input->IsRegister() && input->Equals(instr->result())); |
| 3758 Register reg = ToRegister(input); | 3758 Register reg = ToRegister(input); |
| 3759 | 3759 |
| 3760 DeferredNumberTagI* deferred = new DeferredNumberTagI(this, instr); | 3760 DeferredNumberTagI* deferred = new(zone()) DeferredNumberTagI(this, instr); |
| 3761 __ SmiTag(reg); | 3761 __ SmiTag(reg); |
| 3762 __ j(overflow, deferred->entry()); | 3762 __ j(overflow, deferred->entry()); |
| 3763 __ bind(deferred->exit()); | 3763 __ bind(deferred->exit()); |
| 3764 } | 3764 } |
| 3765 | 3765 |
| 3766 | 3766 |
| 3767 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { | 3767 void LCodeGen::DoDeferredNumberTagI(LNumberTagI* instr) { |
| 3768 Label slow; | 3768 Label slow; |
| 3769 Register reg = ToRegister(instr->InputAt(0)); | 3769 Register reg = ToRegister(instr->InputAt(0)); |
| 3770 Register tmp = reg.is(eax) ? ecx : eax; | 3770 Register tmp = reg.is(eax) ? ecx : eax; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3818 virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); } | 3818 virtual void Generate() { codegen()->DoDeferredNumberTagD(instr_); } |
| 3819 virtual LInstruction* instr() { return instr_; } | 3819 virtual LInstruction* instr() { return instr_; } |
| 3820 private: | 3820 private: |
| 3821 LNumberTagD* instr_; | 3821 LNumberTagD* instr_; |
| 3822 }; | 3822 }; |
| 3823 | 3823 |
| 3824 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); | 3824 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); |
| 3825 Register reg = ToRegister(instr->result()); | 3825 Register reg = ToRegister(instr->result()); |
| 3826 Register tmp = ToRegister(instr->TempAt(0)); | 3826 Register tmp = ToRegister(instr->TempAt(0)); |
| 3827 | 3827 |
| 3828 DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr); | 3828 DeferredNumberTagD* deferred = new(zone()) DeferredNumberTagD(this, instr); |
| 3829 if (FLAG_inline_new) { | 3829 if (FLAG_inline_new) { |
| 3830 __ AllocateHeapNumber(reg, tmp, no_reg, deferred->entry()); | 3830 __ AllocateHeapNumber(reg, tmp, no_reg, deferred->entry()); |
| 3831 } else { | 3831 } else { |
| 3832 __ jmp(deferred->entry()); | 3832 __ jmp(deferred->entry()); |
| 3833 } | 3833 } |
| 3834 __ bind(deferred->exit()); | 3834 __ bind(deferred->exit()); |
| 3835 __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), input_reg); | 3835 __ movdbl(FieldOperand(reg, HeapNumber::kValueOffset), input_reg); |
| 3836 } | 3836 } |
| 3837 | 3837 |
| 3838 | 3838 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4018 private: | 4018 private: |
| 4019 LTaggedToI* instr_; | 4019 LTaggedToI* instr_; |
| 4020 }; | 4020 }; |
| 4021 | 4021 |
| 4022 LOperand* input = instr->InputAt(0); | 4022 LOperand* input = instr->InputAt(0); |
| 4023 ASSERT(input->IsRegister()); | 4023 ASSERT(input->IsRegister()); |
| 4024 ASSERT(input->Equals(instr->result())); | 4024 ASSERT(input->Equals(instr->result())); |
| 4025 | 4025 |
| 4026 Register input_reg = ToRegister(input); | 4026 Register input_reg = ToRegister(input); |
| 4027 | 4027 |
| 4028 DeferredTaggedToI* deferred = new DeferredTaggedToI(this, instr); | 4028 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); |
| 4029 | 4029 |
| 4030 // Smi check. | 4030 // Smi check. |
| 4031 __ JumpIfNotSmi(input_reg, deferred->entry()); | 4031 __ JumpIfNotSmi(input_reg, deferred->entry()); |
| 4032 | 4032 |
| 4033 // Smi to int32 conversion | 4033 // Smi to int32 conversion |
| 4034 __ SmiUntag(input_reg); // Untag smi. | 4034 __ SmiUntag(input_reg); // Untag smi. |
| 4035 | 4035 |
| 4036 __ bind(deferred->exit()); | 4036 __ bind(deferred->exit()); |
| 4037 } | 4037 } |
| 4038 | 4038 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4359 class DeferredAllocateObject: public LDeferredCode { | 4359 class DeferredAllocateObject: public LDeferredCode { |
| 4360 public: | 4360 public: |
| 4361 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 4361 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) |
| 4362 : LDeferredCode(codegen), instr_(instr) { } | 4362 : LDeferredCode(codegen), instr_(instr) { } |
| 4363 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 4363 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } |
| 4364 virtual LInstruction* instr() { return instr_; } | 4364 virtual LInstruction* instr() { return instr_; } |
| 4365 private: | 4365 private: |
| 4366 LAllocateObject* instr_; | 4366 LAllocateObject* instr_; |
| 4367 }; | 4367 }; |
| 4368 | 4368 |
| 4369 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr); | 4369 DeferredAllocateObject* deferred = |
| 4370 new(zone()) DeferredAllocateObject(this, instr); |
| 4370 | 4371 |
| 4371 Register result = ToRegister(instr->result()); | 4372 Register result = ToRegister(instr->result()); |
| 4372 Register scratch = ToRegister(instr->TempAt(0)); | 4373 Register scratch = ToRegister(instr->TempAt(0)); |
| 4373 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); | 4374 Handle<JSFunction> constructor = instr->hydrogen()->constructor(); |
| 4374 Handle<Map> initial_map(constructor->initial_map()); | 4375 Handle<Map> initial_map(constructor->initial_map()); |
| 4375 int instance_size = initial_map->instance_size(); | 4376 int instance_size = initial_map->instance_size(); |
| 4376 ASSERT(initial_map->pre_allocated_property_fields() + | 4377 ASSERT(initial_map->pre_allocated_property_fields() + |
| 4377 initial_map->unused_property_fields() - | 4378 initial_map->unused_property_fields() - |
| 4378 initial_map->inobject_properties() == 0); | 4379 initial_map->inobject_properties() == 0); |
| 4379 | 4380 |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4974 StackCheckStub stub; | 4975 StackCheckStub stub; |
| 4975 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4976 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4976 EnsureSpaceForLazyDeopt(); | 4977 EnsureSpaceForLazyDeopt(); |
| 4977 __ bind(&done); | 4978 __ bind(&done); |
| 4978 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 4979 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
| 4979 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 4980 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
| 4980 } else { | 4981 } else { |
| 4981 ASSERT(instr->hydrogen()->is_backwards_branch()); | 4982 ASSERT(instr->hydrogen()->is_backwards_branch()); |
| 4982 // Perform stack overflow check if this goto needs it before jumping. | 4983 // Perform stack overflow check if this goto needs it before jumping. |
| 4983 DeferredStackCheck* deferred_stack_check = | 4984 DeferredStackCheck* deferred_stack_check = |
| 4984 new DeferredStackCheck(this, instr); | 4985 new(zone()) DeferredStackCheck(this, instr); |
| 4985 ExternalReference stack_limit = | 4986 ExternalReference stack_limit = |
| 4986 ExternalReference::address_of_stack_limit(isolate()); | 4987 ExternalReference::address_of_stack_limit(isolate()); |
| 4987 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 4988 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
| 4988 __ j(below, deferred_stack_check->entry()); | 4989 __ j(below, deferred_stack_check->entry()); |
| 4989 EnsureSpaceForLazyDeopt(); | 4990 EnsureSpaceForLazyDeopt(); |
| 4990 __ bind(instr->done_label()); | 4991 __ bind(instr->done_label()); |
| 4991 deferred_stack_check->SetExit(instr->done_label()); | 4992 deferred_stack_check->SetExit(instr->done_label()); |
| 4992 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 4993 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
| 4993 // Don't record a deoptimization index for the safepoint here. | 4994 // Don't record a deoptimization index for the safepoint here. |
| 4994 // This will be done explicitly when emitting call and the safepoint in | 4995 // 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... |
| 5104 FixedArray::kHeaderSize - kPointerSize)); | 5105 FixedArray::kHeaderSize - kPointerSize)); |
| 5105 __ bind(&done); | 5106 __ bind(&done); |
| 5106 } | 5107 } |
| 5107 | 5108 |
| 5108 | 5109 |
| 5109 #undef __ | 5110 #undef __ |
| 5110 | 5111 |
| 5111 } } // namespace v8::internal | 5112 } } // namespace v8::internal |
| 5112 | 5113 |
| 5113 #endif // V8_TARGET_ARCH_IA32 | 5114 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |