Reviewers: mvstanton,

Description:
Serializer: reset typed array cell type.

[email protected]
BUG=chromium:449937
LOG=N

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+11, -5 lines):
  M src/bootstrapper.cc
  M src/serialize.cc


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 049519b6a83f08c224f13e49e12060cb93c967da..5de9e9d77c1eaef887f03f2265f51a22bc868d20 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2813,9 +2813,11 @@ Genesis::Genesis(Isolate* isolate,
     Utils::OpenHandle(*buffer)->set_should_be_freed(true);
v8::Local<v8::Uint32Array> ta = v8::Uint32Array::New(buffer, 0, num_elems);
     Handle<JSBuiltinsObject> builtins(native_context()->builtins());
- Runtime::DefineObjectProperty(builtins, factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("rngstate")),
-                                  Utils::OpenHandle(*ta), NONE).Assert();
+
+    JSObject::SetOwnPropertyIgnoreAttributes(
+        builtins,
+ factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("rngstate")),
+        Utils::OpenHandle(*ta), DONT_DELETE).Assert();

     // Initialize trigonometric lookup tables and constants.
     const int constants_size = arraysize(fdlibm::MathConstants::constants);
@@ -2826,10 +2828,10 @@ Genesis::Genesis(Isolate* isolate,
     v8::Local<v8::Float64Array> trig_table =
         v8::Float64Array::New(trig_buffer, 0, constants_size);

-    Runtime::DefineObjectProperty(
+    JSObject::SetOwnPropertyIgnoreAttributes(
         builtins,
         factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("kMath")),
-        Utils::OpenHandle(*trig_table), NONE).Assert();
+        Utils::OpenHandle(*trig_table), DONT_DELETE).Assert();
   }

   result_ = native_context();
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 140902f5751eb4d034bcdcbdf366abea1cfa5190..3882c6210bb6498e685df665019a659f6957bb16 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1673,6 +1673,10 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,

   // Replace typed arrays by undefined.
   if (obj->IsJSTypedArray()) obj = isolate_->heap()->undefined_value();
+  if (obj->IsPropertyCell()) {
+    PropertyCell* cell = PropertyCell::cast(obj);
+    if (cell->value()->IsJSTypedArray()) cell->set_type(HeapType::None());
+  }

   int root_index = root_index_map_.Lookup(obj);
   if (root_index != RootIndexMap::kInvalidRootIndex) {


--
--
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/d/optout.

Reply via email to