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

Unified Diff: src/bootstrapper.cc

Issue 861583002: Serializer: reset typed array cell type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 049519b6a83f08c224f13e49e12060cb93c967da..560542de400ccd0470fd03cc102443270fe780f4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2813,9 +2813,13 @@ 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();
+
+ Handle<String> rngstate =
+ factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("rngstate"));
+ // Reset property cell type before (re)initializing.
+ JSBuiltinsObject::InvalidatePropertyCell(builtins, rngstate);
+ JSObject::SetOwnPropertyIgnoreAttributes(
+ builtins, rngstate, Utils::OpenHandle(*ta), DONT_DELETE).Assert();
// Initialize trigonometric lookup tables and constants.
const int constants_size = arraysize(fdlibm::MathConstants::constants);
@@ -2826,10 +2830,12 @@ Genesis::Genesis(Isolate* isolate,
v8::Local<v8::Float64Array> trig_table =
v8::Float64Array::New(trig_buffer, 0, constants_size);
- Runtime::DefineObjectProperty(
- builtins,
- factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("kMath")),
- Utils::OpenHandle(*trig_table), NONE).Assert();
+ Handle<String> kmath =
+ factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("kMath"));
+ // Reset property cell type before (re)initializing.
+ JSBuiltinsObject::InvalidatePropertyCell(builtins, kmath);
+ JSObject::SetOwnPropertyIgnoreAttributes(
+ builtins, kmath, Utils::OpenHandle(*trig_table), DONT_DELETE).Assert();
}
result_ = native_context();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698