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

Issue 263833007: Don't leak contexts in Object.observe (Closed)

Created:
6 years, 7 months ago by rafaelw
Modified:
6 years, 7 months ago
CC:
v8-dev, danno, Toon Verwaest
Visibility:
Public.

Description

Don't leak contexts in Object.observe The Object.observe API may construct internal structures as a result of API calls. These structures can persist as long as an object that was once observed persists. This patch ensures that these structures are created in the correct context so as to avoid leaking contexts R=verwaest@chromium.org, dcarney BUG= Committed: https://code.google.com/p/v8/source/detail?r=21126

Patch Set 1 #

Patch Set 2 : test passes #

Patch Set 3 : try to use correct base #

Patch Set 4 : one more test #

Total comments: 4

Patch Set 5 : cr comments #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -1 line) Patch
M src/bootstrapper.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M src/contexts.h View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M src/object-observe.js View 1 2 3 5 chunks +13 lines, -1 line 2 comments Download
M src/runtime.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 1 chunk +59 lines, -0 lines 7 comments Download
M test/cctest/test-object-observe.cc View 1 2 3 4 1 chunk +92 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Toon Verwaest
lgtm with nit https://codereview.chromium.org/263833007/diff/60001/test/cctest/test-object-observe.cc File test/cctest/test-object-observe.cc (right): https://codereview.chromium.org/263833007/diff/60001/test/cctest/test-object-observe.cc#newcode680 test/cctest/test-object-observe.cc:680: CompileRun("function observer() {};" I guess you ...
6 years, 7 months ago (2014-05-02 14:17:34 UTC) #1
rafaelw
Committed patchset #5 manually as r21126 (presubmit successful).
6 years, 7 months ago (2014-05-02 16:13:15 UTC) #2
rafaelw
https://codereview.chromium.org/263833007/diff/60001/test/cctest/test-object-observe.cc File test/cctest/test-object-observe.cc (right): https://codereview.chromium.org/263833007/diff/60001/test/cctest/test-object-observe.cc#newcode680 test/cctest/test-object-observe.cc:680: CompileRun("function observer() {};" On 2014/05/02 14:17:34, Toon Verwaest wrote: ...
6 years, 7 months ago (2014-05-02 16:18:12 UTC) #3
Jakob Kummerow
DBC. https://codereview.chromium.org/263833007/diff/80001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/263833007/diff/80001/src/object-observe.js#newcode545 src/object-observe.js:545: function NativeObjectNotifierPerformChange(objectInfo, changeType, changeFn) { Please avoid name ...
6 years, 7 months ago (2014-05-02 19:31:37 UTC) #4
adamk
I've uploaded a patch that addresses jkummerow's comments: https://codereview.chromium.org/264793015/ https://codereview.chromium.org/263833007/diff/80001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/263833007/diff/80001/src/object-observe.js#newcode545 src/object-observe.js:545: ...
6 years, 7 months ago (2014-05-02 20:09:12 UTC) #5
Toon Verwaest
https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc#newcode15003 src/runtime.cc:15003: CONVERT_ARG_HANDLE_CHECKED(Object, callback, 1); I think this should become JSReceiver ...
6 years, 7 months ago (2014-05-03 05:28:25 UTC) #6
adamk
https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc#newcode15003 src/runtime.cc:15003: CONVERT_ARG_HANDLE_CHECKED(Object, callback, 1); On 2014/05/03 05:28:26, Toon Verwaest wrote: ...
6 years, 7 months ago (2014-05-05 19:55:05 UTC) #7
rossberg
https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc#newcode15003 src/runtime.cc:15003: CONVERT_ARG_HANDLE_CHECKED(Object, callback, 1); On 2014/05/05 19:55:05, adamk wrote: > ...
6 years, 7 months ago (2014-05-06 10:03:49 UTC) #8
adamk
On 2014/05/06 10:03:49, rossberg wrote: > https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc > File src/runtime.cc (right): > > https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc#newcode15003 > ...
6 years, 7 months ago (2014-05-06 19:10:19 UTC) #9
rossberg
6 years, 7 months ago (2014-05-07 08:49:16 UTC) #10
Message was sent while issue was closed.
On 2014/05/06 19:10:19, adamk wrote:
> On 2014/05/06 10:03:49, rossberg wrote:
> > https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc
> > File src/runtime.cc (right):
> > 
> >
>
https://codereview.chromium.org/263833007/diff/80001/src/runtime.cc#newcode15003
> > src/runtime.cc:15003: CONVERT_ARG_HANDLE_CHECKED(Object, callback, 1);
> > On 2014/05/05 19:55:05, adamk wrote:
> > > On 2014/05/03 05:28:26, Toon Verwaest wrote:
> > > > I think this should become JSReceiver to handle function proxy
callbacks.
> > > 
> > > I've filed a but to track the fact that proxies don't work with
> Object.observe
> > > at the moment: https://code.google.com/p/v8/issues/detail?id=3310
> > > 
> > > > On 2014/05/02 19:31:37, Jakob wrote:
> > > > > Please be as specific as you can regarding the object type here. I
have
> a
> > > > > feeling |callback| must be a JSFunction, so use
> > > > > CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 1);
> > > > 
> > > 
> > 
> > Thanks! While you're at it, can you please also create bugs to track the
> issues
> > that
> > 
> > 1. observing the global object does not currently allowed, due to various
> issues
> > (esp with navigation, e.g. notifier context)
> 
> Not sure where to file this. It's sort of a spec bug, except it's outside the
> purview of ECMAScript. I don't think we want to allow this, so long as we're
> using Mozilla's split-global approach to cross-frame access at least.
> 
> > 2. observing/unobserving in the middle of a splice event does not work
> correctly
> 
> https://code.google.com/p/v8/issues/detail?id=3314
> 
> > 3. change records in cross context scenarios live in different contexts
> > depending on how they are created
> 
> https://code.google.com/p/v8/issues/detail?id=3316 (this one's a little fuzzy
as
> I back-formed it from the thread between Toon and Rafael, feel free to add
more
> detail to the bug)
> 
> > 4. the implementation of observe does not handle acceptList accurately (e.g.
> > observable side effects in accessing .length multiple times)
> 
> https://code.google.com/p/v8/issues/detail?id=3315
> 
> > Some of these might require modifications/extensions to the spec as well.

Thanks, sounds good.

Powered by Google App Engine
This is Rietveld 408576698