2009-01-08 Gavin Barraclough <barraclough@apple.com>
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2009 08:11:00 +0000 (08:11 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2009 08:11:00 +0000 (08:11 +0000)
commit957008dfc4f257c379bffc78351a5e79b9bc60bb
treee16e3fbb21077aa1dc55ee9aa3a39839d02fa5ea
parentf1c0996db09c8f31a036cdf1871a455f85820c13
2009-01-08  Gavin Barraclough  <barraclough@apple.com>

        Reviewed by Oliver Hunt.

        Encode immediates in the low word of JSValuePtrs, on x86-64.

        On 32-bit platforms a JSValuePtr may represent a 31-bit signed integer.
        On 64-bit platforms, if USE(ALTERNATE_JSIMMEDIATE) is defined, a full
        32-bit integer may be stored in an immediate.

        Presently USE(ALTERNATE_JSIMMEDIATE) uses the same encoding as the default
        immediate format - the value is left shifted by one, so a one bit tag can
        be added to indicate the value is an immediate.  However this means that
        values must be commonly be detagged (by right shifting by one) before
        arithmetic operations can be performed on immediates.  This patch modifies
        the formattting so the the high bits of the immediate mark values as being
        integer.

        * assembler/MacroAssembler.h:
        (JSC::MacroAssembler::not32):
        (JSC::MacroAssembler::orPtr):
        (JSC::MacroAssembler::zeroExtend32ToPtr):
        (JSC::MacroAssembler::jaePtr):
        (JSC::MacroAssembler::jbPtr):
        (JSC::MacroAssembler::jnzPtr):
        (JSC::MacroAssembler::jzPtr):
        * assembler/X86Assembler.h:
        (JSC::X86Assembler::):
        (JSC::X86Assembler::notl_r):
        (JSC::X86Assembler::testq_i32r):
        * jit/JIT.cpp:
        (JSC::JIT::privateCompileMainPass):
        (JSC::JIT::privateCompileSlowCases):
        (JSC::JIT::privateCompileCTIMachineTrampolines):
        * jit/JIT.h:
        * jit/JITArithmetic.cpp:
        (JSC::JIT::compileFastArith_op_lshift):
        (JSC::JIT::compileFastArith_op_rshift):
        (JSC::JIT::compileFastArith_op_bitand):
        (JSC::JIT::compileFastArithSlow_op_bitand):
        (JSC::JIT::compileFastArith_op_mod):
        (JSC::JIT::compileFastArithSlow_op_mod):
        (JSC::JIT::compileFastArith_op_add):
        (JSC::JIT::compileFastArith_op_mul):
        (JSC::JIT::compileFastArith_op_post_inc):
        (JSC::JIT::compileFastArith_op_post_dec):
        (JSC::JIT::compileFastArith_op_pre_inc):
        (JSC::JIT::compileFastArith_op_pre_dec):
        (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
        (JSC::JIT::compileBinaryArithOp):
        * jit/JITCall.cpp:
        (JSC::JIT::compileOpCallSlowCase):
        * jit/JITInlineMethods.h:
        (JSC::JIT::emitJumpIfJSCell):
        (JSC::JIT::emitJumpIfNotJSCell):
        (JSC::JIT::emitJumpIfImmNum):
        (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
        (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
        (JSC::JIT::emitFastArithDeTagImmediate):
        (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
        (JSC::JIT::emitFastArithReTagImmediate):
        (JSC::JIT::emitFastArithImmToInt):
        (JSC::JIT::emitFastArithIntToImmNoCheck):
        (JSC::JIT::emitTagAsBoolImmediate):
        * jit/JITPropertyAccess.cpp:
        (JSC::resizePropertyStorage):
        (JSC::JIT::privateCompilePutByIdTransition):
        (JSC::JIT::privateCompilePatchGetArrayLength):
        (JSC::JIT::privateCompileGetByIdSelf):
        (JSC::JIT::privateCompileGetByIdProto):
        (JSC::JIT::privateCompileGetByIdChain):
        (JSC::JIT::privateCompilePutByIdReplace):
        * runtime/JSImmediate.h:
        (JSC::JSImmediate::isNumber):
        (JSC::JSImmediate::isPositiveNumber):
        (JSC::JSImmediate::areBothImmediateNumbers):
        (JSC::JSImmediate::xorImmediateNumbers):
        (JSC::JSImmediate::rightShiftImmediateNumbers):
        (JSC::JSImmediate::canDoFastAdditiveOperations):
        (JSC::JSImmediate::addImmediateNumbers):
        (JSC::JSImmediate::subImmediateNumbers):
        (JSC::JSImmediate::makeInt):
        (JSC::JSImmediate::toBoolean):
        * wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/assembler/MacroAssembler.h
JavaScriptCore/assembler/X86Assembler.h
JavaScriptCore/jit/JIT.cpp
JavaScriptCore/jit/JIT.h
JavaScriptCore/jit/JITArithmetic.cpp
JavaScriptCore/jit/JITCall.cpp
JavaScriptCore/jit/JITInlineMethods.h
JavaScriptCore/jit/JITPropertyAccess.cpp
JavaScriptCore/runtime/JSImmediate.h
JavaScriptCore/wtf/Platform.h