Bug 104220 - [V8] Implement v8IntegerWithoutIsolate(int i)
Summary: [V8] Implement v8IntegerWithoutIsolate(int i)
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: 2012-12-05 22:34 PST by Kentaro Hara
Modified: 2012-12-06 01:21 PST (History)
3 users (show)

See Also:


Attachments
Patch (16.17 KB, patch)
2012-12-05 22:42 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff
Patch (15.12 KB, patch)
2012-12-06 00:05 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 2012-12-05 22:34:36 PST
To make an Isolate mandatory in v8Integer(), we implement v8IntegerWithoutIsolate(int i) for call sites that don't have an Isolate. Eventually we want to kill v8IntegerWithoutIsolate(int i).
Comment 1 Kentaro Hara 2012-12-05 22:42:52 PST
Created attachment 177941 [details]
Patch
Comment 2 Kentaro Hara 2012-12-06 00:05:18 PST
Created attachment 177956 [details]
Patch
Comment 3 Adam Barth 2012-12-06 00:31:52 PST
Comment on attachment 177956 [details]
Patch

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

You might also consider the name deprecatedV8Integer to inform people writing future patches that they shouldn't add more callers of this function.

> Source/WebCore/bindings/v8/Dictionary.cpp:300
> -        v8::Local<v8::Value> indexedValue = v8Array->Get(v8Integer(i));
> +        v8::Local<v8::Value> indexedValue = v8Array->Get(v8IntegerWithoutIsolate(i));

We should be able to store the isolate in a member variable of Dictionary.  Code isn't allowed to hold on to Dictionaries past the call frame in which they receive them.
Comment 4 Kentaro Hara 2012-12-06 00:34:13 PST
(In reply to comment #3)
> (From update of attachment 177956 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177956&action=review
> 
> You might also consider the name deprecatedV8Integer to inform people writing future patches that they shouldn't add more callers of this function.

Good idea. Will fix before landing.

> > Source/WebCore/bindings/v8/Dictionary.cpp:300
> > -        v8::Local<v8::Value> indexedValue = v8Array->Get(v8Integer(i));
> > +        v8::Local<v8::Value> indexedValue = v8Array->Get(v8IntegerWithoutIsolate(i));
> 
> We should be able to store the isolate in a member variable of Dictionary.

Oops, Dictionary already holds m_isolate. I can use it here. Will fix it.
Comment 5 Kentaro Hara 2012-12-06 00:58:42 PST
Committed r136819: <http://trac.webkit.org/changeset/136819>