Changeset 34020 in webkit


Ignore:
Timestamp:
May 22, 2008 1:37:35 AM (16 years ago)
Author:
ggaren@apple.com
Message:

2008-05-22 Geoffrey Garen <ggaren@apple.com>

Reviewed by Adam Roben.


Removed the old recursion guard mechanism, since squirrelfish has its
own mechanism. Also removed some old JS call tracing code, since we
have other ways to do that, too.


SunSpider reports no change.

  • kjs/object.cpp: (KJS::JSObject::call):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34017 r34020  
     12008-05-22  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Reviewed by Adam Roben.
     4       
     5        Removed the old recursion guard mechanism, since squirrelfish has its
     6        own mechanism. Also removed some old JS call tracing code, since we
     7        have other ways to do that, too.
     8       
     9        SunSpider reports no change.
     10
     11        * kjs/object.cpp:
     12        (KJS::JSObject::call):
     13
    1142008-05-22  Maciej Stachowiak  <mjs@apple.com>
    215
  • trunk/JavaScriptCore/kjs/object.cpp

    r33979 r34020  
    3535#include <wtf/Assertions.h>
    3636
    37 // maximum global call stack size. Protects against accidental or
    38 // malicious infinite recursions. Define to -1 if you want no limit.
    39 // In real-world testing it appears ok to bump the stack depth count to 500.
    40 // This of course is dependent on stack frame size.
    41 #define KJS_MAX_STACK 500
    42 
    43 #define JAVASCRIPT_CALL_TRACING 0
    4437#define JAVASCRIPT_MARK_TRACING 0
    4538
    46 #if JAVASCRIPT_CALL_TRACING
    47 static bool _traceJavaScript = false;
    48 
    49 extern "C" {
    50     void setTraceJavaScript(bool f)
    51     {
    52         _traceJavaScript = f;
    53     }
    54 
    55     static bool traceJavaScript()
    56     {
    57         return _traceJavaScript;
    58     }
    59 }
    60 #endif
    61 
    6239namespace KJS {
    6340
     
    6744{
    6845  ASSERT(implementsCall());
    69 
    70 #if KJS_MAX_STACK > 0
    71   static int depth = 0; // sum of all extant function calls
    72 
    73 #if JAVASCRIPT_CALL_TRACING
    74     static bool tracing = false;
    75     if (traceJavaScript() && !tracing) {
    76         tracing = true;
    77         for (int i = 0; i < depth; i++)
    78             putchar (' ');
    79         printf ("*** calling:  %s\n", toString(exec).ascii());
    80         for (int j = 0; j < args.size(); j++) {
    81             for (int i = 0; i < depth; i++)
    82                 putchar (' ');
    83             printf ("*** arg[%d] = %s\n", j, args[j]->toString(exec).ascii());
    84         }
    85         tracing = false;
    86     }
    87 #endif
    88 
    89   if (++depth > KJS_MAX_STACK) {
    90     --depth;
    91     return throwError(exec, RangeError, "Maximum call stack size exceeded.");
    92   }
    93 #endif
    9446
    9547#if JAVASCRIPT_PROFILING
     
    10153#if JAVASCRIPT_PROFILING
    10254    Profiler::profiler()->didExecute(exec, this);
    103 #endif
    104 
    105 
    106 #if KJS_MAX_STACK > 0
    107   --depth;
    108 #endif
    109 
    110 #if JAVASCRIPT_CALL_TRACING
    111     if (traceJavaScript() && !tracing) {
    112         tracing = true;
    113         for (int i = 0; i < depth; i++)
    114             putchar (' ');
    115         printf ("*** returning:  %s\n", ret->toString(exec).ascii());
    116         tracing = false;
    117     }
    11855#endif
    11956
Note: See TracChangeset for help on using the changeset viewer.