Ignore:
Timestamp:
Dec 12, 2008, 12:02:09 AM (16 years ago)
Author:
[email protected]
Message:

2008-12-11 Sam Weinig <[email protected]>

Reviewed by Geoffrey Garen.

Remove dependancy on having the Instruction buffer in order to
deref Structures used for property access and global resolves.
Instead, we put references to the necessary Structures in axillary
data structures on the CodeBlock. This is not an ideal solution,
as we still pay for having the Structures in two places and we
would like to eventually just hold on to offsets into the machine
code buffer.

  • Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT only data structures.
  • GNUmakefile.am:
  • JavaScriptCore.pri:
  • JavaScriptCore.scons:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • bytecode/CodeBlock.cpp: (JSC::isGlobalResolve): (JSC::isPropertyAccess): (JSC::instructionOffsetForNth): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::shrinkToFit):
  • bytecode/CodeBlock.h: (JSC::GlobalResolveInfo::GlobalResolveInfo): (JSC::getNativePC): (JSC::CodeBlock::instructions): (JSC::CodeBlock::getStubInfo): (JSC::CodeBlock::getBytecodeIndex): (JSC::CodeBlock::addPropertyAccessInstruction): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::numberOfStructureStubInfos): (JSC::CodeBlock::addStructureStubInfo): (JSC::CodeBlock::structureStubInfo): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::globalResolveInfo): (JSC::CodeBlock::numberOfCallLinkInfos): (JSC::CodeBlock::addCallLinkInfo): (JSC::CodeBlock::callLinkInfo):
  • bytecode/Instruction.h: (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set): (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
  • bytecode/Opcode.h: (JSC::):
  • bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp. (JSC::StructureStubInfo::deref):
  • bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h. (JSC::StructureStubInfo::StructureStubInfo): (JSC::StructureStubInfo::initGetByIdSelf): (JSC::StructureStubInfo::initGetByIdProto): (JSC::StructureStubInfo::initGetByIdChain): (JSC::StructureStubInfo::initGetByIdSelfList): (JSC::StructureStubInfo::initGetByIdProtoList): (JSC::StructureStubInfo::initPutByIdTransition): (JSC::StructureStubInfo::initPutByIdReplace): (JSC::StructureStubInfo::):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitCatch):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::tryCTICachePutByID): (JSC::Interpreter::tryCTICacheGetByID): (JSC::Interpreter::cti_op_get_by_id_self_fail): (JSC::getPolymorphicAccessStructureListSlot): (JSC::Interpreter::cti_op_get_by_id_proto_list): (JSC::Interpreter::cti_op_resolve_global):
  • jit/JIT.cpp: (JSC::JIT::JIT): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::compileGetByIdSlowCase): (JSC::JIT::compilePutByIdSlowCase): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList):
File:
1 edited

Legend:

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

    r39198 r39229  
    981981
    982982    if (globalObject) {
     983#if ENABLE(JIT)
     984        m_codeBlock->addGlobalResolveInfo();
     985#else
    983986        m_codeBlock->addGlobalResolveInstruction(instructions().size());
     987#endif
    984988        emitOpcode(op_resolve_global);
    985989        instructions().append(dst->index());
     
    10611065RegisterID* BytecodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, const Identifier& property)
    10621066{
     1067#if ENABLE(JIT)
     1068    m_codeBlock->addStructureStubInfo(StructureStubInfo(op_get_by_id));
     1069#else
    10631070    m_codeBlock->addPropertyAccessInstruction(instructions().size());
     1071#endif
    10641072
    10651073    emitOpcode(op_get_by_id);
     
    10761084RegisterID* BytecodeGenerator::emitPutById(RegisterID* base, const Identifier& property, RegisterID* value)
    10771085{
     1086#if ENABLE(JIT)
     1087    m_codeBlock->addStructureStubInfo(StructureStubInfo(op_put_by_id));
     1088#else
    10781089    m_codeBlock->addPropertyAccessInstruction(instructions().size());
     1090#endif
    10791091
    10801092    emitOpcode(op_put_by_id);
     
    12481260
    12491261    emitExpressionInfo(divot, startOffset, endOffset);
     1262
     1263#if ENABLE(JIT)
    12501264    m_codeBlock->addCallLinkInfo();
     1265#endif
    12511266
    12521267    // Emit call.
     
    13271342
    13281343    emitExpressionInfo(divot, startOffset, endOffset);
     1344
     1345#if ENABLE(JIT)
    13291346    m_codeBlock->addCallLinkInfo();
     1347#endif
    13301348
    13311349    emitOpcode(op_construct);
     
    15451563RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* start, Label* end)
    15461564{
     1565#if ENABLE(JIT)
    15471566    HandlerInfo info = { start->offsetFrom(0), end->offsetFrom(0), instructions().size(), m_dynamicScopeDepth, 0 };
     1567#else
     1568    HandlerInfo info = { start->offsetFrom(0), end->offsetFrom(0), instructions().size(), m_dynamicScopeDepth };
     1569#endif
     1570
    15481571    m_codeBlock->addExceptionHandler(info);
    15491572    emitOpcode(op_catch);
Note: See TracChangeset for help on using the changeset viewer.