Closed Bug 1308634 Opened 8 years ago Closed 8 years ago

Inline Object.prototype.hasOwnProperty().

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sstangl, Assigned: sstangl)

Details

Attachments

(1 obsolete file)

The following testcase takes 0.6s in d8, 13.6s in SpiderMonkey:

> function f(o) {
>     k = true;
>     for (var i = 0; i < 10000000; i++) {
>         k = k ^ o.hasOwnProperty('p');
>     }
>     return k;
> }   
>
> f({p: 5});

Google Closure Compiler generates code that uses hasOwnProperty() to check for existence.
Realized I was accidentally using a debug version. We're twice as fast as d8.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Attachment #8933879 - Attachment is obsolete: true
Attachment #8933879 - Flags: review?(padenot)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: