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

Unified Diff: src/bootstrapper.cc

Issue 77773004: Build fix. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 a2d13d13409cdfc22ea370d37b0cabd9b58440fd..b7d10902820dcef4004d1eacf16a8e19274f3af8 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2634,19 +2634,13 @@ Genesis::Genesis(Isolate* isolate,
// We can't (de-)serialize typed arrays currently, but we are lucky: The state
// of the random number generator needs no initialization during snapshot
// creation time.
+ uint32_t* state = NULL;
if (!Serializer::enabled()) {
// Initially seed the per-context random number generator using the
// per-isolate random number generator.
const int num_elems = 2;
- uint32_t* state = new uint32_t[num_elems];
+ state = new uint32_t[num_elems];
const int num_bytes = num_elems * sizeof(*state);
- // We have to delete the state when the context dies, so we remember it in
- // the context (encoded as a Smi, our usual technique for aligned pointers)
- // and do the cleanup in WeakListVisitor<Context>::VisitPhantomObject().
- // This hack can go away when we have a way to allocate the backing store of
- // typed arrays on the heap.
- native_context()->set_random_state(reinterpret_cast<Smi*>(state));
- ASSERT(native_context()->random_state()->IsSmi());
do {
isolate->random_number_generator()->NextBytes(state, num_bytes);
@@ -2661,6 +2655,13 @@ Genesis::Genesis(Isolate* isolate,
Utils::OpenHandle(*ta),
NONE);
}
+ // TODO(svenpanne) We have to delete the state when the context dies, so we
+ // remember it in the context (encoded as a Smi, our usual technique for
+ // aligned pointers) and do the cleanup in
+ // WeakListVisitor<Context>::VisitPhantomObject(). This hack can go away when
+ // we have a way to allocate the backing store of typed arrays on the heap.
+ ASSERT(reinterpret_cast<Smi*>(state)->IsSmi());
+ native_context()->set_random_state(reinterpret_cast<Smi*>(state));
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