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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 LEnvironment* environment) { | 855 LEnvironment* environment) { |
856 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 856 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
857 ? Deoptimizer::LAZY | 857 ? Deoptimizer::LAZY |
858 : Deoptimizer::EAGER; | 858 : Deoptimizer::EAGER; |
859 DeoptimizeIf(condition, environment, bailout_type); | 859 DeoptimizeIf(condition, environment, bailout_type); |
860 } | 860 } |
861 | 861 |
862 | 862 |
863 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 863 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
864 ZoneList<Handle<Map> > maps(1, zone()); | 864 ZoneList<Handle<Map> > maps(1, zone()); |
| 865 ZoneList<Handle<JSObject> > objects(1, zone()); |
865 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 866 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
866 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 867 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
867 RelocInfo::Mode mode = it.rinfo()->rmode(); | 868 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
868 if (mode == RelocInfo::EMBEDDED_OBJECT && | 869 if (it.rinfo()->target_object()->IsMap()) { |
869 it.rinfo()->target_object()->IsMap()) { | 870 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
870 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | |
871 if (map->CanTransition()) { | |
872 maps.Add(map, zone()); | 871 maps.Add(map, zone()); |
| 872 } else if (it.rinfo()->target_object()->IsJSObject()) { |
| 873 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); |
| 874 objects.Add(object, zone()); |
873 } | 875 } |
874 } | 876 } |
875 } | 877 } |
876 #ifdef VERIFY_HEAP | 878 #ifdef VERIFY_HEAP |
877 // This disables verification of weak embedded maps after full GC. | 879 // This disables verification of weak embedded maps after full GC. |
878 // AddDependentCode can cause a GC, which would observe the state where | 880 // AddDependentCode can cause a GC, which would observe the state where |
879 // this code is not yet in the depended code lists of the embedded maps. | 881 // this code is not yet in the depended code lists of the embedded maps. |
880 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 882 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; |
881 #endif | 883 #endif |
882 for (int i = 0; i < maps.length(); i++) { | 884 for (int i = 0; i < maps.length(); i++) { |
883 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); | 885 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
884 } | 886 } |
| 887 for (int i = 0; i < objects.length(); i++) { |
| 888 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
| 889 } |
885 } | 890 } |
886 | 891 |
887 | 892 |
888 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 893 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
889 int length = deoptimizations_.length(); | 894 int length = deoptimizations_.length(); |
890 if (length == 0) return; | 895 if (length == 0) return; |
891 Handle<DeoptimizationInputData> data = | 896 Handle<DeoptimizationInputData> data = |
892 factory()->NewDeoptimizationInputData(length, TENURED); | 897 factory()->NewDeoptimizationInputData(length, TENURED); |
893 | 898 |
894 Handle<ByteArray> translations = | 899 Handle<ByteArray> translations = |
(...skipping 4898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5793 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5798 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5794 __ ldr(result, FieldMemOperand(scratch, | 5799 __ ldr(result, FieldMemOperand(scratch, |
5795 FixedArray::kHeaderSize - kPointerSize)); | 5800 FixedArray::kHeaderSize - kPointerSize)); |
5796 __ bind(&done); | 5801 __ bind(&done); |
5797 } | 5802 } |
5798 | 5803 |
5799 | 5804 |
5800 #undef __ | 5805 #undef __ |
5801 | 5806 |
5802 } } // namespace v8::internal | 5807 } } // namespace v8::internal |
OLD | NEW |