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

Issue 10442129: Implement implicit instance checks for API accessors. (Closed)

Created:
8 years, 6 months ago by Michael Starzinger
Modified:
8 years, 6 months ago
Reviewers:
Sven Panne, danno
CC:
v8-dev, haraken1
Visibility:
Public.

Description

Implement implicit instance checks for API accessors. This allows to specify a constructor against which an implicit instance check is performed for API accessors. If the receiver is incompatible, an implicit TypeError is thrown and no callback is invoked. R=svenpanne@chromium.org BUG=v8:2075 TEST=cctest/test-api/InstanceCheckOn[*] Committed: https://code.google.com/p/v8/source/detail?r=11734

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed comments by Sven Panne. #

Patch Set 3 : Addressed comments by Daniel Clifford. #

Total comments: 4

Patch Set 4 : Addressed comments by Daniel Clifford. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -27 lines) Patch
M include/v8.h View 1 2 3 5 chunks +26 lines, -4 lines 0 comments Download
M src/api.h View 1 2 4 chunks +6 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 8 chunks +24 lines, -10 lines 0 comments Download
M src/arm/stub-cache-arm.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M src/ic.cc View 3 chunks +3 lines, -0 lines 0 comments Download
M src/mips/stub-cache-mips.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M src/objects.h View 1 3 chunks +6 lines, -1 line 0 comments Download
M src/objects.cc View 1 2 chunks +20 lines, -0 lines 0 comments Download
M src/objects-debug.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-inl.h View 1 3 chunks +10 lines, -4 lines 0 comments Download
M src/stub-cache.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 1 chunk +172 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Michael Starzinger
@Danno: Could you PTAL at the API changes. @Sven: Could you PTAL at the implementation. ...
8 years, 6 months ago (2012-06-01 13:19:42 UTC) #1
danno
I think you should add the AccessorSignature as discussed, but otherwise it's looking good.
8 years, 6 months ago (2012-06-01 13:55:56 UTC) #2
Sven Panne
LGTM with nits http://codereview.chromium.org/10442129/diff/1/src/api.cc File src/api.cc (right): http://codereview.chromium.org/10442129/diff/1/src/api.cc#newcode1073 src/api.cc:1073: if (!constructor.IsEmpty()) { Not exactly related ...
8 years, 6 months ago (2012-06-04 07:50:32 UTC) #3
Michael Starzinger
http://codereview.chromium.org/10442129/diff/1/src/api.cc File src/api.cc (right): http://codereview.chromium.org/10442129/diff/1/src/api.cc#newcode1073 src/api.cc:1073: if (!constructor.IsEmpty()) { On 2012/06/04 07:50:32, Sven Panne wrote: ...
8 years, 6 months ago (2012-06-04 09:11:15 UTC) #4
Michael Starzinger
@Danno: Could you PTAL at the API changes (v8.h and api.cc). Thanks! https://chromiumcodereview.appspot.com/10442129/diff/1/include/v8.h File include/v8.h ...
8 years, 6 months ago (2012-06-04 11:34:33 UTC) #5
danno
API lgtm with nits http://codereview.chromium.org/10442129/diff/15001/include/v8.h File include/v8.h (right): http://codereview.chromium.org/10442129/diff/15001/include/v8.h#newcode2353 include/v8.h:2353: * and is used to ...
8 years, 6 months ago (2012-06-06 09:32:31 UTC) #6
Michael Starzinger
8 years, 6 months ago (2012-06-08 07:40:44 UTC) #7
http://codereview.chromium.org/10442129/diff/15001/include/v8.h
File include/v8.h (right):

http://codereview.chromium.org/10442129/diff/15001/include/v8.h#newcode2353
include/v8.h:2353: *   and is used to perform implicit instance checks against.
If the receiver
On 2012/06/06 09:32:31, danno wrote:
> nit: against them.

Done.

http://codereview.chromium.org/10442129/diff/15001/include/v8.h#newcode2485
include/v8.h:2485: * can legally be called with.
On 2012/06/06 09:32:31, danno wrote:
> how about: "An AccessorSignature specifies which receivers are valid arguments
> to an accessor callback."  

Done. Also applied to "Signature" a few lines above.

Powered by Google App Engine
This is Rietveld 408576698