| 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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 LEnvironment* environment) { | 876 LEnvironment* environment) { |
| 877 Deoptimizer::BailoutType bailout_type = info()->IsStub() | 877 Deoptimizer::BailoutType bailout_type = info()->IsStub() |
| 878 ? Deoptimizer::LAZY | 878 ? Deoptimizer::LAZY |
| 879 : Deoptimizer::EAGER; | 879 : Deoptimizer::EAGER; |
| 880 DeoptimizeIf(condition, environment, bailout_type); | 880 DeoptimizeIf(condition, environment, bailout_type); |
| 881 } | 881 } |
| 882 | 882 |
| 883 | 883 |
| 884 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { | 884 void LCodeGen::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
| 885 ZoneList<Handle<Map> > maps(1, zone()); | 885 ZoneList<Handle<Map> > maps(1, zone()); |
| 886 ZoneList<Handle<JSObject> > objects(1, zone()); |
| 886 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 887 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 887 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 888 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
| 888 RelocInfo::Mode mode = it.rinfo()->rmode(); | 889 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
| 889 if (mode == RelocInfo::EMBEDDED_OBJECT && | 890 if (it.rinfo()->target_object()->IsMap()) { |
| 890 it.rinfo()->target_object()->IsMap()) { | 891 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
| 891 Handle<Map> map(Map::cast(it.rinfo()->target_object())); | |
| 892 if (map->CanTransition()) { | |
| 893 maps.Add(map, zone()); | 892 maps.Add(map, zone()); |
| 893 } else if (it.rinfo()->target_object()->IsJSObject()) { |
| 894 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); |
| 895 objects.Add(object, zone()); |
| 894 } | 896 } |
| 895 } | 897 } |
| 896 } | 898 } |
| 897 #ifdef VERIFY_HEAP | 899 #ifdef VERIFY_HEAP |
| 898 // This disables verification of weak embedded maps after full GC. | 900 // This disables verification of weak embedded maps after full GC. |
| 899 // AddDependentCode can cause a GC, which would observe the state where | 901 // AddDependentCode can cause a GC, which would observe the state where |
| 900 // this code is not yet in the depended code lists of the embedded maps. | 902 // this code is not yet in the depended code lists of the embedded maps. |
| 901 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; | 903 NoWeakEmbeddedMapsVerificationScope disable_verification_of_embedded_maps; |
| 902 #endif | 904 #endif |
| 903 for (int i = 0; i < maps.length(); i++) { | 905 for (int i = 0; i < maps.length(); i++) { |
| 904 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); | 906 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
| 905 } | 907 } |
| 908 for (int i = 0; i < objects.length(); i++) { |
| 909 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
| 910 } |
| 906 } | 911 } |
| 907 | 912 |
| 908 | 913 |
| 909 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 914 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
| 910 int length = deoptimizations_.length(); | 915 int length = deoptimizations_.length(); |
| 911 if (length == 0) return; | 916 if (length == 0) return; |
| 912 Handle<DeoptimizationInputData> data = | 917 Handle<DeoptimizationInputData> data = |
| 913 factory()->NewDeoptimizationInputData(length, TENURED); | 918 factory()->NewDeoptimizationInputData(length, TENURED); |
| 914 | 919 |
| 915 Handle<ByteArray> translations = | 920 Handle<ByteArray> translations = |
| (...skipping 4946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5862 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5867 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5863 __ ldr(result, FieldMemOperand(scratch, | 5868 __ ldr(result, FieldMemOperand(scratch, |
| 5864 FixedArray::kHeaderSize - kPointerSize)); | 5869 FixedArray::kHeaderSize - kPointerSize)); |
| 5865 __ bind(&done); | 5870 __ bind(&done); |
| 5866 } | 5871 } |
| 5867 | 5872 |
| 5868 | 5873 |
| 5869 #undef __ | 5874 #undef __ |
| 5870 | 5875 |
| 5871 } } // namespace v8::internal | 5876 } } // namespace v8::internal |
| OLD | NEW |