Bug 120898

Summary: Stop using fastNew/fastDelete in JavaScriptCore
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, ggaren, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch oliver: review+

Anders Carlsson
Reported 2013-09-06 15:05:45 PDT
Stop using fastNew/fastDelete in JavaScriptCore
Attachments
Patch (31.85 KB, patch)
2013-09-06 15:10 PDT, Anders Carlsson
oliver: review+
Anders Carlsson
Comment 1 2013-09-06 15:10:28 PDT
Andreas Kling
Comment 2 2013-09-06 15:15:55 PDT
Comment on attachment 210804 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=210804&action=review > Source/JavaScriptCore/runtime/VM.cpp:160 > + , arrayConstructorTable(adoptPtr(new HashTable(JSC::arrayConstructorTable))) > + , arrayPrototypeTable(adoptPtr(new HashTable(JSC::arrayPrototypeTable))) > + , booleanPrototypeTable(adoptPtr(new HashTable(JSC::booleanPrototypeTable))) Perhaps we should add a HashTable::create() helper that returns a PassOwnPtr? We don't want to put these on the stack anywhere right? > Source/JavaScriptCore/runtime/VM.h:227 > + OwnPtr<const HashTable> arrayConstructorTable; > + OwnPtr<const HashTable> arrayPrototypeTable; > + OwnPtr<const HashTable> booleanPrototypeTable; You could make these "const OwnPtr<const HashTable>" to prevent changes post-construction.
Anders Carlsson
Comment 3 2013-09-06 15:18:15 PDT
(In reply to comment #2) > (From update of attachment 210804 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=210804&action=review > > > Source/JavaScriptCore/runtime/VM.cpp:160 > > + , arrayConstructorTable(adoptPtr(new HashTable(JSC::arrayConstructorTable))) > > + , arrayPrototypeTable(adoptPtr(new HashTable(JSC::arrayPrototypeTable))) > > + , booleanPrototypeTable(adoptPtr(new HashTable(JSC::booleanPrototypeTable))) > > Perhaps we should add a HashTable::create() helper that returns a PassOwnPtr? > We don't want to put these on the stack anywhere right? I’d rather we add a makeOwned function template so you can do arrayConstructorTable(makeOwned<HashTable>()) and have things just work. I want to do that after we’ve gotten rid of PassOwnPtr though. > > > Source/JavaScriptCore/runtime/VM.h:227 > > + OwnPtr<const HashTable> arrayConstructorTable; > > + OwnPtr<const HashTable> arrayPrototypeTable; > > + OwnPtr<const HashTable> booleanPrototypeTable; > > You could make these "const OwnPtr<const HashTable>" to prevent changes post-construction. Good idea!
Anders Carlsson
Comment 4 2013-09-06 15:31:15 PDT
Note You need to log in before you can comment on or make changes to this bug.