Title: [164970] trunk/Source/_javascript_Core
Revision
164970
Author
[email protected]
Date
2014-03-02 21:42:29 -0800 (Sun, 02 Mar 2014)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (164969 => 164970)


--- trunk/Source/_javascript_Core/ChangeLog	2014-03-03 05:33:05 UTC (rev 164969)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-03-03 05:42:29 UTC (rev 164970)
@@ -1,3 +1,19 @@
+2014-03-02  Filip Pizlo  <[email protected]>
+
+        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.
+
 2014-02-25  Andreas Kling  <[email protected]>
 
         JSDOMWindow::commonVM() should return a reference.

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (164969 => 164970)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2014-03-03 05:33:05 UTC (rev 164969)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2014-03-03 05:42:29 UTC (rev 164970)
@@ -2939,13 +2939,16 @@
     ASSERT(instructionCount); // Make sure this is called only after we have an instruction stream; otherwise it'll just return the value of d, which makes no sense.
     
     double result = d + a * sqrt(instructionCount + b) + c * instructionCount;
+    
+    result *= codeTypeThresholdMultiplier();
+    
     if (Options::verboseOSR()) {
         dataLog(
             *this, ": instruction count is ", instructionCount,
             ", scaling execution counter by ", result, " * ", codeTypeThresholdMultiplier(),
             "\n");
     }
-    return result * codeTypeThresholdMultiplier();
+    return result;
 }
 
 static int32_t clipThreshold(double threshold)

Modified: trunk/Source/_javascript_Core/jsc.cpp (164969 => 164970)


--- trunk/Source/_javascript_Core/jsc.cpp	2014-03-03 05:33:05 UTC (rev 164969)
+++ trunk/Source/_javascript_Core/jsc.cpp	2014-03-03 05:42:29 UTC (rev 164970)
@@ -218,6 +218,7 @@
 static EncodedJSValue JSC_HOST_CALL functionPrint(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionDebug(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionDescribe(ExecState*);
+static EncodedJSValue JSC_HOST_CALL functionDescribeArray(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionJSCStack(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionGCAndSweep(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionFullGC(ExecState*);
@@ -343,6 +344,7 @@
         
         addFunction(vm, "debug", functionDebug, 1);
         addFunction(vm, "describe", functionDescribe, 1);
+        addFunction(vm, "describeArray", functionDescribeArray, 1);
         addFunction(vm, "print", functionPrint, 1);
         addFunction(vm, "quit", functionQuit, 0);
         addFunction(vm, "gc", functionGCAndSweep, 0);
@@ -462,10 +464,21 @@
 
 EncodedJSValue JSC_HOST_CALL functionDescribe(ExecState* exec)
 {
-    fprintf(stderr, "--> %s\n", toCString(exec->argument(0)).data());
-    return JSValue::encode(jsUndefined());
+    if (exec->argumentCount() < 1)
+        return JSValue::encode(jsUndefined());
+    return JSValue::encode(jsString(exec, toString(exec->argument(0))));
 }
 
+EncodedJSValue JSC_HOST_CALL functionDescribeArray(ExecState* exec)
+{
+    if (exec->argumentCount() < 1)
+        return JSValue::encode(jsUndefined());
+    JSObject* object = jsDynamicCast<JSObject*>(exec->argument(0));
+    if (!object)
+        return JSValue::encode(jsString(exec, "<not object>"));
+    return JSValue::encode(jsString(exec, toString("<Public length: ", object->getArrayLength(), "; vector length: ", object->getVectorLength(), ">")));
+}
+
 class FunctionJSCStackFunctor {
 public:
     FunctionJSCStackFunctor(StringBuilder& trace)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to