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

Issue 7514040: tighten invariants of HValue::InferRange (Closed)

Created:
9 years, 5 months ago by wingo
Modified:
9 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

tighten invariants of HValue::InferRange * src/hydrogen-instructions.cc (HValue::InferRange): Only mark values with int32 representation as never being -0. Always return a non-NULL value; callers should check for representation().IsNone() if that's their concern. In practice these invariants were not violated by callers, but they were sometimes two calls away, which seems brittle. BUG= TEST=tests pass, modulo http://code.google.com/p/v8/issues/detail?id=1572 Committed: http://code.google.com/p/v8/source/detail?r=8804

Patch Set 1 #

Patch Set 2 : add unit tests for -0 bug #

Patch Set 3 : fix presubmit error #

Patch Set 4 : another wee presubmit thing, sigh #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -10 lines) Patch
M src/hydrogen-instructions.cc View 1 2 3 1 chunk +6 lines, -9 lines 0 comments Download
M test/mjsunit/math-floor.js View 1 2 chunks +28 lines, -0 lines 2 comments Download
M test/mjsunit/math-round.js View 1 2 chunks +17 lines, -1 line 1 comment Download

Messages

Total messages: 5 (0 generated)
wingo
9 years, 5 months ago (2011-07-27 10:40:08 UTC) #1
fschneider
LGTM.
9 years, 4 months ago (2011-07-28 09:09:59 UTC) #2
wingo
The tests that I have added in this updated patch show the -0 bug. I ...
9 years, 4 months ago (2011-08-01 14:34:49 UTC) #3
Kevin Millikin (Chromium)
I'll clean up the test a bit and commit. http://codereview.chromium.org/7514040/diff/8001/test/mjsunit/math-floor.js File test/mjsunit/math-floor.js (right): http://codereview.chromium.org/7514040/diff/8001/test/mjsunit/math-floor.js#newcode55 test/mjsunit/math-floor.js:55: ...
9 years, 4 months ago (2011-08-02 10:24:13 UTC) #4
wingo
9 years, 4 months ago (2011-08-02 13:19:27 UTC) #5
Thanks for the review, the pointers on style, and the explanation of the test.

For posterity, a link to the mailing list discussion:

http://thread.gmane.org/gmane.comp.lang.javascript.v8.devel/37791

Powered by Google App Engine
This is Rietveld 408576698