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

Issue 8242002: Recognize special comparisons via pattern matching on the hydrogen graph. (Closed)

Created:
9 years, 2 months ago by Sven Panne
Modified:
9 years, 2 months ago
CC:
v8-dev
Visibility:
Public.

Description

Recognize special comparisons via pattern matching on the hydrogen graph. Previously, comparisons against null/undefined and comparisons of the result of typeof against a constant string were done syntactically. Now we do this via pattern matching on the hydrogen graph, which opens up more opportunities for better code generation, e.g. the following comparisons are now recognized to be special: var bar = typeof foo; var baz = "undefined"; if (bar == baz) ... var blah = undefined; if (hurz == blah) ... If we did this handling of special cases even later at lithium generation time, even more cases could be recognized, but this would involve bigger changes and this CL handles most common cases. Committed: http://code.google.com/p/v8/source/detail?r=9612

Patch Set 1 #

Total comments: 10

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -25 lines) Patch
M src/hydrogen.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
M src/hydrogen.cc View 1 4 chunks +62 lines, -22 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Sven Panne
9 years, 2 months ago (2011-10-12 07:50:10 UTC) #1
Kevin Millikin (Chromium)
Much better to do this at graph construction. Comments below. http://codereview.chromium.org/8242002/diff/1/src/hydrogen.cc File src/hydrogen.cc (right): http://codereview.chromium.org/8242002/diff/1/src/hydrogen.cc#newcode5793 ...
9 years, 2 months ago (2011-10-13 13:11:59 UTC) #2
Sven Panne
http://codereview.chromium.org/8242002/diff/1/src/hydrogen.cc File src/hydrogen.cc (right): http://codereview.chromium.org/8242002/diff/1/src/hydrogen.cc#newcode5793 src/hydrogen.cc:5793: void HGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr, On 2011/10/13 13:11:59, Kevin Millikin wrote: ...
9 years, 2 months ago (2011-10-13 14:21:38 UTC) #3
Kevin Millikin (Chromium)
9 years, 2 months ago (2011-10-13 14:38:41 UTC) #4
lgtm

Powered by Google App Engine
This is Rietveld 408576698