Changeset 70111 in webkit


Ignore:
Timestamp:
Oct 19, 2010 4:55:08 PM (14 years ago)
Author:
oliver@apple.com
Message:

2010-10-19 Oliver Hunt <oliver@apple.com>

Reviewed by Geoffrey Garen.

Remove support for JSVALUE32 from JSC
https://bugs.webkit.org/show_bug.cgi?id=47948

Remove all the code for supporting JSVALUE32 from JSC.

  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases):
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::emit_op_lshift): (JSC::JIT::emitSlow_op_lshift): (JSC::JIT::emit_op_rshift): (JSC::JIT::emitSlow_op_rshift): (JSC::JIT::emit_op_urshift): (JSC::JIT::emitSlow_op_urshift): (JSC::JIT::emit_op_jnless): (JSC::JIT::emitSlow_op_jnless): (JSC::JIT::emit_op_jless): (JSC::JIT::emitSlow_op_jless): (JSC::JIT::emit_op_jlesseq): (JSC::JIT::emitSlow_op_jlesseq): (JSC::JIT::emit_op_bitand): (JSC::JIT::emit_op_post_inc): (JSC::JIT::emit_op_post_dec): (JSC::JIT::emit_op_pre_inc): (JSC::JIT::emit_op_pre_dec): (JSC::JIT::emit_op_mod): (JSC::JIT::emitSlow_op_mod):
  • jit/JITCall.cpp:
  • jit/JITInlineMethods.h: (JSC::JIT::emitGetFromCallFrameHeaderPtr): (JSC::JIT::emitGetFromCallFrameHeader32):
  • jit/JITOpcodes.cpp: (JSC::JIT::emit_op_loop_if_lesseq): (JSC::JIT::emit_op_bitnot): (JSC::JIT::emit_op_next_pname):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_by_val): (JSC::JIT::emit_op_put_by_val):
  • jit/JITStubs.h:
  • jit/JSInterfaceJIT.h:
  • jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::returnDouble): (JSC::SpecializedThunkJIT::tagReturnAsInt32):
  • jit/ThunkGenerators.cpp: (JSC::sqrtThunkGenerator): (JSC::powThunkGenerator):
  • runtime/Collector.cpp: (JSC::isPossibleCell): (JSC::typeName):
  • runtime/JSCell.h:
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
  • runtime/JSGlobalData.h:
  • runtime/JSGlobalObject.h: (JSC::Structure::prototypeForLookup):
  • runtime/JSImmediate.h: (JSC::reinterpretIntptrToDouble): (JSC::JSImmediate::isIntegerNumber): (JSC::JSImmediate::isDouble): (JSC::JSImmediate::areBothImmediateIntegerNumbers): (JSC::JSImmediate::makeDouble): (JSC::JSImmediate::doubleValue): (JSC::JSImmediate::toBoolean): (JSC::JSImmediate::fromNumberOutsideIntegerRange): (JSC::JSImmediate::from): (JSC::JSImmediate::toDouble): (JSC::JSFastMath::rightShiftImmediateNumbers):
  • runtime/JSNumberCell.cpp:
  • runtime/JSNumberCell.h:
  • runtime/JSObject.h: (JSC::JSObject::JSObject):
  • runtime/JSValue.h:
  • runtime/NumberObject.h:
  • wtf/Platform.h:
Location:
trunk/JavaScriptCore
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r70090 r70111  
     12010-10-19  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Remove support for JSVALUE32 from JSC
     6        https://bugs.webkit.org/show_bug.cgi?id=47948
     7
     8        Remove all the code for supporting JSVALUE32 from JSC.
     9
     10        * jit/JIT.cpp:
     11        (JSC::JIT::privateCompileMainPass):
     12        (JSC::JIT::privateCompileSlowCases):
     13        * jit/JIT.h:
     14        * jit/JITArithmetic.cpp:
     15        (JSC::JIT::emit_op_lshift):
     16        (JSC::JIT::emitSlow_op_lshift):
     17        (JSC::JIT::emit_op_rshift):
     18        (JSC::JIT::emitSlow_op_rshift):
     19        (JSC::JIT::emit_op_urshift):
     20        (JSC::JIT::emitSlow_op_urshift):
     21        (JSC::JIT::emit_op_jnless):
     22        (JSC::JIT::emitSlow_op_jnless):
     23        (JSC::JIT::emit_op_jless):
     24        (JSC::JIT::emitSlow_op_jless):
     25        (JSC::JIT::emit_op_jlesseq):
     26        (JSC::JIT::emitSlow_op_jlesseq):
     27        (JSC::JIT::emit_op_bitand):
     28        (JSC::JIT::emit_op_post_inc):
     29        (JSC::JIT::emit_op_post_dec):
     30        (JSC::JIT::emit_op_pre_inc):
     31        (JSC::JIT::emit_op_pre_dec):
     32        (JSC::JIT::emit_op_mod):
     33        (JSC::JIT::emitSlow_op_mod):
     34        * jit/JITCall.cpp:
     35        * jit/JITInlineMethods.h:
     36        (JSC::JIT::emitGetFromCallFrameHeaderPtr):
     37        (JSC::JIT::emitGetFromCallFrameHeader32):
     38        * jit/JITOpcodes.cpp:
     39        (JSC::JIT::emit_op_loop_if_lesseq):
     40        (JSC::JIT::emit_op_bitnot):
     41        (JSC::JIT::emit_op_next_pname):
     42        * jit/JITPropertyAccess.cpp:
     43        (JSC::JIT::emit_op_get_by_val):
     44        (JSC::JIT::emit_op_put_by_val):
     45        * jit/JITStubs.h:
     46        * jit/JSInterfaceJIT.h:
     47        * jit/SpecializedThunkJIT.h:
     48        (JSC::SpecializedThunkJIT::returnDouble):
     49        (JSC::SpecializedThunkJIT::tagReturnAsInt32):
     50        * jit/ThunkGenerators.cpp:
     51        (JSC::sqrtThunkGenerator):
     52        (JSC::powThunkGenerator):
     53        * runtime/Collector.cpp:
     54        (JSC::isPossibleCell):
     55        (JSC::typeName):
     56        * runtime/JSCell.h:
     57        * runtime/JSGlobalData.cpp:
     58        (JSC::JSGlobalData::JSGlobalData):
     59        * runtime/JSGlobalData.h:
     60        * runtime/JSGlobalObject.h:
     61        (JSC::Structure::prototypeForLookup):
     62        * runtime/JSImmediate.h:
     63        (JSC::reinterpretIntptrToDouble):
     64        (JSC::JSImmediate::isIntegerNumber):
     65        (JSC::JSImmediate::isDouble):
     66        (JSC::JSImmediate::areBothImmediateIntegerNumbers):
     67        (JSC::JSImmediate::makeDouble):
     68        (JSC::JSImmediate::doubleValue):
     69        (JSC::JSImmediate::toBoolean):
     70        (JSC::JSImmediate::fromNumberOutsideIntegerRange):
     71        (JSC::JSImmediate::from):
     72        (JSC::JSImmediate::toDouble):
     73        (JSC::JSFastMath::rightShiftImmediateNumbers):
     74        * runtime/JSNumberCell.cpp:
     75        * runtime/JSNumberCell.h:
     76        * runtime/JSObject.h:
     77        (JSC::JSObject::JSObject):
     78        * runtime/JSValue.h:
     79        * runtime/NumberObject.h:
     80        * wtf/Platform.h:
     81
    1822010-10-19  Csaba Osztrogonác  <ossy@webkit.org>
    283
  • trunk/JavaScriptCore/jit/JIT.cpp

    r69940 r70111  
    187187#endif
    188188
    189 #if !USE(JSVALUE32_64)
     189#if USE(JSVALUE64)
    190190        if (m_labels[m_bytecodeOffset].isUsed())
    191191            killLastResultRegister();
     
    196196        switch (m_interpreter->getOpcodeID(currentInstruction->u.opcode)) {
    197197        DEFINE_BINARY_OP(op_del_by_val)
    198 #if USE(JSVALUE32)
    199         DEFINE_BINARY_OP(op_div)
    200 #endif
    201198        DEFINE_BINARY_OP(op_in)
    202199        DEFINE_BINARY_OP(op_less)
     
    208205        DEFINE_UNARY_OP(op_is_string)
    209206        DEFINE_UNARY_OP(op_is_undefined)
    210 #if !USE(JSVALUE32_64)
     207#if USE(JSVALUE64)
    211208        DEFINE_UNARY_OP(op_negate)
    212209#endif
     
    231228        DEFINE_OP(op_debug)
    232229        DEFINE_OP(op_del_by_id)
    233 #if !USE(JSVALUE32)
    234230        DEFINE_OP(op_div)
    235 #endif
    236231        DEFINE_OP(op_end)
    237232        DEFINE_OP(op_enter)
     
    378373
    379374    for (Vector<SlowCaseEntry>::iterator iter = m_slowCases.begin(); iter != m_slowCases.end();) {
    380 #if !USE(JSVALUE32_64)
     375#if USE(JSVALUE64)
    381376        killLastResultRegister();
    382377#endif
     
    400395        DEFINE_SLOWCASE_OP(op_convert_this)
    401396        DEFINE_SLOWCASE_OP(op_convert_this_strict)
    402 #if !USE(JSVALUE32)
    403397        DEFINE_SLOWCASE_OP(op_div)
    404 #endif
    405398        DEFINE_SLOWCASE_OP(op_eq)
    406399        DEFINE_SLOWCASE_OP(op_get_by_id)
     
    600593}
    601594
    602 #if !USE(JSVALUE32_64)
     595#if USE(JSVALUE64)
    603596void JIT::emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst)
    604597{
  • trunk/JavaScriptCore/jit/JIT.h

    r69940 r70111  
    517517        void emitJumpSlowCaseIfNotJSCell(RegisterID);
    518518        void emitJumpSlowCaseIfNotJSCell(RegisterID, int VReg);
    519 #if USE(JSVALUE64)
    520 #else
     519#if USE(JSVALUE32_64)
    521520        JIT::Jump emitJumpIfImmediateNumber(RegisterID reg)
    522521        {
     
    536535        void emitJumpSlowCaseIfNotImmediateIntegers(RegisterID, RegisterID, RegisterID);
    537536
    538 #if !USE(JSVALUE64)
     537#if USE(JSVALUE32_64)
    539538        void emitFastArithDeTagImmediate(RegisterID);
    540539        Jump emitFastArithDeTagImmediateJumpIfZero(RegisterID);
  • trunk/JavaScriptCore/jit/JITArithmetic.cpp

    r66524 r70111  
    2727
    2828#if ENABLE(JIT)
    29 #if !USE(JSVALUE32_64)
     29#if USE(JSVALUE64)
    3030#include "JIT.h"
    3131
     
    6161    emitFastArithImmToInt(regT2);
    6262    lshift32(regT2, regT0);
    63 #if USE(JSVALUE32)
    64     addSlowCase(branchAdd32(Overflow, regT0, regT0));
    65     signExtend32ToPtr(regT0, regT0);
    66 #endif
    6763    emitFastArithReTagImmediate(regT0, regT0);
    6864    emitPutVirtualRegister(result);
     
    7571    unsigned op2 = currentInstruction[3].u.operand;
    7672
    77 #if USE(JSVALUE64)
    7873    UNUSED_PARAM(op1);
    7974    UNUSED_PARAM(op2);
    8075    linkSlowCase(iter);
    8176    linkSlowCase(iter);
    82 #else
    83     // If we are limited to 32-bit immediates there is a third slow case, which required the operands to have been reloaded.
    84     Jump notImm1 = getSlowCase(iter);
    85     Jump notImm2 = getSlowCase(iter);
    86     linkSlowCase(iter);
    87     emitGetVirtualRegisters(op1, regT0, op2, regT2);
    88     notImm1.link(this);
    89     notImm2.link(this);
    90 #endif
    9177    JITStubCall stubCall(this, cti_op_lshift);
    9278    stubCall.addArgument(regT0);
     
    11197        if (supportsFloatingPointTruncate()) {
    11298            Jump lhsIsInt = emitJumpIfImmediateInteger(regT0);
    113 #if USE(JSVALUE64)
    11499            // supportsFloatingPoint() && USE(JSVALUE64) => 3 SlowCases
    115100            addSlowCase(emitJumpIfNotImmediateNumber(regT0));
     
    117102            movePtrToDouble(regT0, fpRegT0);
    118103            addSlowCase(branchTruncateDoubleToInt32(fpRegT0, regT0));
    119 #else
    120             // supportsFloatingPoint() && !USE(JSVALUE64) => 5 SlowCases (of which 1 IfNotJSCell)
    121             emitJumpSlowCaseIfNotJSCell(regT0, op1);
    122             addSlowCase(checkStructure(regT0, m_globalData->numberStructure.get()));
    123             loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    124             addSlowCase(branchTruncateDoubleToInt32(fpRegT0, regT0));
    125             addSlowCase(branchAdd32(Overflow, regT0, regT0));
    126 #endif
    127104            lhsIsInt.link(this);
    128105            emitJumpSlowCaseIfNotImmediateInteger(regT2);
     
    134111        emitFastArithImmToInt(regT2);
    135112        rshift32(regT2, regT0);
    136 #if USE(JSVALUE32)
    137         signExtend32ToPtr(regT0, regT0);
    138 #endif
    139     }
    140 #if USE(JSVALUE64)
     113    }
    141114    emitFastArithIntToImmNoCheck(regT0, regT0);
    142 #else
    143     orPtr(Imm32(JSImmediate::TagTypeNumber), regT0);
    144 #endif
    145115    emitPutVirtualRegister(result);
    146116}
     
    160130    } else {
    161131        if (supportsFloatingPointTruncate()) {
    162 #if USE(JSVALUE64)
    163132            linkSlowCase(iter);
    164133            linkSlowCase(iter);
    165134            linkSlowCase(iter);
    166 #else
    167             linkSlowCaseIfNotJSCell(iter, op1);
    168             linkSlowCase(iter);
    169             linkSlowCase(iter);
    170             linkSlowCase(iter);
    171             linkSlowCase(iter);
    172 #endif
    173135            // We're reloading op1 to regT0 as we can no longer guarantee that
    174136            // we have not munged the operand.  It may have already been shifted
     
    207169        if (shift < 0 || !(shift & 31))
    208170            addSlowCase(branch32(LessThan, regT0, Imm32(0)));
    209 #if USE(JSVALUE32)
    210         addSlowCase(branchAdd32(Overflow, regT0, regT0));
    211         signExtend32ToPtr(regT0, regT0);
    212 #endif
    213171        emitFastArithReTagImmediate(regT0, regT0);
    214172        emitPutVirtualRegister(dst, regT0);
     
    223181    urshift32(regT1, regT0);
    224182    addSlowCase(branch32(LessThan, regT0, Imm32(0)));
    225 #if USE(JSVALUE32)
    226     addSlowCase(branchAdd32(Overflow, regT0, regT0));
    227     signExtend32ToPtr(regT0, regT0);
    228 #endif
    229183    emitFastArithReTagImmediate(regT0, regT0);
    230184    emitPutVirtualRegister(dst, regT0);
     
    240194        // op1 = regT0
    241195        linkSlowCase(iter); // int32 check
    242 #if USE(JSVALUE64)
    243196        if (supportsFloatingPointTruncate()) {
    244197            JumpList failures;
     
    256209            failures.link(this);
    257210        }
    258 #endif // JSVALUE64
    259211        if (shift < 0 || !(shift & 31))
    260212            linkSlowCase(iter); // failed to box in hot path
    261 #if USE(JSVALUE32)
    262         linkSlowCase(iter); // Couldn't box result
    263 #endif
    264213    } else {
    265214        // op1 = regT0
     
    267216        if (!isOperandConstantImmediateInt(op1)) {
    268217            linkSlowCase(iter); // int32 check -- op1 is not an int
    269 #if USE(JSVALUE64)
    270218            if (supportsFloatingPointTruncate()) {
    271219                JumpList failures;
     
    283231                failures.link(this);
    284232            }
    285 #endif
    286233        }
    287234       
    288235        linkSlowCase(iter); // int32 check - op2 is not an int
    289236        linkSlowCase(iter); // Can't represent unsigned result as an immediate
    290 #if USE(JSVALUE32)
    291         linkSlowCase(iter); // Couldn't box result
    292 #endif
    293237    }
    294238   
     
    331275        emitGetVirtualRegister(op1, regT0);
    332276        emitJumpSlowCaseIfNotImmediateInteger(regT0);
    333 #if USE(JSVALUE64)
    334277        int32_t op2imm = getConstantOperandImmediateInt(op2);
    335 #else
    336         int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)));
    337 #endif
    338278        addJump(branch32(GreaterThanOrEqual, regT0, Imm32(op2imm)), target);
    339279    } else if (isOperandConstantImmediateInt(op1)) {
    340280        emitGetVirtualRegister(op2, regT1);
    341281        emitJumpSlowCaseIfNotImmediateInteger(regT1);
    342 #if USE(JSVALUE64)
    343282        int32_t op1imm = getConstantOperandImmediateInt(op1);
    344 #else
    345         int32_t op1imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op1)));
    346 #endif
    347283        addJump(branch32(LessThanOrEqual, regT1, Imm32(op1imm)), target);
    348284    } else {
     
    382318
    383319        if (supportsFloatingPoint()) {
    384 #if USE(JSVALUE64)
    385320            Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
    386321            addPtr(tagTypeNumberRegister, regT0);
    387322            movePtrToDouble(regT0, fpRegT0);
    388 #else
    389             Jump fail1;
    390             if (!m_codeBlock->isKnownNotImmediate(op1))
    391                 fail1 = emitJumpIfNotJSCell(regT0);
    392 
    393             Jump fail2 = checkStructure(regT0, m_globalData->numberStructure.get());
    394             loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    395 #endif
    396323
    397324            int32_t op2imm = getConstantOperand(op2).asInt32();;
     
    404331            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnless));
    405332
    406 #if USE(JSVALUE64)
    407333            fail1.link(this);
    408 #else
    409             if (!m_codeBlock->isKnownNotImmediate(op1))
    410                 fail1.link(this);
    411             fail2.link(this);
    412 #endif
    413334        }
    414335
     
    423344
    424345        if (supportsFloatingPoint()) {
    425 #if USE(JSVALUE64)
    426346            Jump fail1 = emitJumpIfNotImmediateNumber(regT1);
    427347            addPtr(tagTypeNumberRegister, regT1);
    428348            movePtrToDouble(regT1, fpRegT1);
    429 #else
    430             Jump fail1;
    431             if (!m_codeBlock->isKnownNotImmediate(op2))
    432                 fail1 = emitJumpIfNotJSCell(regT1);
    433 
    434             Jump fail2 = checkStructure(regT1, m_globalData->numberStructure.get());
    435             loadDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT1);
    436 #endif
    437349
    438350            int32_t op1imm = getConstantOperand(op1).asInt32();;
     
    445357            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnless));
    446358
    447 #if USE(JSVALUE64)
    448359            fail1.link(this);
    449 #else
    450             if (!m_codeBlock->isKnownNotImmediate(op2))
    451                 fail1.link(this);
    452             fail2.link(this);
    453 #endif
    454360        }
    455361
     
    464370
    465371        if (supportsFloatingPoint()) {
    466 #if USE(JSVALUE64)
    467372            Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
    468373            Jump fail2 = emitJumpIfNotImmediateNumber(regT1);
     
    472377            movePtrToDouble(regT0, fpRegT0);
    473378            movePtrToDouble(regT1, fpRegT1);
    474 #else
    475             Jump fail1;
    476             if (!m_codeBlock->isKnownNotImmediate(op1))
    477                 fail1 = emitJumpIfNotJSCell(regT0);
    478 
    479             Jump fail2;
    480             if (!m_codeBlock->isKnownNotImmediate(op2))
    481                 fail2 = emitJumpIfNotJSCell(regT1);
    482 
    483             Jump fail3 = checkStructure(regT0, m_globalData->numberStructure.get());
    484             Jump fail4 = checkStructure(regT1, m_globalData->numberStructure.get());
    485             loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    486             loadDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT1);
    487 #endif
    488379
    489380            emitJumpSlowToHot(branchDouble(DoubleLessThanOrEqualOrUnordered, fpRegT1, fpRegT0), target);
     
    491382            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnless));
    492383
    493 #if USE(JSVALUE64)
    494384            fail1.link(this);
    495385            fail2.link(this);
    496386            fail3.link(this);
    497 #else
    498             if (!m_codeBlock->isKnownNotImmediate(op1))
    499                 fail1.link(this);
    500             if (!m_codeBlock->isKnownNotImmediate(op2))
    501                 fail2.link(this);
    502             fail3.link(this);
    503             fail4.link(this);
    504 #endif
    505387        }
    506388
     
    546428        emitGetVirtualRegister(op1, regT0);
    547429        emitJumpSlowCaseIfNotImmediateInteger(regT0);
    548 #if USE(JSVALUE64)
    549430        int32_t op2imm = getConstantOperandImmediateInt(op2);
    550 #else
    551         int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)));
    552 #endif
    553431        addJump(branch32(LessThan, regT0, Imm32(op2imm)), target);
    554432    } else if (isOperandConstantImmediateInt(op1)) {
    555433        emitGetVirtualRegister(op2, regT1);
    556434        emitJumpSlowCaseIfNotImmediateInteger(regT1);
    557 #if USE(JSVALUE64)
    558435        int32_t op1imm = getConstantOperandImmediateInt(op1);
    559 #else
    560         int32_t op1imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op1)));
    561 #endif
    562436        addJump(branch32(GreaterThan, regT1, Imm32(op1imm)), target);
    563437    } else {
     
    597471
    598472        if (supportsFloatingPoint()) {
    599 #if USE(JSVALUE64)
    600473            Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
    601474            addPtr(tagTypeNumberRegister, regT0);
    602475            movePtrToDouble(regT0, fpRegT0);
    603 #else
    604             Jump fail1;
    605             if (!m_codeBlock->isKnownNotImmediate(op1))
    606                 fail1 = emitJumpIfNotJSCell(regT0);
    607 
    608             Jump fail2 = checkStructure(regT0, m_globalData->numberStructure.get());
    609             loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    610 #endif
    611476
    612477            int32_t op2imm = getConstantOperand(op2).asInt32();
     
    619484            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnless));
    620485
    621 #if USE(JSVALUE64)
    622486            fail1.link(this);
    623 #else
    624             if (!m_codeBlock->isKnownNotImmediate(op1))
    625                 fail1.link(this);
    626             fail2.link(this);
    627 #endif
    628487        }
    629488
     
    638497
    639498        if (supportsFloatingPoint()) {
    640 #if USE(JSVALUE64)
    641499            Jump fail1 = emitJumpIfNotImmediateNumber(regT1);
    642500            addPtr(tagTypeNumberRegister, regT1);
    643501            movePtrToDouble(regT1, fpRegT1);
    644 #else
    645             Jump fail1;
    646             if (!m_codeBlock->isKnownNotImmediate(op2))
    647                 fail1 = emitJumpIfNotJSCell(regT1);
    648 
    649             Jump fail2 = checkStructure(regT1, m_globalData->numberStructure.get());
    650             loadDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT1);
    651 #endif
    652502
    653503            int32_t op1imm = getConstantOperand(op1).asInt32();
     
    660510            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnless));
    661511
    662 #if USE(JSVALUE64)
    663512            fail1.link(this);
    664 #else
    665             if (!m_codeBlock->isKnownNotImmediate(op2))
    666                 fail1.link(this);
    667             fail2.link(this);
    668 #endif
    669513        }
    670514
     
    679523
    680524        if (supportsFloatingPoint()) {
    681 #if USE(JSVALUE64)
    682525            Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
    683526            Jump fail2 = emitJumpIfNotImmediateNumber(regT1);
     
    687530            movePtrToDouble(regT0, fpRegT0);
    688531            movePtrToDouble(regT1, fpRegT1);
    689 #else
    690             Jump fail1;
    691             if (!m_codeBlock->isKnownNotImmediate(op1))
    692                 fail1 = emitJumpIfNotJSCell(regT0);
    693 
    694             Jump fail2;
    695             if (!m_codeBlock->isKnownNotImmediate(op2))
    696                 fail2 = emitJumpIfNotJSCell(regT1);
    697 
    698             Jump fail3 = checkStructure(regT0, m_globalData->numberStructure.get());
    699             Jump fail4 = checkStructure(regT1, m_globalData->numberStructure.get());
    700             loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    701             loadDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT1);
    702 #endif
    703532
    704533            emitJumpSlowToHot(branchDouble(DoubleLessThan, fpRegT0, fpRegT1), target);
     
    706535            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnless));
    707536
    708 #if USE(JSVALUE64)
    709537            fail1.link(this);
    710538            fail2.link(this);
    711539            fail3.link(this);
    712 #else
    713             if (!m_codeBlock->isKnownNotImmediate(op1))
    714                 fail1.link(this);
    715             if (!m_codeBlock->isKnownNotImmediate(op2))
    716                 fail2.link(this);
    717             fail3.link(this);
    718             fail4.link(this);
    719 #endif
    720540        }
    721541
     
    761581        emitGetVirtualRegister(op1, regT0);
    762582        emitJumpSlowCaseIfNotImmediateInteger(regT0);
    763 #if USE(JSVALUE64)
    764583        int32_t op2imm = getConstantOperandImmediateInt(op2);
    765 #else
    766         int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)));
    767 #endif
    768584        addJump(branch32(invert ? GreaterThan : LessThanOrEqual, regT0, Imm32(op2imm)), target);
    769585    } else if (isOperandConstantImmediateInt(op1)) {
    770586        emitGetVirtualRegister(op2, regT1);
    771587        emitJumpSlowCaseIfNotImmediateInteger(regT1);
    772 #if USE(JSVALUE64)
    773588        int32_t op1imm = getConstantOperandImmediateInt(op1);
    774 #else
    775         int32_t op1imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op1)));
    776 #endif
    777589        addJump(branch32(invert ? LessThan : GreaterThanOrEqual, regT1, Imm32(op1imm)), target);
    778590    } else {
     
    813625
    814626        if (supportsFloatingPoint()) {
    815 #if USE(JSVALUE64)
    816627            Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
    817628            addPtr(tagTypeNumberRegister, regT0);
    818629            movePtrToDouble(regT0, fpRegT0);
    819 #else
    820             Jump fail1;
    821             if (!m_codeBlock->isKnownNotImmediate(op1))
    822                 fail1 = emitJumpIfNotJSCell(regT0);
    823 
    824             Jump fail2 = checkStructure(regT0, m_globalData->numberStructure.get());
    825             loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    826 #endif
    827630
    828631            int32_t op2imm = getConstantOperand(op2).asInt32();;
     
    835638            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnlesseq));
    836639
    837 #if USE(JSVALUE64)
    838640            fail1.link(this);
    839 #else
    840             if (!m_codeBlock->isKnownNotImmediate(op1))
    841                 fail1.link(this);
    842             fail2.link(this);
    843 #endif
    844641        }
    845642
     
    854651
    855652        if (supportsFloatingPoint()) {
    856 #if USE(JSVALUE64)
    857653            Jump fail1 = emitJumpIfNotImmediateNumber(regT1);
    858654            addPtr(tagTypeNumberRegister, regT1);
    859655            movePtrToDouble(regT1, fpRegT1);
    860 #else
    861             Jump fail1;
    862             if (!m_codeBlock->isKnownNotImmediate(op2))
    863                 fail1 = emitJumpIfNotJSCell(regT1);
    864 
    865             Jump fail2 = checkStructure(regT1, m_globalData->numberStructure.get());
    866             loadDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT1);
    867 #endif
    868656
    869657            int32_t op1imm = getConstantOperand(op1).asInt32();;
     
    876664            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnlesseq));
    877665
    878 #if USE(JSVALUE64)
    879666            fail1.link(this);
    880 #else
    881             if (!m_codeBlock->isKnownNotImmediate(op2))
    882                 fail1.link(this);
    883             fail2.link(this);
    884 #endif
    885667        }
    886668
     
    895677
    896678        if (supportsFloatingPoint()) {
    897 #if USE(JSVALUE64)
    898679            Jump fail1 = emitJumpIfNotImmediateNumber(regT0);
    899680            Jump fail2 = emitJumpIfNotImmediateNumber(regT1);
     
    903684            movePtrToDouble(regT0, fpRegT0);
    904685            movePtrToDouble(regT1, fpRegT1);
    905 #else
    906             Jump fail1;
    907             if (!m_codeBlock->isKnownNotImmediate(op1))
    908                 fail1 = emitJumpIfNotJSCell(regT0);
    909 
    910             Jump fail2;
    911             if (!m_codeBlock->isKnownNotImmediate(op2))
    912                 fail2 = emitJumpIfNotJSCell(regT1);
    913 
    914             Jump fail3 = checkStructure(regT0, m_globalData->numberStructure.get());
    915             Jump fail4 = checkStructure(regT1, m_globalData->numberStructure.get());
    916             loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    917             loadDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT1);
    918 #endif
    919686
    920687            emitJumpSlowToHot(branchDouble(invert ? DoubleLessThanOrUnordered : DoubleGreaterThanOrEqual, fpRegT1, fpRegT0), target);
     
    922689            emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jnlesseq));
    923690
    924 #if USE(JSVALUE64)
    925691            fail1.link(this);
    926692            fail2.link(this);
    927693            fail3.link(this);
    928 #else
    929             if (!m_codeBlock->isKnownNotImmediate(op1))
    930                 fail1.link(this);
    931             if (!m_codeBlock->isKnownNotImmediate(op2))
    932                 fail2.link(this);
    933             fail3.link(this);
    934             fail4.link(this);
    935 #endif
    936694        }
    937695
     
    964722        emitGetVirtualRegister(op2, regT0);
    965723        emitJumpSlowCaseIfNotImmediateInteger(regT0);
    966 #if USE(JSVALUE64)
    967724        int32_t imm = getConstantOperandImmediateInt(op1);
    968725        andPtr(Imm32(imm), regT0);
    969726        if (imm >= 0)
    970727            emitFastArithIntToImmNoCheck(regT0, regT0);
    971 #else
    972         andPtr(Imm32(static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op1)))), regT0);
    973 #endif
    974728    } else if (isOperandConstantImmediateInt(op2)) {
    975729        emitGetVirtualRegister(op1, regT0);
    976730        emitJumpSlowCaseIfNotImmediateInteger(regT0);
    977 #if USE(JSVALUE64)
    978731        int32_t imm = getConstantOperandImmediateInt(op2);
    979732        andPtr(Imm32(imm), regT0);
    980733        if (imm >= 0)
    981734            emitFastArithIntToImmNoCheck(regT0, regT0);
    982 #else
    983         andPtr(Imm32(static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)))), regT0);
    984 #endif
    985735    } else {
    986736        emitGetVirtualRegisters(op1, regT0, op2, regT1);
     
    1024774    move(regT0, regT1);
    1025775    emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1026 #if USE(JSVALUE64)
    1027776    addSlowCase(branchAdd32(Overflow, Imm32(1), regT1));
    1028777    emitFastArithIntToImmNoCheck(regT1, regT1);
    1029 #else
    1030     addSlowCase(branchAdd32(Overflow, Imm32(1 << JSImmediate::IntegerPayloadShift), regT1));
    1031     signExtend32ToPtr(regT1, regT1);
    1032 #endif
    1033778    emitPutVirtualRegister(srcDst, regT1);
    1034779    emitPutVirtualRegister(result);
     
    1056801    move(regT0, regT1);
    1057802    emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1058 #if USE(JSVALUE64)
    1059803    addSlowCase(branchSub32(Zero, Imm32(1), regT1));
    1060804    emitFastArithIntToImmNoCheck(regT1, regT1);
    1061 #else
    1062     addSlowCase(branchSub32(Zero, Imm32(1 << JSImmediate::IntegerPayloadShift), regT1));
    1063     signExtend32ToPtr(regT1, regT1);
    1064 #endif
    1065805    emitPutVirtualRegister(srcDst, regT1);
    1066806    emitPutVirtualRegister(result);
     
    1086826    emitGetVirtualRegister(srcDst, regT0);
    1087827    emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1088 #if USE(JSVALUE64)
    1089828    addSlowCase(branchAdd32(Overflow, Imm32(1), regT0));
    1090829    emitFastArithIntToImmNoCheck(regT0, regT0);
    1091 #else
    1092     addSlowCase(branchAdd32(Overflow, Imm32(1 << JSImmediate::IntegerPayloadShift), regT0));
    1093     signExtend32ToPtr(regT0, regT0);
    1094 #endif
    1095830    emitPutVirtualRegister(srcDst);
    1096831}
     
    1115850    emitGetVirtualRegister(srcDst, regT0);
    1116851    emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1117 #if USE(JSVALUE64)
    1118852    addSlowCase(branchSub32(Zero, Imm32(1), regT0));
    1119853    emitFastArithIntToImmNoCheck(regT0, regT0);
    1120 #else
    1121     addSlowCase(branchSub32(Zero, Imm32(1 << JSImmediate::IntegerPayloadShift), regT0));
    1122     signExtend32ToPtr(regT0, regT0);
    1123 #endif
    1124854    emitPutVirtualRegister(srcDst);
    1125855}
     
    1159889    emitJumpSlowCaseIfNotImmediateInteger(regT2);
    1160890
    1161 #if USE(JSVALUE64)
    1162891    addSlowCase(branchPtr(Equal, regT2, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0)))));
    1163892    m_assembler.cdq();
    1164893    m_assembler.idivl_r(regT2);
    1165 #else
    1166     emitFastArithDeTagImmediate(regT0);
    1167     addSlowCase(emitFastArithDeTagImmediateJumpIfZero(regT2));
    1168 #if CPU(X86) || CPU(X86_64)
    1169     m_assembler.cdq();
    1170     m_assembler.idivl_r(regT2);
    1171     signExtend32ToPtr(regT1, regT1);
    1172 #elif CPU(MIPS)
    1173     m_assembler.div(regT0, regT2);
    1174     m_assembler.mfhi(regT1);
    1175 #endif
    1176 #endif
    1177894    emitFastArithReTagImmediate(regT1, regT0);
    1178895    emitPutVirtualRegister(result);
     
    1183900    unsigned result = currentInstruction[1].u.operand;
    1184901
    1185 #if USE(JSVALUE64)
    1186     linkSlowCase(iter);
    1187     linkSlowCase(iter);
    1188     linkSlowCase(iter);
    1189 #else
    1190     Jump notImm1 = getSlowCase(iter);
    1191     Jump notImm2 = getSlowCase(iter);
    1192     linkSlowCase(iter);
    1193     emitFastArithReTagImmediate(regT0, regT0);
    1194     emitFastArithReTagImmediate(regT2, regT2);
    1195     notImm1.link(this);
    1196     notImm2.link(this);
    1197 #endif
     902    linkSlowCase(iter);
     903    linkSlowCase(iter);
     904    linkSlowCase(iter);
    1198905    JITStubCall stubCall(this, cti_op_mod);
    1199906    stubCall.addArgument(regT0);
     
    1249956
    1250957/* ------------------------------ END: OP_MOD ------------------------------ */
    1251 
    1252 #if USE(JSVALUE64)
    1253958
    1254959/* ------------------------------ BEGIN: USE(JSVALUE64) (OP_ADD, OP_SUB, OP_MUL) ------------------------------ */
     
    15441249}
    15451250
    1546 #else // USE(JSVALUE64)
    1547 
    1548 /* ------------------------------ BEGIN: !USE(JSVALUE64) (OP_ADD, OP_SUB, OP_MUL) ------------------------------ */
    1549 
    1550 void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes types)
    1551 {
    1552     Structure* numberStructure = m_globalData->numberStructure.get();
    1553     Jump wasJSNumberCell1;
    1554     Jump wasJSNumberCell2;
    1555 
    1556     emitGetVirtualRegisters(src1, regT0, src2, regT1);
    1557 
    1558     if (types.second().isReusable() && supportsFloatingPoint()) {
    1559         ASSERT(types.second().mightBeNumber());
    1560 
    1561         // Check op2 is a number
    1562         Jump op2imm = emitJumpIfImmediateInteger(regT1);
    1563         if (!types.second().definitelyIsNumber()) {
    1564             emitJumpSlowCaseIfNotJSCell(regT1, src2);
    1565             addSlowCase(checkStructure(regT1, numberStructure));
    1566         }
    1567 
    1568         // (1) In this case src2 is a reusable number cell.
    1569         //     Slow case if src1 is not a number type.
    1570         Jump op1imm = emitJumpIfImmediateInteger(regT0);
    1571         if (!types.first().definitelyIsNumber()) {
    1572             emitJumpSlowCaseIfNotJSCell(regT0, src1);
    1573             addSlowCase(checkStructure(regT0, numberStructure));
    1574         }
    1575 
    1576         // (1a) if we get here, src1 is also a number cell
    1577         loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    1578         Jump loadedDouble = jump();
    1579         // (1b) if we get here, src1 is an immediate
    1580         op1imm.link(this);
    1581         emitFastArithImmToInt(regT0);
    1582         convertInt32ToDouble(regT0, fpRegT0);
    1583         // (1c)
    1584         loadedDouble.link(this);
    1585         if (opcodeID == op_add)
    1586             addDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    1587         else if (opcodeID == op_sub)
    1588             subDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    1589         else {
    1590             ASSERT(opcodeID == op_mul);
    1591             mulDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    1592         }
    1593 
    1594         // Store the result to the JSNumberCell and jump.
    1595         storeDouble(fpRegT0, Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)));
    1596         move(regT1, regT0);
    1597         emitPutVirtualRegister(dst);
    1598         wasJSNumberCell2 = jump();
    1599 
    1600         // (2) This handles cases where src2 is an immediate number.
    1601         //     Two slow cases - either src1 isn't an immediate, or the subtract overflows.
    1602         op2imm.link(this);
    1603         emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1604     } else if (types.first().isReusable() && supportsFloatingPoint()) {
    1605         ASSERT(types.first().mightBeNumber());
    1606 
    1607         // Check op1 is a number
    1608         Jump op1imm = emitJumpIfImmediateInteger(regT0);
    1609         if (!types.first().definitelyIsNumber()) {
    1610             emitJumpSlowCaseIfNotJSCell(regT0, src1);
    1611             addSlowCase(checkStructure(regT0, numberStructure));
    1612         }
    1613 
    1614         // (1) In this case src1 is a reusable number cell.
    1615         //     Slow case if src2 is not a number type.
    1616         Jump op2imm = emitJumpIfImmediateInteger(regT1);
    1617         if (!types.second().definitelyIsNumber()) {
    1618             emitJumpSlowCaseIfNotJSCell(regT1, src2);
    1619             addSlowCase(checkStructure(regT1, numberStructure));
    1620         }
    1621 
    1622         // (1a) if we get here, src2 is also a number cell
    1623         loadDouble(Address(regT1, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT1);
    1624         Jump loadedDouble = jump();
    1625         // (1b) if we get here, src2 is an immediate
    1626         op2imm.link(this);
    1627         emitFastArithImmToInt(regT1);
    1628         convertInt32ToDouble(regT1, fpRegT1);
    1629         // (1c)
    1630         loadedDouble.link(this);
    1631         loadDouble(Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)), fpRegT0);
    1632         if (opcodeID == op_add)
    1633             addDouble(fpRegT1, fpRegT0);
    1634         else if (opcodeID == op_sub)
    1635             subDouble(fpRegT1, fpRegT0);
    1636         else {
    1637             ASSERT(opcodeID == op_mul);
    1638             mulDouble(fpRegT1, fpRegT0);
    1639         }
    1640         storeDouble(fpRegT0, Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)));
    1641         emitPutVirtualRegister(dst);
    1642 
    1643         // Store the result to the JSNumberCell and jump.
    1644         storeDouble(fpRegT0, Address(regT0, OBJECT_OFFSETOF(JSNumberCell, m_value)));
    1645         emitPutVirtualRegister(dst);
    1646         wasJSNumberCell1 = jump();
    1647 
    1648         // (2) This handles cases where src1 is an immediate number.
    1649         //     Two slow cases - either src2 isn't an immediate, or the subtract overflows.
    1650         op1imm.link(this);
    1651         emitJumpSlowCaseIfNotImmediateInteger(regT1);
    1652     } else
    1653         emitJumpSlowCaseIfNotImmediateIntegers(regT0, regT1, regT2);
    1654 
    1655     if (opcodeID == op_add) {
    1656         emitFastArithDeTagImmediate(regT0);
    1657         addSlowCase(branchAdd32(Overflow, regT1, regT0));
    1658     } else  if (opcodeID == op_sub) {
    1659         addSlowCase(branchSub32(Overflow, regT1, regT0));
    1660         signExtend32ToPtr(regT0, regT0);
    1661         emitFastArithReTagImmediate(regT0, regT0);
    1662     } else {
    1663         ASSERT(opcodeID == op_mul);
    1664         // convert eax & edx from JSImmediates to ints, and check if either are zero
    1665         emitFastArithImmToInt(regT1);
    1666         Jump op1Zero = emitFastArithDeTagImmediateJumpIfZero(regT0);
    1667         Jump op2NonZero = branchTest32(NonZero, regT1);
    1668         op1Zero.link(this);
    1669         // if either input is zero, add the two together, and check if the result is < 0.
    1670         // If it is, we have a problem (N < 0), (N * 0) == -0, not representatble as a JSImmediate.
    1671         move(regT0, regT2);
    1672         addSlowCase(branchAdd32(Signed, regT1, regT2));
    1673         // Skip the above check if neither input is zero
    1674         op2NonZero.link(this);
    1675         addSlowCase(branchMul32(Overflow, regT1, regT0));
    1676         signExtend32ToPtr(regT0, regT0);
    1677         emitFastArithReTagImmediate(regT0, regT0);
    1678     }
    1679     emitPutVirtualRegister(dst);
    1680 
    1681     if (types.second().isReusable() && supportsFloatingPoint())
    1682         wasJSNumberCell2.link(this);
    1683     else if (types.first().isReusable() && supportsFloatingPoint())
    1684         wasJSNumberCell1.link(this);
    1685 }
    1686 
    1687 void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes types)
    1688 {
    1689     linkSlowCase(iter);
    1690     if (types.second().isReusable() && supportsFloatingPoint()) {
    1691         if (!types.first().definitelyIsNumber()) {
    1692             linkSlowCaseIfNotJSCell(iter, src1);
    1693             linkSlowCase(iter);
    1694         }
    1695         if (!types.second().definitelyIsNumber()) {
    1696             linkSlowCaseIfNotJSCell(iter, src2);
    1697             linkSlowCase(iter);
    1698         }
    1699     } else if (types.first().isReusable() && supportsFloatingPoint()) {
    1700         if (!types.first().definitelyIsNumber()) {
    1701             linkSlowCaseIfNotJSCell(iter, src1);
    1702             linkSlowCase(iter);
    1703         }
    1704         if (!types.second().definitelyIsNumber()) {
    1705             linkSlowCaseIfNotJSCell(iter, src2);
    1706             linkSlowCase(iter);
    1707         }
    1708     }
    1709     linkSlowCase(iter);
    1710 
    1711     // additional entry point to handle -0 cases.
    1712     if (opcodeID == op_mul)
    1713         linkSlowCase(iter);
    1714 
    1715     JITStubCall stubCall(this, opcodeID == op_add ? cti_op_add : opcodeID == op_sub ? cti_op_sub : cti_op_mul);
    1716     stubCall.addArgument(src1, regT2);
    1717     stubCall.addArgument(src2, regT2);
    1718     stubCall.call(dst);
    1719 }
    1720 
    1721 void JIT::emit_op_add(Instruction* currentInstruction)
    1722 {
    1723     unsigned result = currentInstruction[1].u.operand;
    1724     unsigned op1 = currentInstruction[2].u.operand;
    1725     unsigned op2 = currentInstruction[3].u.operand;
    1726     OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    1727 
    1728     if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) {
    1729         JITStubCall stubCall(this, cti_op_add);
    1730         stubCall.addArgument(op1, regT2);
    1731         stubCall.addArgument(op2, regT2);
    1732         stubCall.call(result);
    1733         return;
    1734     }
    1735 
    1736     if (isOperandConstantImmediateInt(op1)) {
    1737         emitGetVirtualRegister(op2, regT0);
    1738         emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1739         addSlowCase(branchAdd32(Overflow, Imm32(getConstantOperandImmediateInt(op1) << JSImmediate::IntegerPayloadShift), regT0));
    1740         signExtend32ToPtr(regT0, regT0);
    1741         emitPutVirtualRegister(result);
    1742     } else if (isOperandConstantImmediateInt(op2)) {
    1743         emitGetVirtualRegister(op1, regT0);
    1744         emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1745         addSlowCase(branchAdd32(Overflow, Imm32(getConstantOperandImmediateInt(op2) << JSImmediate::IntegerPayloadShift), regT0));
    1746         signExtend32ToPtr(regT0, regT0);
    1747         emitPutVirtualRegister(result);
    1748     } else {
    1749         compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
    1750     }
    1751 }
    1752 
    1753 void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    1754 {
    1755     unsigned result = currentInstruction[1].u.operand;
    1756     unsigned op1 = currentInstruction[2].u.operand;
    1757     unsigned op2 = currentInstruction[3].u.operand;
    1758 
    1759     OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    1760     if (!types.first().mightBeNumber() || !types.second().mightBeNumber())
    1761         return;
    1762 
    1763     if (isOperandConstantImmediateInt(op1)) {
    1764         Jump notImm = getSlowCase(iter);
    1765         linkSlowCase(iter);
    1766         sub32(Imm32(getConstantOperandImmediateInt(op1) << JSImmediate::IntegerPayloadShift), regT0);
    1767         notImm.link(this);
    1768         JITStubCall stubCall(this, cti_op_add);
    1769         stubCall.addArgument(op1, regT2);
    1770         stubCall.addArgument(regT0);
    1771         stubCall.call(result);
    1772     } else if (isOperandConstantImmediateInt(op2)) {
    1773         Jump notImm = getSlowCase(iter);
    1774         linkSlowCase(iter);
    1775         sub32(Imm32(getConstantOperandImmediateInt(op2) << JSImmediate::IntegerPayloadShift), regT0);
    1776         notImm.link(this);
    1777         JITStubCall stubCall(this, cti_op_add);
    1778         stubCall.addArgument(regT0);
    1779         stubCall.addArgument(op2, regT2);
    1780         stubCall.call(result);
    1781     } else {
    1782         OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    1783         ASSERT(types.first().mightBeNumber() && types.second().mightBeNumber());
    1784         compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, types);
    1785     }
    1786 }
    1787 
    1788 void JIT::emit_op_mul(Instruction* currentInstruction)
    1789 {
    1790     unsigned result = currentInstruction[1].u.operand;
    1791     unsigned op1 = currentInstruction[2].u.operand;
    1792     unsigned op2 = currentInstruction[3].u.operand;
    1793 
    1794     // For now, only plant a fast int case if the constant operand is greater than zero.
    1795     int32_t value;
    1796     if (isOperandConstantImmediateInt(op1) && ((value = getConstantOperandImmediateInt(op1)) > 0)) {
    1797         emitGetVirtualRegister(op2, regT0);
    1798         emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1799         emitFastArithDeTagImmediate(regT0);
    1800         addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT0));
    1801         signExtend32ToPtr(regT0, regT0);
    1802         emitFastArithReTagImmediate(regT0, regT0);
    1803         emitPutVirtualRegister(result);
    1804     } else if (isOperandConstantImmediateInt(op2) && ((value = getConstantOperandImmediateInt(op2)) > 0)) {
    1805         emitGetVirtualRegister(op1, regT0);
    1806         emitJumpSlowCaseIfNotImmediateInteger(regT0);
    1807         emitFastArithDeTagImmediate(regT0);
    1808         addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT0));
    1809         signExtend32ToPtr(regT0, regT0);
    1810         emitFastArithReTagImmediate(regT0, regT0);
    1811         emitPutVirtualRegister(result);
    1812     } else
    1813         compileBinaryArithOp(op_mul, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
    1814 }
    1815 
    1816 void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    1817 {
    1818     unsigned result = currentInstruction[1].u.operand;
    1819     unsigned op1 = currentInstruction[2].u.operand;
    1820     unsigned op2 = currentInstruction[3].u.operand;
    1821 
    1822     if ((isOperandConstantImmediateInt(op1) && (getConstantOperandImmediateInt(op1) > 0))
    1823         || (isOperandConstantImmediateInt(op2) && (getConstantOperandImmediateInt(op2) > 0))) {
    1824         linkSlowCase(iter);
    1825         linkSlowCase(iter);
    1826         // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
    1827         JITStubCall stubCall(this, cti_op_mul);
    1828         stubCall.addArgument(op1, regT2);
    1829         stubCall.addArgument(op2, regT2);
    1830         stubCall.call(result);
    1831     } else
    1832         compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
    1833 }
    1834 
    1835 void JIT::emit_op_sub(Instruction* currentInstruction)
    1836 {
    1837     compileBinaryArithOp(op_sub, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
    1838 }
    1839 
    1840 void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    1841 {
    1842     compileBinaryArithOpSlowCase(op_sub, iter, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
    1843 }
     1251/* ------------------------------ END: OP_ADD, OP_SUB, OP_MUL ------------------------------ */
     1252
     1253} // namespace JSC
    18441254
    18451255#endif // USE(JSVALUE64)
    1846 
    1847 /* ------------------------------ END: OP_ADD, OP_SUB, OP_MUL ------------------------------ */
    1848 
    1849 } // namespace JSC
    1850 
    1851 #endif // !USE(JSVALUE32_64)
    18521256#endif // ENABLE(JIT)
  • trunk/JavaScriptCore/jit/JITCall.cpp

    r63404 r70111  
    2727
    2828#if ENABLE(JIT)
    29 #if !USE(JSVALUE32_64)
     29#if USE(JSVALUE64)
    3030#include "JIT.h"
    3131
     
    258258} // namespace JSC
    259259
    260 #endif // !USE(JSVALUE32_64)
     260#endif // USE(JSVALUE64)
    261261#endif // ENABLE(JIT)
  • trunk/JavaScriptCore/jit/JITInlineMethods.h

    r65044 r70111  
    6464{
    6565    loadPtr(Address(from, entry * sizeof(Register)), to);
    66 #if !USE(JSVALUE32_64)
     66#if USE(JSVALUE64)
    6767    killLastResultRegister();
    6868#endif
     
    8282{
    8383    load32(Address(from, entry * sizeof(Register)), to);
    84 #if !USE(JSVALUE32_64)
     84#if USE(JSVALUE64)
    8585    killLastResultRegister();
    8686#endif
     
    751751}
    752752
    753 #if !USE(JSVALUE64)
     753#if USE(JSVALUE32_64)
    754754ALWAYS_INLINE void JIT::emitFastArithDeTagImmediate(RegisterID reg)
    755755{
  • trunk/JavaScriptCore/jit/JITOpcodes.cpp

    r69940 r70111  
    4040namespace JSC {
    4141
    42 #if !USE(JSVALUE32_64)
     42#if USE(JSVALUE64)
    4343
    4444#define RECORD_JUMP_TARGET(targetOffset) \
     
    362362        emitGetVirtualRegister(op1, regT0);
    363363        emitJumpSlowCaseIfNotImmediateInteger(regT0);
    364 #if USE(JSVALUE64)
    365364        int32_t op2imm = getConstantOperandImmediateInt(op2);
    366 #else
    367         int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)));
    368 #endif
    369365        addJump(branch32(LessThanOrEqual, regT0, Imm32(op2imm)), target);
    370366    } else {
     
    811807    emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
    812808    emitJumpSlowCaseIfNotImmediateInteger(regT0);
    813 #if USE(JSVALUE64)
    814809    not32(regT0);
    815810    emitFastArithIntToImmNoCheck(regT0, regT0);
    816 #else
    817     xorPtr(Imm32(~JSImmediate::TagTypeNumber), regT0);
    818 #endif
    819811    emitPutVirtualRegister(currentInstruction[1].u.operand);
    820812}
     
    952944    loadPtr(Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStrings)), regT2);
    953945
    954 #if USE(JSVALUE64)
    955946    loadPtr(BaseIndex(regT2, regT0, TimesEight), regT2);
    956 #else
    957     loadPtr(BaseIndex(regT2, regT0, TimesFour), regT2);
    958 #endif
    959947
    960948    emitPutVirtualRegister(dst, regT2);
     
    16141602}
    16151603
    1616 #endif // !USE(JSVALUE32_64)
     1604#endif // USE(JSVALUE64)
    16171605
    16181606void JIT::emit_op_resolve_global_dynamic(Instruction* currentInstruction)
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r66150 r70111  
    2727
    2828#if ENABLE(JIT)
    29 #if !USE(JSVALUE32_64)
     29#if USE(JSVALUE64)
    3030#include "JIT.h"
    3131
     
    9090    emitGetVirtualRegisters(base, regT0, property, regT1);
    9191    emitJumpSlowCaseIfNotImmediateInteger(regT1);
    92 #if USE(JSVALUE64)
     92
    9393    // This is technically incorrect - we're zero-extending an int32.  On the hot path this doesn't matter.
    9494    // We check the value as if it was a uint32 against the m_vectorLength - which will always fail if
     
    9898    // extending since it makes it easier to re-tag the value in the slow case.
    9999    zeroExtend32ToPtr(regT1, regT1);
    100 #else
    101     emitFastArithImmToInt(regT1);
    102 #endif
     100
    103101    emitJumpSlowCaseIfNotJSCell(regT0, base);
    104102    addSlowCase(branchPtr(NotEqual, Address(regT0), ImmPtr(m_globalData->jsArrayVPtr)));
     
    205203    emitGetVirtualRegisters(base, regT0, property, regT1);
    206204    emitJumpSlowCaseIfNotImmediateInteger(regT1);
    207 #if USE(JSVALUE64)
    208205    // See comment in op_get_by_val.
    209206    zeroExtend32ToPtr(regT1, regT1);
    210 #else
    211     emitFastArithImmToInt(regT1);
    212 #endif
    213207    emitJumpSlowCaseIfNotJSCell(regT0, base);
    214208    addSlowCase(branchPtr(NotEqual, Address(regT0), ImmPtr(m_globalData->jsArrayVPtr)));
     
    11041098} // namespace JSC
    11051099
    1106 #endif // !USE(JSVALUE32_64)
     1100#endif // USE(JSVALUE64)
    11071101#endif // ENABLE(JIT)
  • trunk/JavaScriptCore/jit/JITStubs.h

    r69940 r70111  
    148148        JITStubArg reserved; // Unused
    149149        JITStubArg args[6];
    150 #if !USE(JSVALUE32_64)
     150#if USE(JSVALUE64)
    151151        void* padding; // Maintain 16-byte stack alignment.
    152152#endif
  • trunk/JavaScriptCore/jit/JSInterfaceJIT.h

    r65021 r70111  
    167167#endif
    168168
    169 #if USE(JSVALUE32) || USE(JSVALUE64)
     169#if USE(JSVALUE64)
    170170        Jump emitJumpIfImmediateNumber(RegisterID reg);
    171171        Jump emitJumpIfNotImmediateNumber(RegisterID reg);
     
    274274#endif
    275275
    276 #if USE(JSVALUE32)
    277     inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadJSCell(unsigned virtualRegisterIndex, RegisterID dst)
    278     {
    279         loadPtr(addressFor(virtualRegisterIndex), dst);
    280         return branchTest32(NonZero, dst, Imm32(JSImmediate::TagMask));
    281     }
    282 
    283     inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadInt32(unsigned virtualRegisterIndex, RegisterID dst)
    284     {
    285         loadPtr(addressFor(virtualRegisterIndex), dst);
    286         Jump result = branchTest32(Zero, dst, Imm32(JSImmediate::TagTypeNumber));
    287         rshift32(Imm32(JSImmediate::IntegerPayloadShift), dst);
    288         return result;
    289     }
    290 
    291     inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadDouble(unsigned, FPRegisterID, RegisterID)
    292     {
    293         ASSERT_NOT_REACHED();
    294         return jump();
    295     }
    296    
    297     ALWAYS_INLINE void JSInterfaceJIT::emitFastArithImmToInt(RegisterID reg)
    298     {
    299         rshift32(Imm32(JSImmediate::IntegerPayloadShift), reg);
    300     }
    301    
    302 #endif
    303 
    304 #if !USE(JSVALUE32_64)
     276#if USE(JSVALUE64)
    305277    inline JSInterfaceJIT::Address JSInterfaceJIT::payloadFor(unsigned virtualRegisterIndex, RegisterID base)
    306278    {
  • trunk/JavaScriptCore/jit/SpecializedThunkJIT.h

    r66150 r70111  
    9797            moveDoubleToPtr(src, regT0);
    9898            subPtr(tagTypeNumberRegister, regT0);
    99 #elif USE(JSVALUE32_64)
     99#else
    100100            storeDouble(src, Address(stackPointerRegister, -(int)sizeof(double)));
    101101            loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(JSValue, u.asBits.tag) - sizeof(double)), regT1);
    102102            loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(JSValue, u.asBits.payload) - sizeof(double)), regT0);
    103 #else
    104             UNUSED_PARAM(src);
    105             ASSERT_NOT_REACHED();
    106             m_failures.append(jump());
    107103#endif
    108104            loadPtr(Address(callFrameRegister, RegisterFile::CallerFrame * (int)sizeof(Register)), callFrameRegister);
     
    145141#if USE(JSVALUE64)
    146142            orPtr(tagTypeNumberRegister, regT0);
    147 #elif USE(JSVALUE32_64)
     143#else
    148144            move(Imm32(JSValue::Int32Tag), regT1);
    149 #else
    150             signExtend32ToPtr(regT0, regT0);
    151             // If we can't tag the result, give up and jump to the slow case
    152             m_failures.append(branchAddPtr(Overflow, regT0, regT0));
    153             addPtr(Imm32(JSImmediate::TagTypeNumber), regT0);
    154145#endif
    155146        }
  • trunk/JavaScriptCore/jit/ThunkGenerators.cpp

    r65653 r70111  
    9393MacroAssemblerCodePtr sqrtThunkGenerator(JSGlobalData* globalData, ExecutablePool* pool)
    9494{
    95 #if USE(JSVALUE64) || USE(JSVALUE32_64)
    9695    SpecializedThunkJIT jit(1, globalData, pool);
    9796    if (!jit.supportsFloatingPointSqrt())
     
    102101    jit.returnDouble(SpecializedThunkJIT::fpRegT0);
    103102    return jit.finalize(globalData->jitStubs->ctiNativeCall());
    104 #else
    105     UNUSED_PARAM(pool);
    106     return globalData->jitStubs->ctiNativeCall();
    107 #endif
    108103}
    109104
     
    113108MacroAssemblerCodePtr powThunkGenerator(JSGlobalData* globalData, ExecutablePool* pool)
    114109{
    115 #if USE(JSVALUE64) || USE(JSVALUE32_64)
    116110    SpecializedThunkJIT jit(2, globalData, pool);
    117111    if (!jit.supportsFloatingPoint())
     
    162156
    163157    return jit.finalize(globalData->jitStubs->ctiNativeCall());
    164 #else
    165     UNUSED_PARAM(pool);
    166     return globalData->jitStubs->ctiNativeCall();
    167 #endif
    168158}
    169159
  • trunk/JavaScriptCore/runtime/Collector.cpp

    r67683 r70111  
    643643COMPILE_ASSERT(sizeof(CollectorCell) % 2 == 0, Collector_cell_size_is_power_of_two);
    644644
    645 #if USE(JSVALUE32)
    646 static bool isHalfCellAligned(void *p)
    647 {
    648     return (((intptr_t)(p) & (CELL_MASK >> 1)) == 0);
     645static inline bool isCellAligned(void *p)
     646{
     647    return (((intptr_t)(p) & CELL_MASK) == 0);
    649648}
    650649
    651650static inline bool isPossibleCell(void* p)
    652651{
    653     return isHalfCellAligned(p) && p;
    654 }
    655 
    656 #else
    657 
    658 static inline bool isCellAligned(void *p)
    659 {
    660     return (((intptr_t)(p) & CELL_MASK) == 0);
    661 }
    662 
    663 static inline bool isPossibleCell(void* p)
    664 {
    665652    return isCellAligned(p) && p;
    666653}
    667 #endif // USE(JSVALUE32)
    668654
    669655void Heap::markConservatively(MarkStack& markStack, void* start, void* end)
     
    11461132    if (cell->isString())
    11471133        return "string";
    1148 #if USE(JSVALUE32)
    1149     if (cell->isNumber())
    1150         return "number";
    1151 #endif
    11521134    if (cell->isGetterSetter())
    11531135        return "Getter-Setter";
  • trunk/JavaScriptCore/runtime/JSCell.h

    r68426 r70111  
    7676
    7777        // Querying the type.
    78 #if USE(JSVALUE32)
    79         bool isNumber() const;
    80 #endif
    8178        bool isString() const;
    8279        bool isObject() const;
     
    157154    }
    158155
    159 #if USE(JSVALUE32)
    160     inline bool JSCell::isNumber() const
    161     {
    162         return m_structure->typeInfo().type() == NumberType;
    163     }
    164 #endif
    165 
    166156    inline bool JSCell::isObject() const
    167157    {
     
    254244    }
    255245
    256 #if !USE(JSVALUE32_64)
     246#if USE(JSVALUE64)
    257247    ALWAYS_INLINE JSCell* JSValue::asCell() const
    258248    {
     
    260250        return m_ptr;
    261251    }
    262 #endif // !USE(JSVALUE32_64)
     252#endif // USE(JSVALUE64)
    263253
    264254    inline JSValue JSValue::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const
  • trunk/JavaScriptCore/runtime/JSGlobalData.cpp

    r69516 r70111  
    134134    , apiWrapperStructure(JSAPIValueWrapper::createStructure(jsNull()))
    135135    , dummyMarkableCellStructure(JSCell::createDummyStructure())
    136 #if USE(JSVALUE32)
    137     , numberStructure(JSNumberCell::createStructure(jsNull()))
    138 #endif
    139136    , identifierTable(globalDataType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable())
    140137    , propertyNames(new CommonIdentifiers(this))
  • trunk/JavaScriptCore/runtime/JSGlobalData.h

    r69516 r70111  
    155155        RefPtr<Structure> dummyMarkableCellStructure;
    156156
    157 #if USE(JSVALUE32)
    158         RefPtr<Structure> numberStructure;
    159 #endif
    160 
    161157        static void storeVPtrs();
    162158        static JS_EXPORTDATA void* jsArrayVPtr;
  • trunk/JavaScriptCore/runtime/JSGlobalObject.h

    r69516 r70111  
    387387            return m_prototype;
    388388
    389 #if USE(JSVALUE32)
    390         if (typeInfo().type() == StringType)
    391             return exec->lexicalGlobalObject()->stringPrototype();
    392 
    393         ASSERT(typeInfo().type() == NumberType);
    394         return exec->lexicalGlobalObject()->numberPrototype();
    395 #else
    396389        ASSERT(typeInfo().type() == StringType);
    397390        return exec->lexicalGlobalObject()->stringPrototype();
    398 #endif
    399391    }
    400392
  • trunk/JavaScriptCore/runtime/JSImmediate.h

    r62419 r70111  
    2323#define JSImmediate_h
    2424
    25 #if !USE(JSVALUE32_64)
     25#if USE(JSVALUE64)
    2626
    2727#include <wtf/Assertions.h>
     
    4545    class UString;
    4646
    47 #if USE(JSVALUE64)
    4847    inline intptr_t reinterpretDoubleToIntptr(double value)
    4948    {
     
    5554        return WTF::bitwise_cast<double>(value);
    5655    }
    57 #endif
    5856
    5957    /*
     
    160158        friend JSValue jsNumber(JSGlobalData* globalData, unsigned long long i);
    161159
    162 #if USE(JSVALUE64)
    163160        // If all bits in the mask are set, this indicates an integer number,
    164161        // if any but not all are set this value is a double precision number.
     
    167164        // with a 16-bit pattern within the range 0x0001..0xFFFE.
    168165        static const intptr_t DoubleEncodeOffset = 0x1000000000000ll;
    169 #elif USE(JSVALUE32)
    170         static const intptr_t TagTypeNumber = 0x1; // bottom bit set indicates integer, this dominates the following bit
    171 #endif
    172166        static const intptr_t TagBitTypeOther   = 0x2; // second bit set indicates immediate other than an integer
    173167        static const intptr_t TagMask           = TagTypeNumber | TagBitTypeOther;
     
    182176        static const intptr_t FullTagTypeNull      = TagBitTypeOther;
    183177
    184 #if USE(JSVALUE64)
    185178        static const int32_t IntegerPayloadShift  = 0;
    186 #else
    187         static const int32_t IntegerPayloadShift  = 1;
    188 #endif
    189179        static const int32_t ExtendedPayloadShift = 4;
    190180
     
    205195        static ALWAYS_INLINE bool isIntegerNumber(JSValue v)
    206196        {
    207 #if USE(JSVALUE64)
    208197            return (rawValue(v) & TagTypeNumber) == TagTypeNumber;
    209 #else
    210             return isNumber(v);
    211 #endif
    212         }
    213 
    214 #if USE(JSVALUE64)
     198        }
     199
    215200        static ALWAYS_INLINE bool isDouble(JSValue v)
    216201        {
    217202            return isNumber(v) && !isIntegerNumber(v);
    218203        }
    219 #endif
    220204
    221205        static ALWAYS_INLINE bool isPositiveIntegerNumber(JSValue v)
     
    261245        static ALWAYS_INLINE bool areBothImmediateIntegerNumbers(JSValue v1, JSValue v2)
    262246        {
    263 #if USE(JSVALUE64)
    264247            return (rawValue(v1) & rawValue(v2) & TagTypeNumber) == TagTypeNumber;
    265 #else
    266             return rawValue(v1) & rawValue(v2) & TagTypeNumber;
    267 #endif
    268248        }
    269249
     
    286266
    287267    private:
    288 #if USE(JSVALUE64)
    289268        static const int minImmediateInt = ((-INT_MAX) - 1);
    290269        static const int maxImmediateInt = INT_MAX;
    291 #else
    292         static const int minImmediateInt = ((-INT_MAX) - 1) >> IntegerPayloadShift;
    293         static const int maxImmediateInt = INT_MAX >> IntegerPayloadShift;
    294 #endif
    295270        static const unsigned maxImmediateUInt = maxImmediateInt;
    296271
     
    303278        // integer doesn't interfere with the tag bits in the upper word.  In the default encoding,
    304279        // if intptr_t id larger then int32_t we sign extend the value through the upper word.
    305 #if USE(JSVALUE64)
    306280        static ALWAYS_INLINE JSValue makeInt(uint32_t value)
    307 #else
    308         static ALWAYS_INLINE JSValue makeInt(int32_t value)
    309 #endif
    310281        {
    311282            return makeValue((static_cast<intptr_t>(value) << IntegerPayloadShift) | TagTypeNumber);
    312283        }
    313284       
    314 #if USE(JSVALUE64)
    315285        static ALWAYS_INLINE JSValue makeDouble(double value)
    316286        {
    317287            return makeValue(reinterpretDoubleToIntptr(value) + DoubleEncodeOffset);
    318288        }
    319 #endif
    320289       
    321290        static ALWAYS_INLINE JSValue makeBool(bool b)
     
    337306        static JSValue fromNumberOutsideIntegerRange(T);
    338307
    339 #if USE(JSVALUE64)
    340308        static ALWAYS_INLINE double doubleValue(JSValue v)
    341309        {
    342310            return reinterpretIntptrToDouble(rawValue(v) - DoubleEncodeOffset);
    343311        }
    344 #endif
    345312
    346313        static ALWAYS_INLINE int32_t intValue(JSValue v)
     
    372339    ALWAYS_INLINE JSValue JSImmediate::oneImmediate() { return makeInt(1); }
    373340
    374 #if USE(JSVALUE64)
    375341    inline bool doubleToBoolean(double value)
    376342    {
     
    384350            : doubleToBoolean(doubleValue(v)) : v == trueImmediate();
    385351    }
    386 #else
    387     ALWAYS_INLINE bool JSImmediate::toBoolean(JSValue v)
    388     {
    389         ASSERT(isImmediate(v));
    390         return isIntegerNumber(v) ? v != zeroImmediate() : v == trueImmediate();
    391     }
    392 #endif
    393352
    394353    ALWAYS_INLINE uint32_t JSImmediate::getTruncatedUInt32(JSValue v)
     
    399358    }
    400359
    401 #if USE(JSVALUE64)
    402360    template<typename T>
    403361    inline JSValue JSImmediate::fromNumberOutsideIntegerRange(T value)
     
    405363        return makeDouble(static_cast<double>(value));
    406364    }
    407 #else
    408     template<typename T>
    409     inline JSValue JSImmediate::fromNumberOutsideIntegerRange(T)
    410     {
    411         return JSValue();
    412     }
    413 #endif
    414365
    415366    ALWAYS_INLINE JSValue JSImmediate::from(char i)
     
    440391    ALWAYS_INLINE JSValue JSImmediate::from(int i)
    441392    {
    442 #if !USE(JSVALUE64)
    443         if ((i < minImmediateInt) | (i > maxImmediateInt))
    444             return fromNumberOutsideIntegerRange(i);
    445 #endif
    446393        return makeInt(i);
    447394    }
     
    506453            return intValue(v);
    507454
    508 #if USE(JSVALUE64)
    509455        if (isNumber(v)) {
    510456            ASSERT(isDouble(v));
    511457            return doubleValue(v);
    512458        }
    513 #else
    514         ASSERT(!isNumber(v));
    515 #endif
    516459
    517460        if (rawValue(v) == FullTagTypeUndefined)
     
    671614        {
    672615            ASSERT(canDoFastRshift(val, shift) || canDoFastUrshift(val, shift));
    673 #if USE(JSVALUE64)
    674616            return JSImmediate::makeValue(static_cast<intptr_t>(static_cast<uint32_t>(static_cast<int32_t>(JSImmediate::rawValue(val)) >> ((JSImmediate::rawValue(shift) >> JSImmediate::IntegerPayloadShift) & 0x1f))) | JSImmediate::TagTypeNumber);
    675 #else
    676             return JSImmediate::makeValue((JSImmediate::rawValue(val) >> ((JSImmediate::rawValue(shift) >> JSImmediate::IntegerPayloadShift) & 0x1f)) | JSImmediate::TagTypeNumber);
    677 #endif
    678617        }
    679618
     
    719658} // namespace JSC
    720659
    721 #endif // !USE(JSVALUE32_64)
     660#endif // USE(JSVALUE64)
    722661
    723662#endif // JSImmediate_h
  • trunk/JavaScriptCore/runtime/JSNumberCell.cpp

    r65177 r70111  
    2424#include "JSNumberCell.h"
    2525
    26 #if USE(JSVALUE32)
    27 
    28 #include "NumberObject.h"
    29 #include "UString.h"
    30 
    31 namespace JSC {
    32 
    33 JSValue JSNumberCell::toPrimitive(ExecState*, PreferredPrimitiveType) const
    34 {
    35     return const_cast<JSNumberCell*>(this);
    36 }
    37 
    38 bool JSNumberCell::getPrimitiveNumber(ExecState*, double& number, JSValue& value)
    39 {
    40     number = m_value;
    41     value = this;
    42     return true;
    43 }
    44 
    45 bool JSNumberCell::toBoolean(ExecState*) const
    46 {
    47     return m_value < 0.0 || m_value > 0.0; // false for NaN
    48 }
    49 
    50 double JSNumberCell::toNumber(ExecState*) const
    51 {
    52   return m_value;
    53 }
    54 
    55 UString JSNumberCell::toString(ExecState*) const
    56 {
    57     return UString::number(m_value);
    58 }
    59 
    60 JSObject* JSNumberCell::toObject(ExecState* exec) const
    61 {
    62     return constructNumber(exec, const_cast<JSNumberCell*>(this));
    63 }
    64 
    65 JSObject* JSNumberCell::toThisObject(ExecState* exec) const
    66 {
    67     return constructNumber(exec, const_cast<JSNumberCell*>(this));
    68 }
    69 
    70 bool JSNumberCell::getUInt32(uint32_t& uint32) const
    71 {
    72     uint32 = static_cast<uint32_t>(m_value);
    73     return uint32 == m_value;
    74 }
    75 
    76 JSValue JSNumberCell::getJSNumber()
    77 {
    78     return this;
    79 }
    80 
    81 JSValue jsNumberCell(ExecState* exec, double d)
    82 {
    83     return new (exec) JSNumberCell(exec, d);
    84 }
    85 
    86 JSValue jsNumberCell(JSGlobalData* globalData, double d)
    87 {
    88     return new (globalData) JSNumberCell(globalData, d);
    89 }
    90 
    91 } // namespace JSC
    92 
    93 #else // USE(JSVALUE32)
    94 
    9526// Keep our exported symbols lists happy.
    9627namespace JSC {
     
    10637} // namespace JSC
    10738
    108 #endif // USE(JSVALUE32)
  • trunk/JavaScriptCore/runtime/JSNumberCell.h

    r57019 r70111  
    3535    extern const double NaN;
    3636    extern const double Inf;
    37 
    38 #if USE(JSVALUE32)
    39     JSValue jsNumberCell(ExecState*, double);
    40 
    41     class Identifier;
    42     class JSCell;
    43     class JSObject;
    44     class JSString;
    45     class PropertySlot;
    46 
    47     struct ClassInfo;
    48     struct Instruction;
    49 
    50     class JSNumberCell : public JSCell {
    51         friend class JIT;
    52         friend JSValue jsNumberCell(JSGlobalData*, double);
    53         friend JSValue jsNumberCell(ExecState*, double);
    54 
    55     public:
    56         double value() const { return m_value; }
    57 
    58         virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
    59         virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue& value);
    60         virtual bool toBoolean(ExecState*) const;
    61         virtual double toNumber(ExecState*) const;
    62         virtual UString toString(ExecState*) const;
    63         virtual JSObject* toObject(ExecState*) const;
    64 
    65         virtual JSObject* toThisObject(ExecState*) const;
    66         virtual JSValue getJSNumber();
    67 
    68         void* operator new(size_t size, ExecState* exec)
    69         {
    70             return exec->heap()->allocateNumber(size);
    71         }
    72 
    73         void* operator new(size_t size, JSGlobalData* globalData)
    74         {
    75             return globalData->heap.allocateNumber(size);
    76         }
    77 
    78         static PassRefPtr<Structure> createStructure(JSValue proto) { return Structure::create(proto, TypeInfo(NumberType, OverridesGetOwnPropertySlot | NeedsThisConversion), AnonymousSlotCount); }
    79 
    80     private:
    81         JSNumberCell(JSGlobalData* globalData, double value)
    82             : JSCell(globalData->numberStructure.get())
    83             , m_value(value)
    84         {
    85         }
    86 
    87         JSNumberCell(ExecState* exec, double value)
    88             : JSCell(exec->globalData().numberStructure.get())
    89             , m_value(value)
    90         {
    91         }
    92 
    93         virtual bool getUInt32(uint32_t&) const;
    94 
    95         double m_value;
    96     };
    97 
    98     JSValue jsNumberCell(JSGlobalData*, double);
    99 
    100     inline bool isNumberCell(JSValue v)
    101     {
    102         return v.isCell() && v.asCell()->isNumber();
    103     }
    104 
    105     inline JSNumberCell* asNumberCell(JSValue v)
    106     {
    107         ASSERT(isNumberCell(v));
    108         return static_cast<JSNumberCell*>(v.asCell());
    109     }
    110 
    111     ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, ExecState* exec, double d)
    112     {
    113         *this = jsNumberCell(exec, d);
    114     }
    115 
    116     inline JSValue::JSValue(ExecState* exec, double d)
    117     {
    118         JSValue v = JSImmediate::from(d);
    119         *this = v ? v : jsNumberCell(exec, d);
    120     }
    121 
    122     inline JSValue::JSValue(ExecState* exec, int i)
    123     {
    124         JSValue v = JSImmediate::from(i);
    125         *this = v ? v : jsNumberCell(exec, i);
    126     }
    127 
    128     inline JSValue::JSValue(ExecState* exec, unsigned i)
    129     {
    130         JSValue v = JSImmediate::from(i);
    131         *this = v ? v : jsNumberCell(exec, i);
    132     }
    133 
    134     inline JSValue::JSValue(ExecState* exec, long i)
    135     {
    136         JSValue v = JSImmediate::from(i);
    137         *this = v ? v : jsNumberCell(exec, i);
    138     }
    139 
    140     inline JSValue::JSValue(ExecState* exec, unsigned long i)
    141     {
    142         JSValue v = JSImmediate::from(i);
    143         *this = v ? v : jsNumberCell(exec, i);
    144     }
    145 
    146     inline JSValue::JSValue(ExecState* exec, long long i)
    147     {
    148         JSValue v = JSImmediate::from(i);
    149         *this = v ? v : jsNumberCell(exec, static_cast<double>(i));
    150     }
    151 
    152     inline JSValue::JSValue(ExecState* exec, unsigned long long i)
    153     {
    154         JSValue v = JSImmediate::from(i);
    155         *this = v ? v : jsNumberCell(exec, static_cast<double>(i));
    156     }
    157 
    158     inline JSValue::JSValue(JSGlobalData* globalData, double d)
    159     {
    160         JSValue v = JSImmediate::from(d);
    161         *this = v ? v : jsNumberCell(globalData, d);
    162     }
    163 
    164     inline JSValue::JSValue(JSGlobalData* globalData, int i)
    165     {
    166         JSValue v = JSImmediate::from(i);
    167         *this = v ? v : jsNumberCell(globalData, i);
    168     }
    169 
    170     inline JSValue::JSValue(JSGlobalData* globalData, unsigned i)
    171     {
    172         JSValue v = JSImmediate::from(i);
    173         *this = v ? v : jsNumberCell(globalData, i);
    174     }
    175 
    176     inline bool JSValue::isDouble() const
    177     {
    178         return isNumberCell(asValue());
    179     }
    180 
    181     inline double JSValue::asDouble() const
    182     {
    183         return asNumberCell(asValue())->value();
    184     }
    185 
    186     inline bool JSValue::isNumber() const
    187     {
    188         return JSImmediate::isNumber(asValue()) || isDouble();
    189     }
    190 
    191     inline double JSValue::uncheckedGetNumber() const
    192     {
    193         ASSERT(isNumber());
    194         return JSImmediate::isImmediate(asValue()) ? JSImmediate::toDouble(asValue()) : asDouble();
    195     }
    196 
    197 #endif // USE(JSVALUE32)
    19837
    19938#if USE(JSVALUE64)
     
    296135#endif // USE(JSVALUE64)
    297136
    298 #if USE(JSVALUE32) || USE(JSVALUE64)
     137#if USE(JSVALUE64)
    299138
    300139    inline JSValue::JSValue(ExecState*, char i)
     
    352191    }
    353192
    354 #endif // USE(JSVALUE32) || USE(JSVALUE64)
     193#endif // USE(JSVALUE64)
    355194
    356195} // namespace JSC
  • trunk/JavaScriptCore/runtime/JSObject.h

    r69516 r70111  
    254254        void isObject();
    255255        void isString();
    256 #if USE(JSVALUE32)
    257         void isNumber();
    258 #endif
    259256
    260257        ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); }
     
    305302    ASSERT(m_structure->isEmpty());
    306303    ASSERT(prototype().isNull() || Heap::heap(this) == Heap::heap(prototype()));
    307 #if USE(JSVALUE64) || USE(JSVALUE32_64)
    308304    ASSERT(OBJECT_OFFSETOF(JSObject, m_inlineStorage) % sizeof(double) == 0);
    309 #endif
    310305}
    311306
  • trunk/JavaScriptCore/runtime/JSValue.h

    r69516 r70111  
    8181        static EncodedJSValue encode(JSValue value);
    8282        static JSValue decode(EncodedJSValue ptr);
    83 #if !USE(JSVALUE32_64)
     83#if USE(JSVALUE64)
    8484    private:
    8585        static JSValue makeImmediate(intptr_t value);
  • trunk/JavaScriptCore/runtime/NumberObject.h

    r54022 r70111  
    3838
    3939    protected:
    40 #if USE(JSVALUE32)
    41         static const unsigned StructureFlags = OverridesMarkChildren | JSWrapperObject::StructureFlags;
    42 #else
    4340        static const unsigned StructureFlags = JSWrapperObject::StructureFlags;
    44 #endif
    4541
    4642    private:
  • trunk/JavaScriptCore/wtf/Platform.h

    r69753 r70111  
    925925#endif
    926926
    927 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
     927#if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64)
    928928#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \
    929929    || (CPU(IA64) && !CPU(IA64_32)) \
     
    932932    || CPU(PPC64)
    933933#define WTF_USE_JSVALUE64 1
    934 #elif CPU(ARM_TRADITIONAL) && COMPILER(MSVC)
    935 #define WTF_USE_JSVALUE32 1
    936934#else
    937935#define WTF_USE_JSVALUE32_64 1
    938936#endif
    939 #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */
     937#endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */
    940938
    941939#if !defined(ENABLE_REPAINT_THROTTLING)
     
    975973    #define ENABLE_JIT_USE_SOFT_MODULO 1
    976974    #endif
    977     #endif
    978 
    979     #if !defined(ENABLE_JIT_OPTIMIZE_NATIVE_CALL) && CPU(X86) && USE(JSVALUE32)
    980     #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
    981975    #endif
    982976
Note: See TracChangeset for help on using the changeset viewer.