Ignore:
Timestamp:
Nov 15, 2008, 11:55:20 AM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

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

Reviewed by Sam Weinig.


Renamed Machine to BytecodeInterpreter.


Nixed the Interpreter class, and changed its two functions to stand-alone
functions.

  • JavaScriptCore.exp:
  • VM/CTI.cpp: (JSC::): (JSC::CTI::emitCTICall): (JSC::CTI::CTI): (JSC::CTI::compileOpCall): (JSC::CTI::emitSlowScriptCheck): (JSC::CTI::compileBinaryArithOpSlowCase): (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases): (JSC::CTI::privateCompile): (JSC::CTI::privateCompileGetByIdSelf): (JSC::CTI::privateCompileGetByIdProto): (JSC::CTI::privateCompileGetByIdChain): (JSC::CTI::privateCompilePutByIdReplace): (JSC::CTI::privateCompilePutByIdTransition): (JSC::CTI::privateCompileCTIMachineTrampolines): (JSC::CTI::freeCTIMachineTrampolines): (JSC::CTI::patchGetByIdSelf): (JSC::CTI::patchPutByIdReplace): (JSC::CTI::privateCompilePatchGetArrayLength): (JSC::CTI::compileRegExp):
  • VM/CTI.h:
  • VM/CodeBlock.cpp: (JSC::CodeBlock::printStructureIDs): (JSC::CodeBlock::dump): (JSC::CodeBlock::derefStructureIDs): (JSC::CodeBlock::refStructureIDs):
  • VM/ExceptionHelpers.cpp: (JSC::createNotAnObjectError):
  • VM/Machine.cpp: (JSC::jsLess): (JSC::jsLessEq): (JSC::BytecodeInterpreter::resolve): (JSC::BytecodeInterpreter::resolveSkip): (JSC::BytecodeInterpreter::resolveGlobal): (JSC::BytecodeInterpreter::resolveBase): (JSC::BytecodeInterpreter::resolveBaseAndProperty): (JSC::BytecodeInterpreter::resolveBaseAndFunc): (JSC::BytecodeInterpreter::slideRegisterWindowForCall): (JSC::BytecodeInterpreter::callEval): (JSC::BytecodeInterpreter::BytecodeInterpreter): (JSC::BytecodeInterpreter::initialize): (JSC::BytecodeInterpreter::~BytecodeInterpreter): (JSC::BytecodeInterpreter::dumpCallFrame): (JSC::BytecodeInterpreter::dumpRegisters): (JSC::BytecodeInterpreter::isOpcode): (JSC::BytecodeInterpreter::unwindCallFrame): (JSC::BytecodeInterpreter::throwException): (JSC::BytecodeInterpreter::execute): (JSC::BytecodeInterpreter::debug): (JSC::BytecodeInterpreter::resetTimeoutCheck): (JSC::BytecodeInterpreter::checkTimeout): (JSC::BytecodeInterpreter::createExceptionScope): (JSC::BytecodeInterpreter::tryCachePutByID): (JSC::BytecodeInterpreter::uncachePutByID): (JSC::BytecodeInterpreter::tryCacheGetByID): (JSC::BytecodeInterpreter::uncacheGetByID): (JSC::BytecodeInterpreter::privateExecute): (JSC::BytecodeInterpreter::retrieveArguments): (JSC::BytecodeInterpreter::retrieveCaller): (JSC::BytecodeInterpreter::retrieveLastCaller): (JSC::BytecodeInterpreter::findFunctionCallFrame): (JSC::BytecodeInterpreter::tryCTICachePutByID): (JSC::BytecodeInterpreter::tryCTICacheGetByID): (JSC::BytecodeInterpreter::cti_op_convert_this): (JSC::BytecodeInterpreter::cti_op_end): (JSC::BytecodeInterpreter::cti_op_add): (JSC::BytecodeInterpreter::cti_op_pre_inc): (JSC::BytecodeInterpreter::cti_timeout_check): (JSC::BytecodeInterpreter::cti_register_file_check): (JSC::BytecodeInterpreter::cti_op_loop_if_less): (JSC::BytecodeInterpreter::cti_op_loop_if_lesseq): (JSC::BytecodeInterpreter::cti_op_new_object): (JSC::BytecodeInterpreter::cti_op_put_by_id): (JSC::BytecodeInterpreter::cti_op_put_by_id_second): (JSC::BytecodeInterpreter::cti_op_put_by_id_generic): (JSC::BytecodeInterpreter::cti_op_put_by_id_fail): (JSC::BytecodeInterpreter::cti_op_get_by_id): (JSC::BytecodeInterpreter::cti_op_get_by_id_second): (JSC::BytecodeInterpreter::cti_op_get_by_id_generic): (JSC::BytecodeInterpreter::cti_op_get_by_id_fail): (JSC::BytecodeInterpreter::cti_op_instanceof): (JSC::BytecodeInterpreter::cti_op_del_by_id): (JSC::BytecodeInterpreter::cti_op_mul): (JSC::BytecodeInterpreter::cti_op_new_func): (JSC::BytecodeInterpreter::cti_op_call_JSFunction): (JSC::BytecodeInterpreter::cti_op_call_arityCheck): (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall): (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall): (JSC::BytecodeInterpreter::cti_op_push_activation): (JSC::BytecodeInterpreter::cti_op_call_NotJSFunction): (JSC::BytecodeInterpreter::cti_op_create_arguments): (JSC::BytecodeInterpreter::cti_op_create_arguments_no_params): (JSC::BytecodeInterpreter::cti_op_tear_off_activation): (JSC::BytecodeInterpreter::cti_op_tear_off_arguments): (JSC::BytecodeInterpreter::cti_op_profile_will_call): (JSC::BytecodeInterpreter::cti_op_profile_did_call): (JSC::BytecodeInterpreter::cti_op_ret_scopeChain): (JSC::BytecodeInterpreter::cti_op_new_array): (JSC::BytecodeInterpreter::cti_op_resolve): (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct): (JSC::BytecodeInterpreter::cti_op_construct_NotJSConstruct): (JSC::BytecodeInterpreter::cti_op_get_by_val): (JSC::BytecodeInterpreter::cti_op_resolve_func): (JSC::BytecodeInterpreter::cti_op_sub): (JSC::BytecodeInterpreter::cti_op_put_by_val): (JSC::BytecodeInterpreter::cti_op_put_by_val_array): (JSC::BytecodeInterpreter::cti_op_lesseq): (JSC::BytecodeInterpreter::cti_op_loop_if_true): (JSC::BytecodeInterpreter::cti_op_negate): (JSC::BytecodeInterpreter::cti_op_resolve_base): (JSC::BytecodeInterpreter::cti_op_resolve_skip): (JSC::BytecodeInterpreter::cti_op_resolve_global): (JSC::BytecodeInterpreter::cti_op_div): (JSC::BytecodeInterpreter::cti_op_pre_dec): (JSC::BytecodeInterpreter::cti_op_jless): (JSC::BytecodeInterpreter::cti_op_not): (JSC::BytecodeInterpreter::cti_op_jtrue): (JSC::BytecodeInterpreter::cti_op_post_inc): (JSC::BytecodeInterpreter::cti_op_eq): (JSC::BytecodeInterpreter::cti_op_lshift): (JSC::BytecodeInterpreter::cti_op_bitand): (JSC::BytecodeInterpreter::cti_op_rshift): (JSC::BytecodeInterpreter::cti_op_bitnot): (JSC::BytecodeInterpreter::cti_op_resolve_with_base): (JSC::BytecodeInterpreter::cti_op_new_func_exp): (JSC::BytecodeInterpreter::cti_op_mod): (JSC::BytecodeInterpreter::cti_op_less): (JSC::BytecodeInterpreter::cti_op_neq): (JSC::BytecodeInterpreter::cti_op_post_dec): (JSC::BytecodeInterpreter::cti_op_urshift): (JSC::BytecodeInterpreter::cti_op_bitxor): (JSC::BytecodeInterpreter::cti_op_new_regexp): (JSC::BytecodeInterpreter::cti_op_bitor): (JSC::BytecodeInterpreter::cti_op_call_eval): (JSC::BytecodeInterpreter::cti_op_throw): (JSC::BytecodeInterpreter::cti_op_get_pnames): (JSC::BytecodeInterpreter::cti_op_next_pname): (JSC::BytecodeInterpreter::cti_op_push_scope): (JSC::BytecodeInterpreter::cti_op_pop_scope): (JSC::BytecodeInterpreter::cti_op_typeof): (JSC::BytecodeInterpreter::cti_op_is_undefined): (JSC::BytecodeInterpreter::cti_op_is_boolean): (JSC::BytecodeInterpreter::cti_op_is_number): (JSC::BytecodeInterpreter::cti_op_is_string): (JSC::BytecodeInterpreter::cti_op_is_object): (JSC::BytecodeInterpreter::cti_op_is_function): (JSC::BytecodeInterpreter::cti_op_stricteq): (JSC::BytecodeInterpreter::cti_op_nstricteq): (JSC::BytecodeInterpreter::cti_op_to_jsnumber): (JSC::BytecodeInterpreter::cti_op_in): (JSC::BytecodeInterpreter::cti_op_push_new_scope): (JSC::BytecodeInterpreter::cti_op_jmp_scopes): (JSC::BytecodeInterpreter::cti_op_put_by_index): (JSC::BytecodeInterpreter::cti_op_switch_imm): (JSC::BytecodeInterpreter::cti_op_switch_char): (JSC::BytecodeInterpreter::cti_op_switch_string): (JSC::BytecodeInterpreter::cti_op_del_by_val): (JSC::BytecodeInterpreter::cti_op_put_getter): (JSC::BytecodeInterpreter::cti_op_put_setter): (JSC::BytecodeInterpreter::cti_op_new_error): (JSC::BytecodeInterpreter::cti_op_debug): (JSC::BytecodeInterpreter::cti_vm_throw):
  • VM/Machine.h:
  • VM/Register.h:
  • VM/SamplingTool.cpp: (JSC::SamplingTool::run):
  • VM/SamplingTool.h: (JSC::SamplingTool::SamplingTool):
  • bytecompiler/CodeGenerator.cpp: (JSC::CodeGenerator::generate): (JSC::CodeGenerator::CodeGenerator): (JSC::CodeGenerator::emitOpcode):
  • debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::evaluate):
  • jsc.cpp: (runWithScripts):
  • parser/Nodes.cpp: (JSC::ScopeNode::ScopeNode):
  • profiler/ProfileGenerator.cpp: (JSC::ProfileGenerator::addParentForConsoleStart):
  • runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncPop): (JSC::arrayProtoFuncPush):
  • runtime/Collector.cpp: (JSC::Heap::collect):
  • runtime/ExecState.h: (JSC::ExecState::interpreter):
  • runtime/FunctionPrototype.cpp: (JSC::functionProtoFuncApply):
  • runtime/Interpreter.cpp: (JSC::Interpreter::evaluate):
  • runtime/JSCell.h:
  • runtime/JSFunction.cpp: (JSC::JSFunction::call): (JSC::JSFunction::argumentsGetter): (JSC::JSFunction::callerGetter): (JSC::JSFunction::construct):
  • runtime/JSFunction.h:
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::~JSGlobalData):
  • runtime/JSGlobalData.h:
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::~JSGlobalObject): (JSC::JSGlobalObject::setTimeoutTime): (JSC::JSGlobalObject::startTimeoutCheck): (JSC::JSGlobalObject::stopTimeoutCheck): (JSC::JSGlobalObject::mark):
  • runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncEval):
  • runtime/JSString.h:
  • runtime/RegExp.cpp: (JSC::RegExp::RegExp):

JavaScriptGlue:

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

Reviewed by Sam Weinig.


Updated for JavaScriptCore renames.

  • JSRun.cpp: (JSRun::Evaluate): (JSRun::CheckSyntax):

WebCore:

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

Reviewed by Sam Weinig.


Updated for JavaScriptCore renames.

  • bindings/js/JSNodeCustom.cpp: (WebCore::JSNode::mark):
  • bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::send):
  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluate):
  • bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::evaluate):
  • bindings/objc/WebScriptObject.mm: (-[WebScriptObject evaluateWebScript:]):
  • bridge/NP_jsobject.cpp: (_NPN_Evaluate):
  • bridge/jni/jni_jsobject.mm: (JavaJSObject::eval):
  • page/Console.cpp: (WebCore::retrieveLastCaller): (WebCore::Console::trace):

WebKit/win:

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

Reviewed by Sam Weinig.


Updated for JavaScriptCore renames.

  • WebScriptCallFrame.cpp: (WebScriptCallFrame::valueByEvaluatingJavaScriptFromString):
File:
1 edited

Legend:

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

    r38349 r38423  
    182182void CodeBlock::printStructureIDs(const Instruction* vPC) const
    183183{
    184     Machine* machine = globalData->machine;
     184    BytecodeInterpreter* interpreter = globalData->interpreter;
    185185    unsigned instructionOffset = vPC - instructions.begin();
    186186
    187     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id)) {
     187    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id)) {
    188188        printStructureID("get_by_id", vPC, 4);
    189189        return;
    190190    }
    191     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_self)) {
     191    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self)) {
    192192        printStructureID("get_by_id_self", vPC, 4);
    193193        return;
    194194    }
    195     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_proto)) {
     195    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto)) {
    196196        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(vPC[4].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structureID).UTF8String().c_str());
    197197        return;
    198198    }
    199     if (vPC[0].u.opcode == machine->getOpcode(op_put_by_id_transition)) {
     199    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
    200200        printf("  [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_new", pointerToSourceString(vPC[4].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[6].u.structureIDChain).UTF8String().c_str());
    201201        return;
    202202    }
    203     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_chain)) {
     203    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain)) {
    204204        printf("  [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(vPC[4].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structureIDChain).UTF8String().c_str());
    205205        return;
    206206    }
    207     if (vPC[0].u.opcode == machine->getOpcode(op_put_by_id)) {
     207    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id)) {
    208208        printStructureID("put_by_id", vPC, 4);
    209209        return;
    210210    }
    211     if (vPC[0].u.opcode == machine->getOpcode(op_put_by_id_replace)) {
     211    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
    212212        printStructureID("put_by_id_replace", vPC, 4);
    213213        return;
    214214    }
    215     if (vPC[0].u.opcode == machine->getOpcode(op_resolve_global)) {
     215    if (vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global)) {
    216216        printStructureID("resolve_global", vPC, 4);
    217217        return;
     
    219219
    220220    // These instructions doesn't ref StructureIDs.
    221     ASSERT(vPC[0].u.opcode == machine->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_call) || vPC[0].u.opcode == machine->getOpcode(op_call_eval) || vPC[0].u.opcode == machine->getOpcode(op_construct));
     221    ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_call) || vPC[0].u.opcode == interpreter->getOpcode(op_call_eval) || vPC[0].u.opcode == interpreter->getOpcode(op_construct));
    222222}
    223223
     
    229229    size_t instructionCount = 0;
    230230    for (Vector<Instruction>::const_iterator it = begin; it != end; ++it)
    231         if (exec->machine()->isOpcode(it->u.opcode))
     231        if (exec->interpreter()->isOpcode(it->u.opcode))
    232232            ++instructionCount;
    233233
     
    360360{
    361361    int location = it - begin;
    362     switch (exec->machine()->getOpcodeID(it->u.opcode)) {
     362    switch (exec->interpreter()->getOpcodeID(it->u.opcode)) {
    363363        case op_enter: {
    364364            printf("[%4d] enter\n", location);
     
    989989void CodeBlock::derefStructureIDs(Instruction* vPC) const
    990990{
    991     Machine* machine = globalData->machine;
    992 
    993     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_self)) {
     991    BytecodeInterpreter* interpreter = globalData->interpreter;
     992
     993    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self)) {
    994994        vPC[4].u.structureID->deref();
    995995        return;
    996996    }
    997     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_proto)) {
     997    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto)) {
    998998        vPC[4].u.structureID->deref();
    999999        vPC[5].u.structureID->deref();
    10001000        return;
    10011001    }
    1002     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_chain)) {
     1002    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain)) {
    10031003        vPC[4].u.structureID->deref();
    10041004        vPC[5].u.structureIDChain->deref();
    10051005        return;
    10061006    }
    1007     if (vPC[0].u.opcode == machine->getOpcode(op_put_by_id_transition)) {
     1007    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
    10081008        vPC[4].u.structureID->deref();
    10091009        vPC[5].u.structureID->deref();
     
    10111011        return;
    10121012    }
    1013     if (vPC[0].u.opcode == machine->getOpcode(op_put_by_id_replace)) {
     1013    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
    10141014        vPC[4].u.structureID->deref();
    10151015        return;
    10161016    }
    1017     if (vPC[0].u.opcode == machine->getOpcode(op_resolve_global)) {
     1017    if (vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global)) {
    10181018        if(vPC[4].u.structureID)
    10191019            vPC[4].u.structureID->deref();
     
    10221022   
    10231023    // These instructions don't ref their StructureIDs.
    1024     ASSERT(vPC[0].u.opcode == machine->getOpcode(op_get_by_id) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id) || vPC[0].u.opcode == machine->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_get_array_length) || vPC[0].u.opcode == machine->getOpcode(op_get_string_length));
     1024    ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_get_array_length) || vPC[0].u.opcode == interpreter->getOpcode(op_get_string_length));
    10251025}
    10261026
    10271027void CodeBlock::refStructureIDs(Instruction* vPC) const
    10281028{
    1029     Machine* machine = globalData->machine;
    1030 
    1031     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_self)) {
     1029    BytecodeInterpreter* interpreter = globalData->interpreter;
     1030
     1031    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self)) {
    10321032        vPC[4].u.structureID->ref();
    10331033        return;
    10341034    }
    1035     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_proto)) {
     1035    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto)) {
    10361036        vPC[4].u.structureID->ref();
    10371037        vPC[5].u.structureID->ref();
    10381038        return;
    10391039    }
    1040     if (vPC[0].u.opcode == machine->getOpcode(op_get_by_id_chain)) {
     1040    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain)) {
    10411041        vPC[4].u.structureID->ref();
    10421042        vPC[5].u.structureIDChain->ref();
    10431043        return;
    10441044    }
    1045     if (vPC[0].u.opcode == machine->getOpcode(op_put_by_id_transition)) {
     1045    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
    10461046        vPC[4].u.structureID->ref();
    10471047        vPC[5].u.structureID->ref();
     
    10491049        return;
    10501050    }
    1051     if (vPC[0].u.opcode == machine->getOpcode(op_put_by_id_replace)) {
     1051    if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
    10521052        vPC[4].u.structureID->ref();
    10531053        return;
     
    10551055   
    10561056    // These instructions don't ref their StructureIDs.
    1057     ASSERT(vPC[0].u.opcode == machine->getOpcode(op_get_by_id) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id) || vPC[0].u.opcode == machine->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == machine->getOpcode(op_put_by_id_generic));
     1057    ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic));
    10581058}
    10591059
Note: See TracChangeset for help on using the changeset viewer.