| 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 const Operand& src2) { | 828 const Operand& src2) { |
| 829 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 829 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
| 830 ? Deoptimizer::LAZY | 830 ? Deoptimizer::LAZY |
| 831 : Deoptimizer::EAGER; | 831 : Deoptimizer::EAGER; |
| 832 DeoptimizeIf(condition, environment, bailout_type, src1, src2); | 832 DeoptimizeIf(condition, environment, bailout_type, src1, src2); |
| 833 } | 833 } |
| 834 | 834 |
| 835 | 835 |
| 836 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 836 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
| 837 ZoneList<Handle<Map> > maps(1, zone()); | 837 ZoneList<Handle<Map> > maps(1, zone()); |
| 838 ZoneList<Handle<JSObject> > objects(1, zone()); |
| 838 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 839 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 839 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 840 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
| 840 RelocInfo::Mode mode = it.rinfo()->rmode(); | 841 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
| 841 if (mode == RelocInfo::EMBEDDED_OBJECT && | 842 if (it.rinfo()->target_object()->IsMap()) { |
| 842 it.rinfo()->target_object()->IsMap()) { | 843 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
| 843 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | |
| 844 if (map->CanTransition()) { | |
| 845 maps.Add(map, zone()); | 844 maps.Add(map, zone()); |
| 845 } else if (it.rinfo()->target_object()->IsJSObject()) { |
| 846 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); |
| 847 objects.Add(object, zone()); |
| 846 } | 848 } |
| 847 } | 849 } |
| 848 } | 850 } |
| 849 #ifdef VERIFY_HEAP | 851 #ifdef VERIFY_HEAP |
| 850 // This disables verification of weak embedded maps after full GC. | 852 // This disables verification of weak embedded maps after full GC. |
| 851 // AddDependentCode can cause a GC, which would observe the state where | 853 // AddDependentCode can cause a GC, which would observe the state where |
| 852 // this code is not yet in the depended code lists of the embedded maps. | 854 // this code is not yet in the depended code lists of the embedded maps. |
| 853 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 855 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; |
| 854 #endif | 856 #endif |
| 855 for (int i = 0; i < maps.length(); i++) { | 857 for (int i = 0; i < maps.length(); i++) { |
| 856 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); | 858 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
| 857 } | 859 } |
| 860 for (int i = 0; i < objects.length(); i++) { |
| 861 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
| 862 } |
| 858 } | 863 } |
| 859 | 864 |
| 860 | 865 |
| 861 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 866 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
| 862 int length = deoptimizations_.length(); | 867 int length = deoptimizations_.length(); |
| 863 if (length == 0) return; | 868 if (length == 0) return; |
| 864 Handle<DeoptimizationInputData> data = | 869 Handle<DeoptimizationInputData> data = |
| 865 factory()->NewDeoptimizationInputData(length, TENURED); | 870 factory()->NewDeoptimizationInputData(length, TENURED); |
| 866 | 871 |
| 867 Handle<ByteArray> translations = | 872 Handle<ByteArray> translations = |
| (...skipping 4920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5788 __ Subu(scratch, result, scratch); | 5793 __ Subu(scratch, result, scratch); |
| 5789 __ lw(result, FieldMemOperand(scratch, | 5794 __ lw(result, FieldMemOperand(scratch, |
| 5790 FixedArray::kHeaderSize - kPointerSize)); | 5795 FixedArray::kHeaderSize - kPointerSize)); |
| 5791 __ bind(&done); | 5796 __ bind(&done); |
| 5792 } | 5797 } |
| 5793 | 5798 |
| 5794 | 5799 |
| 5795 #undef __ | 5800 #undef __ |
| 5796 | 5801 |
| 5797 } } // namespace v8::internal | 5802 } } // namespace v8::internal |
| OLD | NEW |