Ignore:
Timestamp:
Mar 2, 2014, 9:42:29 PM (11 years ago)
Author:
[email protected]
Message:

Debugging improvements from my gbemu investigation session
https://bugs.webkit.org/show_bug.cgi?id=129599

Reviewed by Mark Lam.

Various improvements from when I was investigating bug 129411.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::optimizationThresholdScalingFactor): Make the dataLog() statement print the actual multiplier.

  • jsc.cpp:

(GlobalObject::finishCreation):
(functionDescribe): Make describe() return a string rather than printing the string.
(functionDescribeArray): Like describe(), but prints details about arrays.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r164812 r164970  
    219219static EncodedJSValue JSC_HOST_CALL functionDebug(ExecState*);
    220220static EncodedJSValue JSC_HOST_CALL functionDescribe(ExecState*);
     221static EncodedJSValue JSC_HOST_CALL functionDescribeArray(ExecState*);
    221222static EncodedJSValue JSC_HOST_CALL functionJSCStack(ExecState*);
    222223static EncodedJSValue JSC_HOST_CALL functionGCAndSweep(ExecState*);
     
    344345        addFunction(vm, "debug", functionDebug, 1);
    345346        addFunction(vm, "describe", functionDescribe, 1);
     347        addFunction(vm, "describeArray", functionDescribeArray, 1);
    346348        addFunction(vm, "print", functionPrint, 1);
    347349        addFunction(vm, "quit", functionQuit, 0);
     
    463465EncodedJSValue JSC_HOST_CALL functionDescribe(ExecState* exec)
    464466{
    465     fprintf(stderr, "--> %s\n", toCString(exec->argument(0)).data());
    466     return JSValue::encode(jsUndefined());
     467    if (exec->argumentCount() < 1)
     468        return JSValue::encode(jsUndefined());
     469    return JSValue::encode(jsString(exec, toString(exec->argument(0))));
     470}
     471
     472EncodedJSValue JSC_HOST_CALL functionDescribeArray(ExecState* exec)
     473{
     474    if (exec->argumentCount() < 1)
     475        return JSValue::encode(jsUndefined());
     476    JSObject* object = jsDynamicCast<JSObject*>(exec->argument(0));
     477    if (!object)
     478        return JSValue::encode(jsString(exec, "<not object>"));
     479    return JSValue::encode(jsString(exec, toString("<Public length: ", object->getArrayLength(), "; vector length: ", object->getVectorLength(), ">")));
    467480}
    468481
Note: See TracChangeset for help on using the changeset viewer.