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

Issue 2760393002: Enable deterministic random number generation (Closed)

Created:
3 years, 9 months ago by Sami
Modified:
3 years, 9 months ago
Reviewers:
rmcilroy, Yang
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

Enable deterministic random number generation This patch makes Math.random() behave deterministically when a fixed random seed is provided. This is done by re-seeding the random number generator the first time a script requests a random number. Doing this ensures Math.random() returns the same sequence across page loads and across iframes. BUG=chromium:696001 Review-Url: https://codereview.chromium.org/2760393002 Cr-Commit-Position: refs/heads/master@{#44076} Committed: https://chromium.googlesource.com/v8/v8/+/9b152fdafdd55f5e5ada88b9fae296d823f797c8

Patch Set 1 #

Patch Set 2 : Reset in Runtime_GenerateRandomNumbers instead #

Total comments: 2

Patch Set 3 : Initialize state directly #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -4 lines) Patch
M src/runtime/runtime-maths.cc View 1 2 1 chunk +12 lines, -4 lines 0 comments Download
M test/cctest/test-api.cc View 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (14 generated)
Sami
Hey Ross, can you review and/or suggest a reviewer?
3 years, 9 months ago (2017-03-21 18:51:43 UTC) #3
rmcilroy
Looks reasonable to me but I think Yang would be the best review for this. ...
3 years, 9 months ago (2017-03-22 16:37:23 UTC) #9
Yang
On 2017/03/22 16:37:23, rmcilroy wrote: > Looks reasonable to me but I think Yang would ...
3 years, 9 months ago (2017-03-22 18:12:03 UTC) #10
Sami
On 2017/03/22 18:12:03, Yang wrote: > On 2017/03/22 16:37:23, rmcilroy wrote: > > Looks reasonable ...
3 years, 9 months ago (2017-03-22 20:08:12 UTC) #11
Yang
On 2017/03/22 20:08:12, Sami wrote: > On 2017/03/22 18:12:03, Yang wrote: > > On 2017/03/22 ...
3 years, 9 months ago (2017-03-22 20:31:33 UTC) #12
Yang
On 2017/03/22 20:31:33, Yang wrote: > On 2017/03/22 20:08:12, Sami wrote: > > On 2017/03/22 ...
3 years, 9 months ago (2017-03-23 08:32:24 UTC) #13
Sami
On 2017/03/23 08:32:24, Yang wrote: > V8 offers a --predictable flag, which turns off concurrency ...
3 years, 9 months ago (2017-03-23 10:52:37 UTC) #14
Yang
On 2017/03/23 10:52:37, Sami wrote: > On 2017/03/23 08:32:24, Yang wrote: > > V8 offers ...
3 years, 9 months ago (2017-03-23 11:01:55 UTC) #15
Sami
On 2017/03/23 11:01:55, Yang wrote: > I'm not trying to assign blame here, but if ...
3 years, 9 months ago (2017-03-23 12:26:28 UTC) #16
Yang
LGTM, with a suggestion though. https://codereview.chromium.org/2760393002/diff/20001/src/runtime/runtime-maths.cc File src/runtime/runtime-maths.cc (right): https://codereview.chromium.org/2760393002/diff/20001/src/runtime/runtime-maths.cc#newcode45 src/runtime/runtime-maths.cc:45: isolate->random_number_generator()->SetSeed(FLAG_random_seed); I wonder whether ...
3 years, 9 months ago (2017-03-23 12:30:13 UTC) #17
Yang
On 2017/03/23 12:30:13, Yang wrote: > LGTM, with a suggestion though. > > https://codereview.chromium.org/2760393002/diff/20001/src/runtime/runtime-maths.cc > ...
3 years, 9 months ago (2017-03-23 12:33:12 UTC) #18
Sami
On 2017/03/23 12:33:12, Yang wrote: > Oh and please update CL description! Thanks, done!
3 years, 9 months ago (2017-03-23 16:52:41 UTC) #20
Yang
On 2017/03/23 16:52:41, Sami wrote: > On 2017/03/23 12:33:12, Yang wrote: > > Oh and ...
3 years, 9 months ago (2017-03-23 16:53:56 UTC) #21
Sami
Initialize state directly
3 years, 9 months ago (2017-03-23 17:00:18 UTC) #22
Sami
https://codereview.chromium.org/2760393002/diff/20001/src/runtime/runtime-maths.cc File src/runtime/runtime-maths.cc (right): https://codereview.chromium.org/2760393002/diff/20001/src/runtime/runtime-maths.cc#newcode45 src/runtime/runtime-maths.cc:45: isolate->random_number_generator()->SetSeed(FLAG_random_seed); On 2017/03/23 12:30:13, Yang wrote: > I wonder ...
3 years, 9 months ago (2017-03-23 17:00:27 UTC) #23
Yang
On 2017/03/23 17:00:27, Sami wrote: > https://codereview.chromium.org/2760393002/diff/20001/src/runtime/runtime-maths.cc > File src/runtime/runtime-maths.cc (right): > > https://codereview.chromium.org/2760393002/diff/20001/src/runtime/runtime-maths.cc#newcode45 > ...
3 years, 9 months ago (2017-03-23 17:22:23 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2760393002/40001
3 years, 9 months ago (2017-03-23 17:44:58 UTC) #29
commit-bot: I haz the power
3 years, 9 months ago (2017-03-23 18:14:48 UTC) #32
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/v8/v8/+/9b152fdafdd55f5e5ada88b9fae296d823f...

Powered by Google App Engine
This is Rietveld 408576698