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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 LEnvironment* environment, | 782 LEnvironment* environment, |
783 Register src1, | 783 Register src1, |
784 const Operand& src2) { | 784 const Operand& src2) { |
785 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 785 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
786 ? Deoptimizer::LAZY | 786 ? Deoptimizer::LAZY |
787 : Deoptimizer::EAGER; | 787 : Deoptimizer::EAGER; |
788 DeoptimizeIf(cc, environment, bailout_type, src1, src2); | 788 DeoptimizeIf(cc, environment, bailout_type, src1, src2); |
789 } | 789 } |
790 | 790 |
791 | 791 |
792 void LCodeGen::SoftDeoptimize(LEnvironment* environment, | |
793 Register src1, | |
794 const Operand& src2) { | |
795 ASSERT(!info()->IsStub()); | |
796 DeoptimizeIf(al, environment, Deoptimizer::SOFT, src1, src2); | |
797 } | |
798 | |
799 | |
800 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 792 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
801 ZoneList<Handle<Map> > maps(1, zone()); | 793 ZoneList<Handle<Map> > maps(1, zone()); |
802 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 794 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
803 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 795 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
804 RelocInfo::Mode mode = it.rinfo()->rmode(); | 796 RelocInfo::Mode mode = it.rinfo()->rmode(); |
805 if (mode == RelocInfo::EMBEDDED_OBJECT && | 797 if (mode == RelocInfo::EMBEDDED_OBJECT && |
806 it.rinfo()->target_object()->IsMap()) { | 798 it.rinfo()->target_object()->IsMap()) { |
807 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | 799 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
808 if (map->CanTransition()) { | 800 if (map->CanTransition()) { |
809 maps.Add(map, zone()); | 801 maps.Add(map, zone()); |
(...skipping 4812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5622 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { | 5614 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
5623 EnsureSpaceForLazyDeopt(); | 5615 EnsureSpaceForLazyDeopt(); |
5624 ASSERT(instr->HasEnvironment()); | 5616 ASSERT(instr->HasEnvironment()); |
5625 LEnvironment* env = instr->environment(); | 5617 LEnvironment* env = instr->environment(); |
5626 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 5618 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
5627 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 5619 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
5628 } | 5620 } |
5629 | 5621 |
5630 | 5622 |
5631 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { | 5623 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { |
5632 if (instr->hydrogen_value()->IsSoftDeoptimize()) { | 5624 Deoptimizer::BailoutType type = instr->hydrogen()->type(); |
5633 SoftDeoptimize(instr->environment(), zero_reg, Operand(zero_reg)); | 5625 // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the |
5634 } else { | 5626 // needed return address), even though the implementation of LAZY and EAGER is |
5635 DeoptimizeIf(al, instr->environment(), zero_reg, Operand(zero_reg)); | 5627 // now identical. When LAZY is eventually completely folded into EAGER, remove |
| 5628 // the special case below. |
| 5629 if (info()->IsStub() && type == Deoptimizer::EAGER) { |
| 5630 type = Deoptimizer::LAZY; |
5636 } | 5631 } |
| 5632 DeoptimizeIf(al, instr->environment(), type, zero_reg, Operand(zero_reg)); |
5637 } | 5633 } |
5638 | 5634 |
5639 | 5635 |
5640 void LCodeGen::DoDummyUse(LDummyUse* instr) { | 5636 void LCodeGen::DoDummyUse(LDummyUse* instr) { |
5641 // Nothing to see here, move on! | 5637 // Nothing to see here, move on! |
5642 } | 5638 } |
5643 | 5639 |
5644 | 5640 |
5645 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { | 5641 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { |
5646 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 5642 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5802 __ Subu(scratch, result, scratch); | 5798 __ Subu(scratch, result, scratch); |
5803 __ lw(result, FieldMemOperand(scratch, | 5799 __ lw(result, FieldMemOperand(scratch, |
5804 FixedArray::kHeaderSize - kPointerSize)); | 5800 FixedArray::kHeaderSize - kPointerSize)); |
5805 __ bind(&done); | 5801 __ bind(&done); |
5806 } | 5802 } |
5807 | 5803 |
5808 | 5804 |
5809 #undef __ | 5805 #undef __ |
5810 | 5806 |
5811 } } // namespace v8::internal | 5807 } } // namespace v8::internal |
OLD | NEW |