| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 address = obj->address(); | 366 address = obj->address(); |
| 367 next_alignment_ = kWordAligned; | 367 next_alignment_ = kWordAligned; |
| 368 } else { | 368 } else { |
| 369 address = Allocate(space_number, size); | 369 address = Allocate(space_number, size); |
| 370 obj = HeapObject::FromAddress(address); | 370 obj = HeapObject::FromAddress(address); |
| 371 } | 371 } |
| 372 | 372 |
| 373 isolate_->heap()->OnAllocationEvent(obj, size); | 373 isolate_->heap()->OnAllocationEvent(obj, size); |
| 374 Object** current = reinterpret_cast<Object**>(address); | 374 Object** current = reinterpret_cast<Object**>(address); |
| 375 Object** limit = current + (size >> kPointerSizeLog2); | 375 Object** limit = current + (size >> kPointerSizeLog2); |
| 376 int position = source_.position(); | |
| 377 | 376 |
| 378 if (ReadData(current, limit, space_number, address)) { | 377 if (ReadData(current, limit, space_number, address)) { |
| 379 // Only post process if object content has not been deferred. | 378 // Only post process if object content has not been deferred. |
| 380 obj = PostProcessNewObject(obj, space_number); | 379 obj = PostProcessNewObject(obj, space_number); |
| 381 } | 380 } |
| 382 if (FLAG_log_snapshot_positions) { | |
| 383 LOG(isolate_, SnapshotPositionEvent(obj, position)); | |
| 384 } | |
| 385 | 381 |
| 386 Object* write_back_obj = obj; | 382 Object* write_back_obj = obj; |
| 387 UnalignedCopy(write_back, &write_back_obj); | 383 UnalignedCopy(write_back, &write_back_obj); |
| 388 #ifdef DEBUG | 384 #ifdef DEBUG |
| 389 if (obj->IsCode()) { | 385 if (obj->IsCode()) { |
| 390 DCHECK(space_number == CODE_SPACE || space_number == LO_SPACE); | 386 DCHECK(space_number == CODE_SPACE || space_number == LO_SPACE); |
| 391 } else { | 387 } else { |
| 392 DCHECK(space_number != CODE_SPACE); | 388 DCHECK(space_number != CODE_SPACE); |
| 393 } | 389 } |
| 394 #endif // DEBUG | 390 #endif // DEBUG |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 | 809 |
| 814 default: | 810 default: |
| 815 CHECK(false); | 811 CHECK(false); |
| 816 } | 812 } |
| 817 } | 813 } |
| 818 CHECK_EQ(limit, current); | 814 CHECK_EQ(limit, current); |
| 819 return true; | 815 return true; |
| 820 } | 816 } |
| 821 } // namespace internal | 817 } // namespace internal |
| 822 } // namespace v8 | 818 } // namespace v8 |
| OLD | NEW |