Changeset 27022 in webkit for trunk/JavaScriptCore/bindings


Ignore:
Timestamp:
Oct 24, 2007, 11:38:35 PM (18 years ago)
Author:
eseidel
Message:

2007-10-24 Eric Seidel <[email protected]>

Reviewed by Maciej.


Add a JSGlobalObject class and remove the InterpreterMap
http://bugs.webkit.org/show_bug.cgi?id=15681


This required making JSCallbackObject a template class to allow for
JSGlobalObjects with JSCallbackObject functionality.


SunSpider claims this was a 0.5% speedup.

  • API/JSCallbackObject.cpp: (KJS::):
  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp. (KJS::::JSCallbackObject): (KJS::::init): (KJS::::~JSCallbackObject): (KJS::::initializeIfNeeded): (KJS::::className): (KJS::::getOwnPropertySlot): (KJS::::put): (KJS::::deleteProperty): (KJS::::implementsConstruct): (KJS::::construct): (KJS::::implementsHasInstance): (KJS::::hasInstance): (KJS::::implementsCall): (KJS::::callAsFunction): (KJS::::getPropertyNames): (KJS::::toNumber): (KJS::::toString): (KJS::::setPrivate): (KJS::::getPrivate): (KJS::::inherits): (KJS::::cachedValueGetter): (KJS::::staticValueGetter): (KJS::::staticFunctionGetter): (KJS::::callbackGetter):
  • API/JSClassRef.cpp: (OpaqueJSClass::prototype):
  • API/JSContextRef.cpp: (JSGlobalContextCreate):
  • API/JSObjectRef.cpp: (JSObjectMake): (JSObjectGetPrivate): (JSObjectSetPrivate):
  • API/JSValueRef.cpp: (JSValueIsObjectOfClass):
  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bindings/c/c_utility.cpp: (KJS::Bindings::convertValueToNPVariant):
  • bindings/jni/jni_jsobject.cpp:
  • bindings/objc/objc_utility.mm: (KJS::Bindings::convertValueToObjcValue):
  • kjs/Context.cpp: (KJS::Context::Context):
  • kjs/ExecState.cpp: (KJS::ExecState::lexicalInterpreter):
  • kjs/JSGlobalObject.h: Added. (KJS::JSGlobalObject::JSGlobalObject): (KJS::JSGlobalObject::isGlobalObject): (KJS::JSGlobalObject::interpreter): (KJS::JSGlobalObject::setInterpreter):
  • kjs/array_instance.cpp:
  • kjs/context.h:
  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction): (KJS::GlobalFuncImp::callAsFunction):
  • kjs/interpreter.cpp: (KJS::Interpreter::Interpreter): (KJS::Interpreter::init): (KJS::Interpreter::~Interpreter): (KJS::Interpreter::globalObject): (KJS::Interpreter::initGlobalObject): (KJS::Interpreter::evaluate):
  • kjs/interpreter.h:
  • kjs/lookup.h: (KJS::cacheGlobalObject):
  • kjs/object.h: (KJS::JSObject::isGlobalObject):
  • kjs/testkjs.cpp:
Location:
trunk/JavaScriptCore/bindings
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/c/c_utility.cpp

    r26688 r27022  
    3232
    3333#include "NP_jsobject.h"
    34 #include "c_instance.h"
     34#include "c_instance.h"
     35#include "JSGlobalObject.h"
    3536#include "npruntime_impl.h"
    3637#include "npruntime_priv.h"
     
    131132
    132133            Interpreter* interpreter = 0;
    133             if (originInterpreter->isGlobalObject(value)) {
    134                 interpreter = originInterpreter->interpreterForGlobalObject(value);
    135             }
     134            if (object->isGlobalObject())
     135                interpreter = static_cast<JSGlobalObject*>(object)->interpreter();
    136136
    137137            if (!interpreter)
  • trunk/JavaScriptCore/bindings/jni/jni_jsobject.cpp

    r26688 r27022  
    3131#include "jni_runtime.h"
    3232#include "jni_utility.h"
     33#include "JSGlobalObject.h"
    3334#include "list.h"
    3435#include "runtime_object.h"
  • trunk/JavaScriptCore/bindings/objc/objc_utility.mm

    r26688 r27022  
    2828
    2929#include "objc_instance.h"
     30#include "JSGlobalObject.h"
    3031#include "runtime_array.h"
    3132#include "runtime_object.h"
     
    141142
    142143            Interpreter *interpreter = 0;
    143             if (originInterpreter->isGlobalObject(value))
    144                 interpreter = originInterpreter->interpreterForGlobalObject(value);
     144            if (value->isObject() && static_cast<JSObject*>(value)->isGlobalObject())
     145                interpreter = static_cast<JSGlobalObject*>(value)->interpreter();
    145146
    146147            if (!interpreter)
Note: See TracChangeset for help on using the changeset viewer.