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

Unified Diff: src/serialize.cc

Issue 3197010: Version 2.3.10... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 4 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 | « src/serialize.h ('k') | src/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
===================================================================
--- src/serialize.cc (revision 5316)
+++ src/serialize.cc (working copy)
@@ -831,6 +831,12 @@
CASE_STATEMENT(where, how, within, kLargeFixedArray) \
CASE_BODY(where, how, within, kAnyOldSpace, kUnknownOffsetFromStart)
+#define ONE_PER_CODE_SPACE(where, how, within) \
+ CASE_STATEMENT(where, how, within, CODE_SPACE) \
+ CASE_BODY(where, how, within, CODE_SPACE, kUnknownOffsetFromStart) \
+ CASE_STATEMENT(where, how, within, kLargeCode) \
+ CASE_BODY(where, how, within, LO_SPACE, kUnknownOffsetFromStart)
+
#define EMIT_COMMON_REFERENCE_PATTERNS(pseudo_space_number, \
space_number, \
offset_from_start) \
@@ -862,6 +868,8 @@
// Deserialize a new object and write a pointer to it to the current
// object.
ONE_PER_SPACE(kNewObject, kPlain, kStartOfObject)
+ // 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
// instruction to the current code object.
ONE_PER_SPACE(kNewObject, kFromCode, kFirstInstruction)
@@ -870,11 +878,14 @@
ALL_SPACES(kBackref, kPlain, 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.
+ // to the current code object or the instruction pointer in a function
+ // object.
ALL_SPACES(kBackref, kFromCode, kFirstInstruction)
+ ALL_SPACES(kBackref, kPlain, kFirstInstruction)
// Find an already deserialized object using its offset from the start
// and write a pointer to it to the current object.
ALL_SPACES(kFromStart, kPlain, kStartOfObject)
+ ALL_SPACES(kFromStart, kPlain, kFirstInstruction)
// Find an already deserialized code object using its offset from the
// start and write a pointer to its first instruction to the current code
// object.
@@ -894,6 +905,14 @@
kStartOfObject,
0,
kUnknownOffsetFromStart)
+ // Find an code entry in the partial snapshots cache and
+ // write a pointer to it to the current object.
+ CASE_STATEMENT(kPartialSnapshotCache, kPlain, kFirstInstruction, 0)
+ CASE_BODY(kPartialSnapshotCache,
+ kPlain,
+ kFirstInstruction,
+ 0,
+ kUnknownOffsetFromStart)
// Find an external reference and write a pointer to it to the current
// object.
CASE_STATEMENT(kExternalReference, kPlain, kStartOfObject, 0)
@@ -1336,6 +1355,14 @@
}
+void Serializer::ObjectSerializer::VisitCodeEntry(Address entry_address) {
+ Code* target = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
+ OutputRawData(entry_address);
+ serializer_->SerializeObject(target, kPlain, kFirstInstruction);
+ bytes_processed_so_far_ += kPointerSize;
+}
+
+
void Serializer::ObjectSerializer::VisitExternalAsciiString(
v8::String::ExternalAsciiStringResource** resource_pointer) {
Address references_start = reinterpret_cast<Address>(resource_pointer);
« no previous file with comments | « src/serialize.h ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698