OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/snapshot/deserializer.h" | 5 #include "src/snapshot/deserializer.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/external-reference-table.h" | 8 #include "src/external-reference-table.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 int skip = source_.GetInt(); \ | 470 int skip = source_.GetInt(); \ |
471 current = reinterpret_cast<Object**>( \ | 471 current = reinterpret_cast<Object**>( \ |
472 reinterpret_cast<Address>(current) + skip); \ | 472 reinterpret_cast<Address>(current) + skip); \ |
473 emit_write_barrier = (space_number == NEW_SPACE); \ | 473 emit_write_barrier = (space_number == NEW_SPACE); \ |
474 new_object = GetBackReferencedObject(data & kSpaceMask); \ | 474 new_object = GetBackReferencedObject(data & kSpaceMask); \ |
475 } else if (where == kRootArray) { \ | 475 } else if (where == kRootArray) { \ |
476 int id = source_.GetInt(); \ | 476 int id = source_.GetInt(); \ |
477 Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(id); \ | 477 Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(id); \ |
478 new_object = isolate->heap()->root(root_index); \ | 478 new_object = isolate->heap()->root(root_index); \ |
479 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ | 479 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ |
| 480 hot_objects_.Add(HeapObject::cast(new_object)); \ |
480 } else if (where == kPartialSnapshotCache) { \ | 481 } else if (where == kPartialSnapshotCache) { \ |
481 int cache_index = source_.GetInt(); \ | 482 int cache_index = source_.GetInt(); \ |
482 new_object = isolate->partial_snapshot_cache()->at(cache_index); \ | 483 new_object = isolate->partial_snapshot_cache()->at(cache_index); \ |
483 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ | 484 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ |
484 } else if (where == kExternalReference) { \ | 485 } else if (where == kExternalReference) { \ |
485 int skip = source_.GetInt(); \ | 486 int skip = source_.GetInt(); \ |
486 current = reinterpret_cast<Object**>( \ | 487 current = reinterpret_cast<Object**>( \ |
487 reinterpret_cast<Address>(current) + skip); \ | 488 reinterpret_cast<Address>(current) + skip); \ |
488 int reference_id = source_.GetInt(); \ | 489 int reference_id = source_.GetInt(); \ |
489 Address address = external_reference_table_->address(reference_id); \ | 490 Address address = external_reference_table_->address(reference_id); \ |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 | 809 |
809 default: | 810 default: |
810 CHECK(false); | 811 CHECK(false); |
811 } | 812 } |
812 } | 813 } |
813 CHECK_EQ(limit, current); | 814 CHECK_EQ(limit, current); |
814 return true; | 815 return true; |
815 } | 816 } |
816 } // namespace internal | 817 } // namespace internal |
817 } // namespace v8 | 818 } // namespace v8 |
OLD | NEW |