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

Issue 2877018: Refactor type checks in v8natives.js and runtime.js.... (Closed)

Created:
10 years, 5 months ago by Rico
Modified:
9 years, 6 months ago
Reviewers:
William Hesse
CC:
v8-dev
Visibility:
Public.

Description

Refactor type checks in v8natives.js and runtime.js. This includes adding a new inline IsSpecObject method to the code generator. The old approach was somehow ineffecient since we would call both IsObject, IsUndetectable and IsFunction to determine if something was an object according to the spec. This change introduces a new macro that determines if something is an object according to the spec (and this does not include null). This change also corrects a few places where undetectable objects was not allowed even when they should be (priorly they would use only IS_SPEC_OBJECT_OR_NULL, which would return false on an undetectable object, the new IS_SPEC_OBJECT returns true on an undetectable object. Committed: http://code.google.com/p/v8/source/detail?r=5087

Patch Set 1 #

Total comments: 10

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 8

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -45 lines) Patch
M src/arm/codegen-arm.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 2 3 4 1 chunk +18 lines, -0 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
M src/codegen.h View 2 3 2 chunks +1 line, -1 line 0 comments Download
M src/full-codegen.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/full-codegen.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 2 3 4 1 chunk +21 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
M src/macros.py View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M src/mips/codegen-mips.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/mips/codegen-mips.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/runtime.js View 1 2 3 4 5 chunks +9 lines, -13 lines 0 comments Download
M src/v8natives.js View 1 2 3 15 chunks +16 lines, -30 lines 0 comments Download
M src/x64/codegen-x64.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Rico
10 years, 5 months ago (2010-07-15 13:14:40 UTC) #1
William Hesse
Some comments to start with. http://codereview.chromium.org/2877018/diff/1/2 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/2877018/diff/1/2#newcode4776 src/arm/codegen-arm.cc:4776: true_target()->Branch(eq); This should be ...
10 years, 5 months ago (2010-07-15 14:22:06 UTC) #2
Rico
Bill, could you have another look. I simplified the IsSpecObject implementation in the code generators. ...
10 years, 5 months ago (2010-07-16 09:30:03 UTC) #3
William Hesse
LGTM, if comments are addressed. http://codereview.chromium.org/2877018/diff/35001/1016 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/2877018/diff/35001/1016#newcode4767 src/arm/codegen-arm.cc:4767: // It includes undetectable ...
10 years, 5 months ago (2010-07-16 11:08:36 UTC) #4
Rico
10 years, 5 months ago (2010-07-16 11:19:46 UTC) #5
http://codereview.chromium.org/2877018/diff/35001/1016
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/2877018/diff/35001/1016#newcode4767
src/arm/codegen-arm.cc:4767: // It includes undetectable objects (as oppose to
IsObject).
On 2010/07/16 11:08:36, William Hesse wrote:
> as opposed to
> or
> // It includes undetectable objects (IsObject does not).
> 

Done.

http://codereview.chromium.org/2877018/diff/35001/1022
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/2877018/diff/35001/1022#newcode6456
src/ia32/codegen-ia32.cc:6456: temp.Unuse();
On 2010/07/16 11:08:36, William Hesse wrote:
> temp is not declared in this function.
> You cannot use value.reg() as a temp register unless you spill it from the
> frame.  Otherwise, it might be shared by another local variable.

Done.

http://codereview.chromium.org/2877018/diff/35001/1028
File src/runtime.js (right):

http://codereview.chromium.org/2877018/diff/35001/1028#newcode588
src/runtime.js:588: if (IS_SPEC_OBJECT(x)) return false;
On 2010/07/16 11:08:36, William Hesse wrote:
> Why not return !IS_SPEC_OBJECT(x); ?
> 

Done.

http://codereview.chromium.org/2877018/diff/35001/1030
File src/x64/codegen-x64.cc (right):

http://codereview.chromium.org/2877018/diff/35001/1030#newcode5739
src/x64/codegen-x64.cc:5739: __ CmpObjectType(value.reg(), FIRST_JS_OBJECT_TYPE,
value.reg);
On 2010/07/16 11:08:36, William Hesse wrote:
> kScratchRegister can be used here.

Done.

Powered by Google App Engine
This is Rietveld 408576698