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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 LEnvironment* environment) { | 827 LEnvironment* environment) { |
828 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 828 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
829 ? Deoptimizer::LAZY | 829 ? Deoptimizer::LAZY |
830 : Deoptimizer::EAGER; | 830 : Deoptimizer::EAGER; |
831 DeoptimizeIf(condition, environment, bailout_type); | 831 DeoptimizeIf(condition, environment, bailout_type); |
832 } | 832 } |
833 | 833 |
834 | 834 |
835 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 835 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
836 ZoneList<Handle<Map> > maps(1, zone()); | 836 ZoneList<Handle<Map> > maps(1, zone()); |
| 837 ZoneList<Handle<JSObject> > objects(1, zone()); |
837 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 838 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
838 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 839 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
839 RelocInfo::Mode mode = it.rinfo()->rmode(); | 840 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
840 if (mode == RelocInfo::EMBEDDED_OBJECT && | 841 if (it.rinfo()->target_object()->IsMap()) { |
841 it.rinfo()->target_object()->IsMap()) { | 842 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
842 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | |
843 if (map->CanTransition()) { | |
844 maps.Add(map, zone()); | 843 maps.Add(map, zone()); |
| 844 } else if (it.rinfo()->target_object()->IsJSObject()) { |
| 845 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); |
| 846 objects.Add(object, zone()); |
845 } | 847 } |
846 } | 848 } |
847 } | 849 } |
848 #ifdef VERIFY_HEAP | 850 #ifdef VERIFY_HEAP |
849 // This disables verification of weak embedded maps after full GC. | 851 // This disables verification of weak embedded objects after full GC. |
850 // AddDependentCode can cause a GC, which would observe the state where | 852 // AddDependentCode can cause a GC, which would observe the state where |
851 // this code is not yet in the depended code lists of the embedded maps. | 853 // this code is not yet in the depended code lists of the embedded maps. |
852 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 854 NoWeakObjectVerificationScope disable_verification_of_embedded_objects; |
853 #endif | 855 #endif |
854 for (int i = 0; i < maps.length(); i++) { | 856 for (int i = 0; i < maps.length(); i++) { |
855 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); | 857 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
856 } | 858 } |
| 859 for (int i = 0; i < objects.length(); i++) { |
| 860 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
| 861 } |
857 } | 862 } |
858 | 863 |
859 | 864 |
860 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 865 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
861 int length = deoptimizations_.length(); | 866 int length = deoptimizations_.length(); |
862 if (length == 0) return; | 867 if (length == 0) return; |
863 Handle<DeoptimizationInputData> data = | 868 Handle<DeoptimizationInputData> data = |
864 factory()->NewDeoptimizationInputData(length, TENURED); | 869 factory()->NewDeoptimizationInputData(length, TENURED); |
865 | 870 |
866 Handle<ByteArray> translations = | 871 Handle<ByteArray> translations = |
(...skipping 4938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5805 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5810 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5806 __ ldr(result, FieldMemOperand(scratch, | 5811 __ ldr(result, FieldMemOperand(scratch, |
5807 FixedArray::kHeaderSize - kPointerSize)); | 5812 FixedArray::kHeaderSize - kPointerSize)); |
5808 __ bind(&done); | 5813 __ bind(&done); |
5809 } | 5814 } |
5810 | 5815 |
5811 | 5816 |
5812 #undef __ | 5817 #undef __ |
5813 | 5818 |
5814 } } // namespace v8::internal | 5819 } } // namespace v8::internal |
OLD | NEW |