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/heap/heap.h" | 8 #include "src/heap/heap.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 address = obj->address(); | 357 address = obj->address(); |
358 next_alignment_ = kWordAligned; | 358 next_alignment_ = kWordAligned; |
359 } else { | 359 } else { |
360 address = Allocate(space_number, size); | 360 address = Allocate(space_number, size); |
361 obj = HeapObject::FromAddress(address); | 361 obj = HeapObject::FromAddress(address); |
362 } | 362 } |
363 | 363 |
364 isolate_->heap()->OnAllocationEvent(obj, size); | 364 isolate_->heap()->OnAllocationEvent(obj, size); |
365 Object** current = reinterpret_cast<Object**>(address); | 365 Object** current = reinterpret_cast<Object**>(address); |
366 Object** limit = current + (size >> kPointerSizeLog2); | 366 Object** limit = current + (size >> kPointerSizeLog2); |
367 if (FLAG_log_snapshot_positions) { | 367 int position = source_.position(); |
368 LOG(isolate_, SnapshotPositionEvent(address, source_.position())); | |
369 } | |
370 | 368 |
371 if (ReadData(current, limit, space_number, address)) { | 369 if (ReadData(current, limit, space_number, address)) { |
372 // Only post process if object content has not been deferred. | 370 // Only post process if object content has not been deferred. |
373 obj = PostProcessNewObject(obj, space_number); | 371 obj = PostProcessNewObject(obj, space_number); |
374 } | 372 } |
| 373 if (FLAG_log_snapshot_positions) { |
| 374 LOG(isolate_, SnapshotPositionEvent(obj, position)); |
| 375 } |
375 | 376 |
376 Object* write_back_obj = obj; | 377 Object* write_back_obj = obj; |
377 UnalignedCopy(write_back, &write_back_obj); | 378 UnalignedCopy(write_back, &write_back_obj); |
378 #ifdef DEBUG | 379 #ifdef DEBUG |
379 if (obj->IsCode()) { | 380 if (obj->IsCode()) { |
380 DCHECK(space_number == CODE_SPACE || space_number == LO_SPACE); | 381 DCHECK(space_number == CODE_SPACE || space_number == LO_SPACE); |
381 } else { | 382 } else { |
382 DCHECK(space_number != CODE_SPACE); | 383 DCHECK(space_number != CODE_SPACE); |
383 } | 384 } |
384 #endif // DEBUG | 385 #endif // DEBUG |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 | 804 |
804 default: | 805 default: |
805 CHECK(false); | 806 CHECK(false); |
806 } | 807 } |
807 } | 808 } |
808 CHECK_EQ(limit, current); | 809 CHECK_EQ(limit, current); |
809 return true; | 810 return true; |
810 } | 811 } |
811 } // namespace internal | 812 } // namespace internal |
812 } // namespace v8 | 813 } // namespace v8 |
OLD | NEW |