1. 07 Mar, 2013 1 commit
    • mhahnenberg@apple.com's avatar
      Objective-C API: Need a good way to reference event handlers without causing cycles · db731edf
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=111088
      
      Reviewed by Geoffrey Garen.
      
      JSManagedValue is like a special kind of weak value. When you create a JSManagedValue, you can
      supply an Objective-C object as its "owner". As long as the Objective-C owner object remains
      alive and its wrapper remains accessible to the JSC garbage collector (e.g. by being marked by 
      the global object), the reference to the JavaScript value is strong. As soon as the Objective-C
      owner is deallocated or its wrapper becomes inaccessible to the garbage collector, the reference
      becomes weak.
      
      If you do not supply an owner or you use the weakValueWithValue: convenience class method, the
      returned JSManagedValue behaves as a normal weak reference.
      
      This new class allows clients to maintain references to JavaScript values in the Objective-C
      heap without creating reference cycles/leaking memory.
      
      * API/JSAPIWrapperObject.cpp: Added.
      (JSC):
      (JSC::::createStructure):
      (JSC::JSAPIWrapperObject::JSAPIWrapperObject): This is a special JSObject for the Objective-C API that knows
      for the purposes of garbage collection/marking that it wraps an opaque Objective-C object.
      (JSC::JSAPIWrapperObject::visitChildren): We add the pointer to the wrapped Objective-C object to the set of
      opaque roots so that the weak handle owner for JSManagedValues can find it later.
      * API/JSAPIWrapperObject.h: Added.
      (JSC):
      (JSAPIWrapperObject):
      (JSC::JSAPIWrapperObject::wrappedObject):
      (JSC::JSAPIWrapperObject::setWrappedObject):
      * API/JSBase.cpp:
      (JSSynchronousGarbageCollect):
      * API/JSBasePrivate.h:
      * API/JSCallbackObject.cpp:
      (JSC):
      * API/JSCallbackObject.h:
      (JSC::JSCallbackObject::destroy): Moved this to the header so that we don't get link errors with JSAPIWrapperObject.
      * API/JSContext.mm:
      (-[JSContext initWithVirtualMachine:]): We weren't adding manually allocated/initialized JSVirtualMachine objects to 
      the global cache of virtual machines. The init methods handle this now rather than contextWithGlobalContextRef, since 
      not everyone is guaranteed to use the latter.
      (-[JSContext initWithGlobalContextRef:]):
      (+[JSContext contextWithGlobalContextRef:]):
      * API/JSManagedValue.h: Added.
      * API/JSManagedValue.mm: Added.
      (JSManagedValueHandleOwner):
      (managedValueHandleOwner):
      (+[JSManagedValue weakValueWithValue:]):
      (+[JSManagedValue managedValueWithValue:owner:]):
      (-[JSManagedValue init]): We explicitly call the ARC entrypoints to initialize/get the weak owner field since we don't 
      use ARC when building our framework.
      (-[JSManagedValue initWithValue:]):
      (-[JSManagedValue initWithValue:owner:]):
      (-[JSManagedValue dealloc]):
      (-[JSManagedValue value]):
      (-[JSManagedValue weakOwner]):
      (JSManagedValueHandleOwner::isReachableFromOpaqueRoots): If the Objective-C owner is still alive (i.e. loading the weak field
      returns non-nil) and that value was added to the set of opaque roots by the wrapper for that Objective-C owner, then the the 
      JSObject to which the JSManagedObject refers is still alive.
      * API/JSObjectRef.cpp: We have to add explicit checks for the JSAPIWrapperObject, just like the other types of JSCallbackObjects.
      (JSObjectGetPrivate):
      (JSObjectSetPrivate):
      (JSObjectGetPrivateProperty):
      (JSObjectSetPrivateProperty):
      (JSObjectDeletePrivateProperty):
      * API/JSValue.mm:
      (objectToValueWithoutCopy):
      * API/JSValueRef.cpp:
      (JSValueIsObjectOfClass):
      * API/JSVirtualMachine.mm:
      (-[JSVirtualMachine initWithContextGroupRef:]):
      (+[JSVirtualMachine virtualMachineWithContextGroupRef:]):
      * API/JSWrapperMap.mm:
      (wrapperFinalize):
      (makeWrapper): This is our own internal version of JSObjectMake which creates JSAPIWrapperObjects, the Obj-C API 
      version of JSCallbackObjects.
      (createObjectWithCustomBrand):
      (-[JSObjCClassInfo wrapperForObject:]):
      (tryUnwrapObjcObject):
      * API/JavaScriptCore.h:
      * API/tests/testapi.mm: Added new tests for the strong and weak uses of JSManagedValue in the context of an 
      onclick handler for an Objective-C object inserted into a JSContext.
      (-[TextXYZ setWeakOnclick:]):
      (-[TextXYZ setOnclick:]):
      (-[TextXYZ weakOnclick]):
      (-[TextXYZ onclick]):
      (-[TextXYZ click]):
      * CMakeLists.txt: Various build system additions.
      * GNUmakefile.list.am:
      * JavaScriptCore.gypi:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/JSGlobalObject.cpp: Added the new canonical Structure for the JSAPIWrapperObject class.
      (JSC::JSGlobalObject::reset):
      (JSC):
      (JSC::JSGlobalObject::visitChildren):
      * runtime/JSGlobalObject.h:
      (JSGlobalObject):
      (JSC::JSGlobalObject::objcWrapperObjectStructure):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      db731edf
  2. 05 Mar, 2013 1 commit
  3. 04 Mar, 2013 1 commit
    • mhahnenberg@apple.com's avatar
      Remove contextInternalContext from JSContextInternal.h · f3520b7c
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=111356
      
      Reviewed by Geoffrey Garen.
      
      We don't need it any more since we have globalContextRef in JSContext.
      
      Source/JavaScriptCore:
      
      * API/JSContext.mm:
      * API/JSContextInternal.h:
      * API/JSValue.mm:
      (+[JSValue valueWithBool:inContext:]):
      (+[JSValue valueWithDouble:inContext:]):
      (+[JSValue valueWithInt32:inContext:]):
      (+[JSValue valueWithUInt32:inContext:]):
      (+[JSValue valueWithNewObjectInContext:]):
      (+[JSValue valueWithNewArrayInContext:]):
      (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]):
      (+[JSValue valueWithNewErrorFromMessage:inContext:]):
      (+[JSValue valueWithNullInContext:]):
      (+[JSValue valueWithUndefinedInContext:]):
      (-[JSValue toBool]):
      (-[JSValue toDouble]):
      (-[JSValue toNumber]):
      (-[JSValue toString]):
      (-[JSValue toDate]):
      (-[JSValue toArray]):
      (-[JSValue toDictionary]):
      (-[JSValue valueForProperty:]):
      (-[JSValue setValue:forProperty:]):
      (-[JSValue deleteProperty:]):
      (-[JSValue hasProperty:]):
      (-[JSValue valueAtIndex:]):
      (-[JSValue setValue:atIndex:]):
      (-[JSValue isUndefined]):
      (-[JSValue isNull]):
      (-[JSValue isBoolean]):
      (-[JSValue isNumber]):
      (-[JSValue isString]):
      (-[JSValue isObject]):
      (-[JSValue isEqualToObject:]):
      (-[JSValue isEqualWithTypeCoercionToObject:]):
      (-[JSValue isInstanceOf:]):
      (-[JSValue callWithArguments:]):
      (-[JSValue constructWithArguments:]):
      (-[JSValue invokeMethod:withArguments:]):
      (valueToObject):
      (objectToValueWithoutCopy):
      (objectToValue):
      (-[JSValue initWithValue:inContext:]):
      (-[JSValue dealloc]):
      (-[JSValue description]):
      * API/JSWrapperMap.mm:
      (createObjectWithCustomBrand):
      (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]):
      (-[JSObjCClassInfo wrapperForObject:]):
      (-[JSWrapperMap jsWrapperForObject:]):
      * API/ObjCCallbackFunction.mm:
      (ObjCCallbackFunction::call):
      (objCCallbackFunctionForInvocation):
      
      Source/WebKit/mac:
      
      * WebView/WebScriptWorld.mm:
      (+[WebScriptWorld scriptWorldForJavaScriptContext:]):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f3520b7c
  4. 21 Feb, 2013 1 commit
    • mhahnenberg@apple.com's avatar
      Objective-C API: Need a way to use the Objective-C JavaScript API with WebKit · f0712f94
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=106059
      
      Source/JavaScriptCore: 
      
      Reviewed by Geoffrey Garen.
              
      * API/JSBase.h: Renamed enable flag for API.
      * API/JSBlockAdaptor.h: Using new flag.
      * API/JSBlockAdaptor.mm: Ditto.
      * API/JSContext.h: Add convenience C API conversion function for JSGlobalContextRef.
      * API/JSContext.mm: 
      (-[JSContext JSGlobalContextRef]): Implementation of C API convenience function.
      (-[JSContext initWithVirtualMachine:]): We don't use the m_apiData field any more.
      (-[JSContext initWithGlobalContextRef:]): init method for allocating new JSContexts given a JSGlobalContextRef.
      (-[JSContext dealloc]): No more m_apiData.
      (-[JSContext wrapperForObjCObject:]): Renamed wrapperForObject. 
      (-[JSContext wrapperForJSObject:]): Fetches or allocates the JSValue for the specified JSValueRef in this JSContext.
      (+[JSContext contextWithGlobalContextRef:]): Helper function to grab the lightweight JSContext wrapper for a given
      JSGlobalContextRef from the global wrapper cache or allocate a new one if there isn't already one.
      * API/JSContextInternal.h: New flag, new method declaration for initWithGlobalContextRef.
      * API/JSExport.h: New flag.
      * API/JSValue.h: New flag and new C API convenience method.
      * API/JSValue.mm:
      (-[JSValue JSValueRef]): Implementation of the C API convenience method.
      (objectToValueWithoutCopy):
      (+[JSValue valueWithValue:inContext:]): We now ask the JSContext for an Objective-C JSValue wrapper, which it can cache
      in its internal JSWrapperMap.
      * API/JSValueInternal.h:
      * API/JSVirtualMachine.h:
      * API/JSVirtualMachine.mm: Added global cache that maps JSContextGroupRef -> JSVirtualMachine lightweight wrappers.
      (wrapperCacheLock):
      (initWrapperCache):
      (+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]):
      (+[JSVMWrapperCache wrapperForJSContextGroupRef:]):
      (-[JSVirtualMachine init]):
      (-[JSVirtualMachine initWithContextGroupRef:]):
      (-[JSVirtualMachine dealloc]):
      (+[JSVirtualMachine virtualMachineWithContextGroupRef:]):
      (-[JSVirtualMachine contextForGlobalContextRef:]):
      (-[JSVirtualMachine addContext:forGlobalContextRef:]):
      * API/JSVirtualMachineInternal.h:
      * API/JSWrapperMap.h:
      * API/JSWrapperMap.mm:
      (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): We use the JSObjectSetPrototype C API call because 
      setting the __proto__ property causes all sorts of bad things to happen behind the scenes, which can cause crashes based on 
      when it gets called.
      (-[JSWrapperMap initWithContext:]):
      (-[JSWrapperMap jsWrapperForObject:]):
      (-[JSWrapperMap objcWrapperForJSValueRef:]):
      * API/JavaScriptCore.h:
      * API/ObjCCallbackFunction.h:
      * API/ObjCCallbackFunction.mm:
      (ObjCCallbackFunction::ObjCCallbackFunction): We never actually should have retained the target in the case that we had a 
      block as a callback. Blocks are initially allocated on the stack and are only moved to the heap if we call their copy method.
      Retaining the block on the stack was a bad idea because if that stack frame ever went away and we called the block later, 
      we'd crash and burn.
      (ObjCCallbackFunction::setContext): We need a new setter for when the weak reference to a JSContext inside an ObjCCallbackFunction
      disappears, we can allocate a new one in its place.
      (ObjCCallbackFunction):
      (objCCallbackFunctionCallAsFunction): Reset the callback's context if it's ever destroyed.
      (objCCallbackFunctionForInvocation): Again, don't set the __proto__ property because it uses black magic that can cause us to crash
      depending on when this is called.
      (objCCallbackFunctionForBlock): Here is where we copy the block to the heap when we're first creating the callback object for it.
      * API/tests/testapi.c:
      (main):
      * API/tests/testapi.mm: We're going to get rid of the automatic block conversion, since that is causing leaks. I changed it 
      here in this test just so that it wouldn't mask any other potential leaks. Also modified some of the tests since JSContexts are 
      just lightweight wrappers now, we're not guaranteed to get the same pointer back from the call to [JSValue context] as the one 
      that the value was created in.
      (-[TestObject callback:]):
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData): No more m_apiData.
      * runtime/JSGlobalData.h: Ditto.
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::JSGlobalObject): Ditto.
      * runtime/JSGlobalObject.h:
      
      Source/WebCore: 
      
      Reviewed by Geoffrey Garen.
      
      * WebCore.exp.in:
      * bindings/js/JSDOMWindowShell.cpp:
      (WebCore::JSDOMWindowShell::setWindow): Since we're basically abandoning a JSDOMWindow here, we call
      garbageCollectSoon().
      * bindings/js/JSDOMWindowShell.h:
      * bindings/js/ScriptController.h: New function to get the JSContext for the global object of the current main world.
      * bindings/js/ScriptControllerMac.mm: 
      (WebCore::ScriptController::javaScriptContext): Ditto.
      * bindings/objc/WebScriptObject.h: Added ifdef guards. Also new convenience conversion function for the JSC Obj-C API.
      * bindings/objc/WebScriptObject.mm: JSC::JSValue and JSValue conflict with one another, so we have to be more specific.
      (-[WebScriptObject _globalContextRef]): Useful helper function for getting the JSGlobalContextRef of a particular WebScriptObject.
      (-[WebScriptObject callWebScriptMethod:withArguments:]):
      (-[WebScriptObject evaluateWebScript:]):
      (-[WebScriptObject valueForKey:]):
      (-[WebScriptObject webScriptValueAtIndex:]):
      (+[WebScriptObject _convertValueToObjcValue:JSC::originRootObject:rootObject:]):
      (-[WebScriptObject JSValue]): Implementation of convenience WebScriptObject conversion function to new Objective-C API.
      * bindings/objc/WebScriptObjectPrivate.h:
      
      Source/WebKit/mac: 
      
      Reviewed by Geoffrey Garen.
      
      Addition of appropriate delegate callbacks and support to the WebKit API.
      
      * WebCoreSupport/WebFrameLoaderClient.mm:
      * WebView/WebDelegateImplementationCaching.h:
      (WebFrameLoadDelegateImplementationCache):
      * WebView/WebFrame.h:
      * WebView/WebFrame.mm:
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
      (-[WebFrame _javaScriptContextForScriptWorld:]):
      (-[WebFrame javaScriptContext]):
      * WebView/WebFrameLoadDelegate.h:
      * WebView/WebFramePrivate.h:
      * WebView/WebScriptDebugDelegate.mm:
      (-[WebScriptCallFrame _convertValueToObjcValue:JSC::]):
      (-[WebScriptCallFrame exception]):
      (-[WebScriptCallFrame evaluateWebScript:]):
      * WebView/WebScriptWorld.h:
      * WebView/WebScriptWorld.mm:
      (+[WebScriptWorld scriptWorldForJavaScriptContext:]):
      * WebView/WebView.mm:
      (-[WebView _cacheFrameLoadDelegateImplementations]):
      (aeDescFromJSValue):
      (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
      (-[WebView _computedStyleIncludingVisitedInfo:forElement:]):
      
      Source/WTF: 
      
      Reviewed by Geoffrey Garen.
      
      * wtf/FeatureDefines.h: Added enable flag for JSC Objective-C API so it can be used in
      export files.
      
      Tools: 
      
      Reviewed by Geoffrey Garen.
      
      Added new tests for the WebKit API portion of the JSC Objective-C API.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/mac/JSContextBackForwardCache1.html: Added.
      * TestWebKitAPI/Tests/mac/JSContextBackForwardCache2.html: Added.
      * TestWebKitAPI/Tests/mac/WebViewDidCreateJavaScriptContext.mm: Added.
      (-[MyConsole log:]):
      (-[MyConsole printHelloWorld]):
      (-[MyConsole add:to:]):
      (-[DidCreateJavaScriptContextFrameLoadDelegate webView:didFinishLoadForFrame:]):
      (-[DidCreateJavaScriptContextFrameLoadDelegate webView:didCreateJavaScriptContext:forFrame:]):
      (TestWebKitAPI):
      (TestWebKitAPI::TEST):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f0712f94
  5. 08 Feb, 2013 1 commit
  6. 31 Jan, 2013 1 commit
  7. 24 Jan, 2013 1 commit
    • mhahnenberg@apple.com's avatar
      Objective-C API: Rename JSValue.h/APIJSValue.h to JSCJSValue.h/JSValue.h · c1bc9d39
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107327
      
      Reviewed by Filip Pizlo.
      
      Source/JavaScriptCore:
      
      We're renaming these two files, so we have to replace the names everywhere.
      
      * API/APICast.h:
      * API/APIJSValue.h: Removed.
      * API/JSBlockAdaptor.mm:
      * API/JSStringRefCF.cpp:
      * API/JSValue.h: Copied from Source/JavaScriptCore/API/APIJSValue.h.
      * API/JSValue.mm:
      * API/JSValueInternal.h:
      * API/JSValueRef.cpp:
      * API/JSWeakObjectMapRefPrivate.cpp:
      * API/JavaScriptCore.h:
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/CallLinkStatus.h:
      * bytecode/CodeBlock.cpp:
      * bytecode/MethodOfGettingAValueProfile.h:
      * bytecode/ResolveGlobalStatus.cpp:
      * bytecode/ResolveGlobalStatus.h:
      * bytecode/SpeculatedType.h:
      * bytecode/ValueRecovery.h:
      * dfg/DFGByteCodeParser.cpp:
      * dfg/DFGJITCompiler.cpp:
      * dfg/DFGNode.h:
      * dfg/DFGSpeculativeJIT.cpp:
      * dfg/DFGSpeculativeJIT64.cpp:
      * heap/CopiedBlock.h:
      * heap/HandleStack.cpp:
      * heap/HandleTypes.h:
      * heap/WeakImpl.h:
      * interpreter/Interpreter.h:
      * interpreter/Register.h:
      * interpreter/VMInspector.h:
      * jit/HostCallReturnValue.cpp:
      * jit/HostCallReturnValue.h:
      * jit/JITCode.h:
      * jit/JITExceptions.cpp:
      * jit/JITExceptions.h:
      * jit/JSInterfaceJIT.h:
      * llint/LLIntCLoop.h:
      * llint/LLIntData.h:
      * llint/LLIntSlowPaths.cpp:
      * profiler/ProfilerBytecode.h:
      * profiler/ProfilerBytecodeSequence.h:
      * profiler/ProfilerBytecodes.h:
      * profiler/ProfilerCompilation.h:
      * profiler/ProfilerCompiledBytecode.h:
      * profiler/ProfilerDatabase.h:
      * profiler/ProfilerOSRExit.h:
      * profiler/ProfilerOSRExitSite.h:
      * profiler/ProfilerOrigin.h:
      * profiler/ProfilerOriginStack.h:
      * runtime/ArgList.cpp:
      * runtime/CachedTranscendentalFunction.h:
      * runtime/CallData.h:
      * runtime/Completion.h:
      * runtime/ConstructData.h:
      * runtime/DateConstructor.cpp:
      * runtime/DateInstance.cpp:
      * runtime/DatePrototype.cpp:
      * runtime/JSAPIValueWrapper.h:
      * runtime/JSCJSValue.cpp: Copied from Source/JavaScriptCore/runtime/JSValue.cpp.
      * runtime/JSCJSValue.h: Copied from Source/JavaScriptCore/runtime/JSValue.h.
      (JSValue):
      * runtime/JSCJSValueInlines.h: Copied from Source/JavaScriptCore/runtime/JSValueInlines.h.
      * runtime/JSGlobalData.h:
      * runtime/JSGlobalObject.cpp:
      * runtime/JSGlobalObjectFunctions.h:
      * runtime/JSStringJoiner.h:
      * runtime/JSValue.cpp: Removed.
      * runtime/JSValue.h: Removed.
      * runtime/JSValueInlines.h: Removed.
      * runtime/LiteralParser.h:
      * runtime/Operations.h:
      * runtime/PropertyDescriptor.h:
      * runtime/PropertySlot.h:
      * runtime/Protect.h:
      * runtime/RegExpPrototype.cpp:
      * runtime/Structure.h:
      
      Source/WebCore:
      
      No new tests.
      
      We're renaming these two files, so we have to replace the names everywhere.
      
      * ForwardingHeaders/runtime/JSCJSValue.h: Copied from Source/WebCore/ForwardingHeaders/runtime/JSValue.h.
      * ForwardingHeaders/runtime/JSValue.h: Removed.
      * WebCore.vcproj/WebCore.vcproj:
      * bindings/js/JSArrayBufferViewHelper.h:
      * bindings/js/JSCustomXPathNSResolver.h:
      * bindings/js/JSHTMLAllCollectionCustom.cpp:
      * bindings/js/JSIntentConstructor.cpp:
      * bindings/js/JSMessagePortCustom.h:
      * bindings/js/JSNodeFilterCondition.h:
      * bindings/js/JavaScriptCallFrame.cpp:
      * bindings/js/ScriptCallStackFactory.cpp:
      * bindings/js/ScriptValue.h:
      * bindings/js/SerializedScriptValue.h:
      * bindings/objc/WebScriptObjectPrivate.h:
      * bridge/c/c_utility.h:
      * bridge/testbindings.cpp:
      * bridge/testbindings.mm:
      * bridge/testqtbindings.cpp:
      * plugins/PluginView.cpp:
      * plugins/blackberry/PluginViewBlackBerry.cpp:
      * plugins/gtk/PluginViewGtk.cpp:
      * plugins/mac/PluginViewMac.mm:
      * plugins/qt/PluginViewQt.cpp:
      * plugins/win/PluginViewWin.cpp:
      
      Source/WebKit/gtk:
      
      We're renaming these two files, so we have to replace the names everywhere.
      
      * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
      
      Source/WebKit/mac:
      
      We're renaming these two files, so we have to replace the names everywhere.
      
      * DOM/WebDOMOperations.mm:
      * ForwardingHeaders/runtime/JSCJSValue.h: Copied from Source/WebKit/mac/ForwardingHeaders/runtime/JSValue.h.
      * ForwardingHeaders/runtime/JSValue.h: Removed.
      * WebView/WebFrame.mm:
      * WebView/WebView.mm:
      
      Source/WebKit/win:
      
      We're renaming these two files, so we have to replace the names everywhere.
      
      * WebFrame.cpp:
      * WebView.cpp:
      
      Source/WebKit/wx:
      
      We're renaming these two files, so we have to replace the names everywhere.
      
      * WebFrame.cpp:
      * WebView.cpp:
      
      Source/WebKit2:
      
      We're renaming these two files, so we have to replace the names everywhere.
      
      * WebProcess/WebPage/WebPage.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c1bc9d39
  8. 17 Jan, 2013 2 commits
    • mhahnenberg@apple.com's avatar
      Objective-C API: Clean up JSValue.mm · 953b3bf2
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107163
      
      Reviewed by Darin Adler.
      
      m_context is no longer weak, so there is now a lot of dead code in in JSValue.mm, and a wasted message send
      on every API call.  In the head of just about every method in JSValue.mm we're doing:
      
      JSContext *context = [self context];
      if (!context)
          return nil;
      
      This is getting a retained copy of the context, which is no longer necessary now m_context is no longer weak.
      We can just delete all these lines from all functions doing this, and where they were referring to the local
      variable 'context', instead we can just access m_context directly.
      
      Since we're already going to be modifying most of JSValue.mm, we'll also do the following:
      
      1) context @property is no longer weak – the context property is declared as:
      
          @property(readonly, weak) JSContext *context;
      
      This is really only informative (since we're not presently synthesizing the ivar), but it is now misleading.
      We should change it to:
      
          @property(readonly, retain) JSContext *context;
      
      2) the JSContext ivar and accessor can be automatically generated.  Since we're no longer doing anything
      special with m_context, we can just let the compiler handle the ivar for us.  We'll delete:
      
          JSContext *m_context;
      
      and:
      
          - (JSContext *)context
          {
              return m_context;
      
          }
      
      and find&replace "m_context" to "_context" in JSValue.mm.
      
      * API/APIJSValue.h:
      * API/JSValue.mm:
      (-[JSValue toObject]):
      (-[JSValue toBool]):
      (-[JSValue toDouble]):
      (-[JSValue toNumber]):
      (-[JSValue toString]):
      (-[JSValue toDate]):
      (-[JSValue toArray]):
      (-[JSValue toDictionary]):
      (-[JSValue valueForProperty:]):
      (-[JSValue setValue:forProperty:]):
      (-[JSValue deleteProperty:]):
      (-[JSValue hasProperty:]):
      (-[JSValue defineProperty:descriptor:]):
      (-[JSValue valueAtIndex:]):
      (-[JSValue setValue:atIndex:]):
      (-[JSValue isUndefined]):
      (-[JSValue isNull]):
      (-[JSValue isBoolean]):
      (-[JSValue isNumber]):
      (-[JSValue isString]):
      (-[JSValue isObject]):
      (-[JSValue isEqualToObject:]):
      (-[JSValue isEqualWithTypeCoercionToObject:]):
      (-[JSValue isInstanceOf:]):
      (-[JSValue callWithArguments:]):
      (-[JSValue constructWithArguments:]):
      (-[JSValue invokeMethod:withArguments:]):
      (-[JSValue objectForKeyedSubscript:]):
      (-[JSValue setObject:forKeyedSubscript:]):
      (-[JSValue initWithValue:inContext:]):
      (-[JSValue dealloc]):
      (-[JSValue description]):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      953b3bf2
    • mhahnenberg@apple.com's avatar
      Objective-C API: Clean up JSValue · a9e9f9d1
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107156
      
      Reviewed by Oliver Hunt.
      
      JSContext m_protectCounts, protect, unprotect are all now unnecessary overhead, and should all be removed.  
      These exist to handle the context going away before the value does; the context needs to be able to unprotect 
      values early.  Since the value is now keeping the context alive there is no longer any danger of this happening; 
      instead we should just protect/unprotect the value in JSValue's init/dealloc methods.
      
      * API/JSContext.mm:
      (-[JSContext dealloc]):
      * API/JSContextInternal.h:
      * API/JSValue.mm:
      (-[JSValue initWithValue:inContext:]):
      (-[JSValue dealloc]):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a9e9f9d1
  9. 12 Jan, 2013 1 commit
  10. 11 Jan, 2013 1 commit
  11. 02 Jan, 2013 2 commits
    • barraclough@apple.com's avatar
      Objective-C API for JavaScriptCore · e2c0742f
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=105889
      
      Reviewed by Geoff Garen.
      
      Fixes for more issues raised by Darin.
      
      * API/JSBlockAdaptor.mm:
      (BlockArgument):
      (BlockArgumentStruct::BlockArgumentStruct):
      (BlockArgumentTypeDelegate::typeStruct):
      (BlockResult):
      (BlockResultStruct::BlockResultStruct):
      (buildBlockSignature):
      (-[JSBlockAdaptor initWithBlockSignatureFromProtocol:]):
      (-[JSBlockAdaptor blockFromValue:inContext:withException:]):
          - fix * position for Objective-C types
      * API/JSContext.h:
          - fix * position for Objective-C types
      * API/JSContext.mm:
      (-[JSContext initWithVirtualMachine:]):
      (-[JSContext virtualMachine]):
      (contextInternalContext):
          - fix * position for Objective-C types
      (-[JSContext dealloc]):
      (-[JSContext protect:]):
      (-[JSContext unprotect:]):
          - HashMap<JSValueRef, size_t> -> HashCountedSet<JSValueRef>
      * API/JSContextInternal.h:
      (WeakContextRef):
          - fix * position for Objective-C types
      * API/JSValue.mm:
      (valueToString):
          - fix * position for Objective-C types
      (isNSBoolean):
          - Added helper to check for booleans.
      (objectToValueWithoutCopy):
          - Added contextRef
          - fix * position for Objective-C types
          - Remove @YES, @NO literal usage, use isNSBoolean instead
      (objectToValue):
          - Added contextRef
      (+[JSValue valueWithValue:inContext:]):
      (-[JSValue initWithValue:inContext:]):
          - fix * position for Objective-C types
      (createStructHandlerMap):
      (handerForStructTag):
          - getStructTagHandler -> handerForStructTag
          - Split out createStructHandlerMap
          - strncmp -> memcmp
          - String(type).impl() -> StringImpl::create(type)
      (+[JSValue selectorForStructToValue:]):
      (+[JSValue selectorForValueToStruct:]):
          - getStructTagHandler -> handerForStructTag
      (typeToValueInvocationFor):
      (valueToTypeInvocationFor):
          - fix * position for Objective-C types
      * API/JSValueInternal.h:
          - fix * position for Objective-C types
      * API/JSVirtualMachineInternal.h:
          - fix * position for Objective-C types
      * API/JSWrapperMap.h:
          - fix * position for Objective-C types
      * API/JSWrapperMap.mm:
      (selectorToPropertyName):
      (createObjectWithCustomBrand):
      (createRenameMap):
      (putNonEnumerable):
      (copyMethodsToObject):
      (copyPrototypeProperties):
      (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]):
      (-[JSWrapperMap initWithContext:]):
      (-[JSWrapperMap wrapperForObject:]):
      (getJSExportProtocol):
          - fix * position for Objective-C types
      * API/ObjCCallbackFunction.h:
          - fix * position for Objective-C types
      * API/ObjCCallbackFunction.mm:
      (CallbackArgument):
      (CallbackArgumentStruct::CallbackArgumentStruct):
          - fix * position for Objective-C types
      (CallbackArgumentBlockCallback::createAdoptingJSBlockAdaptor):
          - Added to make adopt explicit
      (CallbackArgumentBlockCallback):
      (CallbackArgumentBlockCallback::CallbackArgumentBlockCallback):
      (ArgumentTypeDelegate::typeBlock):
          - Call createAdoptingJSBlockAdaptor
      (ArgumentTypeDelegate::typeStruct):
      (CallbackResult):
      (CallbackResultStruct::CallbackResultStruct):
      (ResultTypeDelegate::typeStruct):
      (ObjCCallbackFunction::ObjCCallbackFunction):
      (ObjCCallbackFunction::context):
      (objCCallbackFunctionForInvocation):
      (objCCallbackFunctionForMethod):
      (objCCallbackFunctionForBlock):
          - fix * position for Objective-C types
      * API/ObjcRuntimeExtras.h:
      (protocolImplementsProtocol):
      (forEachProtocolImplementingProtocol):
      (forEachMethodInProtocol):
      (forEachPropertyInProtocol):
          - fix * position for Objective-C types
      * API/tests/testapi.m:
      (-[TestObject testArgumentTypesWithInt:double:boolean:string:number:array:dictionary:]):
      (testObjectiveCAPI):
          - fix * position for Objective-C types
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e2c0742f
    • barraclough@apple.com's avatar
      Objective-C API for JavaScriptCore · a56aeb21
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=105889
      
      Reviewed by Geoff Garen.
      
      Fixes for a number of issues raised by Darin.
      
      * API/APIJSValue.h:
          - Fix typos in comment
          - Add newline before NS_CLASS_AVAILABLE(10_9, NA)
          - cls -> expectedClass
          - key type for -setObject:forKeyedSubscript: is now NSObject <NSCopying> *
      * API/JSBase.h:
          - JS_OBJC_API_ENABLED no longer implies __OBJC__
      * API/JSBlockAdaptor.mm:
      (BlockArgumentStruct::BlockArgumentStruct):
      (BlockArgumentStruct):
          - mark virtual functions as virtual, override, and private
          - refactor out buffer allocation for struct types
      (BlockArgumentTypeDelegate::typeVoid):
      (BlockArgumentTypeDelegate::typeBlock):
      (BlockArgumentTypeDelegate::typeStruct):
          - return nil -> return 0
      (BlockResultStruct::BlockResultStruct):
      (BlockResultStruct):
          - mark virtual functions as virtual, override, and private
          - refactor out buffer allocation for struct types
      (buildBlockSignature):
          - %lu is not an appropriate format specifier for NSInteger
      (-[JSBlockAdaptor initWithBlockSignatureFromProtocol:]):
          - nil check [super init]
      (-[JSBlockAdaptor blockMatchesSignature:]):
      (-[JSBlockAdaptor blockFromValue:inContext:withException:]):
          - ctx -> contextRef
      * API/JSContext.h:
          - Fix typos in comment
          - Add newline before NS_CLASS_AVAILABLE(10_9, NA)
          - key type for -setObject:forKeyedSubscript: is now NSObject <NSCopying> *
      * API/JSContext.mm:
      (-[JSContext initWithVirtualMachine:]):
          - nil check [super init]
      (+[JSContext currentArguments]):
          - args -> argumentArray
      (-[JSContext setObject:forKeyedSubscript:]):
          - key type for -setObject:forKeyedSubscript: is now NSObject <NSCopying> *
      (-[JSContext dealloc]):
      (-[JSContext protect:]):
      (-[JSContext unprotect:]):
          - m_protected -> m_protectCounts
      * API/JSValue.mm:
      (-[JSValue toObjectOfClass:]):
          - cls -> expectedClass
      (-[JSValue toBool]):
      (-[JSValue deleteProperty:]):
      (-[JSValue hasProperty:]):
      (-[JSValue isUndefined]):
      (-[JSValue isNull]):
      (-[JSValue isBoolean]):
      (-[JSValue isNumber]):
      (-[JSValue isString]):
      (-[JSValue isObject]):
      (-[JSValue isEqualToObject:]):
      (-[JSValue isEqualWithTypeCoercionToObject:]):
      (-[JSValue isInstanceOf:]):
          - removed ? YES : NO
      (-[JSValue callWithArguments:]):
      (-[JSValue constructWithArguments:]):
      (-[JSValue invokeMethod:withArguments:]):
          - args -> argumentArray
      (+[JSValue valueWithPoint:inContext:]):
      (+[JSValue valueWithRange:inContext:]):
      (+[JSValue valueWithRect:inContext:]):
      (+[JSValue valueWithSize:inContext:]):
          - [NSNumber numberWithFloat:] -> @()
      (-[JSValue objectForKeyedSubscript:]):
      (-[JSValue setObject:forKeyedSubscript:]):
          - key type for -setObject:forKeyedSubscript: is now NSObject <NSCopying> *
      (JSContainerConvertor):
      (JSContainerConvertor::isWorkListEmpty):
      (JSContainerConvertor::convert):
      (ObjcContainerConvertor):
      (ObjcContainerConvertor::isWorkListEmpty):
          - remove WTF::
          - isWorkListEmpty is const
      (objectToValue):
          -  use fast enumeration
      (-[JSValue initWithValue:inContext:]):
          - nil check [super init]
      (getStructTagHandler):
          - m_structHandlers -> structHandlers
      * API/JSVirtualMachine.h:
          - Add newline before NS_CLASS_AVAILABLE(10_9, NA)
      * API/JSVirtualMachine.mm:
      (-[JSVirtualMachine init]):
          - nil check [super init]
      * API/JSWrapperMap.mm:
      (selectorToPropertyName):
      (copyPrototypeProperties):
          - remove WTF::
          - use static_cast
      (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]):
      (-[JSWrapperMap initWithContext:]):
          - nil check [super init]
      (-[JSWrapperMap wrapperForObject:]):
      (tryUnwrapObjcObject):
          - enable ASSERT
      (getJSExportProtocol):
      (getNSBlockClass):
          - remove if check on initializing static
      * API/JavaScriptCore.h:
          - JS_OBJC_API_ENABLED no longer implies __OBJC__
      * API/ObjCCallbackFunction.mm:
      (CallbackArgumentOfClass):
      (CallbackArgumentOfClass::~CallbackArgumentOfClass):
      (CallbackArgumentStruct::CallbackArgumentStruct):
      (CallbackArgumentStruct):
      (CallbackArgumentBlockCallback):
          - mark virtual functions as virtual, override, and private
          - refactor out buffer allocation for struct types
      (ArgumentTypeDelegate::typeVoid):
      (ArgumentTypeDelegate::typeOfClass):
      (ArgumentTypeDelegate::typeStruct):
          - return nil -> return 0
      (CallbackResultStruct::CallbackResultStruct):
      (CallbackResultStruct):
          - mark virtual functions as virtual, override, and private
          - refactor out buffer allocation for struct types
      (ResultTypeDelegate::typeStruct):
          - return nil -> return 0
      (ObjCCallbackFunction):
          - remove WTF::
      (objCCallbackFunctionFinalize):
          - use static_cast
      (objCCallbackFunctionCallAsFunction):
          - Fix typos in comment
      (createObjCCallbackFunctionClass):
      (objCCallbackFunctionClass):
          - Split out createObjCCallbackFunctionClass from objCCallbackFunctionClass
      (ObjCCallbackFunction::call):
          - ctx -> contextRef
      (blockSignatureContainsClass):
          - Remove tri-state enum.
      (skipNumber):
          - isdigit -> isASCIIDigit 
      (objCCallbackFunctionForInvocation):
          - clean up & comment blockSignatureContainsClass() usage
      (tryUnwrapBlock):
          - use static_cast
      * API/ObjcRuntimeExtras.h:
      (forEachProtocolImplementingProtocol):
      (forEachMethodInClass):
      (forEachMethodInProtocol):
      (forEachPropertyInProtocol):
          - Remove WTF::
          - Remove if (count) checks
      (skipPair):
          - NSUInteger -> size_t
      (StringRange):
      (StringRange::operator const char*):
      (StringRange::get):
      (StructBuffer):
      (StructBuffer::StructBuffer):
      (StructBuffer::~StructBuffer):
      (StructBuffer::operator void*):
          - Added helper for creating an aligned buffer, used by struct conversion invocations.
      (parseObjCType):
          - *(position++) -> *position++
      * API/tests/testapi.c:
          - PLATFORM(MAC) -> JS_OBJC_API_ENABLED
      * API/tests/testapi.m:
      (blockSignatureContainsClass):
          - Remove tri-state enum.
      (testObjectiveCAPI):
          - Added more result type checks.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a56aeb21
  12. 01 Jan, 2013 1 commit
    • barraclough@apple.com's avatar
      Objective-C API for JavaScriptCore · fc381887
      barraclough@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=105889
      
      Reviewed by Filip Pizlo.
      
      ../JavaScriptCore: 
      
      For a detailed description of the API implemented here, see:
          JSContext.h
          APIJSValue.h
          JSVirtualMachine.h
          JSExport.h
      Still to do -
          (1) Shoud rename APIJSValue.h -> JSValue.h (but we'll have to rename JSValue.h first).
          (2) Numerous FIXMEs, all with separate bugs filed.
      
      * API/APIJSValue.h: Added.
          - this Objective-C class is used to reference a JavaScript object.
      * API/JSBase.h:
          - added JS_OBJC_API_ENABLED macro to control ObjC API support.
      * API/JSBlockAdaptor.h: Added.
          - this Objective-C class is used in creating a special NSBlock proxying a JavaScript function.
      * API/JSBlockAdaptor.mm: Added.
      (BlockArgument):
      (BlockArgument::~BlockArgument):
      (BlockArgumentBoolean):
      (BlockArgumentBoolean::get):
      (BlockArgumentNumeric):
      (BlockArgumentNumeric::get):
      (BlockArgumentId):
      (BlockArgumentId::get):
      (BlockArgumentStruct):
      (BlockArgumentStruct::BlockArgumentStruct):
      (BlockArgumentStruct::~BlockArgumentStruct):
      (BlockArgumentStruct::get):
          - decoded arguent type information of a JSBlockAdaptor.
      (BlockArgumentTypeDelegate):
      (BlockArgumentTypeDelegate::typeInteger):
      (BlockArgumentTypeDelegate::typeDouble):
      (BlockArgumentTypeDelegate::typeBool):
      (BlockArgumentTypeDelegate::typeVoid):
      (BlockArgumentTypeDelegate::typeId):
      (BlockArgumentTypeDelegate::typeOfClass):
      (BlockArgumentTypeDelegate::typeBlock):
      (BlockArgumentTypeDelegate::typeStruct):
          - delegate for use in conjunction with parseObjCType.
      (BlockResult):
      (BlockResult::~BlockResult):
      (BlockResultVoid):
      (BlockResultVoid::set):
      (BlockResultInteger):
      (BlockResultInteger::set):
      (BlockResultDouble):
      (BlockResultDouble::set):
      (BlockResultBoolean):
      (BlockResultBoolean::set):
      (BlockResultStruct):
      (BlockResultStruct::BlockResultStruct):
      (BlockResultStruct::~BlockResultStruct):
      (BlockResultStruct::set):
          - decoded result type information of a JSBlockAdaptor.
      (buildBlockSignature):
          - partial step in constructing a signature with stack offset information from one without.
      (-[JSBlockAdaptor initWithBlockSignatureFromProtocol:]):
          - constructor.
      (-[JSBlockAdaptor blockMatchesSignature:]):
          - check whether signature strings match, where only one contains stack frame offsets.
      (-[JSBlockAdaptor blockFromValue:inContext:withException:]):
          - use the adaptor to create a special forwarding block.
      * API/JSCallbackObjectFunctions.h:
      (JSC::::inherits):
          - add missing braces to multiline for statement.
      * API/JSContext.h: Added.
          - this Objective-C class is used to reference a JavaScript context.
      * API/JSContext.mm: Added.
      (-[JSContext init]):
          - constructor.
      (-[JSContext initWithVirtualMachine:]):
          - construct in a given VM (JSGlobalData).
      (-[JSContext evaluateScript:]):
      (-[JSContext globalObject]):
          - evaluate a script, global object accessor.
      (+[JSContext currentContext]):
      (+[JSContext currentThis]):
      (+[JSContext currentArguments]):
          - These methods obtain context, this, arguments from within a callback.
      (-[JSContext virtualMachine]):
          - implementation for .virtualMachine property.
      (-[JSContext objectForKeyedSubscript:]):
      (-[JSContext setObject:forKeyedSubscript:]):
          - support for subscript property access.
      (contextInternalContext):
          - internal accessor to m_context.
      (-[JSContext dealloc]):
          - desctructor.
      (-[JSContext notifyException:]):
      (-[JSContext valueFromNotifyException:]):
      (-[JSContext boolFromNotifyException:]):
          - internal method to record an exception was thrown.
      (-[JSContext beginCallbackWithData:thisValue:argumentCount:arguments:]):
      (-[JSContext endCallbackWithData:]):
          - internal methods to push/pop a callback record.
      (-[JSContext protect:]):
      (-[JSContext unprotect:]):
          - internal methods to add a value to a protect set (used to protect the internal property of JSValue).
      (-[JSContext wrapperForObject:]):
          - internal method to create a wrapper object.
      (WeakContextRef::WeakContextRef):
      (WeakContextRef::~WeakContextRef):
      (WeakContextRef::get):
      (WeakContextRef::set):
          - Helper class to implement a weak reference to a JSContext.
      * API/JSContextInternal.h: Added.
      (CallbackData):
      (WeakContextRef):
          - see API/JSContext.mm for description of internal methods.
      * API/JSExport.h: Added.
          - Provides JSExport protocol & JSExportAs macro.
      * API/JSValue.mm: Added.
      (+[JSValue valueWithObject:inContext:]):
      (+[JSValue valueWithBool:inContext:]):
      (+[JSValue valueWithDouble:inContext:]):
      (+[JSValue valueWithInt32:inContext:]):
      (+[JSValue valueWithUInt32:inContext:]):
      (+[JSValue valueWithNewObjectInContext:]):
      (+[JSValue valueWithNewArrayInContext:]):
      (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]):
      (+[JSValue valueWithNewErrorFromMessage:inContext:]):
      (+[JSValue valueWithNullInContext:]):
      (+[JSValue valueWithUndefinedInContext:]):
          - Constructors.
      (-[JSValue toObject]):
      (-[JSValue toObjectOfClass:]):
      (-[JSValue toBool]):
      (-[JSValue toDouble]):
      (-[JSValue toInt32]):
      (-[JSValue toUInt32]):
      (-[JSValue toNumber]):
      (-[JSValue toString]):
      (-[JSValue toDate]):
      (-[JSValue toArray]):
      (-[JSValue toDictionary]):
          - Conversion to Objective-C types.
      (-[JSValue valueForProperty:]):
      (-[JSValue setValue:forProperty:]):
      (-[JSValue deleteProperty:]):
      (-[JSValue hasProperty:]):
      (-[JSValue defineProperty:descriptor:]):
          - Property access by property name.
      (-[JSValue valueAtIndex:]):
      (-[JSValue setValue:atIndex:]):
          - Property access by index.
      (-[JSValue isUndefined]):
      (-[JSValue isNull]):
      (-[JSValue isBoolean]):
      (-[JSValue isNumber]):
      (-[JSValue isString]):
      (-[JSValue isObject]):
          - Test JavaScript type.
      (-[JSValue isEqualToObject:]):
      (-[JSValue isEqualWithTypeCoercionToObject:]):
      (-[JSValue isInstanceOf:]):
          - ===, ==, instanceof operators.
      (-[JSValue callWithArguments:]):
      (-[JSValue constructWithArguments:]):
      (-[JSValue invokeMethod:withArguments:]):
          - Call & construct.
      (-[JSValue context]):
          - implementation for .context property.
      (-[JSValue toPoint]):
      (-[JSValue toRange]):
      (-[JSValue toRect]):
      (-[JSValue toSize]):
      (+[JSValue valueWithPoint:inContext:]):
      (+[JSValue valueWithRange:inContext:]):
      (+[JSValue valueWithRect:inContext:]):
      (+[JSValue valueWithSize:inContext:]):
          - Support for NS struct types.
      (-[JSValue objectForKeyedSubscript:]):
      (-[JSValue objectAtIndexedSubscript:]):
      (-[JSValue setObject:forKeyedSubscript:]):
      (-[JSValue setObject:atIndexedSubscript:]):
          - support for subscript property access.
      (isDate):
      (isArray):
          - internal helper functions to check for instances of JS Date, Array types.
      (JSContainerConvertor):
      (Task):
      (JSContainerConvertor::JSContainerConvertor):
      (JSContainerConvertor::isWorkListEmpty):
      (JSContainerConvertor::convert):
      (JSContainerConvertor::add):
      (JSContainerConvertor::take):
          - helper class for tracking state while converting to Array/Dictionary objects.
      (valueToObjectWithoutCopy):
      (containerValueToObject):
      (valueToObject):
      (valueToNumber):
      (valueToString):
      (valueToDate):
      (valueToArray):
      (valueToDictionary):
          - function for converting JavaScript values to Objective-C objects.
      (ObjcContainerConvertor):
      (ObjcContainerConvertor::ObjcContainerConvertor):
      (ObjcContainerConvertor::isWorkListEmpty):
      (ObjcContainerConvertor::convert):
      (ObjcContainerConvertor::add):
      (ObjcContainerConvertor::take):
          - helper class for tracking state while converting to Array/Dictionary values.
      (objectToValueWithoutCopy):
      (objectToValue):
      (valueInternalValue):
          - function for converting Objective-C objects to JavaScript values.
      (+[JSValue valueWithValue:inContext:]):
      (-[JSValue initWithValue:inContext:]):
          - internal constructors.
      (StructTagHandler):
      (getStructTagHandler):
      (+[JSValue selectorForStructToValue:]):
      (+[JSValue selectorForValueToStruct:]):
          - methods to tracking struct types that support conversion to/from JSValue.
      (-[JSValue dealloc]):
          - destructor.
      (-[JSValue description]):
          - Objective-C to-NSString conversion.
      (typeToValueInvocationFor):
      (valueToTypeInvocationFor):
          - create invocation objects for conversion to/from JSValue.
      * API/JSValueInternal.h: Added.
          - see API/JSValue.mm for description of internal methods.
      * API/JSVirtualMachine.h: Added.
          - this Objective-C class is used to reference a JavaScript virtual machine (JSGlobalData).
      * API/JSVirtualMachine.mm: Added.
      (-[JSVirtualMachine init]):
      (-[JSVirtualMachine dealloc]):
          - constructor & destructor.
      (getGroupFromVirtualMachine):
          - internal accessor for m_group property.
      * API/JSVirtualMachineInternal.h: Added.
          - see API/JSVirtualMachine.mm for description of internal methods.
      * API/JSWrapperMap.h: Added.
      * API/JSWrapperMap.mm: Added.
      (wrapperClass):
          - singleton root for detction (& unwrapping) of wrapper objects.
      (selectorToPropertyName):
          - default selector to property name conversion.
      (createObjectWithCustomBrand):
          - creates a JSObject with a custom NativeBrand (class name).
      (createRenameMap):
          - parse @optional properties of a JSExport protocol.
      (putNonEnumerable):
          - property put with enumerable=false.
      (copyMethodsToObject):
          - iterate methods in a protocol; add functions to a JSObject.
      (parsePropertyAttributes):
          - examine protocol property metadata.
      (makeSetterName):
          - "foo" -> "setFoo"
      (copyPrototypeProperties):
          - create properties on a Protocol object reflecting the instance methods & properties of a protocol.
      (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]):
      (-[JSObjCClassInfo dealloc]):
      (-[JSObjCClassInfo wrapperForObject:]):
      (-[JSObjCClassInfo constructor]):
          - cache the Protocol/Constructor objects for an Objective-C type.
      (-[JSWrapperMap initWithContext:]):
      (-[JSWrapperMap dealloc]):
          - constructor & desctructor.
      (-[JSWrapperMap classInfoForClass:]):
          - maps Class -> JSObjCClassInfo.
      (-[JSWrapperMap wrapperForObject:]):
          - cretae or retrieve a cached wrapper value for an object.
      (tryUnwrapObjcObject):
          - check whether a value is a wrapper object; unwrap if so.
      * API/JavaScriptCore.h:
          - Added includes for new API headers.
      * API/ObjCCallbackFunction.h: Added.
          - this class is used to wrap Objective-C instance methods, class methods & blocks as JSFunction objects.
      * API/ObjCCallbackFunction.mm: Added.
      (CallbackArgument):
      (CallbackArgument::~CallbackArgument):
      (CallbackArgumentBoolean):
      (CallbackArgumentBoolean::set):
      (CallbackArgumentInteger):
      (CallbackArgumentInteger::set):
      (CallbackArgumentDouble):
      (CallbackArgumentDouble::set):
      (CallbackArgumentJSValue):
      (CallbackArgumentJSValue::set):
      (CallbackArgumentId):
      (CallbackArgumentId::set):
      (CallbackArgumentOfClass):
      (CallbackArgumentOfClass::CallbackArgumentOfClass):
      (CallbackArgumentOfClass::~CallbackArgumentOfClass):
      (CallbackArgumentOfClass::set):
      (CallbackArgumentNSNumber):
      (CallbackArgumentNSNumber::set):
      (CallbackArgumentNSString):
      (CallbackArgumentNSString::set):
      (CallbackArgumentNSDate):
      (CallbackArgumentNSDate::set):
      (CallbackArgumentNSArray):
      (CallbackArgumentNSArray::set):
      (CallbackArgumentNSDictionary):
      (CallbackArgumentNSDictionary::set):
      (CallbackArgumentStruct):
      (CallbackArgumentStruct::CallbackArgumentStruct):
      (CallbackArgumentStruct::~CallbackArgumentStruct):
      (CallbackArgumentStruct::set):
      (CallbackArgumentBlockCallback):
      (CallbackArgumentBlockCallback::CallbackArgumentBlockCallback):
      (CallbackArgumentBlockCallback::~CallbackArgumentBlockCallback):
      (CallbackArgumentBlockCallback::set):
          - decoded arguent type information of a ObjCCallbackFunction.
      (ArgumentTypeDelegate):
      (ArgumentTypeDelegate::typeInteger):
      (ArgumentTypeDelegate::typeDouble):
      (ArgumentTypeDelegate::typeBool):
      (ArgumentTypeDelegate::typeVoid):
      (ArgumentTypeDelegate::typeId):
      (ArgumentTypeDelegate::typeOfClass):
      (ArgumentTypeDelegate::typeBlock):
      (ArgumentTypeDelegate::typeStruct):
          - delegate for use in conjunction with parseObjCType.
      (CallbackResult):
      (CallbackResult::~CallbackResult):
      (CallbackResultVoid):
      (CallbackResultVoid::get):
      (CallbackResultId):
      (CallbackResultId::get):
      (CallbackResultNumeric):
      (CallbackResultNumeric::get):
      (CallbackResultBoolean):
      (CallbackResultBoolean::get):
      (CallbackResultStruct):
      (CallbackResultStruct::CallbackResultStruct):
      (CallbackResultStruct::~CallbackResultStruct):
      (CallbackResultStruct::get):
          - decoded result type information of a ObjCCallbackFunction.
      (ResultTypeDelegate):
      (ResultTypeDelegate::typeInteger):
      (ResultTypeDelegate::typeDouble):
      (ResultTypeDelegate::typeBool):
      (ResultTypeDelegate::typeVoid):
      (ResultTypeDelegate::typeId):
      (ResultTypeDelegate::typeOfClass):
      (ResultTypeDelegate::typeBlock):
      (ResultTypeDelegate::typeStruct):
          - delegate for use in conjunction with parseObjCType.
      (ObjCCallbackFunction):
      (ObjCCallbackFunction::ObjCCallbackFunction):
      (ObjCCallbackFunction::~ObjCCallbackFunction):
          - constructor & destructor.
      (ObjCCallbackFunction::context):
          - accessor.
      (ObjCCallbackFunction::wrappedBlock):
          - attemmpt to unwrap a block object.
      (objCCallbackFunctionFinalize):
      (objCCallbackFunctionCallAsFunction):
      (objCCallbackFunctionClass):
          - JSClassRef used to represent ObjCCallbackFunction objects.
      (ObjCCallbackFunction::call):
      (blockSignatureContainsClass):
          - helper function to determine if we're running on a recent Clang.
      (skipNumber):
          - helper used in parsing signature strings.
      (objCCallbackFunctionForInvocation):
      (objCCallbackFunctionForMethod):
      (objCCallbackFunctionForBlock):
          - functions to try to create ObjCCallbackFunction instances for methods/blocks.
      (tryUnwrapBlock):
          - attemmpt to unwrap a block object.
      * API/ObjcRuntimeExtras.h: Added.
      (protocolImplementsProtocol):
      (forEachProtocolImplementingProtocol):
      (forEachMethodInClass):
      (forEachMethodInProtocol):
      (forEachPropertyInProtocol):
          - functions used in reflecting on Objective-C types.
      (skipPair):
          - parsing helper used by parseObjCType, scans for matching parentheses.
      (StringRange):
      (StringRange::StringRange):
      (StringRange::~StringRange):
      (StringRange::operator const char*):
      (StringRange::get):
          - Helper class - create a c string copy of a range of an existing string.
      (parseObjCType):
          - function to parse Objective-C type strings, makes callbacks to a deleagte.
      * API/tests/testapi.c:
      (main):
          - added call to testObjectiveCAPI (in testapi.m).
      * API/tests/testapi.m: Added.
      (+[ParentObject parentTest]):
      (+[TestObject testObject]):
      (+[TestObject classTest]):
      (-[TestObject getString]):
      (-[TestObject testArgumentTypesWithInt:double:boolean:string:number:array:dictionary:]):
      (-[TestObject callback:]):
      (-[TextXYZ test:]):
          - test object, used in various test vases.
      (checkResult):
          - helper function.
      (blockSignatureContainsClass):
          - helper function to determine if we're running on a recent Clang.
      (testObjectiveCAPI):
          - new test cases.
      * JavaScriptCore.xcodeproj/project.pbxproj:
          - added new files.
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      * runtime/JSGlobalData.h:
      (JSGlobalData):
          - added m_apiData - provide convenient storage for use by the API.
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::JSGlobalObject):
      * runtime/JSGlobalObject.h:
      (JSGlobalObject):
          - added m_apiData - provide convenient storage for use by the API.
      
      ../WTF: 
      
      * wtf/WTFThreadData.cpp:
      (WTF::WTFThreadData::WTFThreadData):
      * wtf/WTFThreadData.h:
      (WTFThreadData):
          - Added m_apiData - provide convenient storage for use by the API.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fc381887