Bug 56270

Summary: The JIT 'friend's many classes in JSC; start unwinding this.
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: JavaScriptCoreAssignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal CC: ddkilzer, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
The patch sam: review+

Gavin Barraclough
Reported 2011-03-13 13:50:07 PDT
The JIT need to 'friend' other classes in order to be able to calculate offsets of various properties, or the absolute addresses of members within specific objects, in order to JIT generate code that will access members within the class when run. Instead of using friends in these cases, switch to providing specific accessor methods to provide this information. In the case of offsets, these can be static functions, and in the case of pointers to members within a specific object these can be const methods returning pointers to const values, to prevent clients from modifying values otherwise encapsulated within classes.
Attachments
The patch (57.17 KB, patch)
2011-03-13 13:58 PDT, Gavin Barraclough
sam: review+
Gavin Barraclough
Comment 1 2011-03-13 13:58:59 PDT
Created attachment 85621 [details] The patch
WebKit Review Bot
Comment 2 2011-03-13 14:00:14 PDT
Attachment 85621 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/assembler/X86Assembler.h:302: adcl_im is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:379: addl_im is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:445: andl_im is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:531: orl_im is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:597: subl_im is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:870: cmpl_rm is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:875: cmpl_im is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1042: movl_mEAX is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1079: movl_EAXm is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1110: movq_mEAX is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1116: movq_EAXm is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1156: movl_rm is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1164: movl_mr is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1172: movl_i32m is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Source/JavaScriptCore/assembler/X86Assembler.h:1368: cvtsi2sd_mr is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 15 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
Sam Weinig
Comment 3 2011-03-13 14:05:27 PDT
Comment on attachment 85621 [details] The patch View in context: https://bugs.webkit.org/attachment.cgi?id=85621&action=review > Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:2550 > }; > buildConfigurationList = 149C277108902AFE008A9EFC /* Build configuration list for PBXProject "JavaScriptCore" */; > compatibilityVersion = "Xcode 3.1"; > + developmentRegion = English; > hasScannedForEncodings = 1; > knownRegions = ( > English, How old is your xcode? Please don't check this in. > Source/JavaScriptCore/interpreter/RegisterFile.h:138 > + Register*const* addressOfEnd() const I think a space is needed somewhere here. How about Register* const * addressOfEnd() const > Source/JavaScriptCore/runtime/JSCell.h:144 > + Structure*const* addressOfStructure() const Again with the no spaces! > Source/JavaScriptCore/runtime/JSVariableObject.h:59 > + WriteBarrier<Unknown>*const* addressOfRegisters() const { return &m_registers; } And here.
Gavin Barraclough
Comment 4 2011-03-13 14:57:40 PDT
fixed in r80969
David Kilzer (:ddkilzer)
Comment 5 2011-03-13 21:54:57 PDT
Note You need to log in before you can comment on or make changes to this bug.