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

Issue 2677653002: Fix receiver checks for v8::Function on a remote context. (Closed)

Created:
3 years, 10 months ago by dcheng
Modified:
3 years, 10 months ago
CC:
haraken, v8-reviews_googlegroups.com, Yuki
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix receiver checks for v8::Function on a remote context receiver. v8 allows the embedder to specify a global template to use when creating a new context. However, v8 does not use the supplied template directly when creating the global proxy: it creates a unique template for each global proxy. However, this is problematic for remote contexts: functions cannot use strict receiver checks with the remote context, as the global template will never match the global proxy. To fix this, remote contexts now also include a remote global object in the prototype chain that is instantiated with the global template. This mirrors the way the global proxy is configured for a full v8 context, and allows strict receiver checks to work. BUG=527190 Review-Url: https://codereview.chromium.org/2677653002 Cr-Commit-Position: refs/heads/master@{#43361} Committed: https://chromium.googlesource.com/v8/v8/+/96eda1f7d166cdeb6da643505edd70561f503ed8

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : Fix comments #

Total comments: 3

Patch Set 5 : Rebase to ToT #

Patch Set 6 : Fix bad cast. #

Total comments: 2

Patch Set 7 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -53 lines) Patch
M src/api.cc View 1 2 3 4 5 6 3 chunks +8 lines, -43 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 2 chunks +16 lines, -5 lines 0 comments Download
M test/cctest/test-access-checks.cc View 2 chunks +55 lines, -0 lines 0 comments Download
M test/unittests/api/remote-object-unittest.cc View 1 2 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 31 (18 generated)
dcheng
https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc#newcode4825 src/bootstrapper.cc:4825: global_proxy->map()->set_has_hidden_prototype(true); I don't actually understand why this is needed, ...
3 years, 10 months ago (2017-02-17 07:29:08 UTC) #4
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc#newcode4825 src/bootstrapper.cc:4825: global_proxy->map()->set_has_hidden_prototype(true); On 2017/02/17 at 07:29:08, dcheng wrote: > I ...
3 years, 10 months ago (2017-02-17 08:40:26 UTC) #5
dcheng
https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc#newcode4825 src/bootstrapper.cc:4825: global_proxy->map()->set_has_hidden_prototype(true); On 2017/02/17 08:40:26, jochen wrote: > On 2017/02/17 ...
3 years, 10 months ago (2017-02-17 10:08:27 UTC) #6
dcheng
Also, I have an alternate approach that turns HasInstanceInGlobalProxy() into a JSGlobalProxy method and updates ...
3 years, 10 months ago (2017-02-17 10:32:53 UTC) #7
jochen (gone - plz use gerrit)
On 2017/02/17 at 10:08:27, dcheng wrote: > https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc > File src/bootstrapper.cc (right): > > https://codereview.chromium.org/2677653002/diff/60001/src/bootstrapper.cc#newcode4825 ...
3 years, 10 months ago (2017-02-21 12:34:34 UTC) #8
jochen (gone - plz use gerrit)
anyway, lgtm if the tests pass
3 years, 10 months ago (2017-02-21 12:34:49 UTC) #9
dcheng
PTAL, I fixed a bad cast in FunctionTemplate::HasInstance, since the global object of a JSGlobalProxy ...
3 years, 10 months ago (2017-02-22 04:29:00 UTC) #14
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2677653002/diff/100001/src/api.cc File src/api.cc (right): https://codereview.chromium.org/2677653002/diff/100001/src/api.cc#newcode6574 src/api.cc:6574: if (iter.IsAtEnd()) return false; how can this happen? Shouldn't ...
3 years, 10 months ago (2017-02-22 09:03:14 UTC) #19
dcheng
https://codereview.chromium.org/2677653002/diff/100001/src/api.cc File src/api.cc (right): https://codereview.chromium.org/2677653002/diff/100001/src/api.cc#newcode6574 src/api.cc:6574: if (iter.IsAtEnd()) return false; On 2017/02/22 09:03:14, jochen wrote: ...
3 years, 10 months ago (2017-02-22 09:29:53 UTC) #21
dcheng
On 2017/02/22 09:29:53, dcheng wrote: > https://codereview.chromium.org/2677653002/diff/100001/src/api.cc > File src/api.cc (right): > > https://codereview.chromium.org/2677653002/diff/100001/src/api.cc#newcode6574 > ...
3 years, 10 months ago (2017-02-22 09:45:06 UTC) #23
jochen (gone - plz use gerrit)
lgtm
3 years, 10 months ago (2017-02-22 10:07:37 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2677653002/120001
3 years, 10 months ago (2017-02-22 10:10:51 UTC) #28
commit-bot: I haz the power
3 years, 10 months ago (2017-02-22 10:13:31 UTC) #31
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/v8/v8/+/96eda1f7d166cdeb6da643505edd70561f5...

Powered by Google App Engine
This is Rietveld 408576698