[JSC] x86: Use inc and dec when possible
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 02:35:31 +0000 (02:35 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 02:35:31 +0000 (02:35 +0000)
commit35fff3783f5abe9f20e3378bf45edd63131cc680
tree935aa56b841a62b50069e382fde629539b788171
parenta2f1521af1fd064b54ff041ae6d96937b5182715
[JSC] x86: Use inc and dec when possible
https://bugs.webkit.org/show_bug.cgi?id=119831

Reviewed by Geoffrey Garen.

When incrementing or decrementing by an immediate of 1, use the insctructions
inc and dec instead of add and sub.
The instructions have good timing and their encoding is smaller.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86_64::add32):
(JSC::MacroAssemblerX86_64::sub32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::add64):
(JSC::MacroAssemblerX86_64::sub64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::dec_r):
(JSC::X86Assembler::decq_r):
(JSC::X86Assembler::inc_r):
(JSC::X86Assembler::incq_r):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
Source/JavaScriptCore/assembler/X86Assembler.h