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

Issue 23589002: MIPS: Fix return-value from Array.push stub when pushing non-SMI value (Closed)

Created:
7 years, 3 months ago by fs
Modified:
7 years, 1 month ago
CC:
v8-dev, petarj, Mostyn Bramley-Moore
Visibility:
Public.

Description

MIPS: Fix return-value from Array.push stub when pushing non-SMI value Load and update the arrays length in v0 to make sure the length gets returned correctly when leaving the function. Add new testcase. TEST=mjsunit/array-push-non-smi-value BUG=130022

Patch Set 1 #

Total comments: 4

Patch Set 2 : "Rewind" testcase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -12 lines) Patch
M src/mips/stub-cache-mips.cc View 1 chunk +6 lines, -6 lines 0 comments Download
A + test/mjsunit/array-push-non-smi-value.js View 1 1 chunk +7 lines, -6 lines 1 comment Download

Messages

Total messages: 7 (0 generated)
fs
Fix for a MIPS-specific Array.push issue.
7 years, 3 months ago (2013-08-27 12:23:41 UTC) #1
Jakob Kummerow
+Paul and Akos for the MIPS change. The test case doesn't make much sense to ...
7 years, 3 months ago (2013-08-27 13:58:36 UTC) #2
Paul Lind
This looks-good-to-me, a very nice fix. This is (unfortunately) a common error pattern for MIPS ...
7 years, 3 months ago (2013-08-27 15:08:33 UTC) #3
fs
Rolled back the TC a few steps. Hope it's less puzzling now... https://codereview.chromium.org/23589002/diff/1/test/mjsunit/array-push-non-smi-value.js File test/mjsunit/array-push-non-smi-value.js ...
7 years, 3 months ago (2013-08-27 16:16:12 UTC) #4
Jakob Kummerow
Test case now LGTM with comment. https://codereview.chromium.org/23589002/diff/7001/test/mjsunit/array-push-non-smi-value.js File test/mjsunit/array-push-non-smi-value.js (right): https://codereview.chromium.org/23589002/diff/7001/test/mjsunit/array-push-non-smi-value.js#newcode28 test/mjsunit/array-push-non-smi-value.js:28: // Flags: --allow-natives-syntax ...
7 years, 3 months ago (2013-08-27 16:52:53 UTC) #5
Paul Lind
LGTM, I'll land this for you, and will remove the --allow-natives-syntax flag. Thanks a lot ...
7 years, 3 months ago (2013-08-28 05:21:46 UTC) #6
Jakob Kummerow
7 years, 3 months ago (2013-08-28 07:55:05 UTC) #7
On 2013/08/27 16:16:12, fs wrote:
> (I'm can't claim to be
> entirely familiar with all details around stubs, so guidance towards a better
TC
> would be most appreciated.)

Well, you're fixing a bug, so the primary point of the test is that it fails
without your patch (proving that there is, in fact, a bug) and passes with your
patch (proving that the patch fixes the bug). So the way to build such a test is
to take the unpatched binary and write a test that fails with it; then if
necessary iterate on it until you like it (trim it down, clean it up, whatever
-- or extend it to also cover related cases, depending on what the issue is),
always making sure that it still fails as expected for the bug(s) you're about
to fix.

Runtime function calls like %OptimizeFunctionOnNextCall (which are only allowed
when the --allow-natives-syntax flag is present) are tools that help recreate
specific circumstances in tests, if those are required to (reliably) trigger a
bug. There's no reason to use them if you don't need them.

Powered by Google App Engine
This is Rietveld 408576698