WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
21294
Devirtualize getOwnPropertySlot()
https://bugs.webkit.org/show_bug.cgi?id=21294
Summary
Devirtualize getOwnPropertySlot()
Cameron Zwarich (cpst)
Reported
2008-10-01 23:01:21 PDT
We always use a virtual call for getOwnPropertySlot(), when we should really be able to inline the common cases in many of its callers, or at least use non-virtual calls. This could be achieved by a bit in the StructureID TypeInfo, just like was done for 'instanceof'.
Attachments
patch, working but ChangeLog not done yet
(52.44 KB, patch)
2008-10-22 10:08 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
patch
(50.40 KB, patch)
2008-10-22 12:00 PDT
,
Darin Adler
sam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Cameron Zwarich (cpst)
Comment 1
2008-10-16 22:02:38 PDT
Sam is now working on other tasks, so I will assign this to myself.
Darin Adler
Comment 2
2008-10-22 09:39:10 PDT
***
Bug 21793
has been marked as a duplicate of this bug. ***
Darin Adler
Comment 3
2008-10-22 10:08:51 PDT
Created
attachment 24559
[details]
patch, working but ChangeLog not done yet
Darin Adler
Comment 4
2008-10-22 12:00:55 PDT
Created
attachment 24561
[details]
patch
Sam Weinig
Comment 5
2008-10-22 13:08:24 PDT
Comment on
attachment 24561
[details]
patch - // WebCore uses this to make document.all and style.filter undetectable. static const unsigned MasqueradesAsUndefined = 1; + // WebCore uses MasqueradesAsUndefined to make document.all and style.filter undetectable. static const unsigned ImplementsHasInstance = 1 << 1; The whitespace for this comment seems wrong. +JSGlueGlobalObject::JSGlueGlobalObject(PassRefPtr<StructureID> structure, JSFlags flags) + : JSGlobalObject(structure, new Data, this) +{ + d()->flags = flags; + d()->userObjectStructure = UserObjectImp::createStructureID(jsNull()); +} Might be cleaner to make the Data constructor take arguments. + if (prototype->isNull()) { + static StructureID* structureID = JSInspectorCallbackWrapper::createStructureID(jsNull()).releaseRef(); + return new (unwrappedExec) JSInspectorCallbackWrapper(unwrappedExec, unwrappedObject, structureID); + } Why is leaking the StructureID okay here? For QtRuntimeMethod::createStructureID, why does it have the ImplementsHasInstance flag like InternalFunction? r=me.
Darin Adler
Comment 6
2008-10-22 16:25:30 PDT
(In reply to
comment #5
)
> (From update of
attachment 24561
[details]
[edit]) > - // WebCore uses this to make document.all and style.filter undetectable. > static const unsigned MasqueradesAsUndefined = 1; > + // WebCore uses MasqueradesAsUndefined to make document.all and > style.filter undetectable. > static const unsigned ImplementsHasInstance = 1 << 1; > The whitespace for this comment seems wrong.
I'll move the comment back.
> + d()->flags = flags;
>
> Might be cleaner to make the Data constructor take arguments.
Sure, but since this is just JavaScriptGlue, I think I'll leave it as-is.
> + if (prototype->isNull()) { > + static StructureID* structureID = > JSInspectorCallbackWrapper::createStructureID(jsNull()).releaseRef(); > + return new (unwrappedExec) JSInspectorCallbackWrapper(unwrappedExec, > unwrappedObject, structureID); > + }
>
> Why is leaking the StructureID okay here?
As we discussed, I'll use StructureID::startIgnoringLeaks().
> For QtRuntimeMethod::createStructureID, why does it have the > ImplementsHasInstance flag like InternalFunction?
Oops, will fix.
Darin Adler
Comment 7
2008-10-22 17:16:23 PDT
http://trac.webkit.org/changeset/37799
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug