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

Issue 7461107: Use type info for the ToBoolean translation in crankshaft. (Closed)

Created:
9 years, 5 months ago by Sven Panne
Modified:
9 years, 4 months ago
Reviewers:
fschneider, danno
CC:
v8-dev
Visibility:
Public.

Description

Use type info for the ToBoolean translation in crankshaft. To do this, the Branch instruction needs to carry around a temporary register, but only when the crankshafted code will make a map access. When the crankshafted code sees an object of a type it hasn't encountered before, it will always trigger a deopt. Another option in theses cases would be calling a ToBooleanStub which can handle all types, but then one has to be careful to *not* trigger a GC (which is currently a bit tricky to achieve). Const-corrected ToBoolean::Types. Moved the NeedsMap logic into ToBoolean::Types itself, where it belongs. This patch improves a lot of benchmarks, crypto-orig even by 16.7%, but slows down others. The slowdown has to be investigated, but I'd like to get this patch out first to fix the flakiness problems we currently have due to the previous crankshafted ToBoolean. Committed: http://code.google.com/p/v8/source/detail?r=8758

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 9

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -45 lines) Patch
M src/code-stubs.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/code-stubs.cc View 1 3 chunks +10 lines, -2 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 chunks +2 lines, -8 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 1 chunk +118 lines, -30 lines 0 comments Download
M src/ia32/lithium-ia32.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
Sven Panne
9 years, 5 months ago (2011-07-27 08:56:18 UTC) #1
Sven Panne
New version with 2 changes: a) Fixed a bug where string-only ToBoolean code ran into ...
9 years, 4 months ago (2011-07-28 12:50:38 UTC) #2
danno
lgtm
9 years, 4 months ago (2011-07-28 13:33:03 UTC) #3
fschneider
LGTM as well. http://codereview.chromium.org/7461107/diff/9001/src/ia32/lithium-codegen-ia32.cc File src/ia32/lithium-codegen-ia32.cc (right): http://codereview.chromium.org/7461107/diff/9001/src/ia32/lithium-codegen-ia32.cc#newcode1395 src/ia32/lithium-codegen-ia32.cc:1395: Factory* factory = this->factory(); Doesn't the ...
9 years, 4 months ago (2011-07-28 13:54:58 UTC) #4
Sven Panne
9 years, 4 months ago (2011-07-28 14:12:44 UTC) #5
I'll upload a tiny CL for this stuff now...

http://codereview.chromium.org/7461107/diff/9001/src/ia32/lithium-codegen-ia3...
File src/ia32/lithium-codegen-ia32.cc (right):

http://codereview.chromium.org/7461107/diff/9001/src/ia32/lithium-codegen-ia3...
src/ia32/lithium-codegen-ia32.cc:1395: Factory* factory = this->factory();
On 2011/07/28 13:54:58, fschneider wrote:
> Doesn't the compiler inline the factory() accessor?

Ooops, I haven't seen that retrieving the current isolate is cheap here, because
we can get it via an instance field. So this is local variable is probably not
needed, I'll remove it.

http://codereview.chromium.org/7461107/diff/9001/src/ia32/lithium-codegen-ia3...
src/ia32/lithium-codegen-ia32.cc:1406: if (expected.IsEmpty()) expected =
ToBooleanStub::all_types();
On 2011/07/28 13:54:58, fschneider wrote:
> We should watch out for code size a little. If this case happens often, we
will
> generate lots of inline code. Can you compare performance when calling the
stub
> in this case?

In the programs I've seen so far this doesn't happen very often, but when it
happens, it happens in "hot" code a lot, so I would really like to avoid the
overhead of calling a stub.

What would really help regarding code size and speed would be a different
handling of undetectable objects, but that is a different story...

http://codereview.chromium.org/7461107/diff/9001/src/ia32/lithium-codegen-ia3...
src/ia32/lithium-codegen-ia32.cc:1423: // We've seen a string for the first time
-> deopt.
On 2011/07/28 13:54:58, fschneider wrote:
> Update comment: s/string/boolean

Done.

http://codereview.chromium.org/7461107/diff/9001/src/ia32/lithium-codegen-ia3...
src/ia32/lithium-codegen-ia32.cc:1433: // We've seen a string for the first time
-> deopt.
On 2011/07/28 13:54:58, fschneider wrote:
> Same here.

Done.

Powered by Google App Engine
This is Rietveld 408576698