Changeset 28468 in webkit for trunk/JavaScriptCore/kjs/object.cpp


Ignore:
Timestamp:
Dec 5, 2007, 6:31:41 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and
functions accessing data members from Interpreter to JSGlobalObject.
Changed Interpreter member functions to static functions.


This resolves a bug in global object bootstrapping, where the global
ExecState could be used when uninitialized.


This is a big change, but it's mostly code motion and renaming.


Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
a .7% regression, but Shark sees no difference related to this patch,
and SunSpider reported a .7% speedup from an earlier step in this
refactoring, so I think it's fair to call that a wash.

JavaScriptGlue:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject. Replaced JSInterpreter
subclass with JSGlobalObject subclass.


  • JSRun.cpp: (JSRun::JSRun): (JSRun::Evaluate): (JSRun::CheckSyntax):
  • JSRun.h: (JSGlueGlobalObject::JSGlueGlobalObject):
  • JSUtils.cpp: (KJSValueToCFTypeInternal):
  • JSValueWrapper.cpp: (getThreadGlobalExecState):

WebCore:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject. Changed Interpreter
member functions to static functions. Same for the subclass,
ScriptInterpreter.


This is a big change, but it's mostly code motion and renaming.

WebKit/mac:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject.


  • WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]):

WebKit/win:

Reviewed by Darin Adler.

Third step in refactoring JSGlobalObject: Moved data members and data
member access from Interpreter to JSGlobalObject.


  • WebFrame.cpp: (WebFrame::globalContext): (WebFrame::attachScriptDebugger): (WebFrame::windowObjectCleared):
  • WebScriptDebugger.cpp: (WebScriptDebugger::WebScriptDebugger):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/object.cpp

    r28110 r28468  
    6969
    7070#if KJS_MAX_STACK > 0
    71   static int depth = 0; // sum of all concurrent interpreters
     71  static int depth = 0; // sum of all extant function calls
    7272
    7373#if JAVASCRIPT_CALL_TRACING
     
    366366{
    367367  /* Prefer String for Date objects */
    368   if ((hint == StringType) || (hint != StringType) && (hint != NumberType) && (_proto == exec->lexicalInterpreter()->builtinDatePrototype())) {
     368  if ((hint == StringType) || (hint != NumberType && _proto == exec->lexicalGlobalObject()->datePrototype())) {
    369369    if (JSValue* v = tryGetAndCallProperty(exec, this, exec->propertyNames().toString))
    370370      return v;
     
    600600  switch (errtype) {
    601601  case EvalError:
    602     cons = exec->lexicalInterpreter()->builtinEvalError();
     602    cons = exec->lexicalGlobalObject()->evalErrorConstructor();
    603603    break;
    604604  case RangeError:
    605     cons = exec->lexicalInterpreter()->builtinRangeError();
     605    cons = exec->lexicalGlobalObject()->rangeErrorConstructor();
    606606    break;
    607607  case ReferenceError:
    608     cons = exec->lexicalInterpreter()->builtinReferenceError();
     608    cons = exec->lexicalGlobalObject()->referenceErrorConstructor();
    609609    break;
    610610  case SyntaxError:
    611     cons = exec->lexicalInterpreter()->builtinSyntaxError();
     611    cons = exec->lexicalGlobalObject()->syntaxErrorConstructor();
    612612    break;
    613613  case TypeError:
    614     cons = exec->lexicalInterpreter()->builtinTypeError();
     614    cons = exec->lexicalGlobalObject()->typeErrorConstructor();
    615615    break;
    616616  case URIError:
    617     cons = exec->lexicalInterpreter()->builtinURIError();
     617    cons = exec->lexicalGlobalObject()->URIErrorConstructor();
    618618    break;
    619619  default:
    620     cons = exec->lexicalInterpreter()->builtinError();
     620    cons = exec->lexicalGlobalObject()->errorConstructor();
    621621    break;
    622622  }
Note: See TracChangeset for help on using the changeset viewer.