Bug 67690 - Remove virtual functions from JSCell
Summary: Remove virtual functions from JSCell
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on: 67691 67727 67875 67902 67909 67911 68404 68651 68741 68839 68851 68937 69024 69156 69186 69311 69593 69659 69673 69677 69679 69807 69810 69851 69858 69872 69884 70162 70163 70257 70271 70281 70439 70638 70738 70740 70741 70958
Blocks: 69382
  Show dependency treegraph
 
Reported: 2011-09-06 18:28 PDT by Mark Hahnenberg
Modified: 2011-10-27 10:17 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2011-09-06 18:28:20 PDT
In order to maintain more control over exactly how JS objects are laid out, we need to remove the C++ virtual functions from JS object implementations due to the freedom that C++ compilers are given with how they lay out objects with vtable pointers.  We can also save a little bit of memory due to the lack of vtable pointer in each object.  The methods in JSCell that either need to be made non-virtual or removed are the following:

isGetterSetter
isAPIValueWrapper
isPropertyNameIterator
getCallData
getConstructData
getUInt32
toPrimitive
getPrimitive
toBoolean
toNumber
toString
toObject
visitChildren
put(ExecState*, const Identifier&, JSValue, PutPropertySlot&)
put(ExecState*, unsigned, JSValue)
deleteProperty(ExecState*, const Identifier&)
deleteProperty(ExecState*, unsigned)
toThisObject
getJSNumber
getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&)
getOwnPropertySlot(ExecState*, unsigned, PropertySlot&)

Destructors will be taken care of by Oliver :-)  There will be a patch for each function, roughly.  This will serve as the tracking bug for this task.
Comment 1 Mark Hahnenberg 2011-09-14 17:15:53 PDT
Sam helped me out a little bit and de-virtualized isGetterSetter, isAPIValueWrapper, and killed isPropertyNameIterator :-)
Comment 2 Mark Hahnenberg 2011-10-27 10:17:37 PDT
Except the virtual destructor, which will remain for a while longer until we get around to replacing virtual destructors with finalizers, there are no longer any virtual functions in JSCell.  Closing this bug.