Bug 69311

Summary: Add static ClassInfo structs to classes that override JSCell::getCallData
Product: WebKit Reporter: Mark Hahnenberg <mhahnenberg>
Component: JavaScriptCoreAssignee: Mark Hahnenberg <mhahnenberg>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 69368    
Bug Blocks: 67690, 69186    
Attachments:
Description Flags
Patch
none
Patch darin: review+, webkit.review.bot: commit-queue-

Description Mark Hahnenberg 2011-10-03 18:03:26 PDT
In order for the dynamic lookup on the method table to work properly, every class that implements its own version of the function in question (in this case, getCallData) needs to provide its own static ClassInfo structure, otherwise the wrong method will be called (the next parent in the class hierarchy that defines its own ClassInfo).  We therefore need to add new structures to those classes that override getCallData but don't yet have them.
Comment 1 Mark Hahnenberg 2011-10-03 18:45:53 PDT
Created attachment 109567 [details]
Patch
Comment 2 Darin Adler 2011-10-04 09:28:50 PDT
Comment on attachment 109567 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109567&action=review

> Source/JavaScriptCore/ChangeLog:9
> +        Added ClassInfo structs to each class that defined its own getCallData 
> +        function but did not already have its own ClassInfo struct.  This is a 

Are these structs used yet, or is that a task for a separate patch?

> Source/JavaScriptCore/runtime/Error.cpp:207
> +    virtual CallType getCallDataVirtual(CallData& callData)
>      {
>          return getCallData(this, callData);
>      }

Typically we don’t want virtual functions to also have inline function definitions. Not new in this patch and probably not a problem since we’ll be deleting this soon.
Comment 3 Mark Hahnenberg 2011-10-04 11:07:42 PDT
> Are these structs used yet, or is that a task for a separate patch?

These structs are not yet used, but they are a preliminary step for bug 69186 to make it easier to review.
Comment 4 WebKit Review Bot 2011-10-04 12:21:07 PDT
Comment on attachment 109567 [details]
Patch

Clearing flags on attachment: 109567

Committed r96630: <http://trac.webkit.org/changeset/96630>
Comment 5 WebKit Review Bot 2011-10-04 12:21:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Mark Hahnenberg 2011-10-04 13:41:02 PDT
Reopening because the patch caused assertion failures in validateCell due to fact that not all of the new ClassInfo structs are being used in their associated Structures due to a lack of createStructure methods in these classes.  Rolled out and will resubmit with fixes.
Comment 7 Mark Hahnenberg 2011-10-04 15:11:04 PDT
Created attachment 109701 [details]
Patch
Comment 8 WebKit Review Bot 2011-10-04 19:18:55 PDT
Comment on attachment 109701 [details]
Patch

Rejecting attachment 109701 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
d29926bb419ebfc3b2635e2e00063b7421874f88
r96672 = b07c6f5e8ee25b998824c8fae4991c8b2df68c6c
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.
Updating chromium port dependencies using gclient...

________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium'
Updating webkit projects from gyp files...

Full output: http://queues.webkit.org/results/9944597
Comment 9 Mark Hahnenberg 2011-10-04 19:46:46 PDT
Committed r96674: <http://trac.webkit.org/changeset/96674>