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

Issue 1117011: Inline floating point compare... (Closed)

Created:
10 years, 9 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Inline floating point compare Inline floating point compare instead of calling the stub when the following conditions are met: * Code is in a loop * Compare is not a for loop condition * Compare is not an equal comparison This inlined code handles heap number to heap number and heap number to smi compare. It can also handle smi to smi compare, but whenever there is a chance of comparing two smis the smi compare is inlined before the inlined floating point compare. Support for non SSE2 hardware is included. A new set of variants of the compare stub without the floating point comparison code is called if the inline comapre fails due to the operands not beeing heap numbers or smis. The virtual frame has been extended with a branch taking two live results to be carried through to the destination. This makes this change much simpler as the inlined code have two live results in registers and a number of bailouts. CompareStub::GetName needs to be updated as well. I will do that as a separate change. Also inlined equality check if both operands can't be NaN. This can only provide positive equals if it is the same object. Committed: http://code.google.com/p/v8/source/detail?r=4220

Patch Set 1 #

Total comments: 26

Patch Set 2 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -74 lines) Patch
M src/arm/codegen-arm.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M src/codegen.h View 1 2 chunks +12 lines, -3 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 14 chunks +279 lines, -67 lines 2 comments Download
M src/jump-target.h View 1 chunk +5 lines, -0 lines 0 comments Download
M src/jump-target.cc View 2 chunks +30 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Thygesen Gjesse
10 years, 9 months ago (2010-03-23 08:56:34 UTC) #1
Mads Ager (chromium)
LGTM with a couple of comments. http://codereview.chromium.org/1117011/diff/1/5 File src/codegen.h (right): http://codereview.chromium.org/1117011/diff/1/5#newcode369 src/codegen.h:369: // the stub ...
10 years, 9 months ago (2010-03-23 09:41:55 UTC) #2
Søren Thygesen Gjesse
http://codereview.chromium.org/1117011/diff/1/5 File src/codegen.h (right): http://codereview.chromium.org/1117011/diff/1/5#newcode369 src/codegen.h:369: // the stub will be called due to number ...
10 years, 9 months ago (2010-03-23 10:19:08 UTC) #3
Erik Corry
http://codereview.chromium.org/1117011/diff/1009/6002 File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/1117011/diff/1009/6002#newcode2736 src/ia32/codegen-ia32.cc:2736: if (nan_info == kCantBothBeNaN && cc == equal) { ...
10 years, 9 months ago (2010-03-23 18:09:24 UTC) #4
Søren Thygesen Gjesse
10 years, 9 months ago (2010-03-23 20:40:01 UTC) #5
http://codereview.chromium.org/1117011/diff/1009/6002
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/1117011/diff/1009/6002#newcode2736
src/ia32/codegen-ia32.cc:2736: if (nan_info == kCantBothBeNaN && cc == equal) {
On 2010/03/23 18:09:24, Erik Corry wrote:
> This seems wrong.  If one side is a constant fp number then they can't both be
> NaN, but you still have to check whether the other side is a number or a JS
> object with an arbitrary ToNumber method with side effects.  If we insisted on
> strict equality it might be OK.

This will only provide true when the objects are the same, but not false if they
are different. If they are not the same objects all the rest of the compare code
will perform all the rest of the checks.

Powered by Google App Engine
This is Rietveld 408576698