| 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/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
| 9 #include "src/disassembler.h" | 9 #include "src/disassembler.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 if (obj->IsCell()) { | 1229 if (obj->IsCell()) { |
| 1230 return CanLeak(Cell::cast(obj)->value(), heap, skip_weak_cell); | 1230 return CanLeak(Cell::cast(obj)->value(), heap, skip_weak_cell); |
| 1231 } | 1231 } |
| 1232 if (obj->IsPropertyCell()) { | 1232 if (obj->IsPropertyCell()) { |
| 1233 return CanLeak(PropertyCell::cast(obj)->value(), heap, skip_weak_cell); | 1233 return CanLeak(PropertyCell::cast(obj)->value(), heap, skip_weak_cell); |
| 1234 } | 1234 } |
| 1235 if (obj->IsContext()) return true; | 1235 if (obj->IsContext()) return true; |
| 1236 if (obj->IsMap()) { | 1236 if (obj->IsMap()) { |
| 1237 Map* map = Map::cast(obj); | 1237 Map* map = Map::cast(obj); |
| 1238 for (int i = 0; i < Heap::kStrongRootListLength; i++) { | 1238 for (int i = 0; i < Heap::kStrongRootListLength; i++) { |
| 1239 if (map == heap->roots_array_start()[i]) return false; | 1239 Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i); |
| 1240 if (map == heap->root(root_index)) return false; |
| 1240 } | 1241 } |
| 1241 return true; | 1242 return true; |
| 1242 } | 1243 } |
| 1243 return CanLeak(HeapObject::cast(obj)->map(), heap, skip_weak_cell); | 1244 return CanLeak(HeapObject::cast(obj)->map(), heap, skip_weak_cell); |
| 1244 } | 1245 } |
| 1245 | 1246 |
| 1246 | 1247 |
| 1247 void Code::VerifyEmbeddedObjects(VerifyMode mode) { | 1248 void Code::VerifyEmbeddedObjects(VerifyMode mode) { |
| 1248 if (kind() == OPTIMIZED_FUNCTION) return; | 1249 if (kind() == OPTIMIZED_FUNCTION) return; |
| 1249 Heap* heap = GetIsolate()->heap(); | 1250 Heap* heap = GetIsolate()->heap(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 | 1313 |
| 1313 // Both are done at the same time. | 1314 // Both are done at the same time. |
| 1314 CHECK_EQ(new_it.done(), old_it.done()); | 1315 CHECK_EQ(new_it.done(), old_it.done()); |
| 1315 } | 1316 } |
| 1316 | 1317 |
| 1317 | 1318 |
| 1318 #endif // DEBUG | 1319 #endif // DEBUG |
| 1319 | 1320 |
| 1320 } // namespace internal | 1321 } // namespace internal |
| 1321 } // namespace v8 | 1322 } // namespace v8 |
| OLD | NEW |