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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 | 141 |
142 int LCodeGenBase::GetNextEmittedBlock() const { | 142 int LCodeGenBase::GetNextEmittedBlock() const { |
143 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { | 143 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { |
144 if (!chunk_->GetLabel(i)->HasReplacement()) return i; | 144 if (!chunk_->GetLabel(i)->HasReplacement()) return i; |
145 } | 145 } |
146 return -1; | 146 return -1; |
147 } | 147 } |
148 | 148 |
149 | 149 |
| 150 void LCodeGenBase::RegisterDependentCodeForEmbeddedMaps(Handle<Code> code) { |
| 151 ZoneList<Handle<Map> > maps(1, zone()); |
| 152 ZoneList<Handle<JSObject> > objects(1, zone()); |
| 153 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 154 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
| 155 if (Code::IsWeakEmbeddedObject(code->kind(), it.rinfo()->target_object())) { |
| 156 if (it.rinfo()->target_object()->IsMap()) { |
| 157 Handle<Map> map(Map::cast(it.rinfo()->target_object())); |
| 158 maps.Add(map, zone()); |
| 159 } else if (it.rinfo()->target_object()->IsJSObject()) { |
| 160 Handle<JSObject> object(JSObject::cast(it.rinfo()->target_object())); |
| 161 objects.Add(object, zone()); |
| 162 } |
| 163 } |
| 164 } |
| 165 #ifdef VERIFY_HEAP |
| 166 // This disables verification of weak embedded objects after full GC. |
| 167 // AddDependentCode can cause a GC, which would observe the state where |
| 168 // this code is not yet in the depended code lists of the embedded maps. |
| 169 NoWeakObjectVerificationScope disable_verification_of_embedded_objects; |
| 170 #endif |
| 171 for (int i = 0; i < maps.length(); i++) { |
| 172 maps.at(i)->AddDependentCode(DependentCode::kWeaklyEmbeddedGroup, code); |
| 173 } |
| 174 for (int i = 0; i < objects.length(); i++) { |
| 175 AddWeakObjectToCodeDependency(isolate()->heap(), objects.at(i), code); |
| 176 } |
| 177 } |
| 178 |
| 179 |
150 } } // namespace v8::internal | 180 } } // namespace v8::internal |
OLD | NEW |