Bug 106771 - [V8] Add m_isolate to ScriptController, WorkerScriptController and V8DOMWindowShell
Summary: [V8] Add m_isolate to ScriptController, WorkerScriptController and V8DOMWindo...
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:
 
Reported: 2013-01-14 02:37 PST by Kentaro Hara
Modified: 2013-01-14 05:09 PST (History)
3 users (show)

See Also:


Attachments
Patch (10.28 KB, patch)
2013-01-14 02:38 PST, 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 2013-01-14 02:37:16 PST
Add m_isolate to ScriptController, WorkerScriptController and V8DOMWindowShell.
Comment 1 Kentaro Hara 2013-01-14 02:38:50 PST
Created attachment 182533 [details]
Patch
Comment 2 Adam Barth 2013-01-14 02:54:47 PST
Comment on attachment 182533 [details]
Patch

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

> Source/WebCore/bindings/v8/ScriptController.cpp:105
> +    , m_isolate(v8::Isolate::GetCurrent())

Will the isolate have been created by then?  I guess the tests will tell us!  :)

> Source/WebCore/bindings/v8/ScriptController.h:202
> +    v8::Isolate* m_isolate;

Can we hold onto the isolate forever?
Comment 3 Kentaro Hara 2013-01-14 03:02:32 PST
Comment on attachment 182533 [details]
Patch

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

>> Source/WebCore/bindings/v8/ScriptController.cpp:105
>> +    , m_isolate(v8::Isolate::GetCurrent())
> 
> Will the isolate have been created by then?  I guess the tests will tell us!  :)

Tests are passing. As far as I see, 'Isolate::New()' is found only on WorkerScriptController's constructor. Maybe the Isolate for the main thread is already initialized before ScriptController's constructor (I don't yet understand exactly).

>> Source/WebCore/bindings/v8/ScriptController.h:202
>> +    v8::Isolate* m_isolate;
> 
> Can we hold onto the isolate forever?

As long as a ScriptController is alive, a corresponding Isolate should be alive. So this is safe, isn't it?
Comment 4 WebKit Review Bot 2013-01-14 05:09:43 PST
Comment on attachment 182533 [details]
Patch

Clearing flags on attachment: 182533

Committed r139610: <http://trac.webkit.org/changeset/139610>
Comment 5 WebKit Review Bot 2013-01-14 05:09:46 PST
All reviewed patches have been landed.  Closing bug.