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

Issue 9584006: Inline ordered relative compares of mixed double/undefined values. (Closed)

Created:
8 years, 9 months ago by danno
Modified:
8 years, 9 months ago
Reviewers:
fschneider
CC:
v8-dev
Visibility:
Public.

Description

Inline ordered relational compares of mixed double/undefined values. Allow Crankshaft to inline ordered relational comparisons (<, >, <=, >=) that have undefined arguments in addition to double value arguments (rather than calling the generic Compare stub). R=fschneider@chromium.org TEST=test/mjsunit/comparison-ops-and-undefined.js Committed: https://code.google.com/p/v8/source/detail?r=10905

Patch Set 1 #

Total comments: 10

Patch Set 2 : Review feedback #

Patch Set 3 : Whitespace tweaks #

Patch Set 4 : Tweak comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -17 lines) Patch
M src/arm/code-stubs-arm.cc View 1 2 2 chunks +19 lines, -5 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 3 1 chunk +16 lines, -1 line 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 2 chunks +19 lines, -5 lines 0 comments Download
M src/ic.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download
M src/token.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 chunks +18 lines, -4 lines 0 comments Download
A test/mjsunit/comparison-ops-and-undefined.js View 1 1 chunk +128 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
danno
8 years, 9 months ago (2012-03-02 12:11:23 UTC) #1
fschneider
lgtm https://chromiumcodereview.appspot.com/9584006/diff/1/src/hydrogen-instructions.cc File src/hydrogen-instructions.cc (right): https://chromiumcodereview.appspot.com/9584006/diff/1/src/hydrogen-instructions.cc#newcode1460 src/hydrogen-instructions.cc:1460: // ==, === and != have special handling ...
8 years, 9 months ago (2012-03-02 12:39:15 UTC) #2
danno
8 years, 9 months ago (2012-03-02 13:28:45 UTC) #3
Feedback addressed, landing

http://codereview.chromium.org/9584006/diff/1/src/hydrogen-instructions.cc
File src/hydrogen-instructions.cc (right):

http://codereview.chromium.org/9584006/diff/1/src/hydrogen-instructions.cc#ne...
src/hydrogen-instructions.cc:1460: // ==, === and != have special handling of
undefined, specifically undeifned
On 2012/03/02 12:39:15, fschneider wrote:
> s/undeifned/undefined

Done.

http://codereview.chromium.org/9584006/diff/1/src/hydrogen-instructions.cc#ne...
src/hydrogen-instructions.cc:1467: // See v8:1434
On 2012/03/02 12:39:15, fschneider wrote:
> I'd also refer to the corresponding sections in the ES5 spec (11.9.3, 11.8.5)
> and use the same terms "relational comparison" and "equality comparison".

Done.

http://codereview.chromium.org/9584006/diff/1/src/hydrogen-instructions.cc#ne...
src/hydrogen-instructions.cc:1468: if (!Token::IsOrderedCompareOp(token_)) {
On 2012/03/02 12:39:15, fschneider wrote:
> maybe rename to IsRelationalCompareOp.

Done.

http://codereview.chromium.org/9584006/diff/1/src/ia32/ic-ia32.cc
File src/ia32/ic-ia32.cc (right):

http://codereview.chromium.org/9584006/diff/1/src/ia32/ic-ia32.cc#newcode1730
src/ia32/ic-ia32.cc:1730: JavaScriptFrame::PrintTop(stdout, false, true);
On 2012/03/02 12:39:15, fschneider wrote:
> Leftover from debugging?

Done.

http://codereview.chromium.org/9584006/diff/1/test/mjsunit/comparison-ops-and...
File test/mjsunit/comparison-ops-and-undefined.js (right):

http://codereview.chromium.org/9584006/diff/1/test/mjsunit/comparison-ops-and...
test/mjsunit/comparison-ops-and-undefined.js:44: assertFalse(less_2(.5, .5));
On 2012/03/02 12:39:15, fschneider wrote:
> You could compress this into a helper
> 
> function test_helper(fun, b1, b2, b3, b4) {
>   assertEquals(b1, fun(.5, .5));
>   assertEquals(b2, fun(.5, undefined));
>   assertEquals(b3, fun(undefined, .5));
>   assertEquals(b4, fun(undefined, undefined));
> }
> 
> and call it here like 
> 
> test_helper(less_2, false, false, false, false);
> 
> Then it becomes also easy to add tests for different typefeedback in addition
to
> heap numbers (.5, .5): smis, int32, undefined.

Done.

Powered by Google App Engine
This is Rietveld 408576698