Ignore:
Timestamp:
Nov 15, 2008, 12:34:40 PM (17 years ago)
Author:
[email protected]
Message:

2008-11-15 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Renamed all forms of "byte code" "opcode" "op code" "code" "bitcode"
etc. to "bytecode".

  • VM/CTI.cpp: (JSC::CTI::printBytecodeOperandTypes): (JSC::CTI::emitAllocateNumber): (JSC::CTI::emitNakedCall): (JSC::CTI::emitNakedFastCall): (JSC::CTI::emitCTICall): (JSC::CTI::emitJumpSlowCaseIfNotJSCell): (JSC::CTI::emitJumpSlowCaseIfNotImmNum): (JSC::CTI::emitJumpSlowCaseIfNotImmNums): (JSC::CTI::emitFastArithIntToImmOrSlowCase): (JSC::CTI::compileOpCall): (JSC::CTI::emitSlowScriptCheck): (JSC::CTI::compileBinaryArithOp): (JSC::CTI::compileBinaryArithOpSlowCase): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile):
  • VM/CTI.h: (JSC::CallRecord::CallRecord): (JSC::SwitchRecord::SwitchRecord):
  • VM/CodeBlock.cpp: (JSC::CodeBlock::printStructureIDs): (JSC::CodeBlock::dump): (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::derefStructureIDs): (JSC::CodeBlock::refStructureIDs):
  • VM/CodeBlock.h: (JSC::StructureStubInfo::StructureStubInfo):
  • VM/ExceptionHelpers.cpp: (JSC::createNotAnObjectError):
  • VM/Instruction.h: (JSC::Instruction::Instruction): (JSC::Instruction::):
  • VM/Machine.cpp: (JSC::BytecodeInterpreter::isBytecode): (JSC::BytecodeInterpreter::throwException): (JSC::BytecodeInterpreter::execute): (JSC::BytecodeInterpreter::tryCachePutByID): (JSC::BytecodeInterpreter::uncachePutByID): (JSC::BytecodeInterpreter::tryCacheGetByID): (JSC::BytecodeInterpreter::uncacheGetByID): (JSC::BytecodeInterpreter::privateExecute): (JSC::BytecodeInterpreter::tryCTICachePutByID): (JSC::BytecodeInterpreter::tryCTICacheGetByID): (JSC::BytecodeInterpreter::cti_op_call_JSFunction): (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall): (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
  • VM/Machine.h: (JSC::BytecodeInterpreter::getBytecode): (JSC::BytecodeInterpreter::getBytecodeID): (JSC::BytecodeInterpreter::isCallBytecode):
  • VM/Opcode.cpp: (JSC::): (JSC::BytecodeStats::BytecodeStats): (JSC::compareBytecodeIndices): (JSC::compareBytecodePairIndices): (JSC::BytecodeStats::~BytecodeStats): (JSC::BytecodeStats::recordInstruction): (JSC::BytecodeStats::resetLastInstruction):
  • VM/Opcode.h: (JSC::): (JSC::padBytecodeName):
  • VM/SamplingTool.cpp: (JSC::ScopeSampleRecord::sample): (JSC::SamplingTool::run): (JSC::compareBytecodeIndicesSampling): (JSC::SamplingTool::dump):
  • VM/SamplingTool.h: (JSC::ScopeSampleRecord::ScopeSampleRecord): (JSC::SamplingTool::SamplingTool):
  • bytecompiler/CodeGenerator.cpp: (JSC::CodeGenerator::generate): (JSC::CodeGenerator::CodeGenerator): (JSC::CodeGenerator::emitLabel): (JSC::CodeGenerator::emitBytecode): (JSC::CodeGenerator::emitJump): (JSC::CodeGenerator::emitJumpIfTrue): (JSC::CodeGenerator::emitJumpIfFalse): (JSC::CodeGenerator::emitMove): (JSC::CodeGenerator::emitUnaryOp): (JSC::CodeGenerator::emitPreInc): (JSC::CodeGenerator::emitPreDec): (JSC::CodeGenerator::emitPostInc): (JSC::CodeGenerator::emitPostDec): (JSC::CodeGenerator::emitBinaryOp): (JSC::CodeGenerator::emitEqualityOp): (JSC::CodeGenerator::emitUnexpectedLoad): (JSC::CodeGenerator::emitInstanceOf): (JSC::CodeGenerator::emitResolve): (JSC::CodeGenerator::emitGetScopedVar): (JSC::CodeGenerator::emitPutScopedVar): (JSC::CodeGenerator::emitResolveBase): (JSC::CodeGenerator::emitResolveWithBase): (JSC::CodeGenerator::emitResolveFunction): (JSC::CodeGenerator::emitGetById): (JSC::CodeGenerator::emitPutById): (JSC::CodeGenerator::emitPutGetter): (JSC::CodeGenerator::emitPutSetter): (JSC::CodeGenerator::emitDeleteById): (JSC::CodeGenerator::emitGetByVal): (JSC::CodeGenerator::emitPutByVal): (JSC::CodeGenerator::emitDeleteByVal): (JSC::CodeGenerator::emitPutByIndex): (JSC::CodeGenerator::emitNewObject): (JSC::CodeGenerator::emitNewArray): (JSC::CodeGenerator::emitNewFunction): (JSC::CodeGenerator::emitNewRegExp): (JSC::CodeGenerator::emitNewFunctionExpression): (JSC::CodeGenerator::emitCall): (JSC::CodeGenerator::emitReturn): (JSC::CodeGenerator::emitUnaryNoDstOp): (JSC::CodeGenerator::emitConstruct): (JSC::CodeGenerator::emitPopScope): (JSC::CodeGenerator::emitDebugHook): (JSC::CodeGenerator::emitComplexJumpScopes): (JSC::CodeGenerator::emitJumpScopes): (JSC::CodeGenerator::emitNextPropertyName): (JSC::CodeGenerator::emitCatch): (JSC::CodeGenerator::emitNewError): (JSC::CodeGenerator::emitJumpSubroutine): (JSC::CodeGenerator::emitSubroutineReturn): (JSC::CodeGenerator::emitPushNewScope): (JSC::CodeGenerator::beginSwitch): (JSC::CodeGenerator::endSwitch):
  • bytecompiler/CodeGenerator.h: (JSC::CodeGenerator::emitNode):
  • jsc.cpp: (runWithScripts):
  • masm/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::emitModRm_opr): (JSC::X86Assembler::emitModRm_opr_Unchecked): (JSC::X86Assembler::emitModRm_opm): (JSC::X86Assembler::emitModRm_opm_Unchecked): (JSC::X86Assembler::emitModRm_opmsib):
  • parser/Nodes.cpp: (JSC::NullNode::emitBytecode): (JSC::BooleanNode::emitBytecode): (JSC::NumberNode::emitBytecode): (JSC::StringNode::emitBytecode): (JSC::RegExpNode::emitBytecode): (JSC::ThisNode::emitBytecode): (JSC::ResolveNode::emitBytecode): (JSC::ArrayNode::emitBytecode): (JSC::ObjectLiteralNode::emitBytecode): (JSC::PropertyListNode::emitBytecode): (JSC::BracketAccessorNode::emitBytecode): (JSC::DotAccessorNode::emitBytecode): (JSC::ArgumentListNode::emitBytecode): (JSC::NewExprNode::emitBytecode): (JSC::EvalFunctionCallNode::emitBytecode): (JSC::FunctionCallValueNode::emitBytecode): (JSC::FunctionCallResolveNode::emitBytecode): (JSC::FunctionCallBracketNode::emitBytecode): (JSC::FunctionCallDotNode::emitBytecode): (JSC::PostfixResolveNode::emitBytecode): (JSC::PostfixBracketNode::emitBytecode): (JSC::PostfixDotNode::emitBytecode): (JSC::PostfixErrorNode::emitBytecode): (JSC::DeleteResolveNode::emitBytecode): (JSC::DeleteBracketNode::emitBytecode): (JSC::DeleteDotNode::emitBytecode): (JSC::DeleteValueNode::emitBytecode): (JSC::VoidNode::emitBytecode): (JSC::TypeOfResolveNode::emitBytecode): (JSC::TypeOfValueNode::emitBytecode): (JSC::PrefixResolveNode::emitBytecode): (JSC::PrefixBracketNode::emitBytecode): (JSC::PrefixDotNode::emitBytecode): (JSC::PrefixErrorNode::emitBytecode): (JSC::UnaryOpNode::emitBytecode): (JSC::BinaryOpNode::emitBytecode): (JSC::EqualNode::emitBytecode): (JSC::StrictEqualNode::emitBytecode): (JSC::ReverseBinaryOpNode::emitBytecode): (JSC::ThrowableBinaryOpNode::emitBytecode): (JSC::InstanceOfNode::emitBytecode): (JSC::LogicalOpNode::emitBytecode): (JSC::ConditionalNode::emitBytecode): (JSC::emitReadModifyAssignment): (JSC::ReadModifyResolveNode::emitBytecode): (JSC::AssignResolveNode::emitBytecode): (JSC::AssignDotNode::emitBytecode): (JSC::ReadModifyDotNode::emitBytecode): (JSC::AssignErrorNode::emitBytecode): (JSC::AssignBracketNode::emitBytecode): (JSC::ReadModifyBracketNode::emitBytecode): (JSC::CommaNode::emitBytecode): (JSC::ConstDeclNode::emitBytecode): (JSC::ConstStatementNode::emitBytecode): (JSC::BlockNode::emitBytecode): (JSC::EmptyStatementNode::emitBytecode): (JSC::DebuggerStatementNode::emitBytecode): (JSC::ExprStatementNode::emitBytecode): (JSC::VarStatementNode::emitBytecode): (JSC::IfNode::emitBytecode): (JSC::IfElseNode::emitBytecode): (JSC::DoWhileNode::emitBytecode): (JSC::WhileNode::emitBytecode): (JSC::ForNode::emitBytecode): (JSC::ForInNode::emitBytecode): (JSC::ContinueNode::emitBytecode): (JSC::BreakNode::emitBytecode): (JSC::ReturnNode::emitBytecode): (JSC::WithNode::emitBytecode): (JSC::SwitchNode::emitBytecode): (JSC::LabelNode::emitBytecode): (JSC::ThrowNode::emitBytecode): (JSC::TryNode::emitBytecode): (JSC::ScopeNode::ScopeNode): (JSC::EvalNode::emitBytecode): (JSC::FunctionBodyNode::emitBytecode): (JSC::ProgramNode::emitBytecode): (JSC::FuncDeclNode::emitBytecode): (JSC::FuncExprNode::emitBytecode):
  • parser/Nodes.h: (JSC::UnaryPlusNode::): (JSC::NegateNode::): (JSC::BitwiseNotNode::): (JSC::LogicalNotNode::): (JSC::MultNode::): (JSC::DivNode::): (JSC::ModNode::): (JSC::AddNode::): (JSC::SubNode::): (JSC::LeftShiftNode::): (JSC::RightShiftNode::): (JSC::UnsignedRightShiftNode::): (JSC::LessNode::): (JSC::GreaterNode::): (JSC::LessEqNode::): (JSC::GreaterEqNode::): (JSC::InstanceOfNode::): (JSC::InNode::): (JSC::EqualNode::): (JSC::NotEqualNode::): (JSC::StrictEqualNode::): (JSC::NotStrictEqualNode::): (JSC::BitAndNode::): (JSC::BitOrNode::): (JSC::BitXOrNode::): (JSC::ProgramNode::): (JSC::EvalNode::): (JSC::FunctionBodyNode::):
  • runtime/JSNotAnObject.h:
  • runtime/StructureID.cpp: (JSC::StructureID::fromDictionaryTransition):
  • wtf/Platform.h:
File:
1 edited

Legend:

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

    r38423 r38425  
    132132    m_codeBlock->thisRegister = m_thisRegister.index();
    133133
    134     m_scopeNode->emitCode(*this);
     134    m_scopeNode->emitBytecode(*this);
    135135
    136136#ifndef NDEBUG
     
    228228    , m_nextGlobalIndex(-1)
    229229    , m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
    230     , m_lastOpcodeID(op_end)
     230    , m_lastBytecodeID(op_end)
    231231    , m_emitNodeDepth(0)
    232232{
     
    234234        m_codeBlock->needsFullScopeChain = true;
    235235
    236     emitOpcode(op_enter);
     236    emitBytecode(op_enter);
    237237    codeBlock->globalData = m_globalData;
    238238
     
    305305    , m_codeType(FunctionCode)
    306306    , m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
    307     , m_lastOpcodeID(op_end)
     307    , m_lastBytecodeID(op_end)
    308308    , m_emitNodeDepth(0)
    309309{
     
    323323        ++m_codeBlock->numVars;
    324324        m_activationRegisterIndex = newRegister()->index();
    325         emitOpcode(op_enter_with_activation);
     325        emitBytecode(op_enter_with_activation);
    326326        instructions().append(m_activationRegisterIndex);
    327327    } else
    328         emitOpcode(op_enter);
     328        emitBytecode(op_enter);
    329329
    330330    if (usesArguments)
    331         emitOpcode(op_create_arguments);
     331        emitBytecode(op_create_arguments);
    332332
    333333    const DeclarationStacks::FunctionStack& functionStack = functionBody->functionStack();
     
    354354
    355355    if (functionBody->usesThis()) {
    356         emitOpcode(op_convert_this);
     356        emitBytecode(op_convert_this);
    357357        instructions().append(m_thisRegister.index());
    358358    }
     
    376376    , m_codeType(EvalCode)
    377377    , m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
    378     , m_lastOpcodeID(op_end)
     378    , m_lastBytecodeID(op_end)
    379379    , m_emitNodeDepth(0)
    380380{
     
    382382        m_codeBlock->needsFullScopeChain = true;
    383383
    384     emitOpcode(op_enter);
     384    emitBytecode(op_enter);
    385385    codeBlock->globalData = m_globalData;
    386386    m_codeBlock->numParameters = 1; // Allocate space for "this"
     
    513513
    514514    // This disables peephole optimizations when an instruction is a jump target
    515     m_lastOpcodeID = op_end;
     515    m_lastBytecodeID = op_end;
    516516    return l0;
    517517}
    518518
    519 void CodeGenerator::emitOpcode(OpcodeID opcodeID)
    520 {
    521     instructions().append(globalData()->interpreter->getOpcode(opcodeID));
    522     m_lastOpcodeID = opcodeID;
     519void CodeGenerator::emitBytecode(BytecodeID bytecodeID)
     520{
     521    instructions().append(globalData()->interpreter->getBytecode(bytecodeID));
     522    m_lastBytecodeID = bytecodeID;
    523523}
    524524
     
    554554PassRefPtr<LabelID> CodeGenerator::emitJump(LabelID* target)
    555555{
    556     emitOpcode(target->isForwardLabel() ? op_jmp : op_loop);
     556    emitBytecode(target->isForwardLabel() ? op_jmp : op_loop);
    557557    instructions().append(target->offsetFrom(instructions().size()));
    558558    return target;
     
    561561PassRefPtr<LabelID> CodeGenerator::emitJumpIfTrue(RegisterID* cond, LabelID* target)
    562562{
    563     if (m_lastOpcodeID == op_less && !target->isForwardLabel()) {
     563    if (m_lastBytecodeID == op_less && !target->isForwardLabel()) {
    564564        int dstIndex;
    565565        int src1Index;
     
    570570        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    571571            rewindBinaryOp();
    572             emitOpcode(op_loop_if_less);
     572            emitBytecode(op_loop_if_less);
    573573            instructions().append(src1Index);
    574574            instructions().append(src2Index);
     
    576576            return target;
    577577        }
    578     } else if (m_lastOpcodeID == op_lesseq && !target->isForwardLabel()) {
     578    } else if (m_lastBytecodeID == op_lesseq && !target->isForwardLabel()) {
    579579        int dstIndex;
    580580        int src1Index;
     
    585585        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    586586            rewindBinaryOp();
    587             emitOpcode(op_loop_if_lesseq);
     587            emitBytecode(op_loop_if_lesseq);
    588588            instructions().append(src1Index);
    589589            instructions().append(src2Index);
     
    591591            return target;
    592592        }
    593     } else if (m_lastOpcodeID == op_eq_null && target->isForwardLabel()) {
     593    } else if (m_lastBytecodeID == op_eq_null && target->isForwardLabel()) {
    594594        int dstIndex;
    595595        int srcIndex;
     
    599599        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    600600            rewindUnaryOp();
    601             emitOpcode(op_jeq_null);
     601            emitBytecode(op_jeq_null);
    602602            instructions().append(srcIndex);
    603603            instructions().append(target->offsetFrom(instructions().size()));
    604604            return target;
    605605        }
    606     } else if (m_lastOpcodeID == op_neq_null && target->isForwardLabel()) {
     606    } else if (m_lastBytecodeID == op_neq_null && target->isForwardLabel()) {
    607607        int dstIndex;
    608608        int srcIndex;
     
    612612        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    613613            rewindUnaryOp();
    614             emitOpcode(op_jneq_null);
     614            emitBytecode(op_jneq_null);
    615615            instructions().append(srcIndex);
    616616            instructions().append(target->offsetFrom(instructions().size()));
     
    619619    }
    620620
    621     emitOpcode(target->isForwardLabel() ? op_jtrue : op_loop_if_true);
     621    emitBytecode(target->isForwardLabel() ? op_jtrue : op_loop_if_true);
    622622    instructions().append(cond->index());
    623623    instructions().append(target->offsetFrom(instructions().size()));
     
    629629    ASSERT(target->isForwardLabel());
    630630
    631     if (m_lastOpcodeID == op_less) {
     631    if (m_lastBytecodeID == op_less) {
    632632        int dstIndex;
    633633        int src1Index;
     
    638638        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    639639            rewindBinaryOp();
    640             emitOpcode(op_jnless);
     640            emitBytecode(op_jnless);
    641641            instructions().append(src1Index);
    642642            instructions().append(src2Index);
     
    644644            return target;
    645645        }
    646     } else if (m_lastOpcodeID == op_not) {
     646    } else if (m_lastBytecodeID == op_not) {
    647647        int dstIndex;
    648648        int srcIndex;
     
    652652        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    653653            rewindUnaryOp();
    654             emitOpcode(op_jtrue);
     654            emitBytecode(op_jtrue);
    655655            instructions().append(srcIndex);
    656656            instructions().append(target->offsetFrom(instructions().size()));
    657657            return target;
    658658        }
    659     } else if (m_lastOpcodeID == op_eq_null) {
     659    } else if (m_lastBytecodeID == op_eq_null) {
    660660        int dstIndex;
    661661        int srcIndex;
     
    665665        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    666666            rewindUnaryOp();
    667             emitOpcode(op_jneq_null);
     667            emitBytecode(op_jneq_null);
    668668            instructions().append(srcIndex);
    669669            instructions().append(target->offsetFrom(instructions().size()));
    670670            return target;
    671671        }
    672     } else if (m_lastOpcodeID == op_neq_null) {
     672    } else if (m_lastBytecodeID == op_neq_null) {
    673673        int dstIndex;
    674674        int srcIndex;
     
    678678        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
    679679            rewindUnaryOp();
    680             emitOpcode(op_jeq_null);
     680            emitBytecode(op_jeq_null);
    681681            instructions().append(srcIndex);
    682682            instructions().append(target->offsetFrom(instructions().size()));
     
    685685    }
    686686
    687     emitOpcode(op_jfalse);
     687    emitBytecode(op_jfalse);
    688688    instructions().append(cond->index());
    689689    instructions().append(target->offsetFrom(instructions().size()));
     
    748748RegisterID* CodeGenerator::emitMove(RegisterID* dst, RegisterID* src)
    749749{
    750     emitOpcode(op_mov);
     750    emitBytecode(op_mov);
    751751    instructions().append(dst->index());
    752752    instructions().append(src->index());
     
    754754}
    755755
    756 RegisterID* CodeGenerator::emitUnaryOp(OpcodeID opcode, RegisterID* dst, RegisterID* src, ResultType type)
    757 {
    758     emitOpcode(opcode);
     756RegisterID* CodeGenerator::emitUnaryOp(BytecodeID bytecode, RegisterID* dst, RegisterID* src, ResultType type)
     757{
     758    emitBytecode(bytecode);
    759759    instructions().append(dst->index());
    760760    instructions().append(src->index());
    761     if (opcode == op_negate)
     761    if (bytecode == op_negate)
    762762        instructions().append(type.toInt());
    763763    return dst;
     
    766766RegisterID* CodeGenerator::emitPreInc(RegisterID* srcDst)
    767767{
    768     emitOpcode(op_pre_inc);
     768    emitBytecode(op_pre_inc);
    769769    instructions().append(srcDst->index());
    770770    return srcDst;
     
    773773RegisterID* CodeGenerator::emitPreDec(RegisterID* srcDst)
    774774{
    775     emitOpcode(op_pre_dec);
     775    emitBytecode(op_pre_dec);
    776776    instructions().append(srcDst->index());
    777777    return srcDst;
     
    780780RegisterID* CodeGenerator::emitPostInc(RegisterID* dst, RegisterID* srcDst)
    781781{
    782     emitOpcode(op_post_inc);
     782    emitBytecode(op_post_inc);
    783783    instructions().append(dst->index());
    784784    instructions().append(srcDst->index());
     
    788788RegisterID* CodeGenerator::emitPostDec(RegisterID* dst, RegisterID* srcDst)
    789789{
    790     emitOpcode(op_post_dec);
     790    emitBytecode(op_post_dec);
    791791    instructions().append(dst->index());
    792792    instructions().append(srcDst->index());
     
    794794}
    795795
    796 RegisterID* CodeGenerator::emitBinaryOp(OpcodeID opcode, RegisterID* dst, RegisterID* src1, RegisterID* src2, OperandTypes types)
    797 {
    798     emitOpcode(opcode);
     796RegisterID* CodeGenerator::emitBinaryOp(BytecodeID bytecode, RegisterID* dst, RegisterID* src1, RegisterID* src2, OperandTypes types)
     797{
     798    emitBytecode(bytecode);
    799799    instructions().append(dst->index());
    800800    instructions().append(src1->index());
    801801    instructions().append(src2->index());
    802802
    803     if (opcode == op_bitor || opcode == op_bitand || opcode == op_bitxor ||
    804         opcode == op_add || opcode == op_mul || opcode == op_sub) {
     803    if (bytecode == op_bitor || bytecode == op_bitand || bytecode == op_bitxor ||
     804        bytecode == op_add || bytecode == op_mul || bytecode == op_sub) {
    805805        instructions().append(types.toInt());
    806806    }
     
    809809}
    810810
    811 RegisterID* CodeGenerator::emitEqualityOp(OpcodeID opcode, RegisterID* dst, RegisterID* src1, RegisterID* src2)
    812 {
    813     if (m_lastOpcodeID == op_typeof) {
     811RegisterID* CodeGenerator::emitEqualityOp(BytecodeID bytecode, RegisterID* dst, RegisterID* src1, RegisterID* src2)
     812{
     813    if (m_lastBytecodeID == op_typeof) {
    814814        int dstIndex;
    815815        int srcIndex;
     
    824824            if (value == "undefined") {
    825825                rewindUnaryOp();
    826                 emitOpcode(op_is_undefined);
     826                emitBytecode(op_is_undefined);
    827827                instructions().append(dst->index());
    828828                instructions().append(srcIndex);
     
    831831            if (value == "boolean") {
    832832                rewindUnaryOp();
    833                 emitOpcode(op_is_boolean);
     833                emitBytecode(op_is_boolean);
    834834                instructions().append(dst->index());
    835835                instructions().append(srcIndex);
     
    838838            if (value == "number") {
    839839                rewindUnaryOp();
    840                 emitOpcode(op_is_number);
     840                emitBytecode(op_is_number);
    841841                instructions().append(dst->index());
    842842                instructions().append(srcIndex);
     
    845845            if (value == "string") {
    846846                rewindUnaryOp();
    847                 emitOpcode(op_is_string);
     847                emitBytecode(op_is_string);
    848848                instructions().append(dst->index());
    849849                instructions().append(srcIndex);
     
    852852            if (value == "object") {
    853853                rewindUnaryOp();
    854                 emitOpcode(op_is_object);
     854                emitBytecode(op_is_object);
    855855                instructions().append(dst->index());
    856856                instructions().append(srcIndex);
     
    859859            if (value == "function") {
    860860                rewindUnaryOp();
    861                 emitOpcode(op_is_function);
     861                emitBytecode(op_is_function);
    862862                instructions().append(dst->index());
    863863                instructions().append(srcIndex);
     
    867867    }
    868868
    869     emitOpcode(opcode);
     869    emitBytecode(bytecode);
    870870    instructions().append(dst->index());
    871871    instructions().append(src1->index());
     
    915915RegisterID* CodeGenerator::emitUnexpectedLoad(RegisterID* dst, bool b)
    916916{
    917     emitOpcode(op_unexpected_load);
     917    emitBytecode(op_unexpected_load);
    918918    instructions().append(dst->index());
    919919    instructions().append(addUnexpectedConstant(jsBoolean(b)));
     
    923923RegisterID* CodeGenerator::emitUnexpectedLoad(RegisterID* dst, double d)
    924924{
    925     emitOpcode(op_unexpected_load);
     925    emitBytecode(op_unexpected_load);
    926926    instructions().append(dst->index());
    927927    instructions().append(addUnexpectedConstant(jsNumber(globalData(), d)));
     
    985985RegisterID* CodeGenerator::emitInstanceOf(RegisterID* dst, RegisterID* value, RegisterID* base, RegisterID* basePrototype)
    986986{
    987     emitOpcode(op_instanceof);
     987    emitBytecode(op_instanceof);
    988988    instructions().append(dst->index());
    989989    instructions().append(value->index());
     
    10001000    if (!findScopedProperty(property, index, depth, false, globalObject) && !globalObject) {
    10011001        // We can't optimise at all :-(
    1002         emitOpcode(op_resolve);
     1002        emitBytecode(op_resolve);
    10031003        instructions().append(dst->index());
    10041004        instructions().append(addConstant(property));
     
    10131013    if (globalObject) {
    10141014        m_codeBlock->globalResolveInstructions.append(instructions().size());
    1015         emitOpcode(op_resolve_global);
     1015        emitBytecode(op_resolve_global);
    10161016        instructions().append(dst->index());
    10171017        instructions().append(globalObject);
     
    10241024    // In this case we are at least able to drop a few scope chains from the
    10251025    // lookup chain, although we still need to hash from then on.
    1026     emitOpcode(op_resolve_skip);
     1026    emitBytecode(op_resolve_skip);
    10271027    instructions().append(dst->index());
    10281028    instructions().append(addConstant(property));
     
    10341034{
    10351035    if (globalObject) {
    1036         emitOpcode(op_get_global_var);
     1036        emitBytecode(op_get_global_var);
    10371037        instructions().append(dst->index());
    10381038        instructions().append(asCell(globalObject));
     
    10411041    }
    10421042
    1043     emitOpcode(op_get_scoped_var);
     1043    emitBytecode(op_get_scoped_var);
    10441044    instructions().append(dst->index());
    10451045    instructions().append(index);
     
    10511051{
    10521052    if (globalObject) {
    1053         emitOpcode(op_put_global_var);
     1053        emitBytecode(op_put_global_var);
    10541054        instructions().append(asCell(globalObject));
    10551055        instructions().append(index);
     
    10571057        return value;
    10581058    }
    1059     emitOpcode(op_put_scoped_var);
     1059    emitBytecode(op_put_scoped_var);
    10601060    instructions().append(index);
    10611061    instructions().append(depth);
     
    10661066RegisterID* CodeGenerator::emitResolveBase(RegisterID* dst, const Identifier& property)
    10671067{
    1068     emitOpcode(op_resolve_base);
     1068    emitBytecode(op_resolve_base);
    10691069    instructions().append(dst->index());
    10701070    instructions().append(addConstant(property));
     
    10741074RegisterID* CodeGenerator::emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const Identifier& property)
    10751075{
    1076     emitOpcode(op_resolve_with_base);
     1076    emitBytecode(op_resolve_with_base);
    10771077    instructions().append(baseDst->index());
    10781078    instructions().append(propDst->index());
     
    10831083RegisterID* CodeGenerator::emitResolveFunction(RegisterID* baseDst, RegisterID* funcDst, const Identifier& property)
    10841084{
    1085     emitOpcode(op_resolve_func);
     1085    emitBytecode(op_resolve_func);
    10861086    instructions().append(baseDst->index());
    10871087    instructions().append(funcDst->index());
     
    10941094    m_codeBlock->propertyAccessInstructions.append(instructions().size());
    10951095
    1096     emitOpcode(op_get_by_id);
     1096    emitBytecode(op_get_by_id);
    10971097    instructions().append(dst->index());
    10981098    instructions().append(base->index());
     
    11091109    m_codeBlock->propertyAccessInstructions.append(instructions().size());
    11101110
    1111     emitOpcode(op_put_by_id);
     1111    emitBytecode(op_put_by_id);
    11121112    instructions().append(base->index());
    11131113    instructions().append(addConstant(property));
     
    11221122RegisterID* CodeGenerator::emitPutGetter(RegisterID* base, const Identifier& property, RegisterID* value)
    11231123{
    1124     emitOpcode(op_put_getter);
     1124    emitBytecode(op_put_getter);
    11251125    instructions().append(base->index());
    11261126    instructions().append(addConstant(property));
     
    11311131RegisterID* CodeGenerator::emitPutSetter(RegisterID* base, const Identifier& property, RegisterID* value)
    11321132{
    1133     emitOpcode(op_put_setter);
     1133    emitBytecode(op_put_setter);
    11341134    instructions().append(base->index());
    11351135    instructions().append(addConstant(property));
     
    11401140RegisterID* CodeGenerator::emitDeleteById(RegisterID* dst, RegisterID* base, const Identifier& property)
    11411141{
    1142     emitOpcode(op_del_by_id);
     1142    emitBytecode(op_del_by_id);
    11431143    instructions().append(dst->index());
    11441144    instructions().append(base->index());
     
    11491149RegisterID* CodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property)
    11501150{
    1151     emitOpcode(op_get_by_val);
     1151    emitBytecode(op_get_by_val);
    11521152    instructions().append(dst->index());
    11531153    instructions().append(base->index());
     
    11581158RegisterID* CodeGenerator::emitPutByVal(RegisterID* base, RegisterID* property, RegisterID* value)
    11591159{
    1160     emitOpcode(op_put_by_val);
     1160    emitBytecode(op_put_by_val);
    11611161    instructions().append(base->index());
    11621162    instructions().append(property->index());
     
    11671167RegisterID* CodeGenerator::emitDeleteByVal(RegisterID* dst, RegisterID* base, RegisterID* property)
    11681168{
    1169     emitOpcode(op_del_by_val);
     1169    emitBytecode(op_del_by_val);
    11701170    instructions().append(dst->index());
    11711171    instructions().append(base->index());
     
    11761176RegisterID* CodeGenerator::emitPutByIndex(RegisterID* base, unsigned index, RegisterID* value)
    11771177{
    1178     emitOpcode(op_put_by_index);
     1178    emitBytecode(op_put_by_index);
    11791179    instructions().append(base->index());
    11801180    instructions().append(index);
     
    11851185RegisterID* CodeGenerator::emitNewObject(RegisterID* dst)
    11861186{
    1187     emitOpcode(op_new_object);
     1187    emitBytecode(op_new_object);
    11881188    instructions().append(dst->index());
    11891189    return dst;
     
    11991199        emitNode(argv.last().get(), n->value());
    12001200    }
    1201     emitOpcode(op_new_array);
     1201    emitBytecode(op_new_array);
    12021202    instructions().append(dst->index());
    12031203    instructions().append(argv.size() ? argv[0]->index() : 0); // argv
     
    12081208RegisterID* CodeGenerator::emitNewFunction(RegisterID* dst, FuncDeclNode* n)
    12091209{
    1210     emitOpcode(op_new_func);
     1210    emitBytecode(op_new_func);
    12111211    instructions().append(dst->index());
    12121212    instructions().append(addConstant(n));
     
    12161216RegisterID* CodeGenerator::emitNewRegExp(RegisterID* dst, RegExp* regExp)
    12171217{
    1218     emitOpcode(op_new_regexp);
     1218    emitBytecode(op_new_regexp);
    12191219    instructions().append(dst->index());
    12201220    instructions().append(addRegExp(regExp));
     
    12251225RegisterID* CodeGenerator::emitNewFunctionExpression(RegisterID* r0, FuncExprNode* n)
    12261226{
    1227     emitOpcode(op_new_func_exp);
     1227    emitBytecode(op_new_func_exp);
    12281228    instructions().append(r0->index());
    12291229    instructions().append(addConstant(n));
     
    12411241}
    12421242
    1243 RegisterID* CodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)
    1244 {
    1245     ASSERT(opcodeID == op_call || opcodeID == op_call_eval);
     1243RegisterID* CodeGenerator::emitCall(BytecodeID bytecodeID, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)
     1244{
     1245    ASSERT(bytecodeID == op_call || bytecodeID == op_call_eval);
    12461246    ASSERT(func->refCount());
    12471247
     
    12741274
    12751275    if (m_shouldEmitProfileHooks) {
    1276         emitOpcode(op_profile_will_call);
     1276        emitBytecode(op_profile_will_call);
    12771277        instructions().append(func->index());
    12781278    }
     
    12821282
    12831283    // Emit call.
    1284     emitOpcode(opcodeID);
     1284    emitBytecode(bytecodeID);
    12851285    instructions().append(dst->index()); // dst
    12861286    instructions().append(func->index()); // func
     
    12891289
    12901290    if (m_shouldEmitProfileHooks) {
    1291         emitOpcode(op_profile_did_call);
     1291        emitBytecode(op_profile_did_call);
    12921292        instructions().append(func->index());
    12931293
     
    13041304{
    13051305    if (m_codeBlock->needsFullScopeChain) {
    1306         emitOpcode(op_tear_off_activation);
     1306        emitBytecode(op_tear_off_activation);
    13071307        instructions().append(m_activationRegisterIndex);
    13081308    } else if (m_codeBlock->usesArguments && m_codeBlock->numParameters > 1)
    1309         emitOpcode(op_tear_off_arguments);
     1309        emitBytecode(op_tear_off_arguments);
    13101310
    13111311    return emitUnaryNoDstOp(op_ret, src);
    13121312}
    13131313
    1314 RegisterID* CodeGenerator::emitUnaryNoDstOp(OpcodeID opcode, RegisterID* src)
    1315 {
    1316     emitOpcode(opcode);
     1314RegisterID* CodeGenerator::emitUnaryNoDstOp(BytecodeID bytecode, RegisterID* src)
     1315{
     1316    emitBytecode(bytecode);
    13171317    instructions().append(src->index());
    13181318    return src;
     
    13441344
    13451345    if (m_shouldEmitProfileHooks) {
    1346         emitOpcode(op_profile_will_call);
     1346        emitBytecode(op_profile_will_call);
    13471347        instructions().append(func->index());
    13481348    }
     
    13601360    m_codeBlock->callLinkInfos.append(CallLinkInfo());
    13611361
    1362     emitOpcode(op_construct);
     1362    emitBytecode(op_construct);
    13631363    instructions().append(dst->index()); // dst
    13641364    instructions().append(func->index()); // func
     
    13681368    instructions().append(argv[0]->index()); // thisRegister
    13691369
    1370     emitOpcode(op_construct_verify);
     1370    emitBytecode(op_construct_verify);
    13711371    instructions().append(dst->index());
    13721372    instructions().append(argv[0]->index());
    13731373
    13741374    if (m_shouldEmitProfileHooks) {
    1375         emitOpcode(op_profile_did_call);
     1375        emitBytecode(op_profile_did_call);
    13761376        instructions().append(func->index());
    13771377       
     
    13981398    ASSERT(!m_scopeContextStack.last().isFinallyBlock);
    13991399
    1400     emitOpcode(op_pop_scope);
     1400    emitBytecode(op_pop_scope);
    14011401
    14021402    m_scopeContextStack.removeLast();
     
    14081408    if (!m_shouldEmitDebugHooks)
    14091409        return;
    1410     emitOpcode(op_debug);
     1410    emitBytecode(op_debug);
    14111411    instructions().append(debugHookID);
    14121412    instructions().append(firstLine);
     
    15171517            // We need to remove a number of dynamic scopes to get to the next
    15181518            // finally block
    1519             emitOpcode(op_jmp_scopes);
     1519            emitBytecode(op_jmp_scopes);
    15201520            instructions().append(nNormalScopes);
    15211521
     
    15591559        return emitComplexJumpScopes(target, &m_scopeContextStack.last(), &m_scopeContextStack.last() - scopeDelta);
    15601560
    1561     emitOpcode(op_jmp_scopes);
     1561    emitBytecode(op_jmp_scopes);
    15621562    instructions().append(scopeDelta);
    15631563    instructions().append(target->offsetFrom(instructions().size()));
     
    15671567RegisterID* CodeGenerator::emitNextPropertyName(RegisterID* dst, RegisterID* iter, LabelID* target)
    15681568{
    1569     emitOpcode(op_next_pname);
     1569    emitBytecode(op_next_pname);
    15701570    instructions().append(dst->index());
    15711571    instructions().append(iter->index());
     
    15781578    HandlerInfo info = { start->offsetFrom(0), end->offsetFrom(0), instructions().size(), m_dynamicScopeDepth, 0 };
    15791579    exceptionHandlers().append(info);
    1580     emitOpcode(op_catch);
     1580    emitBytecode(op_catch);
    15811581    instructions().append(targetRegister->index());
    15821582    return targetRegister;
     
    15851585RegisterID* CodeGenerator::emitNewError(RegisterID* dst, ErrorType type, JSValue* message)
    15861586{
    1587     emitOpcode(op_new_error);
     1587    emitBytecode(op_new_error);
    15881588    instructions().append(dst->index());
    15891589    instructions().append(static_cast<int>(type));
     
    15941594PassRefPtr<LabelID> CodeGenerator::emitJumpSubroutine(RegisterID* retAddrDst, LabelID* finally)
    15951595{
    1596     emitOpcode(op_jsr);
     1596    emitBytecode(op_jsr);
    15971597    instructions().append(retAddrDst->index());
    15981598    instructions().append(finally->offsetFrom(instructions().size()));
     
    16021602void CodeGenerator::emitSubroutineReturn(RegisterID* retAddrSrc)
    16031603{
    1604     emitOpcode(op_sret);
     1604    emitBytecode(op_sret);
    16051605    instructions().append(retAddrSrc->index());
    16061606}
     
    16131613    m_dynamicScopeDepth++;
    16141614   
    1615     emitOpcode(op_push_new_scope);
     1615    emitBytecode(op_push_new_scope);
    16161616    instructions().append(dst->index());
    16171617    instructions().append(addConstant(property));
     
    16241624    switch (type) {
    16251625        case SwitchInfo::SwitchImmediate:
    1626             emitOpcode(op_switch_imm);
     1626            emitBytecode(op_switch_imm);
    16271627            break;
    16281628        case SwitchInfo::SwitchCharacter:
    1629             emitOpcode(op_switch_char);
     1629            emitBytecode(op_switch_char);
    16301630            break;
    16311631        case SwitchInfo::SwitchString:
    1632             emitOpcode(op_switch_string);
     1632            emitBytecode(op_switch_string);
    16331633            break;
    16341634        default:
     
    17171717    m_switchContextStack.removeLast();
    17181718    if (switchInfo.switchType == SwitchInfo::SwitchImmediate) {
    1719         instructions()[switchInfo.opcodeOffset + 1] = m_codeBlock->immediateSwitchJumpTables.size();
    1720         instructions()[switchInfo.opcodeOffset + 2] = defaultLabel->offsetFrom(switchInfo.opcodeOffset + 3);
     1719        instructions()[switchInfo.bytecodeOffset + 1] = m_codeBlock->immediateSwitchJumpTables.size();
     1720        instructions()[switchInfo.bytecodeOffset + 2] = defaultLabel->offsetFrom(switchInfo.bytecodeOffset + 3);
    17211721
    17221722        m_codeBlock->immediateSwitchJumpTables.append(SimpleJumpTable());
    17231723        SimpleJumpTable& jumpTable = m_codeBlock->immediateSwitchJumpTables.last();
    17241724
    1725         prepareJumpTableForImmediateSwitch(jumpTable, switchInfo.opcodeOffset + 3, clauseCount, labels, nodes, min, max);
     1725        prepareJumpTableForImmediateSwitch(jumpTable, switchInfo.bytecodeOffset + 3, clauseCount, labels, nodes, min, max);
    17261726    } else if (switchInfo.switchType == SwitchInfo::SwitchCharacter) {
    1727         instructions()[switchInfo.opcodeOffset + 1] = m_codeBlock->characterSwitchJumpTables.size();
    1728         instructions()[switchInfo.opcodeOffset + 2] = defaultLabel->offsetFrom(switchInfo.opcodeOffset + 3);
     1727        instructions()[switchInfo.bytecodeOffset + 1] = m_codeBlock->characterSwitchJumpTables.size();
     1728        instructions()[switchInfo.bytecodeOffset + 2] = defaultLabel->offsetFrom(switchInfo.bytecodeOffset + 3);
    17291729       
    17301730        m_codeBlock->characterSwitchJumpTables.append(SimpleJumpTable());
    17311731        SimpleJumpTable& jumpTable = m_codeBlock->characterSwitchJumpTables.last();
    17321732
    1733         prepareJumpTableForCharacterSwitch(jumpTable, switchInfo.opcodeOffset + 3, clauseCount, labels, nodes, min, max);
     1733        prepareJumpTableForCharacterSwitch(jumpTable, switchInfo.bytecodeOffset + 3, clauseCount, labels, nodes, min, max);
    17341734    } else {
    17351735        ASSERT(switchInfo.switchType == SwitchInfo::SwitchString);
    1736         instructions()[switchInfo.opcodeOffset + 1] = m_codeBlock->stringSwitchJumpTables.size();
    1737         instructions()[switchInfo.opcodeOffset + 2] = defaultLabel->offsetFrom(switchInfo.opcodeOffset + 3);
     1736        instructions()[switchInfo.bytecodeOffset + 1] = m_codeBlock->stringSwitchJumpTables.size();
     1737        instructions()[switchInfo.bytecodeOffset + 2] = defaultLabel->offsetFrom(switchInfo.bytecodeOffset + 3);
    17381738
    17391739        m_codeBlock->stringSwitchJumpTables.append(StringJumpTable());
    17401740        StringJumpTable& jumpTable = m_codeBlock->stringSwitchJumpTables.last();
    17411741
    1742         prepareJumpTableForStringSwitch(jumpTable, switchInfo.opcodeOffset + 3, clauseCount, labels, nodes);
     1742        prepareJumpTableForStringSwitch(jumpTable, switchInfo.bytecodeOffset + 3, clauseCount, labels, nodes);
    17431743    }
    17441744}
Note: See TracChangeset for help on using the changeset viewer.