Reviewers: Michael Starzinger,

Description:
Do not serialize stack limits.

This is part of making snapshots reproducable, more to come...

Please review this at https://codereview.chromium.org/33193004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+13, -2 lines):
  M src/serialize.h
  M src/serialize.cc


Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 7e7c42cd8731149e3f3f17aaaeed050061d38d08..a232d8c9b5b4d8574e50c4c439a0a94b3c000078 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1326,6 +1326,14 @@ void PartialSerializer::Serialize(Object** object) {
 }


+bool Serializer::ShouldBeSkipped(Object** current) {
+  Object** roots = isolate()->heap()->roots_array_start();
+  return current == &roots[Heap::kStoreBufferTopRootIndex]
+      || current == &roots[Heap::kStackLimitRootIndex]
+      || current == &roots[Heap::kRealStackLimitRootIndex];
+}
+
+
 void Serializer::VisitPointers(Object** start, Object** end) {
   Isolate* isolate = this->isolate();;

@@ -1334,8 +1342,7 @@ void Serializer::VisitPointers(Object** start, Object** end) {
       root_index_wave_front_ =
Max(root_index_wave_front_, static_cast<intptr_t>(current - start));
     }
-    if (reinterpret_cast<Address>(current) ==
-        isolate->heap()->store_buffer()->TopAddress()) {
+    if (ShouldBeSkipped(current)) {
       sink_->Put(kSkip, "Skip");
       sink_->PutInt(kPointerSize, "SkipOneWord");
     } else if ((*current)->IsSmi()) {
Index: src/serialize.h
diff --git a/src/serialize.h b/src/serialize.h
index 9d6685be0e6579e468fb5a0ec1efc77b279af0cb..15d936979083e7f4663a249be4a35c685e8857b0 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -573,6 +573,10 @@ class Serializer : public SerializerDeserializer {

   int SpaceAreaSize(int space);

+ // Some roots should not be serialized, because their actual value depends on
+  // absolute addresses and they are reset after deserialization, anyway.
+  bool ShouldBeSkipped(Object** current);
+
   Isolate* isolate_;
   // Keep track of the fullness of each space in order to generate
   // relative addresses for back references.


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to