Revision f230a1cf deps/v8/src/serialize.cc
deps/v8/src/serialize.cc | ||
---|---|---|
532 | 532 |
UNCLASSIFIED, |
533 | 533 |
52, |
534 | 534 |
"cpu_features"); |
535 |
Add(ExternalReference::new_space_allocation_top_address(isolate).address(), |
|
536 |
UNCLASSIFIED, |
|
537 |
53, |
|
538 |
"Heap::NewSpaceAllocationTopAddress"); |
|
539 |
Add(ExternalReference::new_space_allocation_limit_address(isolate).address(), |
|
540 |
UNCLASSIFIED, |
|
541 |
54, |
|
542 |
"Heap::NewSpaceAllocationLimitAddress"); |
|
543 | 535 |
Add(ExternalReference(Runtime::kAllocateInNewSpace, isolate).address(), |
544 | 536 |
UNCLASSIFIED, |
545 |
55,
|
|
537 |
53,
|
|
546 | 538 |
"Runtime::AllocateInNewSpace"); |
547 | 539 |
Add(ExternalReference::old_pointer_space_allocation_top_address( |
548 | 540 |
isolate).address(), |
549 | 541 |
UNCLASSIFIED, |
550 |
56,
|
|
542 |
54,
|
|
551 | 543 |
"Heap::OldPointerSpaceAllocationTopAddress"); |
552 | 544 |
Add(ExternalReference::old_pointer_space_allocation_limit_address( |
553 | 545 |
isolate).address(), |
554 | 546 |
UNCLASSIFIED, |
555 |
57,
|
|
547 |
55,
|
|
556 | 548 |
"Heap::OldPointerSpaceAllocationLimitAddress"); |
557 | 549 |
Add(ExternalReference(Runtime::kAllocateInOldPointerSpace, isolate).address(), |
558 | 550 |
UNCLASSIFIED, |
559 |
58,
|
|
551 |
56,
|
|
560 | 552 |
"Runtime::AllocateInOldPointerSpace"); |
561 | 553 |
Add(ExternalReference::old_data_space_allocation_top_address( |
562 | 554 |
isolate).address(), |
563 | 555 |
UNCLASSIFIED, |
564 |
59,
|
|
556 |
57,
|
|
565 | 557 |
"Heap::OldDataSpaceAllocationTopAddress"); |
566 | 558 |
Add(ExternalReference::old_data_space_allocation_limit_address( |
567 | 559 |
isolate).address(), |
568 | 560 |
UNCLASSIFIED, |
569 |
60,
|
|
561 |
58,
|
|
570 | 562 |
"Heap::OldDataSpaceAllocationLimitAddress"); |
571 | 563 |
Add(ExternalReference(Runtime::kAllocateInOldDataSpace, isolate).address(), |
572 | 564 |
UNCLASSIFIED, |
573 |
61,
|
|
565 |
59,
|
|
574 | 566 |
"Runtime::AllocateInOldDataSpace"); |
575 | 567 |
Add(ExternalReference::new_space_high_promotion_mode_active_address(isolate). |
576 | 568 |
address(), |
577 | 569 |
UNCLASSIFIED, |
578 |
62,
|
|
570 |
60,
|
|
579 | 571 |
"Heap::NewSpaceAllocationLimitAddress"); |
580 | 572 |
Add(ExternalReference::allocation_sites_list_address(isolate).address(), |
581 | 573 |
UNCLASSIFIED, |
582 |
63,
|
|
574 |
61,
|
|
583 | 575 |
"Heap::allocation_sites_list_address()"); |
576 |
Add(ExternalReference::record_object_allocation_function(isolate).address(), |
|
577 |
UNCLASSIFIED, |
|
578 |
62, |
|
579 |
"HeapProfiler::RecordObjectAllocationFromMasm"); |
|
580 |
Add(ExternalReference::address_of_uint32_bias().address(), |
|
581 |
UNCLASSIFIED, |
|
582 |
63, |
|
583 |
"uint32_bias"); |
|
584 |
Add(ExternalReference::get_mark_code_as_executed_function(isolate).address(), |
|
585 |
UNCLASSIFIED, |
|
586 |
64, |
|
587 |
"Code::MarkCodeAsExecuted"); |
|
584 | 588 |
|
585 | 589 |
// Add a small set of deopt entry addresses to encoder without generating the |
586 | 590 |
// deopt table code, which isn't possible at deserialization time. |
... | ... | |
835 | 839 |
isolate_->heap()->undefined_value()); |
836 | 840 |
} |
837 | 841 |
|
842 |
isolate_->heap()->InitializeWeakObjectToCodeTable(); |
|
843 |
|
|
838 | 844 |
// Update data pointers to the external strings containing natives sources. |
839 | 845 |
for (int i = 0; i < Natives::GetBuiltinsCount(); i++) { |
840 | 846 |
Object* source = isolate_->heap()->natives_source_cache()->get(i); |
... | ... | |
1284 | 1290 |
root_index_wave_front_(0) { |
1285 | 1291 |
// The serializer is meant to be used only to generate initial heap images |
1286 | 1292 |
// from a context in which there is only one isolate. |
1287 |
ASSERT(isolate_->IsDefaultIsolate()); |
|
1288 | 1293 |
for (int i = 0; i <= LAST_SPACE; i++) { |
1289 | 1294 |
fullness_[i] = 0; |
1290 | 1295 |
} |
... | ... | |
1317 | 1322 |
} |
1318 | 1323 |
|
1319 | 1324 |
|
1325 |
bool Serializer::ShouldBeSkipped(Object** current) { |
|
1326 |
Object** roots = isolate()->heap()->roots_array_start(); |
|
1327 |
return current == &roots[Heap::kStoreBufferTopRootIndex] |
|
1328 |
|| current == &roots[Heap::kStackLimitRootIndex] |
|
1329 |
|| current == &roots[Heap::kRealStackLimitRootIndex]; |
|
1330 |
} |
|
1331 |
|
|
1332 |
|
|
1320 | 1333 |
void Serializer::VisitPointers(Object** start, Object** end) { |
1321 | 1334 |
Isolate* isolate = this->isolate();; |
1322 | 1335 |
|
... | ... | |
1325 | 1338 |
root_index_wave_front_ = |
1326 | 1339 |
Max(root_index_wave_front_, static_cast<intptr_t>(current - start)); |
1327 | 1340 |
} |
1328 |
if (reinterpret_cast<Address>(current) == |
|
1329 |
isolate->heap()->store_buffer()->TopAddress()) { |
|
1341 |
if (ShouldBeSkipped(current)) { |
|
1330 | 1342 |
sink_->Put(kSkip, "Skip"); |
1331 | 1343 |
sink_->PutInt(kPointerSize, "SkipOneWord"); |
1332 | 1344 |
} else if ((*current)->IsSmi()) { |
... | ... | |
1666 | 1678 |
} |
1667 | 1679 |
|
1668 | 1680 |
|
1669 |
void Serializer::ObjectSerializer::VisitExternalReferences(Address* start, |
|
1670 |
Address* end) { |
|
1671 |
Address references_start = reinterpret_cast<Address>(start); |
|
1681 |
void Serializer::ObjectSerializer::VisitExternalReference(Address* p) { |
|
1682 |
Address references_start = reinterpret_cast<Address>(p); |
|
1672 | 1683 |
int skip = OutputRawData(references_start, kCanReturnSkipInsteadOfSkipping); |
1673 | 1684 |
|
1674 |
for (Address* current = start; current < end; current++) { |
|
1675 |
sink_->Put(kExternalReference + kPlain + kStartOfObject, "ExternalRef"); |
|
1676 |
sink_->PutInt(skip, "SkipB4ExternalRef"); |
|
1677 |
skip = 0; |
|
1678 |
int reference_id = serializer_->EncodeExternalReference(*current); |
|
1679 |
sink_->PutInt(reference_id, "reference id"); |
|
1680 |
} |
|
1681 |
bytes_processed_so_far_ += static_cast<int>((end - start) * kPointerSize); |
|
1685 |
sink_->Put(kExternalReference + kPlain + kStartOfObject, "ExternalRef"); |
|
1686 |
sink_->PutInt(skip, "SkipB4ExternalRef"); |
|
1687 |
int reference_id = serializer_->EncodeExternalReference(*p); |
|
1688 |
sink_->PutInt(reference_id, "reference id"); |
|
1689 |
bytes_processed_so_far_ += kPointerSize; |
|
1682 | 1690 |
} |
1683 | 1691 |
|
1684 | 1692 |
|
Also available in: Unified diff