Chromium Code Reviews| Index: src/serialize.cc |
| diff --git a/src/serialize.cc b/src/serialize.cc |
| index d0a1a639f355d88797e3f796a9d424767d2754aa..5f5b1c8cdb9fcf7ce1061ecf3d2cf79db09b0d85 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; |
|
Erik Corry
2011/12/21 09:33:55
Inconsistency: This constant is premultiplied by k
kisg
2011/12/22 15:30:14
We will change the naming.
This constant is only u
|
| 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) { \ |
|
Erik Corry
2011/12/21 09:33:55
The size of a call target is only relevant if we a
kisg
2011/12/22 15:30:14
Actually, this is a subtle way of saying #ifdef MI
|
| + 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,9 @@ 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. |
| + ONE_PER_SPACE(kNewObject, kFromCode, kStartOfObject) |
|
Erik Corry
2011/12/21 09:33:55
I'm a bit worried about the code size here. The d
kisg
2011/12/22 15:30:14
Done.
|
| // 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 +985,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 +1002,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) |
|
Erik Corry
2011/12/21 09:33:55
Can we replace these with LoadRoot which does the
kisg
2011/12/22 15:30:14
Could you please elaborate this a bit in more deta
|
| + 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) |