Bug 93093 - [V8] Implement v8Undefined() and use it in CodeGeneratorV8.pm
Summary: [V8] Implement v8Undefined() and use it in CodeGeneratorV8.pm
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: 93095
  Show dependency treegraph
 
Reported: 2012-08-03 05:05 PDT by Kentaro Hara
Modified: 2012-08-03 11:21 PDT (History)
5 users (show)

See Also:


Attachments
Patch (78.80 KB, patch)
2012-08-03 05:07 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-03 05:05:05 PDT
There are a couple of equivalent ways to create an undefined value, e.g. v8::Undefined(), v8::Undefined(isolate), v8::Handle<v8::Value>(), etc. We should implement v8Undefined() and use it everywhere.

In this bug, we implement v8Undefined() and use it in CodeGeneratorV8.pm.

We can implement v8Undefined() like this:

    v8::Handle<v8::Value> v8Undefined() { v8::Handle<v8::Value>(); }

This is based on the following performance results:

// 14.5 ns
v8::Handle<v8::Value> xxxAttrGetter(..., info) {
    return v8::Undefined();
}

// 8.24 ns (This cannot be used where isolate can be 0.)
v8::Handle<v8::Value> xxxAttrGetter(..., info) {
    return v8::Undefined(info.GetIsolate());
}

// 8.54 ns
v8::Handle<v8::Value> xxxAttrGetter(..., info) {
    v8::Isolate* isolate = info.GetIsolate();
    return isolate ? v8::Handle<v8::Value>(v8::Undefined(isolate)) : v8::Handle<v8::Value>();
}

// 8.52 ns
v8::Handle<v8::Value> xxxAttrGetter(..., info) {
    return v8::Handle<v8::Value>();
}
Comment 1 Kentaro Hara 2012-08-03 05:07:30 PDT
Created attachment 156331 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-03 11:21:04 PDT
Comment on attachment 156331 [details]
Patch

Clearing flags on attachment: 156331

Committed r124629: <http://trac.webkit.org/changeset/124629>
Comment 3 WebKit Review Bot 2012-08-03 11:21:08 PDT
All reviewed patches have been landed.  Closing bug.