Bug 65347 - Refactor JS objects to allocate in static create methods rather than constructors
Summary: Refactor JS objects to allocate in static create methods rather than construc...
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: 65288 66265 66567
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-28 16:02 PDT by Mark Hahnenberg
Modified: 2011-09-20 14:59 PDT (History)
3 users (show)

See Also:


Attachments
Moved all allocation out of initialization lists in subclass of JSCell (35.40 KB, patch)
2011-08-10 19:25 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Fixing build errors (28.31 KB, patch)
2011-08-11 09:00 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Fixing build errors (28.48 KB, patch)
2011-08-11 10:12 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Revised patch (32.14 KB, patch)
2011-08-15 09:57 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Fixing qt build (32.12 KB, patch)
2011-08-15 11:06 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Moving all allocation in constructors into finishAllocations() method (69.93 KB, patch)
2011-08-15 14:23 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Fixing build errors (43.69 KB, patch)
2011-08-15 14:50 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Fixing build errors (43.69 KB, patch)
2011-08-15 16:01 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2011-07-28 16:02:37 PDT
Now that we have static create methods and we can assert that we allocate only when we're not initializing another object, we want to move as much of the allocation done inside of constructors as possible into their static create methods.  Currently we clear the m_initializingObject flag inside of JSGlobalData if we do any sort of nested allocation within a constructor and then set it back to its original value after that allocation is complete.  Ideally, we wouldn't have to do this at all.
Comment 1 Mark Hahnenberg 2011-08-10 19:25:48 PDT
Created attachment 103570 [details]
Moved all allocation out of initialization lists in subclass of JSCell
Comment 2 Mark Hahnenberg 2011-08-11 09:00:53 PDT
Created attachment 103633 [details]
Fixing build errors
Comment 3 Early Warning System Bot 2011-08-11 09:16:05 PDT
Comment on attachment 103633 [details]
Fixing build errors

Attachment 103633 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9357258
Comment 4 Mark Hahnenberg 2011-08-11 10:12:37 PDT
Created attachment 103642 [details]
Fixing build errors
Comment 5 Geoffrey Garen 2011-08-12 18:17:59 PDT
Comment on attachment 103642 [details]
Fixing build errors

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

The rest of this patch looks good. But let's get rid of that cast.

> Source/WebCore/bindings/js/JSDOMBinding.h:91
> -        return cacheDOMStructure(globalObject, WrapperClass::createStructure(exec->globalData(), WrapperClass::createPrototype(exec, globalObject)), &WrapperClass::s_info);
> +        return cacheDOMStructure(globalObject, WrapperClass::createStructure(exec->globalData(), JSC::JSValue((JSC::JSCell*)WrapperClass::createPrototype(exec, globalObject))), &WrapperClass::s_info);

Let's find the missing #include that necessitated this cast. I'd rather not add a cast like this if we don't have to.
Comment 6 Mark Hahnenberg 2011-08-15 09:57:34 PDT
Created attachment 103920 [details]
Revised patch
Comment 7 Early Warning System Bot 2011-08-15 10:08:57 PDT
Comment on attachment 103920 [details]
Revised patch

Attachment 103920 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9379723
Comment 8 Mark Hahnenberg 2011-08-15 11:06:09 PDT
Created attachment 103928 [details]
Fixing qt build
Comment 9 Geoffrey Garen 2011-08-15 13:02:16 PDT
Comment on attachment 103928 [details]
Fixing qt build

r=me
Comment 10 WebKit Review Bot 2011-08-15 14:12:26 PDT
Comment on attachment 103928 [details]
Fixing qt build

Clearing flags on attachment: 103928

Committed r93059: <http://trac.webkit.org/changeset/93059>
Comment 11 WebKit Review Bot 2011-08-15 14:12:30 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Mark Hahnenberg 2011-08-15 14:23:51 PDT
Created attachment 103952 [details]
Moving all allocation in constructors into finishAllocations() method
Comment 13 Mark Hahnenberg 2011-08-15 14:50:26 PDT
Created attachment 103958 [details]
Fixing build errors
Comment 14 Mark Hahnenberg 2011-08-15 16:01:20 PDT
Created attachment 103970 [details]
Fixing build errors
Comment 15 Mark Hahnenberg 2011-08-15 16:52:57 PDT
Reopening this bug because its description/goal is not yet complete.  Also opening other bugs to resolve this discrepancy a step at a time.
Comment 16 Mark Hahnenberg 2011-09-20 14:59:47 PDT
All subtasks complete, closing bug.