Changeset 96451 in webkit


Ignore:
Timestamp:
Sep 30, 2011 7:14:36 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

DFG operation results are not set correctly in JSVALUE32_64 DFG JIT
https://bugs.webkit.org/show_bug.cgi?id=69126

Patch by Yuqiang Xian <yuqiang.xian@intel.com> on 2011-09-30
Reviewed by Gavin Barraclough.

The setupResults routine has the bug of reversing the source and destination.
Also some other trivial (but stupid) bugs need to be fixed in JSVALUE32_64 DFG JIT.

  • dfg/DFGJITCodeGenerator.h:

(JSC::DFG::setupTwoStubArgs):
(JSC::DFG::setupResults):

  • dfg/DFGJITCodeGenerator32_64.cpp:

(JSC::DFG::JITCodeGenerator::fillJSValue):
(JSC::DFG::JITCodeGenerator::nonSpeculativeValueToInt32):
(JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompare):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r96446 r96451  
     12011-09-30  Yuqiang Xian  <yuqiang.xian@intel.com>
     2
     3        DFG operation results are not set correctly in JSVALUE32_64 DFG JIT
     4        https://bugs.webkit.org/show_bug.cgi?id=69126
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        The setupResults routine has the bug of reversing the source and destination.
     9        Also some other trivial (but stupid) bugs need to be fixed in JSVALUE32_64 DFG JIT.
     10
     11        * dfg/DFGJITCodeGenerator.h:
     12        (JSC::DFG::setupTwoStubArgs):
     13        (JSC::DFG::setupResults):
     14        * dfg/DFGJITCodeGenerator32_64.cpp:
     15        (JSC::DFG::JITCodeGenerator::fillJSValue):
     16        (JSC::DFG::JITCodeGenerator::nonSpeculativeValueToInt32):
     17        (JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompare):
     18
    1192011-09-30  Gavin Barraclough  <barraclough@apple.com>
    220
  • trunk/Source/JavaScriptCore/dfg/DFGJITCodeGenerator.h

    r96443 r96451  
    922922    }
    923923
     924#if CPU(X86_64)
    924925    // These methods used to sort arguments into the correct registers.
    925926    template<GPRReg destA, GPRReg destB>
     
    951952            m_jit.swap(destA, destB);
    952953    }
    953 #if CPU(X86_64)
    954954    template<FPRReg destA, FPRReg destB>
    955955    void setupTwoStubArgs(FPRReg srcA, FPRReg srcB)
     
    11831183    void setupResults(GPRReg tag, GPRReg payload)
    11841184    {
    1185         setupTwoStubArgs<GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2>(payload, tag);
     1185        GPRReg srcA = GPRInfo::returnValueGPR;
     1186        GPRReg srcB = GPRInfo::returnValueGPR2;
     1187        GPRReg destA = payload;
     1188        GPRReg destB = tag;
     1189
     1190        if (srcB != destA) {
     1191            // Handle the easy cases - two simple moves.
     1192            m_jit.move(srcA, destA);
     1193            m_jit.move(srcB, destB);
     1194        } else if (srcA != destB) {
     1195            // Handle the non-swap case - just put srcB in place first.
     1196            m_jit.move(srcB, destB);
     1197            m_jit.move(srcA, destA);
     1198        } else
     1199            m_jit.swap(destA, destB);
    11861200    }
    11871201
  • trunk/Source/JavaScriptCore/dfg/DFGJITCodeGenerator32_64.cpp

    r96415 r96451  
    254254        // If the register has already been locked we need to take a copy.
    255255        // If not, we'll zero extend in place, so mark on the info that this is now type DataFormatInteger, not DataFormatJSInteger.
    256         tagGPR = allocate();
    257256        if (m_gprs.isLocked(gpr)) {
    258257            payloadGPR = allocate();
     
    262261            m_gprs.lock(gpr);
    263262        }
     263        tagGPR = allocate();
    264264        m_jit.move(info.registerFormat() == DataFormatInteger ? JITCompiler::TrustedImm32(JSValue::Int32Tag) : JITCompiler::TrustedImm32(JSValue::CellTag), tagGPR);
    265265        m_gprs.release(gpr);
     
    387387        silentSpillAllRegisters(gpr);
    388388
    389         m_jit.moveDouble(fpr, FPRInfo::argumentFPR0);
     389        m_jit.subPtr(TrustedImm32(sizeof(double)), JITCompiler::stackPointerRegister);
     390        m_jit.storeDouble(fpr, JITCompiler::stackPointerRegister);
    390391        appendCallWithExceptionCheck(toInt32);
    391392        m_jit.move(GPRInfo::returnValueGPR, gpr);
     393        m_jit.addPtr(TrustedImm32(sizeof(double)), JITCompiler::stackPointerRegister);
    392394
    393395        silentFillAllRegisters(gpr);
     
    13541356        GPRTemporary resultTag(this, arg1);
    13551357        GPRTemporary resultPayload(this, arg1, false);
    1356         GPRReg resultTagGPR = resultPayload.gpr();
     1358        GPRReg resultTagGPR = resultTag.gpr();
    13571359        GPRReg resultPayloadGPR = resultPayload.gpr();
    13581360
Note: See TracChangeset for help on using the changeset viewer.