Diff
Modified: trunk/LayoutTests/ChangeLog (121870 => 121871)
--- trunk/LayoutTests/ChangeLog 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/ChangeLog 2012-07-04 21:36:52 UTC (rev 121871)
@@ -1,3 +1,26 @@
+2012-07-04 Anthony Scian <[email protected]>
+
+ Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
+ https://bugs.webkit.org/show_bug.cgi?id=40118
+
+ Reviewed by Yong Li.
+
+ Updated test results now that createScriptCallStack is functional.
+
+ * http/tests/inspector/console-resource-errors-expected.txt:
+ * http/tests/inspector/console-xhr-logging-async-expected.txt:
+ * http/tests/inspector/console-xhr-logging-expected.txt:
+ * http/tests/inspector/network/script-as-text-loading-expected.txt:
+ * inspector/timeline/timeline-animation-frame-expected.txt:
+ * inspector/timeline/timeline-layout-expected.txt:
+ * inspector/timeline/timeline-mark-timeline-expected.txt:
+ * inspector/timeline/timeline-network-resource-expected.txt:
+ * inspector/timeline/timeline-paint-expected.txt:
+ * inspector/timeline/timeline-parse-html-expected.txt:
+ * inspector/timeline/timeline-time-stamp-expected.txt:
+ * inspector/timeline/timeline-timer-expected.txt:
+ * platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt:
+
2012-07-04 Zan Dobersek <[email protected]>
Unreviewed GTK gardening, skip another two http tests that
Modified: trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt (121870 => 121871)
--- trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -4,5 +4,5 @@
GET http://127.0.0.1:8000/inspector/missing.css 404 (Not Found) console-resource-errors-iframe.html:3 console-message console-error-level
GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) non-existent-iframe.html:1 console-message console-error-level
GET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-resource-errors-iframe.html:4 console-message console-error-level
-GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) non-existent-xhr:1 console-message console-error-level
+GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) [native code]:1send [native code]:1loadXHR console-resource-errors.html:18performActions console-resource-errors.html:10eval codeeval [native code]:1_evaluateOn_evaluateAndWrapevaluate(anonymous function) [native code]:1 console-message console-error-level
Modified: trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt (121870 => 121871)
--- trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -3,6 +3,6 @@
Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled for asynchronous XHRs.
Bug 79229
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". network-test.js:39
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". [native code]:1
Done. console-xhr-logging-async.html:14
Modified: trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt (121870 => 121871)
--- trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -11,17 +11,17 @@
Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled.
sending a GET request to resources/xhr-exists.html console-xhr-logging.html:10
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html".
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". [native code]:1
sending a GET request to resources/xhr-does-not-exist.html console-xhr-logging.html:10
-GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) resources/xhr-does-not-exist.html:1
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html".
+GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) [native code]:1
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html". [native code]:1
sending a POST request to resources/post-target.cgi console-xhr-logging.html:10
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi".
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi". [native code]:1
sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html console-xhr-logging.html:10
XMLHttpRequest cannot load http://localhost:8000/inspector/resources/xhr-exists.html. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
sending a GET request to resources/xhr-exists.html console-xhr-logging.html:10
sending a GET request to resources/xhr-does-not-exist.html console-xhr-logging.html:10
-GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) resources/xhr-does-not-exist.html:1
+GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) [native code]:1
sending a POST request to resources/post-target.cgi console-xhr-logging.html:10
sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html console-xhr-logging.html:10
XMLHttpRequest cannot load http://localhost:8000/inspector/resources/xhr-exists.html. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
Modified: trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt (121870 => 121871)
--- trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -1,5 +1,5 @@
Tests console message when script is loaded with incorrect text/html mime type.
Bug 69972
-Resource interpreted as Script but transferred with MIME type text/plain: "http://127.0.0.1:8000/inspector/network/resources/script-as-text.php".
+Resource interpreted as Script but transferred with MIME type text/plain: "http://127.0.0.1:8000/inspector/network/resources/script-as-text.php". [native code]:1
Modified: trunk/LayoutTests/inspector/timeline/timeline-animation-frame-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-animation-frame-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-animation-frame-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -3,6 +3,7 @@
RequestAnimationFrame Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
id : <number>
}
@@ -29,6 +30,7 @@
CancelAnimationFrame Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
id : <number>
}
Modified: trunk/LayoutTests/inspector/timeline/timeline-layout-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-layout-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-layout-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -4,6 +4,7 @@
Layout Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
}
children : <object>
Modified: trunk/LayoutTests/inspector/timeline/timeline-mark-timeline-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-mark-timeline-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-mark-timeline-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -3,6 +3,7 @@
TimeStamp Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
message : "MARK TIMELINE"
}
Modified: trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -6,6 +6,7 @@
ResourceSendRequest Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
requestId : <string>
url : <string>
Modified: trunk/LayoutTests/inspector/timeline/timeline-paint-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-paint-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-paint-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -3,6 +3,7 @@
Paint Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
x : 0
y : 0
Modified: trunk/LayoutTests/inspector/timeline/timeline-parse-html-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-parse-html-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-parse-html-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -4,6 +4,7 @@
ParseHTML Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
length : 9
startLine : 0
@@ -20,6 +21,7 @@
ParseHTML Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
length : 1
startLine : 0
Modified: trunk/LayoutTests/inspector/timeline/timeline-time-stamp-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-time-stamp-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-time-stamp-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -3,6 +3,7 @@
TimeStamp Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
message : "TIME STAMP"
}
Modified: trunk/LayoutTests/inspector/timeline/timeline-timer-expected.txt (121870 => 121871)
--- trunk/LayoutTests/inspector/timeline/timeline-timer-expected.txt 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/LayoutTests/inspector/timeline/timeline-timer-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -3,6 +3,7 @@
TimerInstall Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
timerId : <number>
timeout : 10
@@ -17,6 +18,7 @@
TimerInstall Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
timerId : <number>
timeout : 20
@@ -73,6 +75,7 @@
TimerRemove Properties:
{
startTime : <number>
+ stackTrace : <object>
data : {
timerId : <number>
}
Copied: trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt (from rev 121870, trunk/LayoutTests/http/tests/inspector/console-xhr-logging-async-expected.txt) (0 => 121871)
--- trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt 2012-07-04 21:36:52 UTC (rev 121871)
@@ -0,0 +1,8 @@
+CONSOLE MESSAGE: line 14: Done.
+CONSOLE MESSAGE: line 14: Done.
+Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled for asynchronous XHRs.
+
+Bug 79229
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". network-test.js:39
+Done. console-xhr-logging-async.html:14
+
Modified: trunk/Source/_javascript_Core/ChangeLog (121870 => 121871)
--- trunk/Source/_javascript_Core/ChangeLog 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-07-04 21:36:52 UTC (rev 121871)
@@ -1,3 +1,22 @@
+2012-07-04 Anthony Scian <[email protected]>
+
+ Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
+ https://bugs.webkit.org/show_bug.cgi?id=40118
+
+ Reviewed by Yong Li.
+
+ Added member functions to expose function name, urlString, and line #.
+ Refactored toString to make use of these member functions to reduce
+ duplicated code for future maintenance.
+
+ Manually tested refactoring of toString by tracing thrown exceptions.
+
+ * interpreter/Interpreter.h:
+ (JSC::StackFrame::toString):
+ (JSC::StackFrame::friendlySourceURL):
+ (JSC::StackFrame::friendlyFunctionName):
+ (JSC::StackFrame::friendlyLineNumber):
+
2012-07-04 Andy Wingo <[email protected]>
[GTK] Enable parallel GC
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.h (121870 => 121871)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.h 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.h 2012-07-04 21:36:52 UTC (rev 121871)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,6 +40,7 @@
#include "RegisterFile.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringBuilder.h>
namespace JSC {
@@ -80,46 +82,64 @@
UString sourceURL;
UString toString(CallFrame* callFrame) const
{
- bool hasSourceURLInfo = !sourceURL.isNull() && !sourceURL.isEmpty();
- bool hasLineInfo = line > -1;
+ StringBuilder traceBuild;
+ String functionName = friendlyFunctionName(callFrame);
+ String sourceURL = friendlySourceURL();
+ traceBuild.append(functionName);
+ if (!sourceURL.isEmpty()) {
+ if (!functionName.isEmpty())
+ traceBuild.append('@');
+ traceBuild.append(sourceURL);
+ if (line > -1) {
+ traceBuild.append(':');
+ traceBuild.append(String::number(line));
+ }
+ }
+ return traceBuild.toString().impl();
+ }
+ String friendlySourceURL() const
+ {
String traceLine;
- JSObject* stackFrameCallee = callee.get();
switch (codeType) {
case StackFrameEvalCode:
- if (hasSourceURLInfo) {
- traceLine = hasLineInfo ? String::format("eval code@%s:%d", sourceURL.ascii().data(), line)
- : String::format("eval code@%s", sourceURL.ascii().data());
- } else
- traceLine = String::format("eval code");
+ case StackFrameFunctionCode:
+ case StackFrameGlobalCode:
+ if (!sourceURL.isEmpty())
+ traceLine = sourceURL.impl();
break;
- case StackFrameNativeCode: {
- if (callee) {
- UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee);
- traceLine = String::format("%s@[native code]", functionName.ascii().data());
- } else
- traceLine = "[native code]";
+ case StackFrameNativeCode:
+ traceLine = "[native code]";
break;
}
- case StackFrameFunctionCode: {
- UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee);
- if (hasSourceURLInfo) {
- traceLine = hasLineInfo ? String::format("%s@%s:%d", functionName.ascii().data(), sourceURL.ascii().data(), line)
- : String::format("%s@%s", functionName.ascii().data(), sourceURL.ascii().data());
- } else
- traceLine = String::format("%s\n", functionName.ascii().data());
+ return traceLine.isNull() ? emptyString() : traceLine;
+ }
+ String friendlyFunctionName(CallFrame* callFrame) const
+ {
+ String traceLine;
+ JSObject* stackFrameCallee = callee.get();
+
+ switch (codeType) {
+ case StackFrameEvalCode:
+ traceLine = "eval code";
break;
- }
+ case StackFrameNativeCode:
+ if (callee)
+ traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl();
+ break;
+ case StackFrameFunctionCode:
+ traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl();
+ break;
case StackFrameGlobalCode:
- if (hasSourceURLInfo) {
- traceLine = hasLineInfo ? String::format("global code@%s:%d", sourceURL.ascii().data(), line)
- : String::format("global code@%s", sourceURL.ascii().data());
- } else
- traceLine = String::format("global code");
-
+ traceLine = "global code";
+ break;
}
- return traceLine.impl();
+ return traceLine.isNull() ? emptyString() : traceLine;
}
+ unsigned friendlyLineNumber() const
+ {
+ return line > -1 ? line : 0;
+ }
};
class TopCallFrameSetter {
Modified: trunk/Source/WebCore/ChangeLog (121870 => 121871)
--- trunk/Source/WebCore/ChangeLog 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/Source/WebCore/ChangeLog 2012-07-04 21:36:52 UTC (rev 121871)
@@ -1,3 +1,20 @@
+2012-07-04 Anthony Scian <[email protected]>
+
+ Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
+ https://bugs.webkit.org/show_bug.cgi?id=40118
+
+ Reviewed by Yong Li.
+
+ Implemented stub for createScriptCallStack to call into
+ Interpreter and extract the current stack frames, iterate
+ through the frames and create the return result required.
+
+ No new tests, manually tested thrown exception and inspector
+ tracebacks.
+
+ * bindings/js/ScriptCallStackFactory.cpp:
+ (WebCore::createScriptCallStack):
+
2012-07-04 Dana Jansens <[email protected]>
[chromium] Respect memory needed for RenderSurfaces when reserving contents textures
Modified: trunk/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp (121870 => 121871)
--- trunk/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp 2012-07-04 20:50:54 UTC (rev 121870)
+++ trunk/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp 2012-07-04 21:36:52 UTC (rev 121871)
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -33,6 +34,7 @@
#include "InspectorInstrumentation.h"
#include "JSDOMBinding.h"
+#include "JSMainThreadExecState.h"
#include "ScriptArguments.h"
#include "ScriptCallFrame.h"
#include "ScriptCallStack.h"
@@ -51,9 +53,25 @@
class ScriptExecutionContext;
-PassRefPtr<ScriptCallStack> createScriptCallStack(size_t, bool)
+PassRefPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool emptyIsAllowed)
{
- return 0;
+ Vector<ScriptCallFrame> frames;
+ if (JSC::ExecState* exec = JSMainThreadExecState::currentState()) {
+ Vector<StackFrame> stackTrace;
+ Interpreter::getStackTrace(&exec->globalData(), stackTrace);
+ for (Vector<StackFrame>::const_iterator iter = stackTrace.begin(); iter < stackTrace.end(); iter++) {
+ frames.append(ScriptCallFrame(iter->friendlyFunctionName(exec), iter->friendlySourceURL(), iter->friendlyLineNumber()));
+ if (frames.size() >= maxStackSize)
+ break;
+ }
+ }
+ if (frames.isEmpty() && !emptyIsAllowed) {
+ // No frames found. It may happen in the case where
+ // a bound function is called from native code for example.
+ // Fallback to setting lineNumber to 0, and source and function name to "undefined".
+ frames.append(ScriptCallFrame("undefined", "undefined", 0));
+ }
+ return ScriptCallStack::create(frames);
}
PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState* exec, size_t maxStackSize)