Changeset 37930 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


Ignore:
Timestamp:
Oct 28, 2008, 12:14:12 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-28 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Fixed https://bugs.webkit.org/show_bug.cgi?id=21919
Sampler reports bogus time in op_enter during 3d-raytrace.js


Fixed a bug where we would pass the incorrect Instruction* during some
parts of CTI codegen.

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases):
  • VM/SamplingTool.cpp: (JSC::SamplingTool::run):
  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CTI.cpp

    r37891 r37930  
    668668    bool negated = (type == OpNStrictEq);
    669669
    670     unsigned dst = instruction[i + 1].u.operand;
    671     unsigned src1 = instruction[i + 2].u.operand;
    672     unsigned src2 = instruction[i + 3].u.operand;
     670    unsigned dst = instruction[1].u.operand;
     671    unsigned src1 = instruction[2].u.operand;
     672    unsigned src2 = instruction[3].u.operand;
    673673
    674674    emitGetArg(src1, X86::eax);
     
    973973
    974974#if ENABLE(OPCODE_SAMPLING)
    975         m_jit.movl_i32m(m_machine->sampler()->encodeSample(instruction + i), m_machine->sampler()->sampleSlot());
     975        if (i > 0) // Avoid the overhead of sampling op_enter twice.
     976            m_jit.movl_i32m(m_machine->sampler()->encodeSample(instruction + i), m_machine->sampler()->sampleSlot());
    976977#endif
    977978
     
    10471048        }
    10481049        case op_loop: {
    1049             emitSlowScriptCheck(instruction, i);
     1050            emitSlowScriptCheck(instruction + i, i);
    10501051
    10511052            unsigned target = instruction[i + 1].u.operand;
     
    10551056        }
    10561057        case op_loop_if_less: {
    1057             emitSlowScriptCheck(instruction, i);
     1058            emitSlowScriptCheck(instruction + i, i);
    10581059
    10591060            unsigned target = instruction[i + 3].u.operand;
     
    10761077        }
    10771078        case op_loop_if_lesseq: {
    1078             emitSlowScriptCheck(instruction, i);
     1079            emitSlowScriptCheck(instruction + i, i);
    10791080
    10801081            unsigned target = instruction[i + 3].u.operand;
     
    14521453        CTI_COMPILE_BINARY_OP(op_lesseq)
    14531454        case op_loop_if_true: {
    1454             emitSlowScriptCheck(instruction, i);
     1455            emitSlowScriptCheck(instruction + i, i);
    14551456
    14561457            unsigned target = instruction[i + 2].u.operand;
     
    19081909        CTI_COMPILE_UNARY_OP(op_is_function)
    19091910        case op_stricteq: {
    1910             compileOpStrictEq(instruction, i, OpStrictEq);
     1911            compileOpStrictEq(instruction + i, i, OpStrictEq);
    19111912            i += 4;
    19121913            break;
    19131914        }
    19141915        case op_nstricteq: {
    1915             compileOpStrictEq(instruction, i, OpNStrictEq);
     1916            compileOpStrictEq(instruction + i, i, OpNStrictEq);
    19161917            i += 4;
    19171918            break;
     
    22732274                OperandTypes types = OperandTypes::fromInt(instruction[i + 4].u.operand);
    22742275                if (types.first().mightBeNumber() && types.second().mightBeNumber())
    2275                     compileBinaryArithOpSlowCase(instruction, op_add, iter, dst, src1, src2, types, i);
     2276                    compileBinaryArithOpSlowCase(instruction + i, op_add, iter, dst, src1, src2, types, i);
    22762277                else
    22772278                    ASSERT_NOT_REACHED();
     
    23132314        }
    23142315        case op_sub: {
    2315             compileBinaryArithOpSlowCase(instruction, op_sub, iter, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
     2316            compileBinaryArithOpSlowCase(instruction + i, op_sub, iter, instruction[i + 1].u.operand, instruction[i + 2].u.operand, instruction[i + 3].u.operand, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    23162317            i += 5;
    23172318            break;
     
    23432344        }
    23442345        case op_loop_if_less: {
    2345             emitSlowScriptCheck(instruction, i);
     2346            emitSlowScriptCheck(instruction + i, i);
    23462347
    23472348            unsigned target = instruction[i + 3].u.operand;
     
    24132414        }
    24142415        case op_loop_if_lesseq: {
    2415             emitSlowScriptCheck(instruction, i);
     2416            emitSlowScriptCheck(instruction + i, i);
    24162417
    24172418            unsigned target = instruction[i + 3].u.operand;
     
    24752476        }
    24762477        case op_loop_if_true: {
    2477             emitSlowScriptCheck(instruction, i);
     2478            emitSlowScriptCheck(instruction + i, i);
    24782479
    24792480            m_jit.link(iter->from, m_jit.label());
     
    26902691                emitPutResult(dst);
    26912692            } else
    2692                 compileBinaryArithOpSlowCase(instruction, op_mul, iter, dst, src1, src2, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
     2693                compileBinaryArithOpSlowCase(instruction + i, op_mul, iter, dst, src1, src2, OperandTypes::fromInt(instruction[i + 4].u.operand), i);
    26932694            i += 5;
    26942695            break;
Note: See TracChangeset for help on using the changeset viewer.