OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 770 |
771 void LCodeGen::DeoptimizeIf(Condition cc, | 771 void LCodeGen::DeoptimizeIf(Condition cc, |
772 LEnvironment* environment) { | 772 LEnvironment* environment) { |
773 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 773 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
774 ? Deoptimizer::LAZY | 774 ? Deoptimizer::LAZY |
775 : Deoptimizer::EAGER; | 775 : Deoptimizer::EAGER; |
776 DeoptimizeIf(cc, environment, bailout_type); | 776 DeoptimizeIf(cc, environment, bailout_type); |
777 } | 777 } |
778 | 778 |
779 | 779 |
780 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | |
781 ZoneList<Handle<Map> > maps(1, zone()); | |
782 ZoneList<Handle<JSObject> > objects(1, zone()); | |
783 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | |
784 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | |
785 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { | |
786 if (it.rinfo()->target_object()->IsMap()) { | |
787 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | |
788 maps.Add(map, zone()); | |
789 } else if (it.rinfo()->target_object()->IsJSObject()) { | |
790 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); | |
791 objects.Add(object, zone()); | |
792 } | |
793 } | |
794 } | |
795 #ifdef VERIFY_HEAP | |
796 // This disables verification of weak embedded objects after full GC. | |
797 // AddDependentCode can cause a GC, which would observe the state where | |
798 // this code is not yet in the depended code lists of the embedded maps. | |
799 NoWeakObjectVerificationScope disable_verification_of_embedded_objects; | |
800 #endif | |
801 for (int i = 0; i < maps.length(); i++) { | |
802 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); | |
803 } | |
804 for (int i = 0; i < objects.length(); i++) { | |
805 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); | |
806 } | |
807 } | |
808 | |
809 | |
810 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 780 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
811 int length = deoptimizations_.length(); | 781 int length = deoptimizations_.length(); |
812 if (length == 0) return; | 782 if (length == 0) return; |
813 Handle<DeoptimizationInputData> data = | 783 Handle<DeoptimizationInputData> data = |
814 factory()->NewDeoptimizationInputData(length, TENURED); | 784 factory()->NewDeoptimizationInputData(length, TENURED); |
815 | 785 |
816 Handle<ByteArray> translations = | 786 Handle<ByteArray> translations = |
817 translations_.CreateByteArray(isolate()->factory()); | 787 translations_.CreateByteArray(isolate()->factory()); |
818 data->SetTranslationByteArray(*translations); | 788 data->SetTranslationByteArray(*translations); |
819 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); | 789 data->SetInlinedFunctionCount(Smi::FromInt(inlined_function_count_)); |
(...skipping 4825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5645 FixedArray::kHeaderSize - kPointerSize)); | 5615 FixedArray::kHeaderSize - kPointerSize)); |
5646 __ bind(&done); | 5616 __ bind(&done); |
5647 } | 5617 } |
5648 | 5618 |
5649 | 5619 |
5650 #undef __ | 5620 #undef __ |
5651 | 5621 |
5652 } } // namespace v8::internal | 5622 } } // namespace v8::internal |
5653 | 5623 |
5654 #endif // V8_TARGET_ARCH_X64 | 5624 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |