Bug 115627 - [SH4] Misc bugfix and cleaning in sh4 base JIT
Summary: [SH4] Misc bugfix and cleaning in sh4 base JIT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-06 02:18 PDT by Julien Brianceau
Modified: 2013-05-06 13:27 PDT (History)
4 users (show)

See Also:


Attachments
Misc bugfix and cleaning in sh4 base JIT (15.52 KB, patch)
2013-05-06 02:47 PDT, Julien Brianceau
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Brianceau 2013-05-06 02:18:21 PDT
Misc bugfix and cleaning in sh4 base JIT:
- prevent useless "add #0, Rn" and "sub #0, Rn" in base JIT
- fix wrong usage of R0 register in load32(RegisterID, int, RegisterId)
- add (base == r0) case in load8Signed and load16 functions
- get rid of load32(RegisterID r0, RegisterID src, RegisterID dst), load16(RegisterID r0, RegisterID src, RegisterID dest) and load16Signed(RegisterID r0, RegisterID src, RegisterID dest)
- remove extuw() implementation from MacroAssemblerSH4.h and use the one in SH4Assembler.h
- handle offset and (base == r0) cases in store8(RegisterID, BaseIndex) and store16(RegisterID, BaseIndex)
- correct branch range and save an opcode in replaceWithJump
Comment 1 Julien Brianceau 2013-05-06 02:47:10 PDT
Created attachment 200650 [details]
Misc bugfix and cleaning in sh4 base JIT
Comment 2 WebKit Commit Bot 2013-05-06 02:48:26 PDT
Attachment 200650 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/assembler/MacroAssemblerSH4.h', u'Source/JavaScriptCore/assembler/SH4Assembler.h']" exit_code: 1
Source/JavaScriptCore/assembler/SH4Assembler.h:118:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Julien Brianceau 2013-05-06 02:55:36 PDT
(In reply to comment #2)
> Source/JavaScriptCore/assembler/SH4Assembler.h:118:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]

All other 100+ entries in this enum are in capital letters, so I think I'll leave it as it is.


Also, I didn't see any regression when testing this patch with:
- Tools/Scripts/run-javascriptcore-tests
- Tools/Scripts/run-fast-jsc
Comment 4 Oliver Hunt 2013-05-06 13:00:04 PDT
Comment on attachment 200650 [details]
Misc bugfix and cleaning in sh4 base JIT

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

> Source/JavaScriptCore/assembler/MacroAssemblerSH4.h:673
> +        RegisterID scr = (dest == base) ? claimScratch() : dest;

This seems common enough that you may want to make a function to do it automagically - getScratch(dest, base) or something?
Comment 5 Julien Brianceau 2013-05-06 13:19:18 PDT
(In reply to comment #4)
> (From update of attachment 200650 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=200650&action=review
> 
> > Source/JavaScriptCore/assembler/MacroAssemblerSH4.h:673
> > +        RegisterID scr = (dest == base) ? claimScratch() : dest;
> 
> This seems common enough that you may want to make a function to do it automagically - getScratch(dest, base) or something?
Yes, but in this case I'd also have to make an equivalent "releaseScratch(scr, dest, base)" function. This last one would be a little weird, don't you think?
Comment 6 WebKit Commit Bot 2013-05-06 13:27:42 PDT
Comment on attachment 200650 [details]
Misc bugfix and cleaning in sh4 base JIT

Clearing flags on attachment: 200650

Committed r149634: <http://trac.webkit.org/changeset/149634>
Comment 7 WebKit Commit Bot 2013-05-06 13:27:44 PDT
All reviewed patches have been landed.  Closing bug.