Changeset 138604 in webkit
- Timestamp:
- Jan 1, 2013 7:51:15 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSBase.h
r121762 r138604 29 29 #ifndef __cplusplus 30 30 #include <stdbool.h> 31 #endif 32 33 #ifdef __OBJC__ 34 #import <Foundation/Foundation.h> 31 35 #endif 32 36 … … 136 140 #endif 137 141 142 /* Enable the Objective-C API for platforms with a modern runtime. */ 143 #undef JS_OBJC_API_ENABLED 144 #define JS_OBJC_API_ENABLED (defined(__OBJC__) && defined(__clang__) && defined(__APPLE__) && (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) && !defined(__i386__)) 145 138 146 #endif /* JSBase_h */ -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r130612 r138604 509 509 bool JSCallbackObject<Parent>::inherits(JSClassRef c) const 510 510 { 511 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) 511 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { 512 512 if (jsClass == c) 513 513 return true; 514 514 } 515 515 return false; 516 516 } -
trunk/Source/JavaScriptCore/API/JavaScriptCore.h
r34599 r138604 30 30 #include <JavaScriptCore/JSStringRefCF.h> 31 31 32 #if JS_OBJC_API_ENABLED 33 34 #import "JSContext.h" 35 #import "APIJSValue.h" 36 #import "JSVirtualMachine.h" 37 #import "JSExport.h" 38 39 #endif 40 32 41 #endif /* JavaScriptCore_h */ -
trunk/Source/JavaScriptCore/API/tests/testapi.c
r138329 r138604 49 49 #endif 50 50 51 #if PLATFORM(MAC) 52 void testObjectiveCAPI(void); 53 #endif 54 51 55 static JSGlobalContextRef context; 52 staticint failed;56 int failed; 53 57 static void assertEqualsAsBoolean(JSValueRef value, bool expectedValue) 54 58 { … … 1039 1043 // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>. 1040 1044 ::SetErrorMode(0); 1045 #endif 1046 1047 #if PLATFORM(MAC) 1048 testObjectiveCAPI(); 1041 1049 #endif 1042 1050 -
trunk/Source/JavaScriptCore/ChangeLog
r138523 r138604 1 2012-12-31 Gavin Barraclough <barraclough@apple.com> 2 3 Objective-C API for JavaScriptCore 4 https://bugs.webkit.org/show_bug.cgi?id=105889 5 6 Reviewed by Filip Pizlo. 7 8 For a detailed description of the API implemented here, see: 9 JSContext.h 10 APIJSValue.h 11 JSVirtualMachine.h 12 JSExport.h 13 Still to do - 14 (1) Shoud rename APIJSValue.h -> JSValue.h (but we'll have to rename JSValue.h first). 15 (2) Numerous FIXMEs, all with separate bugs filed. 16 17 * API/APIJSValue.h: Added. 18 - this Objective-C class is used to reference a JavaScript object. 19 * API/JSBase.h: 20 - added JS_OBJC_API_ENABLED macro to control ObjC API support. 21 * API/JSBlockAdaptor.h: Added. 22 - this Objective-C class is used in creating a special NSBlock proxying a JavaScript function. 23 * API/JSBlockAdaptor.mm: Added. 24 (BlockArgument): 25 (BlockArgument::~BlockArgument): 26 (BlockArgumentBoolean): 27 (BlockArgumentBoolean::get): 28 (BlockArgumentNumeric): 29 (BlockArgumentNumeric::get): 30 (BlockArgumentId): 31 (BlockArgumentId::get): 32 (BlockArgumentStruct): 33 (BlockArgumentStruct::BlockArgumentStruct): 34 (BlockArgumentStruct::~BlockArgumentStruct): 35 (BlockArgumentStruct::get): 36 - decoded arguent type information of a JSBlockAdaptor. 37 (BlockArgumentTypeDelegate): 38 (BlockArgumentTypeDelegate::typeInteger): 39 (BlockArgumentTypeDelegate::typeDouble): 40 (BlockArgumentTypeDelegate::typeBool): 41 (BlockArgumentTypeDelegate::typeVoid): 42 (BlockArgumentTypeDelegate::typeId): 43 (BlockArgumentTypeDelegate::typeOfClass): 44 (BlockArgumentTypeDelegate::typeBlock): 45 (BlockArgumentTypeDelegate::typeStruct): 46 - delegate for use in conjunction with parseObjCType. 47 (BlockResult): 48 (BlockResult::~BlockResult): 49 (BlockResultVoid): 50 (BlockResultVoid::set): 51 (BlockResultInteger): 52 (BlockResultInteger::set): 53 (BlockResultDouble): 54 (BlockResultDouble::set): 55 (BlockResultBoolean): 56 (BlockResultBoolean::set): 57 (BlockResultStruct): 58 (BlockResultStruct::BlockResultStruct): 59 (BlockResultStruct::~BlockResultStruct): 60 (BlockResultStruct::set): 61 - decoded result type information of a JSBlockAdaptor. 62 (buildBlockSignature): 63 - partial step in constructing a signature with stack offset information from one without. 64 (-[JSBlockAdaptor initWithBlockSignatureFromProtocol:]): 65 - constructor. 66 (-[JSBlockAdaptor blockMatchesSignature:]): 67 - check whether signature strings match, where only one contains stack frame offsets. 68 (-[JSBlockAdaptor blockFromValue:inContext:withException:]): 69 - use the adaptor to create a special forwarding block. 70 * API/JSCallbackObjectFunctions.h: 71 (JSC::::inherits): 72 - add missing braces to multiline for statement. 73 * API/JSContext.h: Added. 74 - this Objective-C class is used to reference a JavaScript context. 75 * API/JSContext.mm: Added. 76 (-[JSContext init]): 77 - constructor. 78 (-[JSContext initWithVirtualMachine:]): 79 - construct in a given VM (JSGlobalData). 80 (-[JSContext evaluateScript:]): 81 (-[JSContext globalObject]): 82 - evaluate a script, global object accessor. 83 (+[JSContext currentContext]): 84 (+[JSContext currentThis]): 85 (+[JSContext currentArguments]): 86 - These methods obtain context, this, arguments from within a callback. 87 (-[JSContext virtualMachine]): 88 - implementation for .virtualMachine property. 89 (-[JSContext objectForKeyedSubscript:]): 90 (-[JSContext setObject:forKeyedSubscript:]): 91 - support for subscript property access. 92 (contextInternalContext): 93 - internal accessor to m_context. 94 (-[JSContext dealloc]): 95 - desctructor. 96 (-[JSContext notifyException:]): 97 (-[JSContext valueFromNotifyException:]): 98 (-[JSContext boolFromNotifyException:]): 99 - internal method to record an exception was thrown. 100 (-[JSContext beginCallbackWithData:thisValue:argumentCount:arguments:]): 101 (-[JSContext endCallbackWithData:]): 102 - internal methods to push/pop a callback record. 103 (-[JSContext protect:]): 104 (-[JSContext unprotect:]): 105 - internal methods to add a value to a protect set (used to protect the internal property of JSValue). 106 (-[JSContext wrapperForObject:]): 107 - internal method to create a wrapper object. 108 (WeakContextRef::WeakContextRef): 109 (WeakContextRef::~WeakContextRef): 110 (WeakContextRef::get): 111 (WeakContextRef::set): 112 - Helper class to implement a weak reference to a JSContext. 113 * API/JSContextInternal.h: Added. 114 (CallbackData): 115 (WeakContextRef): 116 - see API/JSContext.mm for description of internal methods. 117 * API/JSExport.h: Added. 118 - Provides JSExport protocol & JSExportAs macro. 119 * API/JSValue.mm: Added. 120 (+[JSValue valueWithObject:inContext:]): 121 (+[JSValue valueWithBool:inContext:]): 122 (+[JSValue valueWithDouble:inContext:]): 123 (+[JSValue valueWithInt32:inContext:]): 124 (+[JSValue valueWithUInt32:inContext:]): 125 (+[JSValue valueWithNewObjectInContext:]): 126 (+[JSValue valueWithNewArrayInContext:]): 127 (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]): 128 (+[JSValue valueWithNewErrorFromMessage:inContext:]): 129 (+[JSValue valueWithNullInContext:]): 130 (+[JSValue valueWithUndefinedInContext:]): 131 - Constructors. 132 (-[JSValue toObject]): 133 (-[JSValue toObjectOfClass:]): 134 (-[JSValue toBool]): 135 (-[JSValue toDouble]): 136 (-[JSValue toInt32]): 137 (-[JSValue toUInt32]): 138 (-[JSValue toNumber]): 139 (-[JSValue toString]): 140 (-[JSValue toDate]): 141 (-[JSValue toArray]): 142 (-[JSValue toDictionary]): 143 - Conversion to Objective-C types. 144 (-[JSValue valueForProperty:]): 145 (-[JSValue setValue:forProperty:]): 146 (-[JSValue deleteProperty:]): 147 (-[JSValue hasProperty:]): 148 (-[JSValue defineProperty:descriptor:]): 149 - Property access by property name. 150 (-[JSValue valueAtIndex:]): 151 (-[JSValue setValue:atIndex:]): 152 - Property access by index. 153 (-[JSValue isUndefined]): 154 (-[JSValue isNull]): 155 (-[JSValue isBoolean]): 156 (-[JSValue isNumber]): 157 (-[JSValue isString]): 158 (-[JSValue isObject]): 159 - Test JavaScript type. 160 (-[JSValue isEqualToObject:]): 161 (-[JSValue isEqualWithTypeCoercionToObject:]): 162 (-[JSValue isInstanceOf:]): 163 - ===, ==, instanceof operators. 164 (-[JSValue callWithArguments:]): 165 (-[JSValue constructWithArguments:]): 166 (-[JSValue invokeMethod:withArguments:]): 167 - Call & construct. 168 (-[JSValue context]): 169 - implementation for .context property. 170 (-[JSValue toPoint]): 171 (-[JSValue toRange]): 172 (-[JSValue toRect]): 173 (-[JSValue toSize]): 174 (+[JSValue valueWithPoint:inContext:]): 175 (+[JSValue valueWithRange:inContext:]): 176 (+[JSValue valueWithRect:inContext:]): 177 (+[JSValue valueWithSize:inContext:]): 178 - Support for NS struct types. 179 (-[JSValue objectForKeyedSubscript:]): 180 (-[JSValue objectAtIndexedSubscript:]): 181 (-[JSValue setObject:forKeyedSubscript:]): 182 (-[JSValue setObject:atIndexedSubscript:]): 183 - support for subscript property access. 184 (isDate): 185 (isArray): 186 - internal helper functions to check for instances of JS Date, Array types. 187 (JSContainerConvertor): 188 (Task): 189 (JSContainerConvertor::JSContainerConvertor): 190 (JSContainerConvertor::isWorkListEmpty): 191 (JSContainerConvertor::convert): 192 (JSContainerConvertor::add): 193 (JSContainerConvertor::take): 194 - helper class for tracking state while converting to Array/Dictionary objects. 195 (valueToObjectWithoutCopy): 196 (containerValueToObject): 197 (valueToObject): 198 (valueToNumber): 199 (valueToString): 200 (valueToDate): 201 (valueToArray): 202 (valueToDictionary): 203 - function for converting JavaScript values to Objective-C objects. 204 (ObjcContainerConvertor): 205 (ObjcContainerConvertor::ObjcContainerConvertor): 206 (ObjcContainerConvertor::isWorkListEmpty): 207 (ObjcContainerConvertor::convert): 208 (ObjcContainerConvertor::add): 209 (ObjcContainerConvertor::take): 210 - helper class for tracking state while converting to Array/Dictionary values. 211 (objectToValueWithoutCopy): 212 (objectToValue): 213 (valueInternalValue): 214 - function for converting Objective-C objects to JavaScript values. 215 (+[JSValue valueWithValue:inContext:]): 216 (-[JSValue initWithValue:inContext:]): 217 - internal constructors. 218 (StructTagHandler): 219 (getStructTagHandler): 220 (+[JSValue selectorForStructToValue:]): 221 (+[JSValue selectorForValueToStruct:]): 222 - methods to tracking struct types that support conversion to/from JSValue. 223 (-[JSValue dealloc]): 224 - destructor. 225 (-[JSValue description]): 226 - Objective-C to-NSString conversion. 227 (typeToValueInvocationFor): 228 (valueToTypeInvocationFor): 229 - create invocation objects for conversion to/from JSValue. 230 * API/JSValueInternal.h: Added. 231 - see API/JSValue.mm for description of internal methods. 232 * API/JSVirtualMachine.h: Added. 233 - this Objective-C class is used to reference a JavaScript virtual machine (JSGlobalData). 234 * API/JSVirtualMachine.mm: Added. 235 (-[JSVirtualMachine init]): 236 (-[JSVirtualMachine dealloc]): 237 - constructor & destructor. 238 (getGroupFromVirtualMachine): 239 - internal accessor for m_group property. 240 * API/JSVirtualMachineInternal.h: Added. 241 - see API/JSVirtualMachine.mm for description of internal methods. 242 * API/JSWrapperMap.h: Added. 243 * API/JSWrapperMap.mm: Added. 244 (wrapperClass): 245 - singleton root for detction (& unwrapping) of wrapper objects. 246 (selectorToPropertyName): 247 - default selector to property name conversion. 248 (createObjectWithCustomBrand): 249 - creates a JSObject with a custom NativeBrand (class name). 250 (createRenameMap): 251 - parse @optional properties of a JSExport protocol. 252 (putNonEnumerable): 253 - property put with enumerable=false. 254 (copyMethodsToObject): 255 - iterate methods in a protocol; add functions to a JSObject. 256 (parsePropertyAttributes): 257 - examine protocol property metadata. 258 (makeSetterName): 259 - "foo" -> "setFoo" 260 (copyPrototypeProperties): 261 - create properties on a Protocol object reflecting the instance methods & properties of a protocol. 262 (-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]): 263 (-[JSObjCClassInfo dealloc]): 264 (-[JSObjCClassInfo wrapperForObject:]): 265 (-[JSObjCClassInfo constructor]): 266 - cache the Protocol/Constructor objects for an Objective-C type. 267 (-[JSWrapperMap initWithContext:]): 268 (-[JSWrapperMap dealloc]): 269 - constructor & desctructor. 270 (-[JSWrapperMap classInfoForClass:]): 271 - maps Class -> JSObjCClassInfo. 272 (-[JSWrapperMap wrapperForObject:]): 273 - cretae or retrieve a cached wrapper value for an object. 274 (tryUnwrapObjcObject): 275 - check whether a value is a wrapper object; unwrap if so. 276 * API/JavaScriptCore.h: 277 - Added includes for new API headers. 278 * API/ObjCCallbackFunction.h: Added. 279 - this class is used to wrap Objective-C instance methods, class methods & blocks as JSFunction objects. 280 * API/ObjCCallbackFunction.mm: Added. 281 (CallbackArgument): 282 (CallbackArgument::~CallbackArgument): 283 (CallbackArgumentBoolean): 284 (CallbackArgumentBoolean::set): 285 (CallbackArgumentInteger): 286 (CallbackArgumentInteger::set): 287 (CallbackArgumentDouble): 288 (CallbackArgumentDouble::set): 289 (CallbackArgumentJSValue): 290 (CallbackArgumentJSValue::set): 291 (CallbackArgumentId): 292 (CallbackArgumentId::set): 293 (CallbackArgumentOfClass): 294 (CallbackArgumentOfClass::CallbackArgumentOfClass): 295 (CallbackArgumentOfClass::~CallbackArgumentOfClass): 296 (CallbackArgumentOfClass::set): 297 (CallbackArgumentNSNumber): 298 (CallbackArgumentNSNumber::set): 299 (CallbackArgumentNSString): 300 (CallbackArgumentNSString::set): 301 (CallbackArgumentNSDate): 302 (CallbackArgumentNSDate::set): 303 (CallbackArgumentNSArray): 304 (CallbackArgumentNSArray::set): 305 (CallbackArgumentNSDictionary): 306 (CallbackArgumentNSDictionary::set): 307 (CallbackArgumentStruct): 308 (CallbackArgumentStruct::CallbackArgumentStruct): 309 (CallbackArgumentStruct::~CallbackArgumentStruct): 310 (CallbackArgumentStruct::set): 311 (CallbackArgumentBlockCallback): 312 (CallbackArgumentBlockCallback::CallbackArgumentBlockCallback): 313 (CallbackArgumentBlockCallback::~CallbackArgumentBlockCallback): 314 (CallbackArgumentBlockCallback::set): 315 - decoded arguent type information of a ObjCCallbackFunction. 316 (ArgumentTypeDelegate): 317 (ArgumentTypeDelegate::typeInteger): 318 (ArgumentTypeDelegate::typeDouble): 319 (ArgumentTypeDelegate::typeBool): 320 (ArgumentTypeDelegate::typeVoid): 321 (ArgumentTypeDelegate::typeId): 322 (ArgumentTypeDelegate::typeOfClass): 323 (ArgumentTypeDelegate::typeBlock): 324 (ArgumentTypeDelegate::typeStruct): 325 - delegate for use in conjunction with parseObjCType. 326 (CallbackResult): 327 (CallbackResult::~CallbackResult): 328 (CallbackResultVoid): 329 (CallbackResultVoid::get): 330 (CallbackResultId): 331 (CallbackResultId::get): 332 (CallbackResultNumeric): 333 (CallbackResultNumeric::get): 334 (CallbackResultBoolean): 335 (CallbackResultBoolean::get): 336 (CallbackResultStruct): 337 (CallbackResultStruct::CallbackResultStruct): 338 (CallbackResultStruct::~CallbackResultStruct): 339 (CallbackResultStruct::get): 340 - decoded result type information of a ObjCCallbackFunction. 341 (ResultTypeDelegate): 342 (ResultTypeDelegate::typeInteger): 343 (ResultTypeDelegate::typeDouble): 344 (ResultTypeDelegate::typeBool): 345 (ResultTypeDelegate::typeVoid): 346 (ResultTypeDelegate::typeId): 347 (ResultTypeDelegate::typeOfClass): 348 (ResultTypeDelegate::typeBlock): 349 (ResultTypeDelegate::typeStruct): 350 - delegate for use in conjunction with parseObjCType. 351 (ObjCCallbackFunction): 352 (ObjCCallbackFunction::ObjCCallbackFunction): 353 (ObjCCallbackFunction::~ObjCCallbackFunction): 354 - constructor & destructor. 355 (ObjCCallbackFunction::context): 356 - accessor. 357 (ObjCCallbackFunction::wrappedBlock): 358 - attemmpt to unwrap a block object. 359 (objCCallbackFunctionFinalize): 360 (objCCallbackFunctionCallAsFunction): 361 (objCCallbackFunctionClass): 362 - JSClassRef used to represent ObjCCallbackFunction objects. 363 (ObjCCallbackFunction::call): 364 (blockSignatureContainsClass): 365 - helper function to determine if we're running on a recent Clang. 366 (skipNumber): 367 - helper used in parsing signature strings. 368 (objCCallbackFunctionForInvocation): 369 (objCCallbackFunctionForMethod): 370 (objCCallbackFunctionForBlock): 371 - functions to try to create ObjCCallbackFunction instances for methods/blocks. 372 (tryUnwrapBlock): 373 - attemmpt to unwrap a block object. 374 * API/ObjcRuntimeExtras.h: Added. 375 (protocolImplementsProtocol): 376 (forEachProtocolImplementingProtocol): 377 (forEachMethodInClass): 378 (forEachMethodInProtocol): 379 (forEachPropertyInProtocol): 380 - functions used in reflecting on Objective-C types. 381 (skipPair): 382 - parsing helper used by parseObjCType, scans for matching parentheses. 383 (StringRange): 384 (StringRange::StringRange): 385 (StringRange::~StringRange): 386 (StringRange::operator const char*): 387 (StringRange::get): 388 - Helper class - create a c string copy of a range of an existing string. 389 (parseObjCType): 390 - function to parse Objective-C type strings, makes callbacks to a deleagte. 391 * API/tests/testapi.c: 392 (main): 393 - added call to testObjectiveCAPI (in testapi.m). 394 * API/tests/testapi.m: Added. 395 (+[ParentObject parentTest]): 396 (+[TestObject testObject]): 397 (+[TestObject classTest]): 398 (-[TestObject getString]): 399 (-[TestObject testArgumentTypesWithInt:double:boolean:string:number:array:dictionary:]): 400 (-[TestObject callback:]): 401 (-[TextXYZ test:]): 402 - test object, used in various test vases. 403 (checkResult): 404 - helper function. 405 (blockSignatureContainsClass): 406 - helper function to determine if we're running on a recent Clang. 407 (testObjectiveCAPI): 408 - new test cases. 409 * JavaScriptCore.xcodeproj/project.pbxproj: 410 - added new files. 411 * runtime/JSGlobalData.cpp: 412 (JSC::JSGlobalData::JSGlobalData): 413 * runtime/JSGlobalData.h: 414 (JSGlobalData): 415 - added m_apiData - provide convenient storage for use by the API. 416 * runtime/JSGlobalObject.cpp: 417 (JSC::JSGlobalObject::JSGlobalObject): 418 * runtime/JSGlobalObject.h: 419 (JSGlobalObject): 420 - added m_apiData - provide convenient storage for use by the API. 421 1 422 2012-12-27 Csaba Osztrogonác <ossy@webkit.org> 2 423 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r138465 r138604 541 541 86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */; }; 542 542 86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CCEFDD0F413F8900FD7F9E /* JITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 543 86D2221A167EF9440024C804 /* testapi.m in Sources */ = {isa = PBXBuildFile; fileRef = 86D22219167EF9440024C804 /* testapi.m */; }; 543 544 86D3B2C310156BDE002865E7 /* ARMAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86D3B2BF10156BDE002865E7 /* ARMAssembler.cpp */; }; 544 545 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C010156BDE002865E7 /* ARMAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 549 550 86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */; }; 550 551 86E116B10FE75AC800B512BC /* CodeLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E116B00FE75AC800B512BC /* CodeLocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 552 86E3C612167BABD7006D760A /* APIJSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C606167BAB87006D760A /* APIJSValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 553 86E3C613167BABD7006D760A /* JSContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C607167BAB87006D760A /* JSContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; 554 86E3C614167BABD7006D760A /* JSExport.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60A167BAB87006D760A /* JSExport.h */; settings = {ATTRIBUTES = (Public, ); }; }; 555 86E3C615167BABD7006D760A /* JSVirtualMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60F167BAB87006D760A /* JSVirtualMachine.h */; settings = {ATTRIBUTES = (Public, ); }; }; 556 86E3C616167BABEE006D760A /* JSContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C608167BAB87006D760A /* JSContext.mm */; }; 557 86E3C617167BABEE006D760A /* JSContextInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C609167BAB87006D760A /* JSContextInternal.h */; }; 558 86E3C618167BABEE006D760A /* JSWrapperMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C60B167BAB87006D760A /* JSWrapperMap.mm */; }; 559 86E3C619167BABEE006D760A /* JSWrapperMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60C167BAB87006D760A /* JSWrapperMap.h */; }; 560 86E3C61A167BABEE006D760A /* JSValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C60D167BAB87006D760A /* JSValue.mm */; }; 561 86E3C61B167BABEE006D760A /* JSValueInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60E167BAB87006D760A /* JSValueInternal.h */; }; 562 86E3C61C167BABEE006D760A /* JSVirtualMachine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C610167BAB87006D760A /* JSVirtualMachine.mm */; }; 563 86E3C61D167BABEE006D760A /* JSVirtualMachineInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C611167BAB87006D760A /* JSVirtualMachineInternal.h */; }; 551 564 86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E85538111B9968001AF51E /* JSStringBuilder.h */; }; 552 565 86EBF2FF1560F06A008E9222 /* NameConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2F91560F036008E9222 /* NameConstructor.cpp */; }; … … 570 583 86ECA3EA132DEF1C002B2AD7 /* DFGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ECA3E9132DEF1C002B2AD7 /* DFGNode.h */; }; 571 584 86ECA3FA132DF25A002B2AD7 /* DFGScoreBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ECA3F9132DF25A002B2AD7 /* DFGScoreBoard.h */; }; 585 86F3EEBB168CDE930077B92A /* JSBlockAdaptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB7168CCF750077B92A /* JSBlockAdaptor.h */; }; 586 86F3EEBC168CDE930077B92A /* JSBlockAdaptor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86F3EEB8168CCF750077B92A /* JSBlockAdaptor.mm */; }; 587 86F3EEBD168CDE930077B92A /* ObjCCallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB9168CCF750077B92A /* ObjCCallbackFunction.h */; }; 588 86F3EEBE168CDE930077B92A /* ObjCCallbackFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86F3EEBA168CCF750077B92A /* ObjCCallbackFunction.mm */; }; 589 86F3EEBF168CDE930077B92A /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB616855A5B0077B92A /* ObjcRuntimeExtras.h */; }; 572 590 86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */; }; 573 591 86FA9E92142BBB2E001773B7 /* JSBoundFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */; }; … … 1379 1397 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess.cpp; sourceTree = "<group>"; }; 1380 1398 86CCEFDD0F413F8900FD7F9E /* JITCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCode.h; sourceTree = "<group>"; }; 1399 86D22219167EF9440024C804 /* testapi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = testapi.m; path = API/tests/testapi.m; sourceTree = "<group>"; }; 1381 1400 86D3B2BF10156BDE002865E7 /* ARMAssembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMAssembler.cpp; sourceTree = "<group>"; }; 1382 1401 86D3B2C010156BDE002865E7 /* ARMAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMAssembler.h; sourceTree = "<group>"; }; … … 1387 1406 86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorFixedVMPool.cpp; sourceTree = "<group>"; }; 1388 1407 86E116B00FE75AC800B512BC /* CodeLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeLocation.h; sourceTree = "<group>"; }; 1408 86E3C606167BAB87006D760A /* APIJSValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIJSValue.h; sourceTree = "<group>"; }; 1409 86E3C607167BAB87006D760A /* JSContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSContext.h; sourceTree = "<group>"; }; 1410 86E3C608167BAB87006D760A /* JSContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSContext.mm; sourceTree = "<group>"; }; 1411 86E3C609167BAB87006D760A /* JSContextInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSContextInternal.h; sourceTree = "<group>"; }; 1412 86E3C60A167BAB87006D760A /* JSExport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExport.h; sourceTree = "<group>"; }; 1413 86E3C60B167BAB87006D760A /* JSWrapperMap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSWrapperMap.mm; sourceTree = "<group>"; }; 1414 86E3C60C167BAB87006D760A /* JSWrapperMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrapperMap.h; sourceTree = "<group>"; }; 1415 86E3C60D167BAB87006D760A /* JSValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSValue.mm; sourceTree = "<group>"; }; 1416 86E3C60E167BAB87006D760A /* JSValueInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSValueInternal.h; sourceTree = "<group>"; }; 1417 86E3C60F167BAB87006D760A /* JSVirtualMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVirtualMachine.h; sourceTree = "<group>"; }; 1418 86E3C610167BAB87006D760A /* JSVirtualMachine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSVirtualMachine.mm; sourceTree = "<group>"; }; 1419 86E3C611167BAB87006D760A /* JSVirtualMachineInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVirtualMachineInternal.h; sourceTree = "<group>"; }; 1389 1420 86E85538111B9968001AF51E /* JSStringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringBuilder.h; sourceTree = "<group>"; }; 1390 1421 86EBF2F91560F036008E9222 /* NameConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameConstructor.cpp; sourceTree = "<group>"; }; … … 1408 1439 86ECA3E9132DEF1C002B2AD7 /* DFGNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGNode.h; path = dfg/DFGNode.h; sourceTree = "<group>"; }; 1409 1440 86ECA3F9132DF25A002B2AD7 /* DFGScoreBoard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGScoreBoard.h; path = dfg/DFGScoreBoard.h; sourceTree = "<group>"; }; 1441 86F3EEB616855A5B0077B92A /* ObjcRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjcRuntimeExtras.h; sourceTree = "<group>"; }; 1442 86F3EEB7168CCF750077B92A /* JSBlockAdaptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlockAdaptor.h; sourceTree = "<group>"; }; 1443 86F3EEB8168CCF750077B92A /* JSBlockAdaptor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSBlockAdaptor.mm; sourceTree = "<group>"; }; 1444 86F3EEB9168CCF750077B92A /* ObjCCallbackFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCCallbackFunction.h; sourceTree = "<group>"; }; 1445 86F3EEBA168CCF750077B92A /* ObjCCallbackFunction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ObjCCallbackFunction.mm; sourceTree = "<group>"; }; 1410 1446 86F75EFB151C062F007C9BA3 /* RegExpCachedResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCachedResult.cpp; sourceTree = "<group>"; }; 1411 1447 86F75EFC151C062F007C9BA3 /* RegExpCachedResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCachedResult.h; sourceTree = "<group>"; }; … … 1879 1915 14BD5A2D0A3E91F600BAF59C /* testapi.c */, 1880 1916 14D857740A4696C80032146C /* testapi.js */, 1917 86D22219167EF9440024C804 /* testapi.m */, 1881 1918 651122E5140469BA002B101D /* testRegExp.cpp */, 1882 1919 ); … … 2046 2083 children = ( 2047 2084 1482B78A0A4305AB00517CFC /* APICast.h */, 2085 86E3C606167BAB87006D760A /* APIJSValue.h */, 2048 2086 865F408710E7D56300947361 /* APIShims.h */, 2049 2087 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */, … … 2054 2092 142711380A460BBB0080EEEA /* JSBase.h */, 2055 2093 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */, 2094 86F3EEB7168CCF750077B92A /* JSBlockAdaptor.h */, 2095 86F3EEB8168CCF750077B92A /* JSBlockAdaptor.mm */, 2056 2096 1440F8AD0A508D200005F061 /* JSCallbackConstructor.cpp */, 2057 2097 1440F8AC0A508D200005F061 /* JSCallbackConstructor.h */, … … 2063 2103 1440FCE20A51E46B0005F061 /* JSClassRef.cpp */, 2064 2104 1440FCE10A51E46B0005F061 /* JSClassRef.h */, 2105 86E3C607167BAB87006D760A /* JSContext.h */, 2106 86E3C608167BAB87006D760A /* JSContext.mm */, 2107 86E3C609167BAB87006D760A /* JSContextInternal.h */, 2065 2108 14BD5A290A3E91F600BAF59C /* JSContextRef.cpp */, 2066 2109 14BD5A2A0A3E91F600BAF59C /* JSContextRef.h */, 2067 2110 148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */, 2111 86E3C60A167BAB87006D760A /* JSExport.h */, 2068 2112 1482B7E20A43076000517CFC /* JSObjectRef.cpp */, 2069 2113 1482B7E10A43076000517CFC /* JSObjectRef.h */, … … 2078 2122 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */, 2079 2123 146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */, 2124 86E3C60D167BAB87006D760A /* JSValue.mm */, 2125 86E3C60E167BAB87006D760A /* JSValueInternal.h */, 2080 2126 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */, 2081 2127 1482B6EA0A4300B300517CFC /* JSValueRef.h */, 2128 86E3C60F167BAB87006D760A /* JSVirtualMachine.h */, 2129 86E3C610167BAB87006D760A /* JSVirtualMachine.mm */, 2130 86E3C611167BAB87006D760A /* JSVirtualMachineInternal.h */, 2082 2131 A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */, 2083 2132 A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */, 2084 2133 A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */, 2134 86E3C60B167BAB87006D760A /* JSWrapperMap.mm */, 2135 86E3C60C167BAB87006D760A /* JSWrapperMap.h */, 2136 86F3EEB9168CCF750077B92A /* ObjCCallbackFunction.h */, 2137 86F3EEBA168CCF750077B92A /* ObjCCallbackFunction.mm */, 2138 86F3EEB616855A5B0077B92A /* ObjcRuntimeExtras.h */, 2085 2139 E124A8F60E555775003091F1 /* OpaqueJSString.cpp */, 2086 2140 E124A8F50E555775003091F1 /* OpaqueJSString.h */, … … 3206 3260 0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */, 3207 3261 0F572D4F16879FDD00E57FBD /* ThunkGenerator.h in Headers */, 3262 86E3C612167BABD7006D760A /* APIJSValue.h in Headers */, 3263 86E3C613167BABD7006D760A /* JSContext.h in Headers */, 3264 86E3C614167BABD7006D760A /* JSExport.h in Headers */, 3265 86E3C615167BABD7006D760A /* JSVirtualMachine.h in Headers */, 3266 86E3C617167BABEE006D760A /* JSContextInternal.h in Headers */, 3267 86E3C619167BABEE006D760A /* JSWrapperMap.h in Headers */, 3268 86E3C61B167BABEE006D760A /* JSValueInternal.h in Headers */, 3269 86E3C61D167BABEE006D760A /* JSVirtualMachineInternal.h in Headers */, 3270 86F3EEBB168CDE930077B92A /* JSBlockAdaptor.h in Headers */, 3271 86F3EEBD168CDE930077B92A /* ObjCCallbackFunction.h in Headers */, 3272 86F3EEBF168CDE930077B92A /* ObjcRuntimeExtras.h in Headers */, 3208 3273 ); 3209 3274 runOnlyForDeploymentPostprocessing = 0; … … 3529 3594 files = ( 3530 3595 1440F6100A4F85670005F061 /* testapi.c in Sources */, 3596 86D2221A167EF9440024C804 /* testapi.m in Sources */, 3531 3597 ); 3532 3598 runOnlyForDeploymentPostprocessing = 0; … … 3826 3892 0FEFC9AA1681A3B300567F53 /* DFGOSRExitJumpPlaceholder.cpp in Sources */, 3827 3893 0F5EF91E16878F7A003E5C25 /* JITThunks.cpp in Sources */, 3894 86E3C616167BABEE006D760A /* JSContext.mm in Sources */, 3895 86E3C618167BABEE006D760A /* JSWrapperMap.mm in Sources */, 3896 86E3C61A167BABEE006D760A /* JSValue.mm in Sources */, 3897 86E3C61C167BABEE006D760A /* JSVirtualMachine.mm in Sources */, 3898 86F3EEBC168CDE930077B92A /* JSBlockAdaptor.mm in Sources */, 3899 86F3EEBE168CDE930077B92A /* ObjCCallbackFunction.mm in Sources */, 3828 3900 ); 3829 3901 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r136895 r138604 186 186 #endif 187 187 , m_newStringsSinceLastHashConst(0) 188 , m_apiData(0) 188 189 #if ENABLE(ASSEMBLER) 189 190 , m_canUseAssembler(enableAssembler(executableAllocator)) -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r138465 r138604 454 454 JS_EXPORT_PRIVATE void discardAllCode(); 455 455 456 void *m_apiData; 457 456 458 private: 457 459 friend class LLIntOffsetsExtractor; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r136572 r138604 115 115 , m_evalEnabled(true) 116 116 , m_globalObjectMethodTable(globalObjectMethodTable ? globalObjectMethodTable : &s_globalObjectMethodTable) 117 , m_apiData(0) 117 118 { 118 119 } -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r135041 r138604 197 197 bool hasProfiler() const { return globalObjectMethodTable()->supportsProfiling(this); } 198 198 199 void* m_apiData; 200 199 201 protected: 200 202 JS_EXPORT_PRIVATE explicit JSGlobalObject(JSGlobalData&, Structure*, const GlobalObjectMethodTable* = 0); -
trunk/Source/WTF/ChangeLog
r138561 r138604 1 2012-12-31 Gavin Barraclough <barraclough@apple.com> 2 3 Objective-C API for JavaScriptCore 4 https://bugs.webkit.org/show_bug.cgi?id=105889 5 6 Reviewed by Filip Pizlo. 7 8 * wtf/WTFThreadData.cpp: 9 (WTF::WTFThreadData::WTFThreadData): 10 * wtf/WTFThreadData.h: 11 (WTFThreadData): 12 - Added m_apiData - provide convenient storage for use by the API. 13 1 14 2012-12-28 Ilya Tikhonovsky <loislo@chromium.org> 2 15 -
trunk/Source/WTF/wtf/WTFThreadData.cpp
r131938 r138604 33 33 34 34 WTFThreadData::WTFThreadData() 35 : m_atomicStringTable(0) 35 : m_apiData(0) 36 , m_atomicStringTable(0) 36 37 , m_atomicStringTableDestructor(0) 37 38 #if USE(JSC) -
trunk/Source/WTF/wtf/WTFThreadData.h
r134797 r138604 124 124 #endif // USE(JSC) 125 125 126 void* m_apiData; 127 126 128 private: 127 129 AtomicStringTable* m_atomicStringTable;
Note: See TracChangeset
for help on using the changeset viewer.