Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Unified Diff: src/snapshot/deserializer.cc

Issue 1989203004: [serializer] fix deserializing cell targets in code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/deserializer.cc
diff --git a/src/snapshot/deserializer.cc b/src/snapshot/deserializer.cc
index 88820ae6033efe63b29c13389d6e8545b2de2a63..fea9227606d83c9ef112602ff670a3da9af50d43 100644
--- a/src/snapshot/deserializer.cc
+++ b/src/snapshot/deserializer.cc
@@ -507,12 +507,11 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space,
emit_write_barrier = false; \
} \
if (within == kInnerPointer) { \
- if (space_number != CODE_SPACE || new_object->IsCode()) { \
- Code* new_code_object = reinterpret_cast<Code*>(new_object); \
+ if (new_object->IsCode()) { \
+ Code* new_code_object = Code::cast(new_object); \
new_object = \
reinterpret_cast<Object*>(new_code_object->instruction_start()); \
} else { \
- DCHECK(space_number == CODE_SPACE); \
Cell* cell = Cell::cast(new_object); \
new_object = reinterpret_cast<Object*>(cell->ValueAddress()); \
} \
@@ -579,6 +578,9 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space,
// pointer because it points at the entry point, not at the start of the
// code object.
SINGLE_CASE(kNewObject, kPlain, kInnerPointer, CODE_SPACE)
+ // Support for pointers into a cell. It's an inner pointer because it
+ // points directly at the value field, not the start of the cell object.
+ SINGLE_CASE(kNewObject, kPlain, kInnerPointer, OLD_SPACE)
// Deserialize a new code object and write a pointer to its first
// instruction to the current code object.
ALL_SPACES(kNewObject, kFromCode, kInnerPointer)
@@ -605,8 +607,12 @@ bool Deserializer::ReadData(Object** current, Object** limit, int source_space,
// object.
ALL_SPACES(kBackref, kFromCode, kInnerPointer)
ALL_SPACES(kBackrefWithSkip, kFromCode, kInnerPointer)
- ALL_SPACES(kBackref, kPlain, kInnerPointer)
- ALL_SPACES(kBackrefWithSkip, kPlain, kInnerPointer)
+ // Support for direct instruction pointers in functions.
+ SINGLE_CASE(kBackref, kPlain, kInnerPointer, CODE_SPACE)
+ SINGLE_CASE(kBackrefWithSkip, kPlain, kInnerPointer, CODE_SPACE)
+ // Support for pointers into a cell.
+ SINGLE_CASE(kBackref, kPlain, kInnerPointer, OLD_SPACE)
+ SINGLE_CASE(kBackrefWithSkip, kPlain, kInnerPointer, OLD_SPACE)
// Find an object in the roots array and write a pointer to it to the
// current object.
SINGLE_CASE(kRootArray, kPlain, kStartOfObject, 0)
« no previous file with comments | « no previous file | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698