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

Issue 7497063: Simplify and optimize ToBoolean handling. (Closed)

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

Description

Simplify and optimize ToBoolean handling. Changing our builtin JavaScript code slightly, we can make sure that we never see internal objects as arguments for ToBoolean at runtime. Removing that case from the stub generator and crankshaft makes things a lot easier. Heap numbers can never be undetectable (only strings and spec objects can), so we can leave out a useless test. Try to re-use a non-null register value when returning 'true' in some cases. Removed special handling of the 'handle all' case, it will very probably never happen in real code and only makes things more complicated. Improved naming of the ToBoolean stubs a bit, reflecting the order in which cases are handled in the code itself. Committed: http://code.google.com/p/v8/source/detail?r=8886

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -304 lines) Patch
M src/apinatives.js View 2 chunks +11 lines, -3 lines 4 comments Download
M src/arm/code-stubs-arm.cc View 6 chunks +14 lines, -40 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 chunk +1 line, -7 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 4 chunks +9 lines, -51 lines 0 comments Download
M src/code-stubs.h View 4 chunks +2 lines, -4 lines 0 comments Download
M src/code-stubs.cc View 3 chunks +13 lines, -7 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 5 chunks +34 lines, -46 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 4 chunks +10 lines, -47 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 chunk +1 line, -4 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 5 chunks +33 lines, -45 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 4 chunks +9 lines, -45 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Sven Panne
9 years, 4 months ago (2011-08-10 12:03:24 UTC) #1
Erik Corry
LGTM http://codereview.chromium.org/7497063/diff/1/src/apinatives.js File src/apinatives.js (right): http://codereview.chromium.org/7497063/diff/1/src/apinatives.js#newcode82 src/apinatives.js:82: fun.prototype = typeof prototype ==='undefined' ? Missing space ...
9 years, 4 months ago (2011-08-10 16:44:35 UTC) #2
Sven Panne
9 years, 4 months ago (2011-08-11 07:19:24 UTC) #3
http://codereview.chromium.org/7497063/diff/1/src/apinatives.js
File src/apinatives.js (right):

http://codereview.chromium.org/7497063/diff/1/src/apinatives.js#newcode82
src/apinatives.js:82: fun.prototype = typeof prototype ==='undefined' ?
On 2011/08/10 16:44:36, Erik Corry wrote:
> Missing space after ===

Done.

http://codereview.chromium.org/7497063/diff/1/src/apinatives.js#newcode91
src/apinatives.js:91: if (!(typeof parent ==='undefined')) {
On 2011/08/10 16:44:36, Erik Corry wrote:
> Ditto

Done.

Powered by Google App Engine
This is Rietveld 408576698