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