Bug 93315 - [V8] Pass Isolate to ArrayValue and Dictionary
Summary: [V8] Pass Isolate to ArrayValue and Dictionary
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 84074
  Show dependency treegraph
 
Reported: 2012-08-06 18:15 PDT by Kentaro Hara
Modified: 2012-08-08 02:45 PDT (History)
4 users (show)

See Also:


Attachments
Patch (10.76 KB, patch)
2012-08-06 18:17 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (10.77 KB, patch)
2012-08-06 18:53 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
patch for landing (11.05 KB, patch)
2012-08-07 18:32 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (11.05 KB, patch)
2012-08-07 18:33 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-08-06 18:15:06 PDT
We should pass Isolate to ArrayValue and Dictionary.

Rationale 1: We want to replace V8Proxy::throwError(ExceptionCode) with setDOMException(ExceptionCode, Isolate*). For the replacement, we need to pass Isolate to V8Utilities::extractTransferables(). To pass Isolate to V8Utilities::extractTransferables(), ( ...omitted... ), we need to pass Isolate* to ArrayValue and Dictionary.

Rationale 2: JSC already passes ExecState to ArrayValue and Dictionary.
Comment 1 Kentaro Hara 2012-08-06 18:17:55 PDT
Created attachment 156818 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-06 18:33:44 PDT
Comment on attachment 156818 [details]
Patch

Attachment 156818 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13451204
Comment 3 Kentaro Hara 2012-08-06 18:53:02 PDT
Created attachment 156825 [details]
Patch
Comment 4 Adam Barth 2012-08-07 15:01:32 PDT
Comment on attachment 156825 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=156825&action=review

> Source/WebCore/bindings/v8/ArrayValue.h:60
> +    v8::Isolate* m_isolate;

Is it ok to store a long-lived pointer to an isolate?  How do we know this pointer remains valid?
Comment 5 Kentaro Hara 2012-08-07 18:32:00 PDT
Created attachment 157078 [details]
patch for landing
Comment 6 Kentaro Hara 2012-08-07 18:33:02 PDT
Created attachment 157079 [details]
Patch
Comment 7 Kentaro Hara 2012-08-07 18:38:34 PDT
(In reply to comment #4)
> > Source/WebCore/bindings/v8/ArrayValue.h:60
> > +    v8::Isolate* m_isolate;
> 
> Is it ok to store a long-lived pointer to an isolate?  How do we know this pointer remains valid?

I think it's ok. Dictionary and ArrayValue are designed based on the assumption that they are allocated on stack. In fact,

- Dictionary already has m_options of type Local<Value>. ArrayValue already has m_array of type Local<Array>.

- JSC already stores ExecState in Dictionary and ArrayValue.

Just in case, I added ASSERT(m_isolate == v8::Isolate::Current()) to the patch.
Comment 8 Adam Barth 2012-08-07 22:32:22 PDT
Comment on attachment 157079 [details]
Patch

Makes sense.  Thanks.
Comment 9 WebKit Review Bot 2012-08-08 00:06:39 PDT
Comment on attachment 157079 [details]
Patch

Rejecting attachment 157079 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
-merging Tools/ChangeLog
Failed to merge in the changes.
Patch failed at 0001 Optimize ChildNode{Insertion,Removal}Notifier::notify() by lazily taking a snapshot of child nodes

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/origin/master: command returned error: 1

Died at Tools/Scripts/update-webkit line 164.

Full output: http://queues.webkit.org/results/13459119
Comment 10 WebKit Review Bot 2012-08-08 02:45:39 PDT
Comment on attachment 157079 [details]
Patch

Clearing flags on attachment: 157079

Committed r125012: <http://trac.webkit.org/changeset/125012>
Comment 11 WebKit Review Bot 2012-08-08 02:45:43 PDT
All reviewed patches have been landed.  Closing bug.