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

Unified Diff: src/serialize.cc

Issue 8491008: MIPS: Enable serialization for MIPS architecture. (Closed)
Patch Set: Rebased on r10294, addressed some review comments Created 9 years 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 | « src/mips/assembler-mips-inl.h ('k') | test/cctest/cctest.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index d0a1a639f355d88797e3f796a9d424767d2754aa..577366716f080858f8191cf9b04a3b3af82bb4bd 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -761,6 +761,7 @@ void Deserializer::ReadObject(int space_number,
static const int kUnknownOffsetFromStart = -1;
+static const int kInstructionsForSplitImmediate = 3*kPointerSize;
void Deserializer::ReadChunk(Object** current,
Object** limit,
@@ -833,7 +834,12 @@ void Deserializer::ReadChunk(Object** current,
if (how == kFromCode) { \
Address location_of_branch_data = \
reinterpret_cast<Address>(current); \
- Assembler::set_target_at(location_of_branch_data, \
+ Address patch_site = location_of_branch_data; \
+ if (Assembler::kCallTargetSize == 0) { \
+ current_was_incremented = true; \
+ patch_site -= kInstructionsForSplitImmediate; \
+ } \
+ Assembler::set_target_at(patch_site, \
reinterpret_cast<Address>(new_object)); \
if (within == kFirstInstruction) { \
location_of_branch_data += Assembler::kCallTargetSize; \
@@ -967,6 +973,11 @@ void Deserializer::ReadChunk(Object** current,
// Deserialize a new object and write a pointer to it to the current
// object.
ONE_PER_SPACE(kNewObject, kPlain, kStartOfObject)
+ // Deserialize a new object from pointer found in code and write
+ // a pointer to it to the current object. Required only for MIPS.
+#if V8_TARGET_ARCH_MIPS
+ ONE_PER_SPACE(kNewObject, kFromCode, kStartOfObject)
+#endif
// Support for direct instruction pointers in functions
ONE_PER_CODE_SPACE(kNewObject, kPlain, kFirstInstruction)
// Deserialize a new code object and write a pointer to its first
@@ -976,6 +987,10 @@ void Deserializer::ReadChunk(Object** current,
// allocation point and write a pointer to it to the current object.
ALL_SPACES(kBackref, kPlain, kStartOfObject)
// Find a recently deserialized code object using its offset from the
+ // current allocation point and write a pointer to it to the current
+ // object. Required only for MIPS.
+ ALL_SPACES(kBackref, kFromCode, kStartOfObject)
+ // Find a recently deserialized code object using its offset from the
// current allocation point and write a pointer to its first instruction
// to the current code object or the instruction pointer in a function
// object.
@@ -989,10 +1004,21 @@ void Deserializer::ReadChunk(Object** current,
// start and write a pointer to its first instruction to the current code
// object.
ALL_SPACES(kFromStart, kFromCode, kFirstInstruction)
+ // Find an already deserialized code object using its offset from
+ // the start and write a pointer to it to the current object.
+ // Required only for MIPS.
+ ALL_SPACES(kFromStart, kFromCode, kStartOfObject)
// Find an object in the roots array and write a pointer to it to the
// current object.
CASE_STATEMENT(kRootArray, kPlain, kStartOfObject, 0)
CASE_BODY(kRootArray, kPlain, kStartOfObject, 0, kUnknownOffsetFromStart)
+ // Required only for MIPS.
+ CASE_STATEMENT(kRootArray, kFromCode, kStartOfObject, 0)
+ CASE_BODY(kRootArray,
+ kFromCode,
+ kStartOfObject,
+ 0,
+ kUnknownOffsetFromStart)
// Find an object in the partial snapshots cache and write a pointer to it
// to the current object.
CASE_STATEMENT(kPartialSnapshotCache, kPlain, kStartOfObject, 0)
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698