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

Unified Diff: src/serialize.cc

Issue 9722020: Enable snapshots on MIPS. This is based on (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 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
Index: src/serialize.cc
===================================================================
--- src/serialize.cc (revision 11074)
+++ src/serialize.cc (working copy)
@@ -849,13 +849,12 @@
if (how == kFromCode) { \
Address location_of_branch_data = \
reinterpret_cast<Address>(current); \
- Assembler::set_target_at(location_of_branch_data, \
- reinterpret_cast<Address>(new_object)); \
- if (within == kFirstInstruction) { \
- location_of_branch_data += Assembler::kCallTargetSize; \
- current = reinterpret_cast<Object**>(location_of_branch_data); \
- current_was_incremented = true; \
- } \
+ Assembler::deserialization_set_special_target_at( \
+ location_of_branch_data, \
+ reinterpret_cast<Address>(new_object)); \
+ location_of_branch_data += Assembler::kSpecialTargetSize; \
+ current = reinterpret_cast<Object**>(location_of_branch_data); \
+ current_was_incremented = true; \
} else { \
*current = new_object; \
} \
@@ -991,7 +990,22 @@
// Find a recently deserialized object using its offset from the current
// allocation point and write a pointer to it to the current object.
ALL_SPACES(kBackref, kPlain, kStartOfObject)
+#if V8_TARGET_ARCH_MIPS
+ // Deserialize a new object from pointer found in code and write
+ // a pointer to it to the current object. Required only for MIPS, and
+ // omitted on the other architectures because it is fully unrolled and
+ // would cause bloat.
+ ONE_PER_SPACE(kNewObject, kFromCode, 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 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)
+#endif
+ // 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.
@@ -1229,12 +1243,23 @@
}
-int Serializer::RootIndex(HeapObject* heap_object) {
+int Serializer::RootIndex(HeapObject* heap_object, HowToCode from) {
Heap* heap = HEAP;
if (heap->InNewSpace(heap_object)) return kInvalidRootIndex;
for (int i = 0; i < root_index_wave_front_; i++) {
Object* root = heap->roots_array_start()[i];
- if (!root->IsSmi() && root == heap_object) return i;
+ if (!root->IsSmi() && root == heap_object) {
+#if V8_TARGET_ARCH_MIPS
+ if (from == kFromCode) {
+ // In order to avoid code bloat in the deserializer we don't have
+ // support for the encoding that specifies a particular root should
+ // be written into the lui/ori instructions on MIPS. Therefore we
+ // should not generate such serialization data for MIPS.
+ return kInvalidRootIndex;
+ }
+#endif
+ return i;
+ }
}
return kInvalidRootIndex;
}
@@ -1287,7 +1312,7 @@
HeapObject* heap_object = HeapObject::cast(o);
int root_index;
- if ((root_index = RootIndex(heap_object)) != kInvalidRootIndex) {
+ if ((root_index = RootIndex(heap_object, how_to_code)) != kInvalidRootIndex) {
PutRoot(root_index, heap_object, how_to_code, where_to_point);
return;
}
@@ -1359,7 +1384,7 @@
}
int root_index;
- if ((root_index = RootIndex(heap_object)) != kInvalidRootIndex) {
+ if ((root_index = RootIndex(heap_object, how_to_code)) != kInvalidRootIndex) {
PutRoot(root_index, heap_object, how_to_code, where_to_point);
return;
}
@@ -1439,7 +1464,7 @@
while (current < end && !(*current)->IsSmi()) {
HeapObject* current_contents = HeapObject::cast(*current);
- int root_index = serializer_->RootIndex(current_contents);
+ int root_index = serializer_->RootIndex(current_contents, kPlain);
// Repeats are not subject to the write barrier so there are only some
// objects that can be used in a repeat encoding. These are the early
// ones in the root array that are never in new space.
« no previous file with comments | « src/serialize.h ('k') | src/x64/assembler-x64.h » ('j') | test/cctest/cctest.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698