Ignore:
Timestamp:
May 24, 2010, 5:44:17 PM (15 years ago)
Author:
[email protected]
Message:

Reverting 60075 & 60084, these broke the interpreter.

Reviewed by NOBODY (revert).

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dump):
(JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):

  • bytecode/CodeBlock.h:
  • bytecode/Opcode.h:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitConstruct):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::emitGetByIdExceptionInfo):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpConstructSetupArgs):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileOpConstructSetupArgs):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emit_op_convert_this):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):
(JSC::JITThunks::hostFunctionStub):

  • jit/JITStubs.h:

(JSC::JITThunks::ctiNativeCall):
(JSC::):

  • runtime/ExceptionHelpers.cpp:

(JSC::createNotAnObjectError):

  • runtime/Executable.h:

(JSC::NativeExecutable::create):
(JSC::NativeExecutable::NativeExecutable):

  • runtime/JSFunction.cpp:
  • runtime/JSFunction.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r60075 r60105  
    365365    ++m_nextParameterIndex;
    366366    ++m_codeBlock->m_numParameters;
     367
     368    if (!isConstructor() && (functionBody->usesThis() || m_shouldEmitDebugHooks)) {
     369        emitOpcode(op_convert_this);
     370        instructions().append(m_thisRegister.index());
     371    }
    367372   
    368373    for (size_t i = 0; i < parameterCount; ++i)
     
    370375
    371376    preserveLastVar();
    372 
    373     if (isConstructor()) {
    374         RefPtr<RegisterID> func = newTemporary();
    375         RefPtr<RegisterID> funcProto = newTemporary();
    376 
    377         emitOpcode(op_get_callee);
    378         instructions().append(func->index());
    379         // Load prototype.
    380         emitGetByIdExceptionInfo(op_create_this);
    381         emitGetById(funcProto.get(), func.get(), globalData()->propertyNames->prototype);
    382 
    383         emitOpcode(op_create_this);
    384         instructions().append(m_thisRegister.index());
    385         instructions().append(funcProto->index());
    386     } else if (functionBody->usesThis() || m_shouldEmitDebugHooks) {
    387         emitOpcode(op_convert_this);
    388         instructions().append(m_thisRegister.index());
    389     }
    390377}
    391378
     
    15951582    }
    15961583
     1584    RefPtr<RegisterID> funcProto = newTemporary();
     1585
    15971586    // Generate code for arguments.
    15981587    Vector<RefPtr<RegisterID>, 16> argv;
     
    16101599    }
    16111600
     1601    // Load prototype.
     1602    emitExpressionInfo(divot, startOffset, endOffset);
     1603    emitGetByIdExceptionInfo(op_construct);
     1604    emitGetById(funcProto.get(), func, globalData()->propertyNames->prototype);
     1605
    16121606    // Reserve space for call frame.
    16131607    Vector<RefPtr<RegisterID>, RegisterFile::CallFrameHeaderSize> callFrame;
     
    16251619    instructions().append(argv.size()); // argCount
    16261620    instructions().append(argv[0]->index() + argv.size() + RegisterFile::CallFrameHeaderSize); // registerOffset
     1621    instructions().append(funcProto->index()); // proto
     1622    instructions().append(argv[0]->index()); // thisRegister
    16271623    if (dst != ignoredResult()) {
    16281624        emitOpcode(op_call_put_result);
Note: See TracChangeset for help on using the changeset viewer.