Ignore:
Timestamp:
Jan 15, 2009, 7:20:35 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-15 Gavin Barraclough <[email protected]>

Reviewed by Geoff Garen.

On x86-64 allow JSImmediate to encode 64-bit double precision values.
This patch only affects builds that set USE(ALTERNATE_JSIMMEDIATE).

Updates the implementation of JSValuePtr
and JSImmediate:: methods that operate on neumeric values to be be aware of the new representation. When this representation is in use, the class JSNumberCell is redundant and is compiled out.

The format of the new immediate representation is documented in JSImmediate.h.

  • JavaScriptCore.exp:
  • assembler/MacroAssembler.h: (JSC::MacroAssembler::subPtr):
  • assembler/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::subq_rr): (JSC::X86Assembler::movq_rr): (JSC::X86Assembler::ucomisd_rr): (JSC::X86Assembler::X86InstructionFormatter::twoByteOp64):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::cti_op_stricteq): (JSC::Interpreter::cti_op_nstricteq):
  • jit/JIT.cpp: (JSC::JIT::compileOpStrictEq): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases):
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::compileFastArith_op_lshift): (JSC::JIT::compileFastArith_op_rshift): (JSC::JIT::compileFastArith_op_bitand): (JSC::JIT::compileFastArith_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/JITInlineMethods.h: (JSC::JIT::emitJumpIfBothJSCells): (JSC::JIT::emitJumpIfEitherNumber): (JSC::JIT::emitJumpIfNotEitherNumber): (JSC::JIT::emitJumpIfImmediateIntegerNumber): (JSC::JIT::emitJumpIfNotImmediateIntegerNumber): (JSC::JIT::emitJumpIfNotImmediateIntegerNumbers): (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumber): (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumbers): (JSC::JIT::emitFastArithDeTagImmediate): (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): (JSC::JIT::emitFastArithReTagImmediate): (JSC::JIT::emitFastArithIntToImmNoCheck):
  • runtime/JSCell.h:
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
  • runtime/JSImmediate.cpp: (JSC::JSImmediate::toThisObject): (JSC::JSImmediate::toObject): (JSC::JSImmediate::toString):
  • runtime/JSImmediate.h: (JSC::wtf_reinterpret_cast): (JSC::JSImmediate::isNumber): (JSC::JSImmediate::isIntegerNumber): (JSC::JSImmediate::isDoubleNumber): (JSC::JSImmediate::isPositiveIntegerNumber): (JSC::JSImmediate::areBothImmediateIntegerNumbers): (JSC::JSImmediate::makeInt): (JSC::JSImmediate::makeDouble): (JSC::JSImmediate::doubleValue): (JSC::doubleToBoolean): (JSC::JSImmediate::toBoolean): (JSC::JSImmediate::getTruncatedUInt32): (JSC::JSImmediate::makeOutOfIntegerRange): (JSC::JSImmediate::from): (JSC::JSImmediate::getTruncatedInt32): (JSC::JSImmediate::toDouble): (JSC::JSImmediate::getUInt32): (JSC::JSValuePtr::isInt32Fast): (JSC::JSValuePtr::isUInt32Fast): (JSC::JSValuePtr::areBothInt32Fast): (JSC::JSFastMath::canDoFastBitwiseOperations): (JSC::JSFastMath::xorImmediateNumbers): (JSC::JSFastMath::canDoFastRshift): (JSC::JSFastMath::canDoFastUrshift): (JSC::JSFastMath::rightShiftImmediateNumbers): (JSC::JSFastMath::canDoFastAdditiveOperations): (JSC::JSFastMath::addImmediateNumbers): (JSC::JSFastMath::subImmediateNumbers):
  • runtime/JSNumberCell.cpp: (JSC::jsNumberCell):
  • runtime/JSNumberCell.h: (JSC::createNumberStructure): (JSC::isNumberCell): (JSC::asNumberCell): (JSC::jsNumber): (JSC::JSValuePtr::isDoubleNumber): (JSC::JSValuePtr::getDoubleNumber): (JSC::JSValuePtr::isNumber): (JSC::JSValuePtr::uncheckedGetNumber): (JSC::jsNaN): (JSC::JSValuePtr::getNumber): (JSC::JSValuePtr::numberToInt32): (JSC::JSValuePtr::numberToUInt32):
  • runtime/JSValue.h:
  • runtime/NumberConstructor.cpp: (JSC::numberConstructorNegInfinity): (JSC::numberConstructorPosInfinity): (JSC::numberConstructorMaxValue): (JSC::numberConstructorMinValue):
  • runtime/NumberObject.cpp: (JSC::constructNumber):
  • runtime/NumberObject.h:
  • runtime/Operations.h: (JSC::JSValuePtr::equal): (JSC::JSValuePtr::equalSlowCaseInline): (JSC::JSValuePtr::strictEqual): (JSC::JSValuePtr::strictEqualSlowCaseInline):
  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/X86Assembler.h

    r39738 r39958  
    146146        OP2_MULSD_VsdWsd    = 0x59,
    147147        OP2_SUBSD_VsdWsd    = 0x5C,
     148        OP2_MOVD_VdEd       = 0x6E,
    148149        OP2_MOVD_EdVd       = 0x7E,
    149150        OP2_JO_rel32        = 0x80,
     
    442443
    443444#if PLATFORM(X86_64)
     445    void subq_rr(RegisterID src, RegisterID dst)
     446    {
     447        m_formatter.oneByteOp64(OP_SUB_EvGv, src, dst);
     448    }
     449
    444450    void subq_ir(int imm, RegisterID dst)
    445451    {
     
    10891095    }
    10901096
     1097#if PLATFORM(X86_64)
     1098    void movq_rr(RegisterID src, XMMRegisterID dst)
     1099    {
     1100        m_formatter.prefix(PRE_SSE_66);
     1101        m_formatter.twoByteOp64(OP2_MOVD_VdEd, (RegisterID)dst, src);
     1102    }
     1103#endif
     1104
    10911105    void movsd_rm(XMMRegisterID src, int offset, RegisterID base)
    10921106    {
     
    11321146    }
    11331147
    1134     void ucomis_rr(XMMRegisterID src, XMMRegisterID dst)
     1148    void ucomisd_rr(XMMRegisterID src, XMMRegisterID dst)
    11351149    {
    11361150        m_formatter.prefix(PRE_SSE_66);
     
    14151429            m_buffer.putByteUnchecked(opcode);
    14161430            memoryModRM(reg, base, index, scale, offset);
     1431        }
     1432
     1433        void twoByteOp64(TwoByteOpcodeID opcode, int reg, RegisterID rm)
     1434        {
     1435            m_buffer.ensureSpace(maxInstructionSize);
     1436            emitRexW(reg, 0, rm);
     1437            m_buffer.putByteUnchecked(OP_2BYTE_ESCAPE);
     1438            m_buffer.putByteUnchecked(opcode);
     1439            registerModRM(reg, rm);
    14171440        }
    14181441#endif
Note: See TracChangeset for help on using the changeset viewer.