|
|
Descriptionmath.js: Use %_TypedArrayGetLength to get length
https://codereview.chromium.org/2001393004 makes TypedArray
length property writable, which means we shouldn't depend on it.
Instead, use %_TypedArrayGetLength% to get length.
Attached regression test.
BUG=chromium:615776
Committed: https://crrev.com/a7d091ffe385fc62e372f34317d97e6ea31a0a4a
Cr-Commit-Position: refs/heads/master@{#36655}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : trim test case #Patch Set 4 : remove second test case #Patch Set 5 : remove second test case for real #Patch Set 6 : fix mathrandom and test it #Patch Set 7 : fix error msg #Patch Set 8 : remove extra var #Patch Set 9 : install a length getter that throws #Patch Set 10 : don't use assertDoesNotThrow #Patch Set 11 : add typedarray check #Messages
Total messages: 40 (14 generated)
The CQ bit was checked by gsathya@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020203006/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2020203006/20001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use the %_TypedArrayGetLength% call to get length. Attached regression test. BUG=v8:615776 ========== to ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use the %_TypedArrayGetLength% call to get length. Attached regression test. BUG=v8:615776 ==========
gsathya@chromium.org changed reviewers: + yangguo@chromium.org
Description was changed from ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use the %_TypedArrayGetLength% call to get length. Attached regression test. BUG=v8:615776 ========== to ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=v8:615776 ==========
Description was changed from ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=v8:615776 ========== to ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=v8:615776 ==========
Description was changed from ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=v8:615776 ========== to ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=chromium:615776 ==========
On 2016/06/01 03:06:34, gsathya wrote: can you reduce the test case a bit? The current one only fails because WeakMap happens to be based on Math.random internally.
On 2016/06/01 03:06:34, gsathya wrote: can you reduce the test case a bit? The current one only fails because WeakMap happens to be based on Math.random internally.
On 2016/06/01 03:29:51, Yang wrote: > On 2016/06/01 03:06:34, gsathya wrote: > > can you reduce the test case a bit? The current one only fails because WeakMap > happens to be based on Math.random internally. I ended up removing the second test case (since they both fail because of the same thing). Let me know if you'd rather have a trimmed version of the second test case like in patchset3 (https://codereview.chromium.org/2020203006/#ps40001)
On 2016/06/01 03:41:58, gsathya wrote: > On 2016/06/01 03:29:51, Yang wrote: > > On 2016/06/01 03:06:34, gsathya wrote: > > > > can you reduce the test case a bit? The current one only fails because WeakMap > > happens to be based on Math.random internally. > > I ended up removing the second test case (since they both fail because of the > same thing). Let me know if you'd rather have a trimmed version of the second > test case like in patchset3 > (https://codereview.chromium.org/2020203006/#ps40001) lgtm. What I had in mind was to call Math.random directly.
On 2016/06/01 03:41:58, gsathya wrote: > On 2016/06/01 03:29:51, Yang wrote: > > On 2016/06/01 03:06:34, gsathya wrote: > > > > can you reduce the test case a bit? The current one only fails because WeakMap > > happens to be based on Math.random internally. > > I ended up removing the second test case (since they both fail because of the > same thing). Let me know if you'd rather have a trimmed version of the second > test case like in patchset3 > (https://codereview.chromium.org/2020203006/#ps40001) lgtm. What I had in mind was to call Math.random directly.
On 2016/06/01 03:45:03, Yang wrote: > On 2016/06/01 03:41:58, gsathya wrote: > > On 2016/06/01 03:29:51, Yang wrote: > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > can you reduce the test case a bit? The current one only fails because > WeakMap > > > happens to be based on Math.random internally. > > > > I ended up removing the second test case (since they both fail because of the > > same thing). Let me know if you'd rather have a trimmed version of the second > > test case like in patchset3 > > (https://codereview.chromium.org/2020203006/#ps40001) > > lgtm. What I had in mind was to call Math.random directly. Done. PTAL.
On 2016/06/01 04:27:08, gsathya wrote: > On 2016/06/01 03:45:03, Yang wrote: > > On 2016/06/01 03:41:58, gsathya wrote: > > > On 2016/06/01 03:29:51, Yang wrote: > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > can you reduce the test case a bit? The current one only fails because > > WeakMap > > > > happens to be based on Math.random internally. > > > > > > I ended up removing the second test case (since they both fail because of > the > > > same thing). Let me know if you'd rather have a trimmed version of the > second > > > test case like in patchset3 > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > lgtm. What I had in mind was to call Math.random directly. > > Done. PTAL. lgtm. however, this still requires MathRandom to not guard against zero-length typed array. I could imagine that, were it implemented slightly differently, it might simply carry on. We could install a getter for the length property that then either throws, or calls %Abort.
On 2016/06/01 04:33:30, Yang wrote: > On 2016/06/01 04:27:08, gsathya wrote: > > On 2016/06/01 03:45:03, Yang wrote: > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > can you reduce the test case a bit? The current one only fails because > > > WeakMap > > > > > happens to be based on Math.random internally. > > > > > > > > I ended up removing the second test case (since they both fail because of > > the > > > > same thing). Let me know if you'd rather have a trimmed version of the > > second > > > > test case like in patchset3 > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > Done. PTAL. > > lgtm. > > however, this still requires MathRandom to not guard against zero-length typed > array. I could imagine that, were it implemented slightly differently, it might > simply carry on. > > We could install a getter for the length property that then either throws, or > calls %Abort. Fair enough. Updated.
On 2016/06/01 04:43:34, gsathya wrote: > On 2016/06/01 04:33:30, Yang wrote: > > On 2016/06/01 04:27:08, gsathya wrote: > > > On 2016/06/01 03:45:03, Yang wrote: > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > can you reduce the test case a bit? The current one only fails because > > > > WeakMap > > > > > > happens to be based on Math.random internally. > > > > > > > > > > I ended up removing the second test case (since they both fail because > of > > > the > > > > > same thing). Let me know if you'd rather have a trimmed version of the > > > second > > > > > test case like in patchset3 > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > Done. PTAL. > > > > lgtm. > > > > however, this still requires MathRandom to not guard against zero-length typed > > array. I could imagine that, were it implemented slightly differently, it > might > > simply carry on. > > > > We could install a getter for the length property that then either throws, or > > calls %Abort. > > Fair enough. Updated. assertDoesNotThrow would take a closure. The way it is used it doesnt do anything, I think. It's also unnecessary. Let's remove it.
On 2016/06/01 04:46:06, Yang wrote: > On 2016/06/01 04:43:34, gsathya wrote: > > On 2016/06/01 04:33:30, Yang wrote: > > > On 2016/06/01 04:27:08, gsathya wrote: > > > > On 2016/06/01 03:45:03, Yang wrote: > > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > > > can you reduce the test case a bit? The current one only fails > because > > > > > WeakMap > > > > > > > happens to be based on Math.random internally. > > > > > > > > > > > > I ended up removing the second test case (since they both fail because > > of > > > > the > > > > > > same thing). Let me know if you'd rather have a trimmed version of the > > > > second > > > > > > test case like in patchset3 > > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > > > Done. PTAL. > > > > > > lgtm. > > > > > > however, this still requires MathRandom to not guard against zero-length > typed > > > array. I could imagine that, were it implemented slightly differently, it > > might > > > simply carry on. > > > > > > We could install a getter for the length property that then either throws, > or > > > calls %Abort. > > > > Fair enough. Updated. > > assertDoesNotThrow would take a closure. The way it is used it doesnt do > anything, I think. It's also unnecessary. Let's remove it. assertDoesNotThrow evals code, so it should work, but agreed that it isn't strictly necessary. Removed.
On 2016/06/01 04:52:30, gsathya wrote: > On 2016/06/01 04:46:06, Yang wrote: > > On 2016/06/01 04:43:34, gsathya wrote: > > > On 2016/06/01 04:33:30, Yang wrote: > > > > On 2016/06/01 04:27:08, gsathya wrote: > > > > > On 2016/06/01 03:45:03, Yang wrote: > > > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > > > > > can you reduce the test case a bit? The current one only fails > > because > > > > > > WeakMap > > > > > > > > happens to be based on Math.random internally. > > > > > > > > > > > > > > I ended up removing the second test case (since they both fail > because > > > of > > > > > the > > > > > > > same thing). Let me know if you'd rather have a trimmed version of > the > > > > > second > > > > > > > test case like in patchset3 > > > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > > > > > Done. PTAL. > > > > > > > > lgtm. > > > > > > > > however, this still requires MathRandom to not guard against zero-length > > typed > > > > array. I could imagine that, were it implemented slightly differently, it > > > might > > > > simply carry on. > > > > > > > > We could install a getter for the length property that then either throws, > > or > > > > calls %Abort. > > > > > > Fair enough. Updated. > > > > assertDoesNotThrow would take a closure. The way it is used it doesnt do > > anything, I think. It's also unnecessary. Let's remove it. > > assertDoesNotThrow evals code, so it should work, but agreed that it isn't > strictly necessary. Removed. Err, thought I had the calls within quotes. You're right it doesn't work. Anyways, removed.
On 2016/06/01 04:55:02, gsathya wrote: > On 2016/06/01 04:52:30, gsathya wrote: > > On 2016/06/01 04:46:06, Yang wrote: > > > On 2016/06/01 04:43:34, gsathya wrote: > > > > On 2016/06/01 04:33:30, Yang wrote: > > > > > On 2016/06/01 04:27:08, gsathya wrote: > > > > > > On 2016/06/01 03:45:03, Yang wrote: > > > > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > > > > > > > can you reduce the test case a bit? The current one only fails > > > because > > > > > > > WeakMap > > > > > > > > > happens to be based on Math.random internally. > > > > > > > > > > > > > > > > I ended up removing the second test case (since they both fail > > because > > > > of > > > > > > the > > > > > > > > same thing). Let me know if you'd rather have a trimmed version of > > the > > > > > > second > > > > > > > > test case like in patchset3 > > > > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > > > > > > > Done. PTAL. > > > > > > > > > > lgtm. > > > > > > > > > > however, this still requires MathRandom to not guard against zero-length > > > typed > > > > > array. I could imagine that, were it implemented slightly differently, > it > > > > might > > > > > simply carry on. > > > > > > > > > > We could install a getter for the length property that then either > throws, > > > or > > > > > calls %Abort. > > > > > > > > Fair enough. Updated. > > > > > > assertDoesNotThrow would take a closure. The way it is used it doesnt do > > > anything, I think. It's also unnecessary. Let's remove it. > > > > assertDoesNotThrow evals code, so it should work, but agreed that it isn't > > strictly necessary. Removed. > > Err, thought I had the calls within quotes. You're right it doesn't work. > Anyways, removed. lgtm.
The CQ bit was checked by gsathya@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020203006/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2020203006/180001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: v8_linux64_avx2_rel_ng on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/buil...) v8_linux64_avx2_rel_ng_triggered on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng_trig...)
The CQ bit was checked by gsathya@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020203006/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2020203006/200001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/06/01 05:01:48, Yang wrote: > On 2016/06/01 04:55:02, gsathya wrote: > > On 2016/06/01 04:52:30, gsathya wrote: > > > On 2016/06/01 04:46:06, Yang wrote: > > > > On 2016/06/01 04:43:34, gsathya wrote: > > > > > On 2016/06/01 04:33:30, Yang wrote: > > > > > > On 2016/06/01 04:27:08, gsathya wrote: > > > > > > > On 2016/06/01 03:45:03, Yang wrote: > > > > > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > > > > > > > > > can you reduce the test case a bit? The current one only fails > > > > because > > > > > > > > WeakMap > > > > > > > > > > happens to be based on Math.random internally. > > > > > > > > > > > > > > > > > > I ended up removing the second test case (since they both fail > > > because > > > > > of > > > > > > > the > > > > > > > > > same thing). Let me know if you'd rather have a trimmed version > of > > > the > > > > > > > second > > > > > > > > > test case like in patchset3 > > > > > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > > > > > > > > > Done. PTAL. > > > > > > > > > > > > lgtm. > > > > > > > > > > > > however, this still requires MathRandom to not guard against > zero-length > > > > typed > > > > > > array. I could imagine that, were it implemented slightly differently, > > it > > > > > might > > > > > > simply carry on. > > > > > > > > > > > > We could install a getter for the length property that then either > > throws, > > > > or > > > > > > calls %Abort. > > > > > > > > > > Fair enough. Updated. > > > > > > > > assertDoesNotThrow would take a closure. The way it is used it doesnt do > > > > anything, I think. It's also unnecessary. Let's remove it. > > > > > > assertDoesNotThrow evals code, so it should work, but agreed that it isn't > > > strictly necessary. Removed. > > > > Err, thought I had the calls within quotes. You're right it doesn't work. > > Anyways, removed. > > lgtm. PTAL. Turns out GenerateRandonNumbers also returns a JSArray during snapshot phase, so I need a IsTypedArray check.
On 2016/06/01 18:00:31, gsathya wrote: > On 2016/06/01 05:01:48, Yang wrote: > > On 2016/06/01 04:55:02, gsathya wrote: > > > On 2016/06/01 04:52:30, gsathya wrote: > > > > On 2016/06/01 04:46:06, Yang wrote: > > > > > On 2016/06/01 04:43:34, gsathya wrote: > > > > > > On 2016/06/01 04:33:30, Yang wrote: > > > > > > > On 2016/06/01 04:27:08, gsathya wrote: > > > > > > > > On 2016/06/01 03:45:03, Yang wrote: > > > > > > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > > > > > > > > > > > can you reduce the test case a bit? The current one only > fails > > > > > because > > > > > > > > > WeakMap > > > > > > > > > > > happens to be based on Math.random internally. > > > > > > > > > > > > > > > > > > > > I ended up removing the second test case (since they both fail > > > > because > > > > > > of > > > > > > > > the > > > > > > > > > > same thing). Let me know if you'd rather have a trimmed > version > > of > > > > the > > > > > > > > second > > > > > > > > > > test case like in patchset3 > > > > > > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > > > > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > > > > > > > > > > > Done. PTAL. > > > > > > > > > > > > > > lgtm. > > > > > > > > > > > > > > however, this still requires MathRandom to not guard against > > zero-length > > > > > typed > > > > > > > array. I could imagine that, were it implemented slightly > differently, > > > it > > > > > > might > > > > > > > simply carry on. > > > > > > > > > > > > > > We could install a getter for the length property that then either > > > throws, > > > > > or > > > > > > > calls %Abort. > > > > > > > > > > > > Fair enough. Updated. > > > > > > > > > > assertDoesNotThrow would take a closure. The way it is used it doesnt do > > > > > anything, I think. It's also unnecessary. Let's remove it. > > > > > > > > assertDoesNotThrow evals code, so it should work, but agreed that it isn't > > > > strictly necessary. Removed. > > > > > > Err, thought I had the calls within quotes. You're right it doesn't work. > > > Anyways, removed. > > > > lgtm. > > PTAL. Turns out GenerateRandonNumbers also returns a JSArray during snapshot > phase, so I need a IsTypedArray check. This only happens if we call Math.random before creating the snapshot. Which is not the usual case, and only used for custom startup snapshot. Can you check whether there is any performance regression for Math.random()? A micro-benchmark should suffice. If there is a regression, let's disable that one test that tests Math.random in custom startup snapshot for now, file a bug for that, and assign it to me.
On 2016/06/01 18:04:24, Yang wrote: > On 2016/06/01 18:00:31, gsathya wrote: > > On 2016/06/01 05:01:48, Yang wrote: > > > On 2016/06/01 04:55:02, gsathya wrote: > > > > On 2016/06/01 04:52:30, gsathya wrote: > > > > > On 2016/06/01 04:46:06, Yang wrote: > > > > > > On 2016/06/01 04:43:34, gsathya wrote: > > > > > > > On 2016/06/01 04:33:30, Yang wrote: > > > > > > > > On 2016/06/01 04:27:08, gsathya wrote: > > > > > > > > > On 2016/06/01 03:45:03, Yang wrote: > > > > > > > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > > > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > > > > > > > > > > > > > can you reduce the test case a bit? The current one only > > fails > > > > > > because > > > > > > > > > > WeakMap > > > > > > > > > > > > happens to be based on Math.random internally. > > > > > > > > > > > > > > > > > > > > > > I ended up removing the second test case (since they both > fail > > > > > because > > > > > > > of > > > > > > > > > the > > > > > > > > > > > same thing). Let me know if you'd rather have a trimmed > > version > > > of > > > > > the > > > > > > > > > second > > > > > > > > > > > test case like in patchset3 > > > > > > > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > > > > > > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > > > > > > > > > > > > > Done. PTAL. > > > > > > > > > > > > > > > > lgtm. > > > > > > > > > > > > > > > > however, this still requires MathRandom to not guard against > > > zero-length > > > > > > typed > > > > > > > > array. I could imagine that, were it implemented slightly > > differently, > > > > it > > > > > > > might > > > > > > > > simply carry on. > > > > > > > > > > > > > > > > We could install a getter for the length property that then either > > > > throws, > > > > > > or > > > > > > > > calls %Abort. > > > > > > > > > > > > > > Fair enough. Updated. > > > > > > > > > > > > assertDoesNotThrow would take a closure. The way it is used it doesnt > do > > > > > > anything, I think. It's also unnecessary. Let's remove it. > > > > > > > > > > assertDoesNotThrow evals code, so it should work, but agreed that it > isn't > > > > > strictly necessary. Removed. > > > > > > > > Err, thought I had the calls within quotes. You're right it doesn't work. > > > > Anyways, removed. > > > > > > lgtm. > > > > PTAL. Turns out GenerateRandonNumbers also returns a JSArray during snapshot > > phase, so I need a IsTypedArray check. > > This only happens if we call Math.random before creating the snapshot. Which is > not the usual case, and only used for custom startup snapshot. Can you check > whether there is any performance regression for Math.random()? A micro-benchmark > should suffice. If there is a regression, let's disable that one test that tests > Math.random in custom startup snapshot for now, file a bug for that, and assign > it to me. I don't see any regressions.
On 2016/06/01 18:27:15, gsathya wrote: > On 2016/06/01 18:04:24, Yang wrote: > > On 2016/06/01 18:00:31, gsathya wrote: > > > On 2016/06/01 05:01:48, Yang wrote: > > > > On 2016/06/01 04:55:02, gsathya wrote: > > > > > On 2016/06/01 04:52:30, gsathya wrote: > > > > > > On 2016/06/01 04:46:06, Yang wrote: > > > > > > > On 2016/06/01 04:43:34, gsathya wrote: > > > > > > > > On 2016/06/01 04:33:30, Yang wrote: > > > > > > > > > On 2016/06/01 04:27:08, gsathya wrote: > > > > > > > > > > On 2016/06/01 03:45:03, Yang wrote: > > > > > > > > > > > On 2016/06/01 03:41:58, gsathya wrote: > > > > > > > > > > > > On 2016/06/01 03:29:51, Yang wrote: > > > > > > > > > > > > > On 2016/06/01 03:06:34, gsathya wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > can you reduce the test case a bit? The current one only > > > fails > > > > > > > because > > > > > > > > > > > WeakMap > > > > > > > > > > > > > happens to be based on Math.random internally. > > > > > > > > > > > > > > > > > > > > > > > > I ended up removing the second test case (since they both > > fail > > > > > > because > > > > > > > > of > > > > > > > > > > the > > > > > > > > > > > > same thing). Let me know if you'd rather have a trimmed > > > version > > > > of > > > > > > the > > > > > > > > > > second > > > > > > > > > > > > test case like in patchset3 > > > > > > > > > > > > (https://codereview.chromium.org/2020203006/#ps40001) > > > > > > > > > > > > > > > > > > > > > > lgtm. What I had in mind was to call Math.random directly. > > > > > > > > > > > > > > > > > > > > Done. PTAL. > > > > > > > > > > > > > > > > > > lgtm. > > > > > > > > > > > > > > > > > > however, this still requires MathRandom to not guard against > > > > zero-length > > > > > > > typed > > > > > > > > > array. I could imagine that, were it implemented slightly > > > differently, > > > > > it > > > > > > > > might > > > > > > > > > simply carry on. > > > > > > > > > > > > > > > > > > We could install a getter for the length property that then > either > > > > > throws, > > > > > > > or > > > > > > > > > calls %Abort. > > > > > > > > > > > > > > > > Fair enough. Updated. > > > > > > > > > > > > > > assertDoesNotThrow would take a closure. The way it is used it > doesnt > > do > > > > > > > anything, I think. It's also unnecessary. Let's remove it. > > > > > > > > > > > > assertDoesNotThrow evals code, so it should work, but agreed that it > > isn't > > > > > > strictly necessary. Removed. > > > > > > > > > > Err, thought I had the calls within quotes. You're right it doesn't > work. > > > > > Anyways, removed. > > > > > > > > lgtm. > > > > > > PTAL. Turns out GenerateRandonNumbers also returns a JSArray during snapshot > > > phase, so I need a IsTypedArray check. > > > > This only happens if we call Math.random before creating the snapshot. Which > is > > not the usual case, and only used for custom startup snapshot. Can you check > > whether there is any performance regression for Math.random()? A > micro-benchmark > > should suffice. If there is a regression, let's disable that one test that > tests > > Math.random in custom startup snapshot for now, file a bug for that, and > assign > > it to me. > > I don't see any regressions. LGTM. I remember that there are some Kraken or Sunspider benchmarks that rely on Math.random, which is why I'm asking.
The CQ bit was checked by gsathya@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2020203006/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2020203006/200001
Message was sent while issue was closed.
Description was changed from ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=chromium:615776 ========== to ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=chromium:615776 ==========
Message was sent while issue was closed.
Committed patchset #11 (id:200001)
Message was sent while issue was closed.
Description was changed from ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=chromium:615776 ========== to ========== math.js: Use %_TypedArrayGetLength to get length https://codereview.chromium.org/2001393004 makes TypedArray length property writable, which means we shouldn't depend on it. Instead, use %_TypedArrayGetLength% to get length. Attached regression test. BUG=chromium:615776 Committed: https://crrev.com/a7d091ffe385fc62e372f34317d97e6ea31a0a4a Cr-Commit-Position: refs/heads/master@{#36655} ==========
Message was sent while issue was closed.
Patchset 11 (id:??) landed as https://crrev.com/a7d091ffe385fc62e372f34317d97e6ea31a0a4a Cr-Commit-Position: refs/heads/master@{#36655} |