diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-09-08 17:14:42 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-09-08 17:14:42 -0700 |
commit | 8796ed22783bbbb9d286463e27db275325106fed (patch) | |
tree | c4d13c9a6dc9196925489392ffe589f4d43d8939 /deps/v8/src/serialize.cc | |
parent | 512016fd7441d8919c29f369a38622ab1dd01942 (diff) | |
download | node-new-8796ed22783bbbb9d286463e27db275325106fed.tar.gz |
Upgrade V8 to 2.4.2
Diffstat (limited to 'deps/v8/src/serialize.cc')
-rw-r--r-- | deps/v8/src/serialize.cc | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/deps/v8/src/serialize.cc b/deps/v8/src/serialize.cc index 0057d18f1d..cde7577c7a 100644 --- a/deps/v8/src/serialize.cc +++ b/deps/v8/src/serialize.cc @@ -241,16 +241,6 @@ void ExternalReferenceTable::PopulateTable() { DEBUG_ADDRESS, Debug::k_restarter_frame_function_pointer << kDebugIdShift, "Debug::restarter_frame_function_pointer_address()"); - const char* debug_register_format = "Debug::register_address(%i)"; - int dr_format_length = StrLength(debug_register_format); - for (int i = 0; i < kNumJSCallerSaved; ++i) { - Vector<char> name = Vector<char>::New(dr_format_length + 1); - OS::SNPrintF(name, debug_register_format, i); - Add(Debug_Address(Debug::k_register_address, i).address(), - DEBUG_ADDRESS, - Debug::k_register_address << kDebugIdShift | i, - name.start()); - } #endif // Stat counters @@ -831,6 +821,12 @@ void Deserializer::ReadChunk(Object** current, 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 +858,8 @@ 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) + // 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 +868,14 @@ void Deserializer::ReadChunk(Object** current, 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 +895,14 @@ void Deserializer::ReadChunk(Object** current, 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 +1345,14 @@ void Serializer::ObjectSerializer::VisitCodeTarget(RelocInfo* rinfo) { } +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); |