OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 | 1211 |
1212 | 1212 |
1213 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { | 1213 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { |
1214 for (int i = 0; i < number_of_transitions(); ++i) { | 1214 for (int i = 0; i < number_of_transitions(); ++i) { |
1215 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1215 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1216 } | 1216 } |
1217 return true; | 1217 return true; |
1218 } | 1218 } |
1219 | 1219 |
1220 | 1220 |
| 1221 void Code::VerifyEmbeddedObjectsInFullCode() { |
| 1222 // Check that no context-specific object has been embedded. |
| 1223 Heap* heap = GetIsolate()->heap(); |
| 1224 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 1225 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 1226 Object* obj = it.rinfo()->target_object(); |
| 1227 if (obj->IsCell()) obj = Cell::cast(obj)->value(); |
| 1228 if (obj->IsPropertyCell()) obj = PropertyCell::cast(obj)->value(); |
| 1229 if (!obj->IsHeapObject()) continue; |
| 1230 Map* map = obj->IsMap() ? Map::cast(obj) : HeapObject::cast(obj)->map(); |
| 1231 int i = 0; |
| 1232 while (map != heap->roots_array_start()[i++]) { |
| 1233 CHECK_LT(i, Heap::kStrongRootListLength); |
| 1234 } |
| 1235 } |
| 1236 } |
| 1237 |
| 1238 |
1221 #endif // DEBUG | 1239 #endif // DEBUG |
1222 | 1240 |
1223 } } // namespace v8::internal | 1241 } } // namespace v8::internal |
OLD | NEW |