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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ | 521 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ |
522 hot_objects_.Add(HeapObject::cast(new_object)); \ | 522 hot_objects_.Add(HeapObject::cast(new_object)); \ |
523 } else if (where == kPartialSnapshotCache) { \ | 523 } else if (where == kPartialSnapshotCache) { \ |
524 int cache_index = source_.GetInt(); \ | 524 int cache_index = source_.GetInt(); \ |
525 new_object = isolate->partial_snapshot_cache()->at(cache_index); \ | 525 new_object = isolate->partial_snapshot_cache()->at(cache_index); \ |
526 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ | 526 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ |
527 } else if (where == kExternalReference) { \ | 527 } else if (where == kExternalReference) { \ |
528 int skip = source_.GetInt(); \ | 528 int skip = source_.GetInt(); \ |
529 current = reinterpret_cast<Object**>( \ | 529 current = reinterpret_cast<Object**>( \ |
530 reinterpret_cast<Address>(current) + skip); \ | 530 reinterpret_cast<Address>(current) + skip); \ |
531 int reference_id = source_.GetInt(); \ | 531 uint32_t reference_id = static_cast<uint32_t>(source_.GetInt()); \ |
532 Address address = external_reference_table_->address(reference_id); \ | 532 Address address = external_reference_table_->address(reference_id); \ |
533 new_object = reinterpret_cast<Object*>(address); \ | 533 new_object = reinterpret_cast<Object*>(address); \ |
534 } else if (where == kAttachedReference) { \ | 534 } else if (where == kAttachedReference) { \ |
535 int index = source_.GetInt(); \ | 535 int index = source_.GetInt(); \ |
536 new_object = *attached_objects_[index]; \ | 536 new_object = *attached_objects_[index]; \ |
537 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ | 537 emit_write_barrier = isolate->heap()->InNewSpace(new_object); \ |
538 } else { \ | 538 } else { \ |
539 DCHECK(where == kBuiltin); \ | 539 DCHECK(where == kBuiltin); \ |
540 DCHECK(deserializing_user_code()); \ | 540 DCHECK(deserializing_user_code()); \ |
541 int builtin_id = source_.GetInt(); \ | 541 int builtin_id = source_.GetInt(); \ |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 | 851 |
852 default: | 852 default: |
853 CHECK(false); | 853 CHECK(false); |
854 } | 854 } |
855 } | 855 } |
856 CHECK_EQ(limit, current); | 856 CHECK_EQ(limit, current); |
857 return true; | 857 return true; |
858 } | 858 } |
859 } // namespace internal | 859 } // namespace internal |
860 } // namespace v8 | 860 } // namespace v8 |
OLD | NEW |