Ignore:
Timestamp:
May 27, 2008, 4:25:09 PM (17 years ago)
Author:
Adam Roben
Message:

Roll out r34156, which was accidentally checked in

File:
1 edited

Legend:

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

    r34156 r34157  
    113113}
    114114
    115 static void printInstruction(const char* name, int location, const char* argumentsFormat = 0, ...)
    116 {
    117     printf("[%4d] %-20s ", location, name);
    118 
    119     if (argumentsFormat) {
    120         va_list arguments;
    121         va_start(arguments, argumentsFormat);
    122         vprintf(argumentsFormat, arguments);
    123         va_end(arguments);
    124     }
    125 
    126     printf("\n");
    127 }
    128 
    129115static void printUnaryOp(int location, Vector<Instruction>::const_iterator& it, const char* op)
    130116{
     
    132118    int r1 = (++it)->u.operand;
    133119
    134     printInstruction(op, location, "%s, %s", registerName(r0).c_str(), registerName(r1).c_str());
     120    printf("[%4d] %s\t\t %s, %s\n", location, op, registerName(r0).c_str(), registerName(r1).c_str());
    135121}
    136122
     
    140126    int r1 = (++it)->u.operand;
    141127    int r2 = (++it)->u.operand;
    142     printInstruction(op, location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
     128    printf("[%4d] %s\t\t %s, %s, %s\n", location, op, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
    143129}
    144130
     
    147133    int r0 = (++it)->u.operand;
    148134    int offset = (++it)->u.operand;
    149     printInstruction(op, location, "%s, %d(->%d)", registerName(r0).c_str(), offset, jumpTarget(begin, it, offset));
     135    printf("[%4d] %s\t\t %s, %d(->%d)\n", location, op, registerName(r0).c_str(), offset, jumpTarget(begin, it, offset));
    150136}
    151137
     
    211197            int r0 = (++it)->u.operand;
    212198            int k0 = (++it)->u.operand;
    213             printInstruction("load", location, "%s, %s", registerName(r0).c_str(), constantName(exec, k0, jsValues[k0]).c_str());
     199            printf("[%4d] load\t\t %s, %s\t\t\n", location, registerName(r0).c_str(), constantName(exec, k0, jsValues[k0]).c_str());
    214200            break;
    215201        }
    216202        case op_new_object: {
    217203            int r0 = (++it)->u.operand;
    218             printInstruction("new_object", location, "%s", registerName(r0).c_str());
     204            printf("[%4d] new_object\t %s\n", location, registerName(r0).c_str());
    219205            break;
    220206        }
    221207        case op_new_array: {
    222208            int r0 = (++it)->u.operand;
    223             printInstruction("new_array", location, "%s", registerName(r0).c_str());
     209            printf("[%4d] new_array\t %s\n", location, registerName(r0).c_str());
    224210            break;
    225211        }
     
    227213            int r0 = (++it)->u.operand;
    228214            int re0 = (++it)->u.operand;
    229             printInstruction("new_regexp", location, "%s, %s", registerName(r0).c_str(), regexpName(re0, regexps[re0].get()).c_str());
     215            printf("[%4d] new_regexp\t %s, %s\n", location, registerName(r0).c_str(), regexpName(re0, regexps[re0].get()).c_str());
    230216            break;
    231217        }
     
    233219            int r0 = (++it)->u.operand;
    234220            int r1 = (++it)->u.operand;
    235             printInstruction("mov", location, "%s, %s", registerName(r0).c_str(), registerName(r1).c_str());
     221            printf("[%4d] mov\t\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str());
    236222            break;
    237223        }
     
    266252        case op_pre_inc: {
    267253            int r0 = (++it)->u.operand;
    268             printInstruction("pre_inc", location, "%s", registerName(r0).c_str());
     254            printf("[%4d] pre_inc\t\t %s\n", location, registerName(r0).c_str());
    269255            break;
    270256        }
    271257        case op_pre_dec: {
    272258            int r0 = (++it)->u.operand;
    273             printInstruction("pre_dec", location, "%s", registerName(r0).c_str());
     259            printf("[%4d] pre_dec\t\t %s\n", location, registerName(r0).c_str());
    274260            break;
    275261        }
     
    353339            int r0 = (++it)->u.operand;
    354340            int id0 = (++it)->u.operand;
    355             printInstruction("resolve", location, "%s, %s", registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str());
     341            printf("[%4d] resolve\t\t %s, %s\n", location, registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str());
    356342            break;
    357343        }
     
    360346            int id0 = (++it)->u.operand;
    361347            int skipLevels = (++it)->u.operand;
    362             printInstruction("resolve_skip", location, "%s, %s, %d", registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), skipLevels);
     348            printf("[%4d] resolve_skip\t %s, %s, %d\n", location, registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), skipLevels);
    363349            break;
    364350        }
     
    367353            int index = (++it)->u.operand;
    368354            int skipLevels = (++it)->u.operand;
    369             printInstruction("get_scoped_var", location, "%s, %d, %d", registerName(r0).c_str(), index, skipLevels);
     355            printf("[%4d] get_scoped_var\t\t %s, %d, %d\n", location, registerName(r0).c_str(), index, skipLevels);
    370356            break;
    371357        }
     
    374360            int skipLevels = (++it)->u.operand;
    375361            int r0 = (++it)->u.operand;
    376             printInstruction("put_scoped_var", location, "%d, %d, %s", index, skipLevels, registerName(r0).c_str());
     362            printf("[%4d] put_scoped_var\t\t %d, %d, %s\n", location, index, skipLevels, registerName(r0).c_str());
    377363            break;
    378364        }
     
    380366            int r0 = (++it)->u.operand;
    381367            int id0 = (++it)->u.operand;
    382             printInstruction("resolve_base", location, "%s, %s", registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str());
     368            printf("[%4d] resolve_base\t %s, %s\n", location, registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str());
    383369            break;
    384370        }
     
    387373            int r1 = (++it)->u.operand;
    388374            int id0 = (++it)->u.operand;
    389             printInstruction("resolve_with_base", location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
     375            printf("[%4d] resolve_with_base %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
    390376            break;
    391377        }
     
    394380            int r1 = (++it)->u.operand;
    395381            int id0 = (++it)->u.operand;
    396             printInstruction("resolve_func", location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
     382            printf("[%4d] resolve_func\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
    397383            break;
    398384        }
     
    401387            int r1 = (++it)->u.operand;
    402388            int id0 = (++it)->u.operand;
    403             printInstruction("get_by_id", location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
     389            printf("[%4d] get_by_id\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
    404390            break;
    405391        }
     
    408394            int id0 = (++it)->u.operand;
    409395            int r1 = (++it)->u.operand;
    410             printInstruction("put_by_id", location, "%s, %s, %s", registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), registerName(r1).c_str());
     396            printf("[%4d] put_by_id\t %s, %s, %s\n", location, registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), registerName(r1).c_str());
    411397            break;
    412398        }
     
    415401            int id0 = (++it)->u.operand;
    416402            int r1 = (++it)->u.operand;
    417             printInstruction("put_getter", location, "%s, %s, %s", registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), registerName(r1).c_str());
     403            printf("[%4d] put_getter\t %s, %s, %s\n", location, registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), registerName(r1).c_str());
    418404            break;
    419405        }
     
    422408            int id0 = (++it)->u.operand;
    423409            int r1 = (++it)->u.operand;
    424             printInstruction("put_setter", location, "%s, %s, %s", registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), registerName(r1).c_str());
     410            printf("[%4d] put_setter\t %s, %s, %s\n", location, registerName(r0).c_str(), idName(id0, identifiers[id0]).c_str(), registerName(r1).c_str());
    425411            break;
    426412        }
     
    429415            int r1 = (++it)->u.operand;
    430416            int id0 = (++it)->u.operand;
    431             printInstruction("del_by_id", location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
     417            printf("[%4d] del_by_id\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, identifiers[id0]).c_str());
    432418            break;
    433419        }
     
    436422            int r1 = (++it)->u.operand;
    437423            int r2 = (++it)->u.operand;
    438             printInstruction("get_by_val", location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
     424            printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
    439425            break;
    440426        }
     
    443429            int r1 = (++it)->u.operand;
    444430            int r2 = (++it)->u.operand;
    445             printInstruction("put_by_val", location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
     431            printf("[%4d] put_by_val\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
    446432            break;
    447433        }
     
    450436            int r1 = (++it)->u.operand;
    451437            int r2 = (++it)->u.operand;
    452             printInstruction("del_by_val", location, "%s, %s, %s", registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
     438            printf("[%4d] del_by_val\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str());
    453439            break;
    454440        }
     
    457443            unsigned n0 = (++it)->u.operand;
    458444            int r1 = (++it)->u.operand;
    459             printInstruction("put_by_index", location, "%s, %u, %s", registerName(r0).c_str(), n0, registerName(r1).c_str());
     445            printf("[%4d] put_by_index\t %s, %u, %s\n", location, registerName(r0).c_str(), n0, registerName(r1).c_str());
    460446            break;
    461447        }
    462448        case op_jmp: {
    463449            int offset = (++it)->u.operand;
    464             printInstruction("jmp", location, "%d(->%d)", offset, jumpTarget(begin, it, offset));
     450            printf("[%4d] jmp\t\t %d(->%d)\n", location, offset, jumpTarget(begin, it, offset));
    465451            break;
    466452        }
     
    476462            int r0 = (++it)->u.operand;
    477463            int f0 = (++it)->u.operand;
    478             printInstruction("new_func", location, "%s, f%d", registerName(r0).c_str(), f0);
     464            printf("[%4d] new_func\t\t %s, f%d\n", location, registerName(r0).c_str(), f0);
    479465            break;
    480466        }
     
    482468            int r0 = (++it)->u.operand;
    483469            int f0 = (++it)->u.operand;
    484             printInstruction("new_func_exp", location, "%s, f%d", registerName(r0).c_str(), f0);
     470            printf("[%4d] new_func_exp\t %s, f%d\n", location, registerName(r0).c_str(), f0);
    485471            break;
    486472        }
     
    491477            int tempCount = (++it)->u.operand;
    492478            int argCount = (++it)->u.operand;
    493             printInstruction("call", location, "%s, %s, %s, %d, %d", registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), tempCount, argCount);
     479            printf("[%4d] call\t\t %s, %s, %s, %d, %d\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), tempCount, argCount);
    494480            break;
    495481        }
     
    500486            int tempCount = (++it)->u.operand;
    501487            int argCount = (++it)->u.operand;
    502             printInstruction("call_eval", location, "%s, %s, %s, %d, %d", registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), tempCount, argCount);
     488            printf("[%4d] call_eval\t\t %s, %s, %s, %d, %d\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), tempCount, argCount);
    503489            break;
    504490        }
    505491        case op_ret: {
    506492            int r0 = (++it)->u.operand;
    507             printInstruction("ret", location, "%s", registerName(r0).c_str());
     493            printf("[%4d] ret\t\t %s\n", location, registerName(r0).c_str());
    508494            break;
    509495        }
     
    513499            int tempCount = (++it)->u.operand;
    514500            int argCount = (++it)->u.operand;
    515             printInstruction("construct", location, "%s, %s, %d, %d", registerName(r0).c_str(), registerName(r1).c_str(), tempCount, argCount);
     501            printf("[%4d] construct\t %s, %s, %d, %d\n", location, registerName(r0).c_str(), registerName(r1).c_str(), tempCount, argCount);
    516502            break;
    517503        }
     
    519505            int r0 = (++it)->u.operand;
    520506            int r1 = (++it)->u.operand;
    521             printInstruction("get_pnames", location, "%s, %s", registerName(r0).c_str(), registerName(r1).c_str());
     507            printf("[%4d] get_pnames\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str());
    522508            break;
    523509        }
     
    526512            int iter = (++it)->u.operand;
    527513            int offset = (++it)->u.operand;
    528             printInstruction("next_pname", location, "%s, %s, %d(->%d)", registerName(dest).c_str(), registerName(iter).c_str(), offset, jumpTarget(begin, it, offset));
     514            printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(dest).c_str(), registerName(iter).c_str(), offset, jumpTarget(begin, it, offset));
    529515            break;
    530516        }
    531517        case op_push_scope: {
    532518            int r0 = (++it)->u.operand;
    533             printInstruction("push_scope", location, "%s", registerName(r0).c_str());
     519            printf("[%4d] push_scope\t %s\n", location, registerName(r0).c_str());
    534520            break;
    535521        }
    536522        case op_pop_scope: {
    537             printInstruction("pop_scope", location);
     523            printf("[%4d] pop_scope\n", location);
    538524            break;
    539525        }
     
    541527            int scopeDelta = (++it)->u.operand;
    542528            int offset = (++it)->u.operand;
    543             printInstruction("jmp_scopes", location, "^%d, %d(->%d)", scopeDelta, offset, jumpTarget(begin, it, offset));
     529            printf("[%4d] jmp_scopes\t^%d, %d(->%d)\n", location, scopeDelta, offset, jumpTarget(begin, it, offset));
    544530            break;
    545531        }
    546532        case op_catch: {
    547533            int r0 = (++it)->u.operand;
    548             printInstruction("catch", location, "%s", registerName(r0).c_str());
     534            printf("[%4d] catch\t\t %s\n", location, registerName(r0).c_str());
    549535            break;
    550536        }
    551537        case op_throw: {
    552538            int r0 = (++it)->u.operand;
    553             printInstruction("throw", location, "%s", registerName(r0).c_str());
     539            printf("[%4d] throw\t\t %s\n", location, registerName(r0).c_str());
    554540            break;
    555541        }
     
    558544            int errorType = (++it)->u.operand;
    559545            int k0 = (++it)->u.operand;
    560             printInstruction("new_error", location, "%s, %d, %s", registerName(r0).c_str(), errorType, constantName(exec, k0, jsValues[k0]).c_str());
     546            printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(r0).c_str(), errorType, constantName(exec, k0, jsValues[k0]).c_str());
    561547            break;
    562548        }
     
    564550            int retAddrDst = (++it)->u.operand;
    565551            int offset = (++it)->u.operand;
    566             printInstruction("jsr", location, "%s, %d(->%d)", registerName(retAddrDst).c_str(), offset, jumpTarget(begin, it, offset));
     552            printf("[%4d] jsr\t\t %s, %d(->%d)\n", location, registerName(retAddrDst).c_str(), offset, jumpTarget(begin, it, offset));
    567553            break;
    568554        }
    569555        case op_sret: {
    570556            int retAddrSrc = (++it)->u.operand;
    571             printInstruction("sret", location, "%s", registerName(retAddrSrc).c_str());
     557            printf("[%4d] sret\t\t %s\n", location, registerName(retAddrSrc).c_str());
    572558            break;
    573559        }
     
    576562            int firstLine = (++it)->u.operand;
    577563            int lastLine = (++it)->u.operand;
    578             printInstruction("debug", location, "%s, %d, %d", debugHookName(debugHookID), firstLine, lastLine);
     564            printf("[%4d] debug\t\t %s, %d, %d\n", location, debugHookName(debugHookID), firstLine, lastLine);
    579565            break;
    580566        }
    581567        case op_end: {
    582568            int r0 = (++it)->u.operand;
    583             printInstruction("end", location, "%s", registerName(r0).c_str());
     569            printf("[%4d] end\t\t %s\n", location, registerName(r0).c_str());
    584570            break;
    585571        }
Note: See TracChangeset for help on using the changeset viewer.