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

Issue 21211: Optimize comparisons with constant Smis. Evaluate comparisons of... (Closed)

Created:
11 years, 10 months ago by William Hesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Optimize comparisons with constant Smis. Evaluate comparisons of two constant Smis at compile time. Fix switch statements so that they work with unconditionally true and false label comparisons. Committed: http://code.google.com/p/v8/source/detail?r=1249

Patch Set 1 #

Total comments: 25

Patch Set 2 : '' #

Total comments: 4

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -63 lines) Patch
M src/codegen-ia32.cc View 1 2 3 chunks +165 lines, -63 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
William Hesse
11 years, 10 months ago (2009-02-10 14:52:13 UTC) #1
Kevin Millikin (Chromium)
Mostly comments on the comments. There might be a bug. I would refactor Comparison to ...
11 years, 10 months ago (2009-02-11 09:35:05 UTC) #2
William Hesse
http://codereview.chromium.org/21211/diff/1/2 File src/codegen-ia32.cc (right): http://codereview.chromium.org/21211/diff/1/2#newcode1336 Line 1336: // If either side is a constant SMI, ...
11 years, 10 months ago (2009-02-11 10:46:44 UTC) #3
Kevin Millikin (Chromium)
LGTM, but I still think the comments are murky about what's going on in the ...
11 years, 10 months ago (2009-02-11 12:03:11 UTC) #4
William Hesse
11 years, 10 months ago (2009-02-11 12:54:00 UTC) #5
http://codereview.chromium.org/21211/diff/5/2002
File src/codegen-ia32.cc (right):

http://codereview.chromium.org/21211/diff/5/2002#newcode2024
Line 2024: // The test is compiled, and linked with the previous and next tests.
On 2009/02/11 12:03:11, Kevin Millikin wrote:
> This comment still seems wrong.  It is a ways away from the line where the
test
> is compiled, and the test is only compiled conditionally, and it doesn't have
> anything to do with linking to the next test.
> 
> What I think the reader cares about is why this code is conditionally guarded,
> because knowing that depends on reasoning about the previous loop iterations. 
> Try something like "Unless this is the first (non-default) case, some previous
> case was unconditionally true, or the immediately previous (non-default) case
> had its body compiled, there is a dangling jump to the test."

Done.

http://codereview.chromium.org/21211/diff/5/2002#newcode2032
Line 2032: // If the switch value is a constant, we may have unconditional
On 2009/02/11 12:03:11, Kevin Millikin wrote:
> I wouldn't be so specific about implementation details about why we might have
> unconditional control flow (ie, don't say "constant" because we might base
> decisions on known type-tags for non-constants or value-range propagation or
> something, and it isn't really relevant here anyway).
> 
> The important thing that is difficult for the reader to reason out seems to me
> to be in which cases the frame can be valid (first non-default case or the
> immediately previous test that was compiled was not unconditionally true) and
> which cases invalid (the previous compiled test was unconditionally true).

Done.

Powered by Google App Engine
This is Rietveld 408576698