Bug 87689 - [V8] Avoid passing NULL to an 'isolate' parameter
Summary: [V8] Avoid passing NULL to an 'isolate' parameter
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-05-28 19:32 PDT by Kentaro Hara
Modified: 2012-05-28 21:16 PDT (History)
2 users (show)

See Also:


Attachments
Patch (10.95 KB, patch)
2012-05-28 19:39 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
patch for landing (10.02 KB, patch)
2012-05-28 19:52 PDT, Kentaro Hara
no flags Details | Formatted Diff | Diff
patch for landing (10.02 KB, patch)
2012-05-28 19:53 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-05-28 19:32:02 PDT
v8::Null(isolate) crashes if we pass a NULL isolate. Thus we are planning to replace v8::Null()s in a following way:

- Implement V8Bindings::v8Null(isolate). v8Null(isolate) does the NULL check. If isolate is NULL, v8Null(isolate) calls v8::Null(). Otherwise, v8Null(isolate) calls v8::Null(isolate).

- In V8 bindings, we replace v8::Null() with v8::Null(isolate) for a non-optional 'isolate' parameter. (e.g. void foo(..., Isolate* isolate) { v8::Null(); } )

- In V8 bindings, we replace v8::Null() with v8Null(isolate) for an optional 'isolate' parameter. (e.g. void foo(..., Isolate* isolate = 0) { v8::Null(); } )

However, currently we cannot do the replacement mechanically, since some code pass NULL to a non-optional 'isolate' parameter. In other words, currently "non-optional" does not guarantee that 'isolate' is not NULL.

In this bug, we remove all the code that passes NULL to a non-optional 'isolate' parameter. This will enable us to achieve the replacement mechanically.
Comment 1 Kentaro Hara 2012-05-28 19:39:13 PDT
Created attachment 144428 [details]
Patch
Comment 2 Kentaro Hara 2012-05-28 19:52:26 PDT
Created attachment 144429 [details]
patch for landing
Comment 3 Kentaro Hara 2012-05-28 19:53:12 PDT
Created attachment 144430 [details]
patch for landing
Comment 4 WebKit Review Bot 2012-05-28 21:11:23 PDT
Comment on attachment 144430 [details]
patch for landing

Clearing flags on attachment: 144430

Committed r118722: <http://trac.webkit.org/changeset/118722>