Changeset 38428 in webkit for trunk/JavaScriptCore/parser


Ignore:
Timestamp:
Nov 15, 2008, 1:37:49 PM (17 years ago)
Author:
[email protected]
Message:

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

Suggested by Maciej Stachowiak.


Reverted most "opcode" => "bytecode" renames. We use "bytecode" as a
mass noun to refer to a stream of instructions. Each instruction may be
an opcode or an operand.

  • VM/CTI.cpp: (JSC::CTI::emitCTICall): (JSC::CTI::compileOpCall): (JSC::CTI::compileBinaryArithOp): (JSC::CTI::compileBinaryArithOpSlowCase): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile):
  • VM/CTI.h:
  • VM/CodeBlock.cpp: (JSC::CodeBlock::printStructureIDs): (JSC::CodeBlock::dump): (JSC::CodeBlock::derefStructureIDs): (JSC::CodeBlock::refStructureIDs):
  • VM/CodeBlock.h:
  • VM/ExceptionHelpers.cpp: (JSC::createNotAnObjectError):
  • VM/Instruction.h: (JSC::Instruction::Instruction): (JSC::Instruction::):
  • VM/Machine.cpp: (JSC::BytecodeInterpreter::isOpcode): (JSC::BytecodeInterpreter::throwException): (JSC::BytecodeInterpreter::tryCachePutByID): (JSC::BytecodeInterpreter::uncachePutByID): (JSC::BytecodeInterpreter::tryCacheGetByID): (JSC::BytecodeInterpreter::uncacheGetByID): (JSC::BytecodeInterpreter::privateExecute): (JSC::BytecodeInterpreter::tryCTICachePutByID): (JSC::BytecodeInterpreter::tryCTICacheGetByID):
  • VM/Machine.h: (JSC::BytecodeInterpreter::getOpcode): (JSC::BytecodeInterpreter::getOpcodeID): (JSC::BytecodeInterpreter::isCallBytecode):
  • VM/Opcode.cpp: (JSC::): (JSC::OpcodeStats::OpcodeStats): (JSC::compareOpcodeIndices): (JSC::compareOpcodePairIndices): (JSC::OpcodeStats::~OpcodeStats): (JSC::OpcodeStats::recordInstruction): (JSC::OpcodeStats::resetLastInstruction):
  • VM/Opcode.h: (JSC::): (JSC::padOpcodeName):
  • VM/SamplingTool.cpp: (JSC::ScopeSampleRecord::sample): (JSC::SamplingTool::run): (JSC::compareOpcodeIndicesSampling): (JSC::SamplingTool::dump):
  • VM/SamplingTool.h: (JSC::ScopeSampleRecord::ScopeSampleRecord): (JSC::SamplingTool::SamplingTool):
  • bytecompiler/CodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): (JSC::BytecodeGenerator::emitLabel): (JSC::BytecodeGenerator::emitOpcode): (JSC::BytecodeGenerator::emitJump): (JSC::BytecodeGenerator::emitJumpIfTrue): (JSC::BytecodeGenerator::emitJumpIfFalse): (JSC::BytecodeGenerator::emitMove): (JSC::BytecodeGenerator::emitUnaryOp): (JSC::BytecodeGenerator::emitPreInc): (JSC::BytecodeGenerator::emitPreDec): (JSC::BytecodeGenerator::emitPostInc): (JSC::BytecodeGenerator::emitPostDec): (JSC::BytecodeGenerator::emitBinaryOp): (JSC::BytecodeGenerator::emitEqualityOp): (JSC::BytecodeGenerator::emitUnexpectedLoad): (JSC::BytecodeGenerator::emitInstanceOf): (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitGetScopedVar): (JSC::BytecodeGenerator::emitPutScopedVar): (JSC::BytecodeGenerator::emitResolveBase): (JSC::BytecodeGenerator::emitResolveWithBase): (JSC::BytecodeGenerator::emitResolveFunction): (JSC::BytecodeGenerator::emitGetById): (JSC::BytecodeGenerator::emitPutById): (JSC::BytecodeGenerator::emitPutGetter): (JSC::BytecodeGenerator::emitPutSetter): (JSC::BytecodeGenerator::emitDeleteById): (JSC::BytecodeGenerator::emitGetByVal): (JSC::BytecodeGenerator::emitPutByVal): (JSC::BytecodeGenerator::emitDeleteByVal): (JSC::BytecodeGenerator::emitPutByIndex): (JSC::BytecodeGenerator::emitNewObject): (JSC::BytecodeGenerator::emitNewArray): (JSC::BytecodeGenerator::emitNewFunction): (JSC::BytecodeGenerator::emitNewRegExp): (JSC::BytecodeGenerator::emitNewFunctionExpression): (JSC::BytecodeGenerator::emitCall): (JSC::BytecodeGenerator::emitReturn): (JSC::BytecodeGenerator::emitUnaryNoDstOp): (JSC::BytecodeGenerator::emitConstruct): (JSC::BytecodeGenerator::emitPopScope): (JSC::BytecodeGenerator::emitDebugHook): (JSC::BytecodeGenerator::emitComplexJumpScopes): (JSC::BytecodeGenerator::emitJumpScopes): (JSC::BytecodeGenerator::emitNextPropertyName): (JSC::BytecodeGenerator::emitCatch): (JSC::BytecodeGenerator::emitNewError): (JSC::BytecodeGenerator::emitJumpSubroutine): (JSC::BytecodeGenerator::emitSubroutineReturn): (JSC::BytecodeGenerator::emitPushNewScope): (JSC::BytecodeGenerator::beginSwitch):
  • bytecompiler/CodeGenerator.h:
  • 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::UnaryOpNode::emitBytecode): (JSC::BinaryOpNode::emitBytecode): (JSC::ReverseBinaryOpNode::emitBytecode): (JSC::ThrowableBinaryOpNode::emitBytecode): (JSC::emitReadModifyAssignment): (JSC::ScopeNode::ScopeNode):
  • 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::):
  • runtime/StructureID.cpp: (JSC::StructureID::fromDictionaryTransition):
  • wtf/Platform.h:
Location:
trunk/JavaScriptCore/parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Nodes.cpp

    r38427 r38428  
    10941094{
    10951095    RegisterID* src = generator.emitNode(m_expr.get());
    1096     return generator.emitUnaryOp(bytecode(), generator.finalDestination(dst), src, m_expr->resultDescriptor());
     1096    return generator.emitUnaryOp(opcodeID(), generator.finalDestination(dst), src, m_expr->resultDescriptor());
    10971097}
    10981098
     
    11121112RegisterID* BinaryOpNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
    11131113{
    1114     BytecodeID bytecode = this->bytecode();
    1115     if (bytecode == op_neq) {
     1114    OpcodeID opcodeID = this->opcodeID();
     1115    if (opcodeID == op_neq) {
    11161116        if (m_expr1->isNull() || m_expr2->isNull()) {
    11171117            RefPtr<RegisterID> src = generator.emitNode(dst, m_expr1->isNull() ? m_expr2.get() : m_expr1.get());
     
    11221122    RefPtr<RegisterID> src1 = generator.emitNodeForLeftHandSide(m_expr1.get(), m_rightHasAssignments, m_expr2->isPure(generator));
    11231123    RegisterID* src2 = generator.emitNode(m_expr2.get());
    1124     return generator.emitBinaryOp(bytecode, generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor()));
     1124    return generator.emitBinaryOp(opcodeID, generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor()));
    11251125}
    11261126
     
    11481148    RefPtr<RegisterID> src1 = generator.emitNodeForLeftHandSide(m_expr1.get(), m_rightHasAssignments, m_expr2->isPure(generator));
    11491149    RegisterID* src2 = generator.emitNode(m_expr2.get());
    1150     return generator.emitBinaryOp(bytecode(), generator.finalDestination(dst, src1.get()), src2, src1.get(), OperandTypes(m_expr2->resultDescriptor(), m_expr1->resultDescriptor()));
     1150    return generator.emitBinaryOp(opcodeID(), generator.finalDestination(dst, src1.get()), src2, src1.get(), OperandTypes(m_expr2->resultDescriptor(), m_expr1->resultDescriptor()));
    11511151}
    11521152
     
    11561156    RegisterID* src2 = generator.emitNode(m_expr2.get());
    11571157    generator.emitExpressionInfo(divot(), startOffset(), endOffset());
    1158     return generator.emitBinaryOp(bytecode(), generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor()));
     1158    return generator.emitBinaryOp(opcodeID(), generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor()));
    11591159}
    11601160
     
    12491249static ALWAYS_INLINE RegisterID* emitReadModifyAssignment(BytecodeGenerator& generator, RegisterID* dst, RegisterID* src1, RegisterID* src2, Operator oper, OperandTypes types)
    12501250{
    1251     BytecodeID bytecode;
     1251    OpcodeID opcodeID;
    12521252    switch (oper) {
    12531253        case OpMultEq:
    1254             bytecode = op_mul;
     1254            opcodeID = op_mul;
    12551255            break;
    12561256        case OpDivEq:
    1257             bytecode = op_div;
     1257            opcodeID = op_div;
    12581258            break;
    12591259        case OpPlusEq:
    1260             bytecode = op_add;
     1260            opcodeID = op_add;
    12611261            break;
    12621262        case OpMinusEq:
    1263             bytecode = op_sub;
     1263            opcodeID = op_sub;
    12641264            break;
    12651265        case OpLShift:
    1266             bytecode = op_lshift;
     1266            opcodeID = op_lshift;
    12671267            break;
    12681268        case OpRShift:
    1269             bytecode = op_rshift;
     1269            opcodeID = op_rshift;
    12701270            break;
    12711271        case OpURShift:
    1272             bytecode = op_urshift;
     1272            opcodeID = op_urshift;
    12731273            break;
    12741274        case OpAndEq:
    1275             bytecode = op_bitand;
     1275            opcodeID = op_bitand;
    12761276            break;
    12771277        case OpXOrEq:
    1278             bytecode = op_bitxor;
     1278            opcodeID = op_bitxor;
    12791279            break;
    12801280        case OpOrEq:
    1281             bytecode = op_bitor;
     1281            opcodeID = op_bitor;
    12821282            break;
    12831283        case OpModEq:
    1284             bytecode = op_mod;
     1284            opcodeID = op_mod;
    12851285            break;
    12861286        default:
     
    12891289    }
    12901290   
    1291     return generator.emitBinaryOp(bytecode, dst, src1, src2, types);
     1291    return generator.emitBinaryOp(opcodeID, dst, src1, src2, types);
    12921292}
    12931293
     
    23902390    if (funcStack)
    23912391        m_functionStack = *funcStack;
    2392 #if ENABLE(BYTECODE_SAMPLING)
     2392#if ENABLE(OPCODE_SAMPLING)
    23932393    globalData->interpreter->sampler()->notifyOfScope(this);
    23942394#endif
  • trunk/JavaScriptCore/parser/Nodes.h

    r38427 r38428  
    10781078
    10791079        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL;
    1080         virtual BytecodeID bytecode() const JSC_FAST_CALL = 0;
     1080        virtual OpcodeID opcodeID() const JSC_FAST_CALL = 0;
    10811081
    10821082    protected:
     
    10931093        virtual ExpressionNode* stripUnaryPlus() { return m_expr.get(); }
    10941094
    1095         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_to_jsnumber; }
     1095        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_to_jsnumber; }
    10961096    };
    10971097
     
    11031103        }
    11041104
    1105         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_negate; }
     1105        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_negate; }
    11061106    };
    11071107
     
    11131113        }
    11141114
    1115         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitnot; }
     1115        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitnot; }
    11161116    };
    11171117
     
    11231123        }
    11241124
    1125         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_not; }
     1125        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_not; }
    11261126    };
    11271127
     
    11481148
    11491149        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL;
    1150         virtual BytecodeID bytecode() const JSC_FAST_CALL = 0;
     1150        virtual OpcodeID opcodeID() const JSC_FAST_CALL = 0;
    11511151
    11521152    protected:
     
    11781178        }
    11791179
    1180         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_mul; }
     1180        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_mul; }
    11811181    };
    11821182
     
    11881188        }
    11891189
    1190         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_div; }
     1190        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_div; }
    11911191    };
    11921192
     
    11981198        }
    11991199
    1200         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_mod; }
     1200        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_mod; }
    12011201    };
    12021202
     
    12081208        }
    12091209
    1210         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_add; }
     1210        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_add; }
    12111211    };
    12121212
     
    12181218        }
    12191219
    1220         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_sub; }
     1220        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_sub; }
    12211221    };
    12221222
     
    12281228        }
    12291229
    1230         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_lshift; }
     1230        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_lshift; }
    12311231    };
    12321232
     
    12381238        }
    12391239
    1240         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_rshift; }
     1240        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_rshift; }
    12411241    };
    12421242
     
    12481248        }
    12491249
    1250         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_urshift; }
     1250        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_urshift; }
    12511251    };
    12521252
     
    12581258        }
    12591259
    1260         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_less; }
     1260        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_less; }
    12611261    };
    12621262
     
    12681268        }
    12691269
    1270         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_less; }
     1270        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_less; }
    12711271    };
    12721272
     
    12781278        }
    12791279
    1280         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_lesseq; }
     1280        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_lesseq; }
    12811281    };
    12821282
     
    12881288        }
    12891289
    1290         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_lesseq; }
     1290        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_lesseq; }
    12911291    };
    12921292
     
    13111311        }
    13121312
    1313         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_instanceof; }
     1313        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_instanceof; }
    13141314
    13151315        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL;
     
    13231323        }
    13241324
    1325         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_in; }
     1325        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_in; }
    13261326    };
    13271327
     
    13341334
    13351335        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL;
    1336         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_eq; }
     1336        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_eq; }
    13371337    };
    13381338
     
    13441344        }
    13451345
    1346         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_neq; }
     1346        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_neq; }
    13471347    };
    13481348
     
    13551355
    13561356        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL;
    1357         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_stricteq; }
     1357        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_stricteq; }
    13581358    };
    13591359
     
    13651365        }
    13661366
    1367         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_nstricteq; }
     1367        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_nstricteq; }
    13681368    };
    13691369
     
    13751375        }
    13761376
    1377         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitand; }
     1377        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitand; }
    13781378    };
    13791379
     
    13851385        }
    13861386
    1387         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitor; }
     1387        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitor; }
    13881388    };
    13891389
     
    13951395        }
    13961396
    1397         virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitxor; }
     1397        virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitxor; }
    13981398    };
    13991399
Note: See TracChangeset for help on using the changeset viewer.