[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kjs
From: Maks Orlovich <maksim () kde ! org>
Date: 2009-02-14 23:45:55
Message-ID: 1234655155.263435.23418.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 926289 by orlovich:
Merged revision 926165:
- Better tracing of this assert
- Remove tracing stuff that's redundant with KJS_VERBOSE
M +10 -44 object.cpp
--- trunk/KDE/kdelibs/kjs/object.cpp #926288:926289
@@ -33,6 +33,8 @@
#include "PropertyNameArray.h"
#include <math.h>
+#include <typeinfo>
+
// maximum global call stack size. Protects against accidental or
// malicious infinite recursions. Define to -1 if you want no limit.
#if PLATFORM(DARWIN)
@@ -43,25 +45,9 @@
#define KJS_MAX_STACK 900
#endif
-#define JAVASCRIPT_CALL_TRACING 0
+
#define JAVASCRIPT_MARK_TRACING 0
-#if JAVASCRIPT_CALL_TRACING
-static bool _traceJavaScript = false;
-
-extern "C" {
- void setTraceJavaScript(bool f)
- {
- _traceJavaScript = f;
- }
-
- static bool traceJavaScript()
- {
- return _traceJavaScript;
- }
-}
-#endif
-
namespace KJS {
// ------------------------------ Object ---------------------------------------
@@ -73,22 +59,6 @@
#if KJS_MAX_STACK > 0
static int depth = 0; // sum of all concurrent interpreters
-#if JAVASCRIPT_CALL_TRACING
- static bool tracing = false;
- if (traceJavaScript() && !tracing) {
- tracing = true;
- for (int i = 0; i < depth; i++)
- putchar (' ');
- printf ("*** calling: %s\n", toString(exec).ascii());
- for (int j = 0; j < args.size(); j++) {
- for (int i = 0; i < depth; i++)
- putchar (' ');
- printf ("*** arg[%d] = %s\n", j, args[j]->toString(exec).ascii());
- }
- tracing = false;
- }
-#endif
-
if (++depth > KJS_MAX_STACK) {
depth -= 11; //Give the debugger some room..
return throwError(exec, RangeError, "Maximum call stack size exceeded.");
@@ -97,22 +67,18 @@
#endif
JSValue *ret = callAsFunction(exec,thisObj,args);
- assert(ret);
+#ifndef NDEBUG
+ if (!ret) {
+ fprintf(stderr, "callAsFunction returned 0 on:%s\n", typeid(*this).name());
+ assert(ret);
+ }
+#endif
+
#if KJS_MAX_STACK > 0
--depth;
#endif
-#if JAVASCRIPT_CALL_TRACING
- if (traceJavaScript() && !tracing) {
- tracing = true;
- for (int i = 0; i < depth; i++)
- putchar (' ');
- printf ("*** returning: %s\n", ret->toString(exec).ascii());
- tracing = false;
- }
-#endif
-
return ret;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic