From 297c63cd5e3495d1b079496e7438b804684e82b7 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 25 Jun 2013 10:19:55 -0700 Subject: [PATCH 01/43] jsbidings for mac --- .../contents.xcworkspacedata | 5 +- .../bindings/js_manual_conversions.cpp | 49 +- .../bindings/proj.mac/jsbindings-Prefix.pch | 7 + .../jsbindings.xcodeproj/project.pbxproj | 666 ++++++ .../spidermonkey-mac/include/ds/BitArray.h | 58 + .../spidermonkey-mac/include/gc/Root.h | 1078 ++++++++++ .../spidermonkey-mac/include/js-config.h | 65 + .../spidermonkey-mac/include/js.msg | 390 ++++ .../spidermonkey-mac/include/js/Anchor.h | 163 ++ .../include/js/CharacterEncoding.h | 144 ++ .../spidermonkey-mac/include/js/GCAPI.h | 247 +++ .../spidermonkey-mac/include/js/HashTable.h | 1442 +++++++++++++ .../spidermonkey-mac/include/js/HeapAPI.h | 160 ++ .../include/js/LegacyIntTypes.h | 59 + .../include/js/MemoryMetrics.h | 400 ++++ .../spidermonkey-mac/include/js/PropertyKey.h | 99 + .../include/js/RequiredDefines.h | 24 + .../spidermonkey-mac/include/js/TemplateLib.h | 122 ++ .../spidermonkey-mac/include/js/Utility.h | 866 ++++++++ .../spidermonkey-mac/include/js/Value.h | 1819 +++++++++++++++++ .../spidermonkey-mac/include/js/Vector.h | 1076 ++++++++++ .../spidermonkey-mac/include/jsalloc.h | 99 + .../include/jsapi.h.REMOVED.git-id | 1 + .../spidermonkey-mac/include/jsclass.h | 401 ++++ .../spidermonkey-mac/include/jsclist.h | 106 + .../spidermonkey-mac/include/jscpucfg.h | 121 ++ .../spidermonkey-mac/include/jsdbgapi.h | 486 +++++ .../spidermonkey-mac/include/jsdhash.h | 611 ++++++ .../spidermonkey-mac/include/jsfriendapi.h | 1421 +++++++++++++ .../spidermonkey-mac/include/jslock.h | 42 + .../spidermonkey-mac/include/json.h | 46 + .../spidermonkey-mac/include/jsperf.h | 130 ++ .../spidermonkey-mac/include/jsprf.h | 77 + .../spidermonkey-mac/include/jsprototypes.h | 61 + .../spidermonkey-mac/include/jsproxy.h | 327 +++ .../spidermonkey-mac/include/jsprvtd.h | 303 +++ .../spidermonkey-mac/include/jspubtd.h | 383 ++++ .../spidermonkey-mac/include/jstypes.h | 282 +++ .../spidermonkey-mac/include/jsutil.h | 471 +++++ .../spidermonkey-mac/include/jsversion.h | 181 ++ .../spidermonkey-mac/include/jswrapper.h | 329 +++ .../include/mozilla/Assertions.h | 376 ++++ .../include/mozilla/Attributes.h | 324 +++ .../include/mozilla/BloomFilter.h | 234 +++ .../spidermonkey-mac/include/mozilla/Char16.h | 56 + .../include/mozilla/CheckedInt.h | 809 ++++++++ .../include/mozilla/Compiler.h | 24 + .../include/mozilla/Constants.h | 15 + .../include/mozilla/DebugOnly.h | 77 + .../include/mozilla/EnumSet.h | 175 ++ .../include/mozilla/FloatingPoint.h | 244 +++ .../include/mozilla/GuardObjects.h | 150 ++ .../include/mozilla/HashFunctions.h | 359 ++++ .../spidermonkey-mac/include/mozilla/Likely.h | 22 + .../include/mozilla/LinkedList.h | 429 ++++ .../include/mozilla/MSStdInt.h | 247 +++ .../include/mozilla/MathAlgorithms.h | 47 + .../include/mozilla/MemoryChecking.h | 71 + .../include/mozilla/NullPtr.h | 48 + .../spidermonkey-mac/include/mozilla/Range.h | 49 + .../include/mozilla/RangedPtr.h | 254 +++ .../spidermonkey-mac/include/mozilla/RefPtr.h | 413 ++++ .../spidermonkey-mac/include/mozilla/SHA1.h | 61 + .../spidermonkey-mac/include/mozilla/Scoped.h | 271 +++ .../include/mozilla/SplayTree.h | 285 +++ .../include/mozilla/StandardInteger.h | 43 + .../include/mozilla/ThreadLocal.h | 147 ++ .../include/mozilla/TypeTraits.h | 253 +++ .../include/mozilla/TypedEnum.h | 213 ++ .../spidermonkey-mac/include/mozilla/Types.h | 136 ++ .../spidermonkey-mac/include/mozilla/Util.h | 283 +++ .../include/mozilla/WeakPtr.h | 144 ++ .../lib/libjs_static.a.REMOVED.git-id | 1 + 73 files changed, 21051 insertions(+), 26 deletions(-) create mode 100644 scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch create mode 100644 scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj create mode 100644 scripting/javascript/spidermonkey-mac/include/ds/BitArray.h create mode 100644 scripting/javascript/spidermonkey-mac/include/gc/Root.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js-config.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js.msg create mode 100644 scripting/javascript/spidermonkey-mac/include/js/Anchor.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/GCAPI.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/HashTable.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/LegacyIntTypes.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/PropertyKey.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/RequiredDefines.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/Utility.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/Value.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/Vector.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsalloc.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id create mode 100644 scripting/javascript/spidermonkey-mac/include/jsclass.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsclist.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jscpucfg.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsdbgapi.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsdhash.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsfriendapi.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jslock.h create mode 100644 scripting/javascript/spidermonkey-mac/include/json.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsperf.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsprf.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsprototypes.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsproxy.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsprvtd.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jspubtd.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jstypes.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsutil.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jsversion.h create mode 100644 scripting/javascript/spidermonkey-mac/include/jswrapper.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/BloomFilter.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Char16.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Compiler.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Constants.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/DebugOnly.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/EnumSet.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/FloatingPoint.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/GuardObjects.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/HashFunctions.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Likely.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/LinkedList.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/MSStdInt.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/MemoryChecking.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/NullPtr.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Range.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/RangedPtr.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/RefPtr.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/SHA1.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Scoped.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/SplayTree.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/StandardInteger.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/ThreadLocal.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/TypedEnum.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Types.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/Util.h create mode 100644 scripting/javascript/spidermonkey-mac/include/mozilla/WeakPtr.h create mode 100644 scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id diff --git a/cocos2d-mac.xcworkspace/contents.xcworkspacedata b/cocos2d-mac.xcworkspace/contents.xcworkspacedata index 2fdc94ae40..99e1e01c8b 100644 --- a/cocos2d-mac.xcworkspace/contents.xcworkspacedata +++ b/cocos2d-mac.xcworkspace/contents.xcworkspacedata @@ -23,6 +23,9 @@ + + @@ -36,7 +39,7 @@ location = "group:CocosDenshion/proj.mac/CocosDenshion.xcodeproj"> + location = "group:scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj"> diff --git a/scripting/javascript/bindings/js_manual_conversions.cpp b/scripting/javascript/bindings/js_manual_conversions.cpp index efa23f5ef9..395c710a0f 100644 --- a/scripting/javascript/bindings/js_manual_conversions.cpp +++ b/scripting/javascript/bindings/js_manual_conversions.cpp @@ -12,19 +12,19 @@ JSBool jsval_to_opaque( JSContext *cx, jsval vp, void **r) { #ifdef __LP64__ + + // begin JSObject *tmp_arg; - if( ! JS_ValueToObject( cx, vp, &tmp_arg ) ) - return JS_FALSE; + JSBool ok = JS_ValueToObject( cx, vp, &tmp_arg ); + JSB_PRECONDITION2( ok, cx, JS_FALSE, "Error converting value to object"); + JSB_PRECONDITION2( tmp_arg && JS_IsTypedArrayObject( tmp_arg ), cx, JS_FALSE, "Not a TypedArray object"); + JSB_PRECONDITION2( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(void*), cx, JS_FALSE, "Invalid Typed Array length"); - JSB_PRECONDITION( js_IsTypedArray( tmp_arg ), "jsb: Not a TypedArray object"); - - JSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(void*), "jsb: Invalid Typed Array lenght"); - - int32_t* arg_array = (int32_t*)JS_GetTypedArrayData( tmp_arg ); - uint64 ret = arg_array[0]; + uint32_t* arg_array = (uint32_t*)JS_GetArrayBufferViewData( tmp_arg ); + uint64_t ret = arg_array[0]; ret = ret << 32; ret |= arg_array[1]; - + #else assert( sizeof(int)==4); int32_t ret; @@ -52,19 +52,18 @@ JSBool jsval_to_long( JSContext *cx, jsval vp, long *r ) #ifdef __LP64__ // compatibility check assert( sizeof(long)==8); - JSObject *tmp_arg; - if( ! JS_ValueToObject( cx, vp, &tmp_arg ) ) - return JS_FALSE; + JSString *jsstr = JS_ValueToString(cx, vp); + JSB_PRECONDITION2(jsstr, cx, JS_FALSE, "Error converting value to string"); - JSB_PRECONDITION( js_IsTypedArray( tmp_arg ), "jsb: Not a TypedArray object"); + char *str = JS_EncodeString(cx, jsstr); + JSB_PRECONDITION2(str, cx, JS_FALSE, "Error encoding string"); + + char *endptr; + long ret = strtol(str, &endptr, 10); + + *r = ret; + return JS_TRUE; - JSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(long), "jsb: Invalid Typed Array lenght"); - - int32_t* arg_array = (int32_t*)JS_GetTypedArrayData( tmp_arg ); - long ret = arg_array[0]; - ret = ret << 32; - ret |= arg_array[1]; - #else // compatibility check assert( sizeof(int)==4); @@ -97,11 +96,11 @@ jsval opaque_to_jsval( JSContext *cx, void *opaque ) { #ifdef __LP64__ uint64_t number = (uint64_t)opaque; - JSObject *typedArray = js_CreateTypedArray(cx, js::TypedArray::TYPE_UINT32, 2); - int32_t *buffer = (int32_t*)JS_GetTypedArrayData(typedArray); + JSObject *typedArray = JS_NewUint32Array( cx, 2 ); + uint32_t *buffer = (uint32_t*)JS_GetArrayBufferViewData(typedArray); buffer[0] = number >> 32; buffer[1] = number & 0xffffffff; - return OBJECT_TO_JSVAL(typedArray); + return OBJECT_TO_JSVAL(typedArray); #else assert(sizeof(int)==4); int32_t number = (int32_t) opaque; @@ -198,8 +197,8 @@ jsval uint_to_jsval( JSContext *cx, unsigned int number ) jsval long_to_jsval( JSContext *cx, long number ) { #ifdef __LP64__ - NSCAssert( sizeof(long)==8, @"Error!"); - + assert( sizeof(long)==8); + char chr[128]; snprintf(chr, sizeof(chr)-1, "%ld", number); JSString *ret_obj = JS_NewStringCopyZ(cx, chr); diff --git a/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch b/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch new file mode 100644 index 0000000000..af8c4a19d5 --- /dev/null +++ b/scripting/javascript/bindings/proj.mac/jsbindings-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'jsbindings' target in the 'jsbindings' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj b/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..8c89badc50 --- /dev/null +++ b/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj @@ -0,0 +1,666 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1A0C0E8B1778088700838530 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0C0E8A1778088700838530 /* Foundation.framework */; }; + 1A0C0EDA1778095000838530 /* cocos2d_specifics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */; }; + 1A0C0EDB1778095000838530 /* cocosjs_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */; }; + 1A0C0EDC1778095000838530 /* jsb_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */; }; + 1A0C0EEC1778095000838530 /* js_bindings_ccbreader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */; }; + 1A0C0EED1778095000838530 /* js_bindings_chipmunk_auto_classes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */; }; + 1A0C0EEE1778095000838530 /* js_bindings_chipmunk_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */; }; + 1A0C0EEF1778095000838530 /* js_bindings_chipmunk_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */; }; + 1A0C0EF01778095000838530 /* js_bindings_chipmunk_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */; }; + 1A0C0EF11778095000838530 /* js_bindings_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */; }; + 1A0C0EF21778095000838530 /* js_bindings_opengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */; }; + 1A0C0EF31778095000838530 /* js_bindings_system_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */; }; + 1A0C0EF41778095000838530 /* js_bindings_system_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */; }; + 1A0C0EF51778095000838530 /* js_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */; }; + 1A0C0EF61778095000838530 /* jsb_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */; }; + 1A0C0EF71778095000838530 /* jsb_opengl_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */; }; + 1A0C0EF81778095000838530 /* jsb_opengl_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */; }; + 1A0C0EF91778095000838530 /* jsb_opengl_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */; }; + 1A0C0EFA1778095000838530 /* jsb_websocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED31778095000838530 /* jsb_websocket.cpp */; }; + 1A0C0EFB1778095000838530 /* ScriptingCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED51778095000838530 /* ScriptingCore.cpp */; }; + 1A0C0EFC1778095000838530 /* XMLHTTPRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */; }; + 1A6E46D51778162E0055514D /* jsb_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */; }; + A00B437317795C5C00480238 /* libjs_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A00B437217795C5C00480238 /* libjs_static.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 1A0C0E851778088700838530 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1A0C0E871778088700838530 /* libjsbindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjsbindings.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A0C0E8A1778088700838530 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocos2d_specifics.cpp; path = ../cocos2d_specifics.cpp; sourceTree = ""; }; + 1A0C0E9A1778095000838530 /* cocos2d_specifics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = cocos2d_specifics.hpp; path = ../cocos2d_specifics.hpp; sourceTree = ""; }; + 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocosjs_manual_conversions.cpp; path = ../cocosjs_manual_conversions.cpp; sourceTree = ""; }; + 1A0C0E9C1778095000838530 /* cocosjs_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cocosjs_manual_conversions.h; path = ../cocosjs_manual_conversions.h; sourceTree = ""; }; + 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_auto.cpp; sourceTree = ""; }; + 1A0C0E9F1778095000838530 /* jsb_cocos2dx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_auto.hpp; sourceTree = ""; }; + 1A0C0EA01778095000838530 /* jsb_cocos2dx_auto_api.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2dx_auto_api.js; sourceTree = ""; }; + 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_extension_auto.cpp; sourceTree = ""; }; + 1A0C0EA21778095000838530 /* jsb_cocos2dx_extension_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_extension_auto.hpp; sourceTree = ""; }; + 1A0C0EA31778095000838530 /* jsb_cocos2dx_extension_auto_api.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2dx_extension_auto_api.js; sourceTree = ""; }; + 1A0C0EA41778095000838530 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + 1A0C0EA61778095000838530 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb.js; sourceTree = ""; }; + 1A0C0EA71778095000838530 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk.js; sourceTree = ""; }; + 1A0C0EA81778095000838530 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk_constants.js; sourceTree = ""; }; + 1A0C0EA91778095000838530 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d.js; sourceTree = ""; }; + 1A0C0EAA1778095000838530 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_constants.js; sourceTree = ""; }; + 1A0C0EAB1778095000838530 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_extension.js; sourceTree = ""; }; + 1A0C0EAC1778095000838530 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocosbuilder.js; sourceTree = ""; }; + 1A0C0EAD1778095000838530 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_debugger.js; sourceTree = ""; }; + 1A0C0EAE1778095000838530 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl.js; sourceTree = ""; }; + 1A0C0EAF1778095000838530 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl_constants.js; sourceTree = ""; }; + 1A0C0EB01778095000838530 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_sys.js; sourceTree = ""; }; + 1A0C0EB11778095000838530 /* main.debug.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.debug.js; sourceTree = ""; }; + 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_ccbreader.cpp; path = ../js_bindings_ccbreader.cpp; sourceTree = ""; }; + 1A0C0EB31778095000838530 /* js_bindings_ccbreader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_ccbreader.h; path = ../js_bindings_ccbreader.h; sourceTree = ""; }; + 1A0C0EB41778095000838530 /* js_bindings_chipmunk_auto_classes_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_auto_classes_registration.h; path = ../js_bindings_chipmunk_auto_classes_registration.h; sourceTree = ""; }; + 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_auto_classes.cpp; path = ../js_bindings_chipmunk_auto_classes.cpp; sourceTree = ""; }; + 1A0C0EB61778095000838530 /* js_bindings_chipmunk_auto_classes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_auto_classes.h; path = ../js_bindings_chipmunk_auto_classes.h; sourceTree = ""; }; + 1A0C0EB71778095000838530 /* js_bindings_chipmunk_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_functions_registration.h; path = ../js_bindings_chipmunk_functions_registration.h; sourceTree = ""; }; + 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_functions.cpp; path = ../js_bindings_chipmunk_functions.cpp; sourceTree = ""; }; + 1A0C0EB91778095000838530 /* js_bindings_chipmunk_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_functions.h; path = ../js_bindings_chipmunk_functions.h; sourceTree = ""; }; + 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_manual.cpp; path = ../js_bindings_chipmunk_manual.cpp; sourceTree = ""; }; + 1A0C0EBB1778095000838530 /* js_bindings_chipmunk_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_manual.h; path = ../js_bindings_chipmunk_manual.h; sourceTree = ""; }; + 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_chipmunk_registration.cpp; path = ../js_bindings_chipmunk_registration.cpp; sourceTree = ""; }; + 1A0C0EBD1778095000838530 /* js_bindings_chipmunk_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_chipmunk_registration.h; path = ../js_bindings_chipmunk_registration.h; sourceTree = ""; }; + 1A0C0EBE1778095000838530 /* js_bindings_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_config.h; path = ../js_bindings_config.h; sourceTree = ""; }; + 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_core.cpp; path = ../js_bindings_core.cpp; sourceTree = ""; }; + 1A0C0EC01778095000838530 /* js_bindings_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_core.h; path = ../js_bindings_core.h; sourceTree = ""; }; + 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_opengl.cpp; path = ../js_bindings_opengl.cpp; sourceTree = ""; }; + 1A0C0EC21778095000838530 /* js_bindings_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_opengl.h; path = ../js_bindings_opengl.h; sourceTree = ""; }; + 1A0C0EC31778095000838530 /* js_bindings_system_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_functions_registration.h; path = ../js_bindings_system_functions_registration.h; sourceTree = ""; }; + 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_system_functions.cpp; path = ../js_bindings_system_functions.cpp; sourceTree = ""; }; + 1A0C0EC51778095000838530 /* js_bindings_system_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_functions.h; path = ../js_bindings_system_functions.h; sourceTree = ""; }; + 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_bindings_system_registration.cpp; path = ../js_bindings_system_registration.cpp; sourceTree = ""; }; + 1A0C0EC71778095000838530 /* js_bindings_system_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_bindings_system_registration.h; path = ../js_bindings_system_registration.h; sourceTree = ""; }; + 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = js_manual_conversions.cpp; path = ../js_manual_conversions.cpp; sourceTree = ""; }; + 1A0C0EC91778095000838530 /* js_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = js_manual_conversions.h; path = ../js_manual_conversions.h; sourceTree = ""; }; + 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_cocos2dx_extension_manual.cpp; path = ../jsb_cocos2dx_extension_manual.cpp; sourceTree = ""; }; + 1A0C0ECB1778095000838530 /* jsb_cocos2dx_extension_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_cocos2dx_extension_manual.h; path = ../jsb_cocos2dx_extension_manual.h; sourceTree = ""; }; + 1A0C0ECC1778095000838530 /* jsb_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_helper.h; path = ../jsb_helper.h; sourceTree = ""; }; + 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_functions.cpp; path = ../jsb_opengl_functions.cpp; sourceTree = ""; }; + 1A0C0ECE1778095000838530 /* jsb_opengl_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_functions.h; path = ../jsb_opengl_functions.h; sourceTree = ""; }; + 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_manual.cpp; path = ../jsb_opengl_manual.cpp; sourceTree = ""; }; + 1A0C0ED01778095000838530 /* jsb_opengl_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_manual.h; path = ../jsb_opengl_manual.h; sourceTree = ""; }; + 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_opengl_registration.cpp; path = ../jsb_opengl_registration.cpp; sourceTree = ""; }; + 1A0C0ED21778095000838530 /* jsb_opengl_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_opengl_registration.h; path = ../jsb_opengl_registration.h; sourceTree = ""; }; + 1A0C0ED31778095000838530 /* jsb_websocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_websocket.cpp; path = ../jsb_websocket.cpp; sourceTree = ""; }; + 1A0C0ED41778095000838530 /* jsb_websocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_websocket.h; path = ../jsb_websocket.h; sourceTree = ""; }; + 1A0C0ED51778095000838530 /* ScriptingCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptingCore.cpp; path = ../ScriptingCore.cpp; sourceTree = ""; }; + 1A0C0ED61778095000838530 /* ScriptingCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptingCore.h; path = ../ScriptingCore.h; sourceTree = ""; }; + 1A0C0ED71778095000838530 /* spidermonkey_specifics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spidermonkey_specifics.h; path = ../spidermonkey_specifics.h; sourceTree = ""; }; + 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XMLHTTPRequest.cpp; path = ../XMLHTTPRequest.cpp; sourceTree = ""; }; + 1A0C0ED91778095000838530 /* XMLHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLHTTPRequest.h; path = ../XMLHTTPRequest.h; sourceTree = ""; }; + A00B432A17795C5C00480238 /* BitArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitArray.h; sourceTree = ""; }; + A00B432C17795C5C00480238 /* Root.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Root.h; sourceTree = ""; }; + A00B432E17795C5C00480238 /* Anchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Anchor.h; sourceTree = ""; }; + A00B432F17795C5C00480238 /* CharacterEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterEncoding.h; sourceTree = ""; }; + A00B433017795C5C00480238 /* GCAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCAPI.h; sourceTree = ""; }; + A00B433117795C5C00480238 /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = ""; }; + A00B433217795C5C00480238 /* HeapAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapAPI.h; sourceTree = ""; }; + A00B433317795C5C00480238 /* LegacyIntTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyIntTypes.h; sourceTree = ""; }; + A00B433417795C5C00480238 /* MemoryMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryMetrics.h; sourceTree = ""; }; + A00B433517795C5C00480238 /* PropertyKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyKey.h; sourceTree = ""; }; + A00B433617795C5C00480238 /* RequiredDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequiredDefines.h; sourceTree = ""; }; + A00B433717795C5C00480238 /* TemplateLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateLib.h; sourceTree = ""; }; + A00B433817795C5C00480238 /* Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utility.h; sourceTree = ""; }; + A00B433917795C5C00480238 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = ""; }; + A00B433A17795C5C00480238 /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector.h; sourceTree = ""; }; + A00B433B17795C5C00480238 /* js-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "js-config.h"; sourceTree = ""; }; + A00B433C17795C5C00480238 /* js.msg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = js.msg; sourceTree = ""; }; + A00B433D17795C5C00480238 /* jsalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsalloc.h; sourceTree = ""; }; + A00B433E17795C5C00480238 /* jsapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsapi.h; sourceTree = ""; }; + A00B433F17795C5C00480238 /* jsclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclass.h; sourceTree = ""; }; + A00B434017795C5C00480238 /* jsclist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclist.h; sourceTree = ""; }; + A00B434117795C5C00480238 /* jscpucfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jscpucfg.h; sourceTree = ""; }; + A00B434217795C5C00480238 /* jsdbgapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdbgapi.h; sourceTree = ""; }; + A00B434317795C5C00480238 /* jsdhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdhash.h; sourceTree = ""; }; + A00B434417795C5C00480238 /* jsfriendapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsfriendapi.h; sourceTree = ""; }; + A00B434517795C5C00480238 /* jslock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jslock.h; sourceTree = ""; }; + A00B434617795C5C00480238 /* json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json.h; sourceTree = ""; }; + A00B434717795C5C00480238 /* jsperf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsperf.h; sourceTree = ""; }; + A00B434817795C5C00480238 /* jsprf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprf.h; sourceTree = ""; }; + A00B434917795C5C00480238 /* jsprototypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprototypes.h; sourceTree = ""; }; + A00B434A17795C5C00480238 /* jsproxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsproxy.h; sourceTree = ""; }; + A00B434B17795C5C00480238 /* jsprvtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprvtd.h; sourceTree = ""; }; + A00B434C17795C5C00480238 /* jspubtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jspubtd.h; sourceTree = ""; }; + A00B434D17795C5C00480238 /* jstypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jstypes.h; sourceTree = ""; }; + A00B434E17795C5C00480238 /* jsutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsutil.h; sourceTree = ""; }; + A00B434F17795C5C00480238 /* jsversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsversion.h; sourceTree = ""; }; + A00B435017795C5C00480238 /* jswrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jswrapper.h; sourceTree = ""; }; + A00B435217795C5C00480238 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = ""; }; + A00B435317795C5C00480238 /* Attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attributes.h; sourceTree = ""; }; + A00B435417795C5C00480238 /* BloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilter.h; sourceTree = ""; }; + A00B435517795C5C00480238 /* Char16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Char16.h; sourceTree = ""; }; + A00B435617795C5C00480238 /* CheckedInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedInt.h; sourceTree = ""; }; + A00B435717795C5C00480238 /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; + A00B435817795C5C00480238 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; + A00B435917795C5C00480238 /* DebugOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugOnly.h; sourceTree = ""; }; + A00B435A17795C5C00480238 /* EnumSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnumSet.h; sourceTree = ""; }; + A00B435B17795C5C00480238 /* FloatingPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingPoint.h; sourceTree = ""; }; + A00B435C17795C5C00480238 /* GuardObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuardObjects.h; sourceTree = ""; }; + A00B435D17795C5C00480238 /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = ""; }; + A00B435E17795C5C00480238 /* Likely.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Likely.h; sourceTree = ""; }; + A00B435F17795C5C00480238 /* LinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkedList.h; sourceTree = ""; }; + A00B436017795C5C00480238 /* MathAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathAlgorithms.h; sourceTree = ""; }; + A00B436117795C5C00480238 /* MemoryChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryChecking.h; sourceTree = ""; }; + A00B436217795C5C00480238 /* MSStdInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSStdInt.h; sourceTree = ""; }; + A00B436317795C5C00480238 /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = ""; }; + A00B436417795C5C00480238 /* Range.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = ""; }; + A00B436517795C5C00480238 /* RangedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangedPtr.h; sourceTree = ""; }; + A00B436617795C5C00480238 /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = ""; }; + A00B436717795C5C00480238 /* Scoped.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scoped.h; sourceTree = ""; }; + A00B436817795C5C00480238 /* SHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHA1.h; sourceTree = ""; }; + A00B436917795C5C00480238 /* SplayTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplayTree.h; sourceTree = ""; }; + A00B436A17795C5C00480238 /* StandardInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StandardInteger.h; sourceTree = ""; }; + A00B436B17795C5C00480238 /* ThreadLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadLocal.h; sourceTree = ""; }; + A00B436C17795C5C00480238 /* TypedEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedEnum.h; sourceTree = ""; }; + A00B436D17795C5C00480238 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = ""; }; + A00B436E17795C5C00480238 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = ""; }; + A00B436F17795C5C00480238 /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; + A00B437017795C5C00480238 /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = ""; }; + A00B437217795C5C00480238 /* libjs_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjs_static.a; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1A0C0E841778088700838530 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1A0C0E8B1778088700838530 /* Foundation.framework in Frameworks */, + A00B437317795C5C00480238 /* libjs_static.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1A0C0E7E1778088700838530 = { + isa = PBXGroup; + children = ( + 1A0C0E981778093E00838530 /* bindings */, + 1A0C0E891778088700838530 /* Frameworks */, + 1A0C0E881778088700838530 /* Products */, + ); + sourceTree = ""; + }; + 1A0C0E881778088700838530 /* Products */ = { + isa = PBXGroup; + children = ( + 1A0C0E871778088700838530 /* libjsbindings.a */, + ); + name = Products; + sourceTree = ""; + }; + 1A0C0E891778088700838530 /* Frameworks */ = { + isa = PBXGroup; + children = ( + A00B432717795C5C00480238 /* spidermonkey-mac */, + 1A0C0E8A1778088700838530 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 1A0C0E981778093E00838530 /* bindings */ = { + isa = PBXGroup; + children = ( + 1A0C0E991778095000838530 /* cocos2d_specifics.cpp */, + 1A0C0E9A1778095000838530 /* cocos2d_specifics.hpp */, + 1A0C0E9B1778095000838530 /* cocosjs_manual_conversions.cpp */, + 1A0C0E9C1778095000838530 /* cocosjs_manual_conversions.h */, + 1A0C0E9D1778095000838530 /* generated */, + 1A0C0EA51778095000838530 /* js */, + 1A0C0EB21778095000838530 /* js_bindings_ccbreader.cpp */, + 1A0C0EB31778095000838530 /* js_bindings_ccbreader.h */, + 1A0C0EB41778095000838530 /* js_bindings_chipmunk_auto_classes_registration.h */, + 1A0C0EB51778095000838530 /* js_bindings_chipmunk_auto_classes.cpp */, + 1A0C0EB61778095000838530 /* js_bindings_chipmunk_auto_classes.h */, + 1A0C0EB71778095000838530 /* js_bindings_chipmunk_functions_registration.h */, + 1A0C0EB81778095000838530 /* js_bindings_chipmunk_functions.cpp */, + 1A0C0EB91778095000838530 /* js_bindings_chipmunk_functions.h */, + 1A0C0EBA1778095000838530 /* js_bindings_chipmunk_manual.cpp */, + 1A0C0EBB1778095000838530 /* js_bindings_chipmunk_manual.h */, + 1A0C0EBC1778095000838530 /* js_bindings_chipmunk_registration.cpp */, + 1A0C0EBD1778095000838530 /* js_bindings_chipmunk_registration.h */, + 1A0C0EBE1778095000838530 /* js_bindings_config.h */, + 1A0C0EBF1778095000838530 /* js_bindings_core.cpp */, + 1A0C0EC01778095000838530 /* js_bindings_core.h */, + 1A0C0EC11778095000838530 /* js_bindings_opengl.cpp */, + 1A0C0EC21778095000838530 /* js_bindings_opengl.h */, + 1A0C0EC31778095000838530 /* js_bindings_system_functions_registration.h */, + 1A0C0EC41778095000838530 /* js_bindings_system_functions.cpp */, + 1A0C0EC51778095000838530 /* js_bindings_system_functions.h */, + 1A0C0EC61778095000838530 /* js_bindings_system_registration.cpp */, + 1A0C0EC71778095000838530 /* js_bindings_system_registration.h */, + 1A0C0EC81778095000838530 /* js_manual_conversions.cpp */, + 1A0C0EC91778095000838530 /* js_manual_conversions.h */, + 1A0C0ECA1778095000838530 /* jsb_cocos2dx_extension_manual.cpp */, + 1A0C0ECB1778095000838530 /* jsb_cocos2dx_extension_manual.h */, + 1A0C0ECC1778095000838530 /* jsb_helper.h */, + 1A0C0ECD1778095000838530 /* jsb_opengl_functions.cpp */, + 1A0C0ECE1778095000838530 /* jsb_opengl_functions.h */, + 1A0C0ECF1778095000838530 /* jsb_opengl_manual.cpp */, + 1A0C0ED01778095000838530 /* jsb_opengl_manual.h */, + 1A0C0ED11778095000838530 /* jsb_opengl_registration.cpp */, + 1A0C0ED21778095000838530 /* jsb_opengl_registration.h */, + 1A0C0ED31778095000838530 /* jsb_websocket.cpp */, + 1A0C0ED41778095000838530 /* jsb_websocket.h */, + 1A0C0ED51778095000838530 /* ScriptingCore.cpp */, + 1A0C0ED61778095000838530 /* ScriptingCore.h */, + 1A0C0ED71778095000838530 /* spidermonkey_specifics.h */, + 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */, + 1A0C0ED91778095000838530 /* XMLHTTPRequest.h */, + ); + name = bindings; + sourceTree = ""; + }; + 1A0C0E9D1778095000838530 /* generated */ = { + isa = PBXGroup; + children = ( + 1A0C0E9E1778095000838530 /* jsb_cocos2dx_auto.cpp */, + 1A0C0E9F1778095000838530 /* jsb_cocos2dx_auto.hpp */, + 1A0C0EA01778095000838530 /* jsb_cocos2dx_auto_api.js */, + 1A0C0EA11778095000838530 /* jsb_cocos2dx_extension_auto.cpp */, + 1A0C0EA21778095000838530 /* jsb_cocos2dx_extension_auto.hpp */, + 1A0C0EA31778095000838530 /* jsb_cocos2dx_extension_auto_api.js */, + 1A0C0EA41778095000838530 /* README */, + ); + name = generated; + path = ../generated; + sourceTree = ""; + }; + 1A0C0EA51778095000838530 /* js */ = { + isa = PBXGroup; + children = ( + 1A0C0EA61778095000838530 /* jsb.js */, + 1A0C0EA71778095000838530 /* jsb_chipmunk.js */, + 1A0C0EA81778095000838530 /* jsb_chipmunk_constants.js */, + 1A0C0EA91778095000838530 /* jsb_cocos2d.js */, + 1A0C0EAA1778095000838530 /* jsb_cocos2d_constants.js */, + 1A0C0EAB1778095000838530 /* jsb_cocos2d_extension.js */, + 1A0C0EAC1778095000838530 /* jsb_cocosbuilder.js */, + 1A0C0EAD1778095000838530 /* jsb_debugger.js */, + 1A0C0EAE1778095000838530 /* jsb_opengl.js */, + 1A0C0EAF1778095000838530 /* jsb_opengl_constants.js */, + 1A0C0EB01778095000838530 /* jsb_sys.js */, + 1A0C0EB11778095000838530 /* main.debug.js */, + ); + name = js; + path = ../js; + sourceTree = ""; + }; + A00B432717795C5C00480238 /* spidermonkey-mac */ = { + isa = PBXGroup; + children = ( + A00B432817795C5C00480238 /* include */, + A00B437117795C5C00480238 /* lib */, + ); + name = "spidermonkey-mac"; + path = "../../spidermonkey-mac"; + sourceTree = ""; + }; + A00B432817795C5C00480238 /* include */ = { + isa = PBXGroup; + children = ( + A00B432917795C5C00480238 /* ds */, + A00B432B17795C5C00480238 /* gc */, + A00B432D17795C5C00480238 /* js */, + A00B433B17795C5C00480238 /* js-config.h */, + A00B433C17795C5C00480238 /* js.msg */, + A00B433D17795C5C00480238 /* jsalloc.h */, + A00B433E17795C5C00480238 /* jsapi.h */, + A00B433F17795C5C00480238 /* jsclass.h */, + A00B434017795C5C00480238 /* jsclist.h */, + A00B434117795C5C00480238 /* jscpucfg.h */, + A00B434217795C5C00480238 /* jsdbgapi.h */, + A00B434317795C5C00480238 /* jsdhash.h */, + A00B434417795C5C00480238 /* jsfriendapi.h */, + A00B434517795C5C00480238 /* jslock.h */, + A00B434617795C5C00480238 /* json.h */, + A00B434717795C5C00480238 /* jsperf.h */, + A00B434817795C5C00480238 /* jsprf.h */, + A00B434917795C5C00480238 /* jsprototypes.h */, + A00B434A17795C5C00480238 /* jsproxy.h */, + A00B434B17795C5C00480238 /* jsprvtd.h */, + A00B434C17795C5C00480238 /* jspubtd.h */, + A00B434D17795C5C00480238 /* jstypes.h */, + A00B434E17795C5C00480238 /* jsutil.h */, + A00B434F17795C5C00480238 /* jsversion.h */, + A00B435017795C5C00480238 /* jswrapper.h */, + A00B435117795C5C00480238 /* mozilla */, + ); + path = include; + sourceTree = ""; + }; + A00B432917795C5C00480238 /* ds */ = { + isa = PBXGroup; + children = ( + A00B432A17795C5C00480238 /* BitArray.h */, + ); + path = ds; + sourceTree = ""; + }; + A00B432B17795C5C00480238 /* gc */ = { + isa = PBXGroup; + children = ( + A00B432C17795C5C00480238 /* Root.h */, + ); + path = gc; + sourceTree = ""; + }; + A00B432D17795C5C00480238 /* js */ = { + isa = PBXGroup; + children = ( + A00B432E17795C5C00480238 /* Anchor.h */, + A00B432F17795C5C00480238 /* CharacterEncoding.h */, + A00B433017795C5C00480238 /* GCAPI.h */, + A00B433117795C5C00480238 /* HashTable.h */, + A00B433217795C5C00480238 /* HeapAPI.h */, + A00B433317795C5C00480238 /* LegacyIntTypes.h */, + A00B433417795C5C00480238 /* MemoryMetrics.h */, + A00B433517795C5C00480238 /* PropertyKey.h */, + A00B433617795C5C00480238 /* RequiredDefines.h */, + A00B433717795C5C00480238 /* TemplateLib.h */, + A00B433817795C5C00480238 /* Utility.h */, + A00B433917795C5C00480238 /* Value.h */, + A00B433A17795C5C00480238 /* Vector.h */, + ); + path = js; + sourceTree = ""; + }; + A00B435117795C5C00480238 /* mozilla */ = { + isa = PBXGroup; + children = ( + A00B435217795C5C00480238 /* Assertions.h */, + A00B435317795C5C00480238 /* Attributes.h */, + A00B435417795C5C00480238 /* BloomFilter.h */, + A00B435517795C5C00480238 /* Char16.h */, + A00B435617795C5C00480238 /* CheckedInt.h */, + A00B435717795C5C00480238 /* Compiler.h */, + A00B435817795C5C00480238 /* Constants.h */, + A00B435917795C5C00480238 /* DebugOnly.h */, + A00B435A17795C5C00480238 /* EnumSet.h */, + A00B435B17795C5C00480238 /* FloatingPoint.h */, + A00B435C17795C5C00480238 /* GuardObjects.h */, + A00B435D17795C5C00480238 /* HashFunctions.h */, + A00B435E17795C5C00480238 /* Likely.h */, + A00B435F17795C5C00480238 /* LinkedList.h */, + A00B436017795C5C00480238 /* MathAlgorithms.h */, + A00B436117795C5C00480238 /* MemoryChecking.h */, + A00B436217795C5C00480238 /* MSStdInt.h */, + A00B436317795C5C00480238 /* NullPtr.h */, + A00B436417795C5C00480238 /* Range.h */, + A00B436517795C5C00480238 /* RangedPtr.h */, + A00B436617795C5C00480238 /* RefPtr.h */, + A00B436717795C5C00480238 /* Scoped.h */, + A00B436817795C5C00480238 /* SHA1.h */, + A00B436917795C5C00480238 /* SplayTree.h */, + A00B436A17795C5C00480238 /* StandardInteger.h */, + A00B436B17795C5C00480238 /* ThreadLocal.h */, + A00B436C17795C5C00480238 /* TypedEnum.h */, + A00B436D17795C5C00480238 /* Types.h */, + A00B436E17795C5C00480238 /* TypeTraits.h */, + A00B436F17795C5C00480238 /* Util.h */, + A00B437017795C5C00480238 /* WeakPtr.h */, + ); + path = mozilla; + sourceTree = ""; + }; + A00B437117795C5C00480238 /* lib */ = { + isa = PBXGroup; + children = ( + A00B437217795C5C00480238 /* libjs_static.a */, + ); + path = lib; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1A0C0E861778088700838530 /* jsbindings */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1A0C0E951778088700838530 /* Build configuration list for PBXNativeTarget "jsbindings" */; + buildPhases = ( + 1A0C0E831778088700838530 /* Sources */, + 1A0C0E841778088700838530 /* Frameworks */, + 1A0C0E851778088700838530 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = jsbindings; + productName = jsbindings; + productReference = 1A0C0E871778088700838530 /* libjsbindings.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 1A0C0E7F1778088700838530 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + }; + buildConfigurationList = 1A0C0E821778088700838530 /* Build configuration list for PBXProject "jsbindings" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 1A0C0E7E1778088700838530; + productRefGroup = 1A0C0E881778088700838530 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1A0C0E861778088700838530 /* jsbindings */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 1A0C0E831778088700838530 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1A6E46D51778162E0055514D /* jsb_cocos2dx_extension_auto.cpp in Sources */, + 1A0C0EDA1778095000838530 /* cocos2d_specifics.cpp in Sources */, + 1A0C0EDB1778095000838530 /* cocosjs_manual_conversions.cpp in Sources */, + 1A0C0EDC1778095000838530 /* jsb_cocos2dx_auto.cpp in Sources */, + 1A0C0EEC1778095000838530 /* js_bindings_ccbreader.cpp in Sources */, + 1A0C0EED1778095000838530 /* js_bindings_chipmunk_auto_classes.cpp in Sources */, + 1A0C0EEE1778095000838530 /* js_bindings_chipmunk_functions.cpp in Sources */, + 1A0C0EEF1778095000838530 /* js_bindings_chipmunk_manual.cpp in Sources */, + 1A0C0EF01778095000838530 /* js_bindings_chipmunk_registration.cpp in Sources */, + 1A0C0EF11778095000838530 /* js_bindings_core.cpp in Sources */, + 1A0C0EF21778095000838530 /* js_bindings_opengl.cpp in Sources */, + 1A0C0EF31778095000838530 /* js_bindings_system_functions.cpp in Sources */, + 1A0C0EF41778095000838530 /* js_bindings_system_registration.cpp in Sources */, + 1A0C0EF51778095000838530 /* js_manual_conversions.cpp in Sources */, + 1A0C0EF61778095000838530 /* jsb_cocos2dx_extension_manual.cpp in Sources */, + 1A0C0EF71778095000838530 /* jsb_opengl_functions.cpp in Sources */, + 1A0C0EF81778095000838530 /* jsb_opengl_manual.cpp in Sources */, + 1A0C0EF91778095000838530 /* jsb_opengl_registration.cpp in Sources */, + 1A0C0EFA1778095000838530 /* jsb_websocket.cpp in Sources */, + 1A0C0EFB1778095000838530 /* ScriptingCore.cpp in Sources */, + 1A0C0EFC1778095000838530 /* XMLHTTPRequest.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1A0C0E931778088700838530 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "DEBUG=1", + CC_TARGET_OS_MAC, + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 1A0C0E941778088700838530 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = ( + NDEBUG, + CC_TARGET_OS_MAC, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SDKROOT = macosx; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 1A0C0E961778088700838530 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/jsbindings.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "jsbindings-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOS2D_DEBUG=1", + "CC_ENABLE_CHIPMUNK_INTEGRATION=1", + ); + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../../../CocosDenshion/include", + "\"$(SRCROOT)/../../../../external/chipmunk/include/chipmunk\"", + "\"$(SRCROOT)/../../../../external/libwebsockets/mac/include\"", + "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", + "\"$(SRCROOT)/../../../../external\"", + "\"$(SRCROOT)/../../../../extensions\"", + "\"$(SRCROOT)/../../../../extensions/LocalStorage\"", + "\"$(SRCROOT)/../../../../extensions/network\"", + "\"$(SRCROOT)/../../../../cocos2dx\"", + "\"$(SRCROOT)/../../../../cocos2dx/include\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/mac/Simulation\"", + "\"$(SRCROOT)/../../spidermonkey-mac/include\"", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../spidermonkey-mac/lib\"", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 1A0C0E971778088700838530 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/jsbindings.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "jsbindings-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "CC_ENABLE_CHIPMUNK_INTEGRATION=1", + ); + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../../../CocosDenshion/include", + "\"$(SRCROOT)/../../../../external/chipmunk/include/chipmunk\"", + "\"$(SRCROOT)/../../../../external/libwebsockets/mac/include\"", + "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", + "\"$(SRCROOT)/../../../../external\"", + "\"$(SRCROOT)/../../../../extensions\"", + "\"$(SRCROOT)/../../../../extensions/LocalStorage\"", + "\"$(SRCROOT)/../../../../extensions/network\"", + "\"$(SRCROOT)/../../../../cocos2dx\"", + "\"$(SRCROOT)/../../../../cocos2dx/include\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/mac/Simulation\"", + "\"$(SRCROOT)/../../spidermonkey-mac/include\"", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../spidermonkey-mac/lib\"", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1A0C0E821778088700838530 /* Build configuration list for PBXProject "jsbindings" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1A0C0E931778088700838530 /* Debug */, + 1A0C0E941778088700838530 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1A0C0E951778088700838530 /* Build configuration list for PBXNativeTarget "jsbindings" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1A0C0E961778088700838530 /* Debug */, + 1A0C0E971778088700838530 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 1A0C0E7F1778088700838530 /* Project object */; +} diff --git a/scripting/javascript/spidermonkey-mac/include/ds/BitArray.h b/scripting/javascript/spidermonkey-mac/include/ds/BitArray.h new file mode 100644 index 0000000000..1be12fc881 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/ds/BitArray.h @@ -0,0 +1,58 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef BitArray_h__ +#define BitArray_h__ + +#include "jstypes.h" + +#include "js/TemplateLib.h" + +namespace js { + +template +class BitArray { + private: + uintptr_t map[nbits / JS_BITS_PER_WORD + (nbits % JS_BITS_PER_WORD == 0 ? 0 : 1)]; + + public: + void clear(bool value) { + if (value) + memset(map, 0xFF, sizeof(map)); + else + memset(map, 0, sizeof(map)); + } + + inline bool get(size_t offset) const { + uintptr_t index, mask; + getMarkWordAndMask(offset, &index, &mask); + return map[index] & mask; + } + + inline void set(size_t offset) { + uintptr_t index, mask; + getMarkWordAndMask(offset, &index, &mask); + map[index] |= mask; + } + + inline void unset(size_t offset) { + uintptr_t index, mask; + getMarkWordAndMask(offset, &index, &mask); + map[index] &= ~mask; + } + + private: + inline void getMarkWordAndMask(size_t offset, + uintptr_t *indexp, uintptr_t *maskp) const { + *indexp = offset >> tl::FloorLog2::result; + *maskp = uintptr_t(1) << (offset & (JS_BITS_PER_WORD - 1)); + } +}; + +} /* namespace js */ + +#endif diff --git a/scripting/javascript/spidermonkey-mac/include/gc/Root.h b/scripting/javascript/spidermonkey-mac/include/gc/Root.h new file mode 100644 index 0000000000..53a72ea49b --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/gc/Root.h @@ -0,0 +1,1078 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=78: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsgc_root_h__ +#define jsgc_root_h__ + +#include "mozilla/GuardObjects.h" +#include "mozilla/TypeTraits.h" + +#include "js/Utility.h" +#include "js/TemplateLib.h" + +#include "jspubtd.h" + +/* + * Moving GC Stack Rooting + * + * A moving GC may change the physical location of GC allocated things, even + * when they are rooted, updating all pointers to the thing to refer to its new + * location. The GC must therefore know about all live pointers to a thing, + * not just one of them, in order to behave correctly. + * + * The |Root| and |Handle| classes below are used to root stack locations + * whose value may be held live across a call that can trigger GC. For a + * code fragment such as: + * + * JSObject *obj = NewObject(cx); + * DoSomething(cx); + * ... = obj->lastProperty(); + * + * If |DoSomething()| can trigger a GC, the stack location of |obj| must be + * rooted to ensure that the GC does not move the JSObject referred to by + * |obj| without updating |obj|'s location itself. This rooting must happen + * regardless of whether there are other roots which ensure that the object + * itself will not be collected. + * + * If |DoSomething()| cannot trigger a GC, and the same holds for all other + * calls made between |obj|'s definitions and its last uses, then no rooting + * is required. The |Unrooted| class below is used to ensure that this + * property is true and remains true in the future. + * + * SpiderMonkey can trigger a GC at almost any time and in ways that are not + * always clear. For example, the following innocuous-looking actions can + * cause a GC: allocation of any new GC thing; JSObject::hasProperty; + * JS_ReportError and friends; and ToNumber, among many others. The following + * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_, + * rt->malloc_, and friends and JS_ReportOutOfMemory. + * + * The following family of four classes will exactly root a stack location. + * Incorrect usage of these classes will result in a compile error in almost + * all cases. Therefore, it is very hard to be incorrectly rooted if you use + * these classes exclusively. These classes are all templated on the type T of + * the value being rooted. + * + * - Rooted declares a variable of type T, whose value is always rooted. + * Rooted may be automatically coerced to a Handle, below. Rooted + * should be used whenever a local variable's value may be held live across a + * call which can trigger a GC. This is generally true of + * + * - Handle is a const reference to a Rooted. Functions which take GC + * things or values as arguments and need to root those arguments should + * generally use handles for those arguments and avoid any explicit rooting. + * This has two benefits. First, when several such functions call each other + * then redundant rooting of multiple copies of the GC thing can be avoided. + * Second, if the caller does not pass a rooted value a compile error will be + * generated, which is quicker and easier to fix than when relying on a + * separate rooting analysis. + * + * - MutableHandle is a non-const reference to Rooted. It is used in the + * same way as Handle and includes a |set(const T &v)| method to allow + * updating the value of the referenced Rooted. A MutableHandle can be + * created from a Rooted by using |Rooted::operator&()|. + * + * In some cases the small performance overhead of exact rooting is too much. + * In these cases, try the following: + * + * - Move all Rooted above inner loops: this allows you to re-use the root + * on each iteration of the loop. + * + * - Pass Handle through your hot call stack to avoid re-rooting costs at + * every invocation. + * + * If this is not enough, the following family of two classes and two + * functions can provide partially type-safe and mostly runtime-safe access to + * GC things. + * + * - AutoAssertNoGC is a scoped guard that will trigger an assertion if a GC, + * or an appropriately marked method that might GC, is entered when it is in + * scope. By convention the name given to instances of this guard is |nogc|. + * + * - AssertCanGC() will assert if an AutoAssertNoGC is in scope either locally + * or anywhere in the call stack. + * + * - UnrootedT is a typedef for a pointer to thing of type T. In DEBUG builds + * it gets replaced by a class that additionally acts as an AutoAssertNoGC + * guard. Since there is only minimal compile-time protection against + * mis-use, UnrootedT should only be used in places where there is adequate + * coverage of AutoAssertNoGC and AssertCanGC guards to ensure that mis-use + * is caught at runtime. + * + * - DropUnrooted(UnrootedT &v) will poison |v| and end its AutoAssertNoGC + * scope. This can be used to force |v| out of scope before its C++ scope + * would end naturally. The usage of braces C++ syntactical scopes |{...}| + * is strongly perferred to this, but sometimes will not work because of + * awkwardly overlapping lifetimes. + * + * There also exists a set of RawT typedefs for modules without rooting + * concerns, such as the GC. Do not use these as they provide no rooting + * protection whatsoever. + * + * The following diagram explains the list of supported, implicit type + * conversions between classes of this family: + * + * RawT ----> UnrootedT + * | ^ + * | | + * | v + * +--------> Rooted <---> Handle + * ^ ^ + * | | + * | | + * +---> MutableHandle + * (via &) + * + * Currently all of these types implicit conversion to RawT. These are present + * only for the purpose of bootstrapping exact rooting and will be removed in + * the future (Bug 817164). + */ + +namespace js { + +class Module; + +template class Rooted; +template class Unrooted; + +template +struct RootMethods {}; + +template +class RootedBase {}; + +template +class HandleBase {}; + +template +class MutableHandleBase {}; + +} /* namespace js */ + +namespace JS { + +class AutoAssertNoGC; + +template class Handle; +template class MutableHandle; + +JS_FRIEND_API(void) EnterAssertNoGCScope(); +JS_FRIEND_API(void) LeaveAssertNoGCScope(); + +/* These are exposing internal state of the GC for inlining purposes. */ +JS_FRIEND_API(bool) InNoGCScope(); +JS_FRIEND_API(bool) isGCEnabled(); + +#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) +extern void +CheckStackRoots(JSContext *cx); +#endif + +/* + * Handle provides an implicit constructor for NullPtr so that, given: + * foo(Handle h); + * callers can simply write: + * foo(NullPtr()); + * which avoids creating a Rooted just to pass NULL. + */ +struct NullPtr +{ + static void * const constNullValue; +}; + +/* + * Reference to a T that has been rooted elsewhere. This is most useful + * as a parameter type, which guarantees that the T lvalue is properly + * rooted. See "Move GC Stack Rooting" above. + * + * If you want to add additional methods to Handle for a specific + * specialization, define a HandleBase specialization containing them. + */ +template +class Handle : public js::HandleBase +{ + friend class MutableHandle; + + public: + /* Creates a handle from a handle of a type convertible to T. */ + template + Handle(Handle handle, + typename mozilla::EnableIf::value, int>::Type dummy = 0) + { + ptr = reinterpret_cast(handle.address()); + } + + /* Create a handle for a NULL pointer. */ + Handle(NullPtr) { + typedef typename js::tl::StaticAssert::value>::result _; + ptr = reinterpret_cast(&NullPtr::constNullValue); + } + + Handle(MutableHandle handle) { + ptr = handle.address(); + } + + /* + * This may be called only if the location of the T is guaranteed + * to be marked (for some reason other than being a Rooted), + * e.g., if it is guaranteed to be reachable from an implicit root. + * + * Create a Handle from a raw location of a T. + */ + static Handle fromMarkedLocation(const T *p) { + Handle h; + h.ptr = p; + return h; + } + + /* + * Construct a handle from an explicitly rooted location. This is the + * normal way to create a handle, and normally happens implicitly. + */ + template + inline + Handle(js::Rooted &root, + typename mozilla::EnableIf::value, int>::Type dummy = 0); + + /* Construct a read only handle from a mutable handle. */ + template + inline + Handle(MutableHandle &root, + typename mozilla::EnableIf::value, int>::Type dummy = 0); + + const T *address() const { return ptr; } + T get() const { return *ptr; } + + operator T() const { return get(); } + T operator->() const { return get(); } + + bool operator!=(const T &other) { return *ptr != other; } + bool operator==(const T &other) { return *ptr == other; } + + private: + Handle() {} + + const T *ptr; + + template + void operator=(S v) MOZ_DELETE; +}; + +typedef Handle HandleObject; +typedef Handle HandleModule; +typedef Handle HandleFunction; +typedef Handle HandleScript; +typedef Handle HandleString; +typedef Handle HandleId; +typedef Handle HandleValue; + +/* + * Similar to a handle, but the underlying storage can be changed. This is + * useful for outparams. + * + * If you want to add additional methods to MutableHandle for a specific + * specialization, define a MutableHandleBase specialization containing + * them. + */ +template +class MutableHandle : public js::MutableHandleBase +{ + public: + inline MutableHandle(js::Rooted *root); + + void set(T v) { + JS_ASSERT(!js::RootMethods::poisoned(v)); + *ptr = v; + } + + /* + * This may be called only if the location of the T is guaranteed + * to be marked (for some reason other than being a Rooted), + * e.g., if it is guaranteed to be reachable from an implicit root. + * + * Create a MutableHandle from a raw location of a T. + */ + static MutableHandle fromMarkedLocation(T *p) { + MutableHandle h; + h.ptr = p; + return h; + } + + T *address() const { return ptr; } + T get() const { return *ptr; } + + operator T() const { return get(); } + T operator->() const { return get(); } + + private: + MutableHandle() {} + + T *ptr; + + template + void operator=(S v) MOZ_DELETE; +}; + +typedef MutableHandle MutableHandleObject; +typedef MutableHandle MutableHandleFunction; +typedef MutableHandle MutableHandleScript; +typedef MutableHandle MutableHandleString; +typedef MutableHandle MutableHandleId; +typedef MutableHandle MutableHandleValue; + +} /* namespace JS */ + +namespace js { + +/* + * Raw pointer used as documentation that a parameter does not need to be + * rooted. + */ +typedef JSObject * RawObject; +typedef JSString * RawString; +typedef jsid RawId; +typedef JS::Value RawValue; + +/* + * InternalHandle is a handle to an internal pointer into a gcthing. Use + * InternalHandle when you have a pointer to a direct field of a gcthing, or + * when you need a parameter type for something that *may* be a pointer to a + * direct field of a gcthing. + */ +template +class InternalHandle {}; + +template +class InternalHandle +{ + void * const *holder; + size_t offset; + + public: + /* + * Create an InternalHandle using a Handle to the gcthing containing the + * field in question, and a pointer to the field. + */ + template + InternalHandle(const JS::Handle &handle, T *field) + : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get())) + {} + + /* + * Create an InternalHandle to a field within a Rooted<>. + */ + template + InternalHandle(const Rooted &root, T *field) + : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get())) + {} + + T *get() const { return reinterpret_cast(uintptr_t(*holder) + offset); } + + const T &operator*() const { return *get(); } + T *operator->() const { return get(); } + + static InternalHandle fromMarkedLocation(T *fieldPtr) { + return InternalHandle(fieldPtr); + } + + private: + /* + * Create an InternalHandle to something that is not a pointer to a + * gcthing, and so does not need to be rooted in the first place. Use these + * InternalHandles to pass pointers into functions that also need to accept + * regular InternalHandles to gcthing fields. + * + * Make this private to prevent accidental misuse; this is only for + * fromMarkedLocation(). + */ + InternalHandle(T *field) + : holder(reinterpret_cast(&JS::NullPtr::constNullValue)), + offset(uintptr_t(field)) + {} +}; + +#ifdef DEBUG +/* + * |Unrooted| acts as an AutoAssertNoGC after it is initialized. It otherwise + * acts like as a normal pointer of type T. + */ +template +class Unrooted +{ + public: + Unrooted() : ptr_(UninitializedTag()) {} + + /* + * |Unrooted| can be initialized from a convertible |Rooted| or + * |Handle|. This is so that we can call AutoAssertNoGC methods that + * take |Unrooted| parameters with a convertible rooted argument + * without explicit unpacking. + * + * Note: Even though this allows implicit conversion to |Unrooted| + * type, this is safe because Unrooted acts as an AutoAssertNoGC scope. + */ + template + inline Unrooted(const Rooted &root, + typename mozilla::EnableIf::value, int>::Type dummy = 0); + + template + Unrooted(const JS::Handle &root, + typename mozilla::EnableIf::value, int>::Type dummy = 0) + : ptr_(root.get()) + { + JS_ASSERT(ptr_ != UninitializedTag()); + JS::EnterAssertNoGCScope(); + } + + /* + * |Unrooted| can initialize by copying from a convertible type + * |Unrooted|. This enables usage such as: + * + * Unrooted base = js_NewBaseShape(cx); + * Unrooted ubase = static_cast(ubase); + */ + template + Unrooted(const Unrooted &other) + /* Note: |static_cast| acquires other.ptr_ in DEBUG builds. */ + : ptr_(static_cast(static_cast(other))) + { + if (ptr_ != UninitializedTag()) + JS::EnterAssertNoGCScope(); + } + + Unrooted(const Unrooted &other) : ptr_(other.ptr_) { + if (ptr_ != UninitializedTag()) + JS::EnterAssertNoGCScope(); + } + + Unrooted(const T &p) : ptr_(p) { + JS_ASSERT(ptr_ != UninitializedTag()); + JS::EnterAssertNoGCScope(); + } + + Unrooted(const JS::NullPtr &) : ptr_(NULL) { + JS::EnterAssertNoGCScope(); + } + + ~Unrooted() { + if (ptr_ != UninitializedTag()) + JS::LeaveAssertNoGCScope(); + } + + void drop() { + if (ptr_ != UninitializedTag()) + JS::LeaveAssertNoGCScope(); + ptr_ = UninitializedTag(); + } + + /* See notes for Unrooted::Unrooted(const T &) */ + Unrooted &operator=(T other) { + JS_ASSERT(other != UninitializedTag()); + if (ptr_ == UninitializedTag()) + JS::EnterAssertNoGCScope(); + ptr_ = other; + return *this; + } + Unrooted &operator=(Unrooted other) { + JS_ASSERT(other.ptr_ != UninitializedTag()); + if (ptr_ == UninitializedTag()) + JS::EnterAssertNoGCScope(); + ptr_ = other.ptr_; + return *this; + } + + operator T() const { return (ptr_ == UninitializedTag()) ? NULL : ptr_; } + T *operator&() { return &ptr_; } + const T operator->() const { JS_ASSERT(ptr_ != UninitializedTag()); return ptr_; } + bool operator==(const T &other) { return ptr_ == other; } + bool operator!=(const T &other) { return ptr_ != other; } + + private: + /* + * The after-initialization constraint is to handle the case: + * + * Unrooted foo = js_NewFoo(cx); + * + * In this case, C++ may run the default constructor, then call MaybeGC, + * and finally call the assignment operator. We cannot handle this case by + * simply checking if the pointer is NULL, since that would disable the + * NoGCScope on assignment. Instead we tag the pointer when we should + * disable the LeaveNoGCScope. + */ + static inline T UninitializedTag() { return reinterpret_cast(2); }; + + T ptr_; +}; + +/* + * This macro simplifies declaration of the required matching raw-pointer for + * optimized builds and Unrooted template for debug builds. + */ +# define ForwardDeclare(type) \ + class type; \ + typedef Unrooted Unrooted##type; \ + typedef type * Raw##type + +# define ForwardDeclareJS(type) \ + class JS##type; \ + namespace js { \ + typedef js::Unrooted Unrooted##type; \ + typedef JS##type * Raw##type; \ + } \ + class JS##type + +template +T DropUnrooted(Unrooted &unrooted) +{ + T rv = unrooted; + unrooted.drop(); + return rv; +} + +template +T DropUnrooted(T &unrooted) +{ + T rv = unrooted; + JS::PoisonPtr(&unrooted); + return rv; +} + +template <> +inline RawId DropUnrooted(RawId &id) { return id; } + +#else /* NDEBUG */ + +/* In opt builds |UnrootedFoo| is a real |Foo*|. */ +# define ForwardDeclare(type) \ + class type; \ + typedef type * Unrooted##type; \ + typedef type * Raw##type + +# define ForwardDeclareJS(type) \ + class JS##type; \ + namespace js { \ + typedef JS##type * Unrooted##type; \ + typedef JS##type * Raw##type; \ + } \ + class JS##type + +template +class Unrooted +{ + private: + Unrooted() MOZ_DELETE; + Unrooted(const Unrooted &) MOZ_DELETE; + ~Unrooted() MOZ_DELETE; +}; + +template +T DropUnrooted(T &unrooted) { return unrooted; } + +#endif /* DEBUG */ + +/* + * By default, pointers should use the inheritance hierarchy to find their + * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that + * Rooted may be used without the class definition being available. + */ +template +struct RootKind +{ + static ThingRootKind rootKind() { return T::rootKind(); } +}; + +template +struct RootMethods +{ + static T *initial() { return NULL; } + static ThingRootKind kind() { return RootKind::rootKind(); } + static bool poisoned(T *v) { return IsPoisonedPtr(v); } +}; + +/* + * Local variable of type T whose value is always rooted. This is typically + * used for local variables, or for non-rooted values being passed to a + * function that requires a handle, e.g. Foo(Root(cx, x)). + * + * If you want to add additional methods to Rooted for a specific + * specialization, define a RootedBase specialization containing them. + */ +template +class Rooted : public RootedBase +{ + void init(JSContext *cxArg) { +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + ContextFriendFields *cx = ContextFriendFields::get(cxArg); + commonInit(cx->thingGCRooters); +#endif + } + + void init(PerThreadData *ptArg) { +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + PerThreadDataFriendFields *pt = PerThreadDataFriendFields::get(ptArg); + commonInit(pt->thingGCRooters); +#endif + } + + public: + Rooted(JSContext *cx + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(RootMethods::initial()) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + init(cx); + } + + Rooted(JSContext *cx, T initial + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(initial) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + init(cx); + } + + template + Rooted(JSContext *cx, const Unrooted &initial + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(static_cast(initial)) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + init(cx); + } + + Rooted(PerThreadData *pt + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(RootMethods::initial()) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + init(pt); + } + + Rooted(PerThreadData *pt, T initial + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(initial) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + init(pt); + } + + template + Rooted(PerThreadData *pt, const Unrooted &initial + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(static_cast(initial)) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + init(pt); + } + + ~Rooted() { +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + JS_ASSERT(*stack == this); + *stack = prev; +#endif + } + +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + Rooted *previous() { return prev; } +#endif + + operator T() const { return ptr; } + T operator->() const { return ptr; } + T *address() { return &ptr; } + const T *address() const { return &ptr; } + T &get() { return ptr; } + const T &get() const { return ptr; } + + T &operator=(T value) { + JS_ASSERT(!RootMethods::poisoned(value)); + ptr = value; + return ptr; + } + + T &operator=(const Rooted &value) { + ptr = value; + return ptr; + } + + bool operator!=(const T &other) { return ptr != other; } + bool operator==(const T &other) { return ptr == other; } + + private: + void commonInit(Rooted **thingGCRooters) { +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + ThingRootKind kind = RootMethods::kind(); + this->stack = reinterpret_cast**>(&thingGCRooters[kind]); + this->prev = *stack; + *stack = this; + + JS_ASSERT(!RootMethods::poisoned(ptr)); +#endif + } + +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + Rooted **stack, *prev; +#endif + +#if defined(JSGC_ROOT_ANALYSIS) + /* Has the rooting analysis ever scanned this Rooted's stack location? */ + friend void JS::CheckStackRoots(JSContext*); + bool scanned; +#endif + + /* + * |ptr| must be the last field in Rooted because the analysis treats all + * Rooted as Rooted during the analysis. See bug 829372. + */ + T ptr; + + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER + + Rooted(const Rooted &) MOZ_DELETE; +}; + +#if !(defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING)) +// Defined in vm/String.h. +template <> +class Rooted; +#endif + +#ifdef DEBUG +template template +inline +Unrooted::Unrooted(const Rooted &root, + typename mozilla::EnableIf::value, int>::Type dummy) + : ptr_(root.get()) +{ + JS_ASSERT(ptr_ != UninitializedTag()); + JS::EnterAssertNoGCScope(); +} +#endif /* DEBUG */ + +typedef Rooted RootedObject; +typedef Rooted RootedModule; +typedef Rooted RootedFunction; +typedef Rooted RootedScript; +typedef Rooted RootedString; +typedef Rooted RootedId; +typedef Rooted RootedValue; + +/* + * Mark a stack location as a root for the rooting analysis, without actually + * rooting it in release builds. This should only be used for stack locations + * of GC things that cannot be relocated by a garbage collection, and that + * are definitely reachable via another path. + */ +class SkipRoot +{ +#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) + + SkipRoot **stack, *prev; + const uint8_t *start; + const uint8_t *end; + + template + void init(SkipRoot **head, const T *ptr, size_t count) { + this->stack = head; + this->prev = *stack; + *stack = this; + this->start = (const uint8_t *) ptr; + this->end = this->start + (sizeof(T) * count); + } + + public: + template + SkipRoot(JSContext *cx, const T *ptr, size_t count = 1 + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + { + init(&ContextFriendFields::get(cx)->skipGCRooters, ptr, count); + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + + template + SkipRoot(js::PerThreadData *ptd, const T *ptr, size_t count = 1 + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + { + PerThreadDataFriendFields *ptff = PerThreadDataFriendFields::get(ptd); + init(&ptff->skipGCRooters, ptr, count); + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + + ~SkipRoot() { + JS_ASSERT(*stack == this); + *stack = prev; + } + + SkipRoot *previous() { return prev; } + + bool contains(const uint8_t *v, size_t len) { + return v >= start && v + len <= end; + } + +#else /* DEBUG && JSGC_ROOT_ANALYSIS */ + + public: + template + SkipRoot(JSContext *cx, const T *ptr, size_t count = 1 + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + + template + SkipRoot(PerThreadData *ptd, const T *ptr, size_t count = 1 + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + +#endif /* DEBUG && JSGC_ROOT_ANALYSIS */ + + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + +/* Interface substitute for Rooted which does not root the variable's memory. */ +template +class FakeRooted : public RootedBase +{ + public: + FakeRooted(JSContext *cx + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(RootMethods::initial()) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + + FakeRooted(JSContext *cx, T initial + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(initial) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + + template + FakeRooted(JSContext *cx, const Unrooted &initial + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : ptr(static_cast(initial)) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + + operator T() const { return ptr; } + T operator->() const { return ptr; } + T *address() { return &ptr; } + const T *address() const { return &ptr; } + T &get() { return ptr; } + const T &get() const { return ptr; } + + T &operator=(T value) { + JS_ASSERT(!RootMethods::poisoned(value)); + ptr = value; + return ptr; + } + + bool operator!=(const T &other) { return ptr != other; } + bool operator==(const T &other) { return ptr == other; } + + private: + T ptr; + + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER + + FakeRooted(const FakeRooted &) MOZ_DELETE; +}; + +/* Interface substitute for MutableHandle which is not required to point to rooted memory. */ +template +class FakeMutableHandle : public js::MutableHandleBase +{ + public: + FakeMutableHandle(T *t) { + ptr = t; + } + + FakeMutableHandle(FakeRooted *root) { + ptr = root->address(); + } + + void set(T v) { + JS_ASSERT(!js::RootMethods::poisoned(v)); + *ptr = v; + } + + T *address() const { return ptr; } + T get() const { return *ptr; } + + operator T() const { return get(); } + T operator->() const { return get(); } + + private: + FakeMutableHandle() {} + + T *ptr; + + template + void operator=(S v) MOZ_DELETE; +}; + +/* + * Types for a variable that either should or shouldn't be rooted, depending on + * the template parameter Rooted. Used for implementing functions that can + * operate on either rooted or unrooted data. + * + * The toHandle() and toMutableHandle() functions are for calling functions + * which require handle types and are only called in the CanGC case. These + * allow the calling code to type check. + */ +enum AllowGC { + NoGC = 0, + CanGC = 1 +}; +template +class MaybeRooted +{ +}; + +template class MaybeRooted +{ + public: + typedef Handle HandleType; + typedef Rooted RootType; + typedef MutableHandle MutableHandleType; + + static inline Handle toHandle(HandleType v) { + return v; + } + + static inline MutableHandle toMutableHandle(MutableHandleType v) { + return v; + } +}; + +template class MaybeRooted +{ + public: + typedef T HandleType; + typedef FakeRooted RootType; + typedef FakeMutableHandle MutableHandleType; + + static inline Handle toHandle(HandleType v) { + JS_NOT_REACHED("Bad conversion"); + return Handle::fromMarkedLocation(NULL); + } + + static inline MutableHandle toMutableHandle(MutableHandleType v) { + JS_NOT_REACHED("Bad conversion"); + return MutableHandle::fromMarkedLocation(NULL); + } +}; + +} /* namespace js */ + +namespace JS { + +template template +inline +Handle::Handle(js::Rooted &root, + typename mozilla::EnableIf::value, int>::Type dummy) +{ + ptr = reinterpret_cast(root.address()); +} + +template template +inline +Handle::Handle(MutableHandle &root, + typename mozilla::EnableIf::value, int>::Type dummy) +{ + ptr = reinterpret_cast(root.address()); +} + +template +inline +MutableHandle::MutableHandle(js::Rooted *root) +{ + ptr = root->address(); +} + +/* + * The scoped guard object AutoAssertNoGC forces the GC to assert if a GC is + * attempted while the guard object is live. If you have a GC-unsafe operation + * to perform, use this guard object to protect your operation. + */ +class AutoAssertNoGC +{ + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER + +public: + AutoAssertNoGC(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; +#ifdef DEBUG + EnterAssertNoGCScope(); +#endif + } + + ~AutoAssertNoGC() { +#ifdef DEBUG + LeaveAssertNoGCScope(); +#endif + } +}; + +/* + * AssertCanGC will assert if it is called inside of an AutoAssertNoGC region. + */ +JS_ALWAYS_INLINE void +AssertCanGC() +{ + JS_ASSERT_IF(isGCEnabled(), !InNoGCScope()); +} + +JS_FRIEND_API(bool) NeedRelaxedRootChecks(); + +} /* namespace JS */ + +namespace js { + +/* + * Hook for dynamic root analysis. Checks the native stack and poisons + * references to GC things which have not been rooted. + */ +inline void MaybeCheckStackRoots(JSContext *cx, bool relax = true) +{ + JS::AssertCanGC(); +#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) + if (relax && NeedRelaxedRootChecks()) + return; + CheckStackRoots(cx); +#endif +} + +namespace gc { +struct Cell; +} /* namespace gc */ + +/* Base class for automatic read-only object rooting during compilation. */ +class CompilerRootNode +{ + protected: + CompilerRootNode(js::gc::Cell *ptr) : next(NULL), ptr_(ptr) {} + + public: + void **address() { return (void **)&ptr_; } + + public: + CompilerRootNode *next; + + protected: + js::gc::Cell *ptr_; +}; + +} /* namespace js */ + +ForwardDeclareJS(Script); +ForwardDeclareJS(Function); +ForwardDeclareJS(Object); + +#endif /* jsgc_root_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js-config.h b/scripting/javascript/spidermonkey-mac/include/js-config.h new file mode 100644 index 0000000000..95f19a7012 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js-config.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=78: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_config_h___ +#define js_config_h___ + +/* Definitions set at build time that affect SpiderMonkey's public API. + This header file is generated by the SpiderMonkey configure script, + and installed along with jsapi.h. */ + +/* Define to 1 if SpiderMonkey should support multi-threaded clients. */ +/* #undef JS_THREADSAFE */ + +/* Define to 1 if SpiderMonkey should include ctypes support. */ +/* #undef JS_HAS_CTYPES */ + +/* Define to 1 if SpiderMonkey should support the ability to perform + entirely too much GC. */ +#define JS_GC_ZEAL 1 + +/* Define to 1 if the header is present and + useable. See jscpucfg.h. */ +/* #undef JS_HAVE_ENDIAN_H */ + +/* Define to 1 if the header is present and + useable. See jscpucfg.h. */ +#define JS_HAVE_MACHINE_ENDIAN_H 1 + +/* Define to 1 if the header is present and + useable. See jscpucfg.h. */ +/* #undef JS_HAVE_SYS_ISA_DEFS_H */ + +/* Define to 1 if the defines int8_t, etc. */ +/* #undef JS_SYS_TYPES_H_DEFINES_EXACT_SIZE_TYPES */ + +/* Define to 1 if the N-byte __intN types are defined by the + compiler. */ +/* #undef JS_HAVE___INTN */ + +/* Define to 1 if #including provides definitions for + intptr_t and uintptr_t. */ +/* #undef JS_STDDEF_H_HAS_INTPTR_T */ + +/* Define to 1 if #including provides definitions for + intptr_t and uintptr_t. */ +/* #undef JS_CRTDEFS_H_HAS_INTPTR_T */ + +/* The configure script defines these if it doesn't #define + JS_HAVE_STDINT_H. */ +/* #undef JS_INT8_TYPE */ +/* #undef JS_INT16_TYPE */ +/* #undef JS_INT32_TYPE */ +/* #undef JS_INT64_TYPE */ +/* #undef JS_INTPTR_TYPE */ +#define JS_BYTES_PER_WORD 8 + +/* Some mozilla code uses JS-friend APIs that depend on JS_METHODJIT being + correct. */ +#define JS_METHODJIT 1 + +#endif /* js_config_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js.msg b/scripting/javascript/spidermonkey-mac/include/js.msg new file mode 100644 index 0000000000..ba58f4d00e --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js.msg @@ -0,0 +1,390 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * This is the JavaScript error message file. + * + * The format for each JS error message is: + * + * MSG_DEF(, , , , + * ) + * + * where ; + * is a legal C identifer that will be used in the + * JS engine source. + * + * is an unique integral value identifying this error. + * + * is an integer literal specifying the total number of + * replaceable arguments in the following format string. + * + * is an exception index from the enum in jsexn.c; + * JSEXN_NONE for none. The given exception index will be raised by the + * engine when the corresponding error occurs. + * + * is a string literal, optionally containing sequences + * {X} where X is an integer representing the argument number that will + * be replaced with a string value when the error is reported. + * + * e.g. + * + * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 73, JSEXN_NONE, 2, + * "{0} is not a member of the {1} family") + * + * can be used: + * + * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, "Rhino", "Monkey"); + * + * to report: + * + * "Rhino is not a member of the Monkey family" + * + * When removing MSG_DEFs, convert them to JSMSG_UNUSED placeholders: + * + * MSG_DEF(JSMSG_UNUSED7, 7, 0, JSEXN_NONE, "") + * + * Before adding a new MSG_DEF at the end, look for existing JSMSG_UNUSED + * free index placeholders in the middle of the list. + */ + +MSG_DEF(JSMSG_NOT_AN_ERROR, 0, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_NOT_DEFINED, 1, 1, JSEXN_REFERENCEERR, "{0} is not defined") +MSG_DEF(JSMSG_INACTIVE, 2, 0, JSEXN_INTERNALERR, "nothing active on context") +MSG_DEF(JSMSG_MORE_ARGS_NEEDED, 3, 3, JSEXN_TYPEERR, "{0} requires more than {1} argument{2}") +MSG_DEF(JSMSG_BAD_CHAR, 4, 1, JSEXN_INTERNALERR, "invalid format character {0}") +MSG_DEF(JSMSG_BAD_TYPE, 5, 1, JSEXN_TYPEERR, "unknown type {0}") +MSG_DEF(JSMSG_ALLOC_OVERFLOW, 6, 0, JSEXN_INTERNALERR, "allocation size overflow") +MSG_DEF(JSMSG_MISSING_HEXDIGITS, 7, 0, JSEXN_SYNTAXERR, "missing hexadecimal digits after '0x'") +MSG_DEF(JSMSG_INCOMPATIBLE_PROTO, 8, 3, JSEXN_TYPEERR, "{0}.prototype.{1} called on incompatible {2}") +MSG_DEF(JSMSG_NO_CONSTRUCTOR, 9, 1, JSEXN_TYPEERR, "{0} has no constructor") +MSG_DEF(JSMSG_CANT_ALIAS, 10, 3, JSEXN_TYPEERR, "can't alias {0} to {1} in class {2}") +MSG_DEF(JSMSG_NOT_SCRIPTED_FUNCTION, 11, 1, JSEXN_TYPEERR, "{0} is not a scripted function") +MSG_DEF(JSMSG_BAD_SORT_ARG, 12, 0, JSEXN_TYPEERR, "invalid Array.prototype.sort argument") +MSG_DEF(JSMSG_BAD_ATOMIC_NUMBER, 13, 1, JSEXN_INTERNALERR, "internal error: no index for atom {0}") +MSG_DEF(JSMSG_TOO_MANY_LITERALS, 14, 0, JSEXN_INTERNALERR, "too many literals") +MSG_DEF(JSMSG_CANT_WATCH, 15, 1, JSEXN_TYPEERR, "can't watch non-native objects of class {0}") +MSG_DEF(JSMSG_STACK_UNDERFLOW, 16, 2, JSEXN_INTERNALERR, "internal error compiling {0}: stack underflow at pc {1}") +MSG_DEF(JSMSG_NEED_DIET, 17, 1, JSEXN_INTERNALERR, "{0} too large") +MSG_DEF(JSMSG_TOO_MANY_LOCAL_ROOTS, 18, 0, JSEXN_ERR, "out of local root space") +MSG_DEF(JSMSG_READ_ONLY, 19, 1, JSEXN_TYPEERR, "{0} is read-only") +MSG_DEF(JSMSG_BAD_FORMAL, 20, 0, JSEXN_SYNTAXERR, "malformed formal parameter") +MSG_DEF(JSMSG_CANT_DELETE, 21, 1, JSEXN_TYPEERR, "property {0} is non-configurable and can't be deleted") +MSG_DEF(JSMSG_NOT_FUNCTION, 22, 1, JSEXN_TYPEERR, "{0} is not a function") +MSG_DEF(JSMSG_NOT_CONSTRUCTOR, 23, 1, JSEXN_TYPEERR, "{0} is not a constructor") +MSG_DEF(JSMSG_INVALID_DATE, 24, 0, JSEXN_RANGEERR, "invalid date") +MSG_DEF(JSMSG_TOO_DEEP, 25, 1, JSEXN_INTERNALERR, "{0} nested too deeply") +MSG_DEF(JSMSG_OVER_RECURSED, 26, 0, JSEXN_INTERNALERR, "too much recursion") +MSG_DEF(JSMSG_IN_NOT_OBJECT, 27, 1, JSEXN_TYPEERR, "invalid 'in' operand {0}") +MSG_DEF(JSMSG_BAD_NEW_RESULT, 28, 1, JSEXN_TYPEERR, "invalid new expression result {0}") +MSG_DEF(JSMSG_UNUSED29, 29, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED30, 30, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_BAD_INSTANCEOF_RHS, 31, 1, JSEXN_TYPEERR, "invalid 'instanceof' operand {0}") +MSG_DEF(JSMSG_BAD_BYTECODE, 32, 1, JSEXN_INTERNALERR, "unimplemented JavaScript bytecode {0}") +MSG_DEF(JSMSG_BAD_RADIX, 33, 0, JSEXN_RANGEERR, "radix must be an integer at least 2 and no greater than 36") +MSG_DEF(JSMSG_PAREN_BEFORE_LET, 34, 0, JSEXN_SYNTAXERR, "missing ( before let head") +MSG_DEF(JSMSG_CANT_CONVERT, 35, 1, JSEXN_ERR, "can't convert {0} to an integer") +MSG_DEF(JSMSG_CYCLIC_VALUE, 36, 1, JSEXN_TYPEERR, "cyclic {0} value") +MSG_DEF(JSMSG_COMPILE_EXECED_SCRIPT, 37, 0, JSEXN_TYPEERR, "can't compile over a script that is currently executing") +MSG_DEF(JSMSG_CANT_CONVERT_TO, 38, 2, JSEXN_TYPEERR, "can't convert {0} to {1}") +MSG_DEF(JSMSG_NO_PROPERTIES, 39, 1, JSEXN_TYPEERR, "{0} has no properties") +MSG_DEF(JSMSG_CANT_FIND_CLASS, 40, 1, JSEXN_TYPEERR, "can't find class id {0}") +MSG_DEF(JSMSG_DEAD_OBJECT, 41, 0, JSEXN_TYPEERR, "can't access dead object") +MSG_DEF(JSMSG_BYTECODE_TOO_BIG, 42, 2, JSEXN_INTERNALERR, "bytecode {0} too large (limit {1})") +MSG_DEF(JSMSG_UNKNOWN_FORMAT, 43, 1, JSEXN_INTERNALERR, "unknown bytecode format {0}") +MSG_DEF(JSMSG_TOO_MANY_CON_ARGS, 44, 0, JSEXN_SYNTAXERR, "too many constructor arguments") +MSG_DEF(JSMSG_TOO_MANY_FUN_ARGS, 45, 0, JSEXN_SYNTAXERR, "too many function arguments") +MSG_DEF(JSMSG_BAD_QUANTIFIER, 46, 0, JSEXN_SYNTAXERR, "invalid quantifier") +MSG_DEF(JSMSG_MIN_TOO_BIG, 47, 1, JSEXN_SYNTAXERR, "overlarge minimum {0}") +MSG_DEF(JSMSG_MAX_TOO_BIG, 48, 1, JSEXN_SYNTAXERR, "overlarge maximum {0}") +MSG_DEF(JSMSG_OUT_OF_ORDER, 49, 1, JSEXN_SYNTAXERR, "maximum {0} less than minimum") +MSG_DEF(JSMSG_BAD_DESTRUCT_DECL, 50, 0, JSEXN_SYNTAXERR, "missing = in destructuring declaration") +MSG_DEF(JSMSG_BAD_DESTRUCT_ASS, 51, 0, JSEXN_REFERENCEERR, "invalid destructuring assignment operator") +MSG_DEF(JSMSG_PAREN_AFTER_LET, 52, 0, JSEXN_SYNTAXERR, "missing ) after let head") +MSG_DEF(JSMSG_CURLY_AFTER_LET, 53, 0, JSEXN_SYNTAXERR, "missing } after let block") +MSG_DEF(JSMSG_MISSING_PAREN, 54, 0, JSEXN_SYNTAXERR, "unterminated parenthetical") +MSG_DEF(JSMSG_UNTERM_CLASS, 55, 1, JSEXN_SYNTAXERR, "unterminated character class {0}") +MSG_DEF(JSMSG_TRAILING_SLASH, 56, 0, JSEXN_SYNTAXERR, "trailing \\ in regular expression") +MSG_DEF(JSMSG_BAD_CLASS_RANGE, 57, 0, JSEXN_SYNTAXERR, "invalid range in character class") +MSG_DEF(JSMSG_BAD_REGEXP_FLAG, 58, 1, JSEXN_SYNTAXERR, "invalid regular expression flag {0}") +MSG_DEF(JSMSG_NO_INPUT, 59, 5, JSEXN_SYNTAXERR, "no input for /{0}/{1}{2}{3}{4}") +MSG_DEF(JSMSG_CANT_OPEN, 60, 2, JSEXN_ERR, "can't open {0}: {1}") +MSG_DEF(JSMSG_TOO_MANY_FUN_APPLY_ARGS, 61, 0, JSEXN_RANGEERR, "arguments array passed to Function.prototype.apply is too large") +MSG_DEF(JSMSG_UNMATCHED_RIGHT_PAREN, 62, 0, JSEXN_SYNTAXERR, "unmatched ) in regular expression") +MSG_DEF(JSMSG_TOO_BIG_TO_ENCODE, 63, 0, JSEXN_INTERNALERR, "data are to big to encode") +MSG_DEF(JSMSG_ARG_INDEX_OUT_OF_RANGE, 64, 1, JSEXN_RANGEERR, "argument {0} accesses an index that is out of range") +MSG_DEF(JSMSG_SPREAD_TOO_LARGE, 65, 0, JSEXN_RANGEERR, "array too large due to spread operand(s)") +MSG_DEF(JSMSG_SOURCE_TOO_LONG, 66, 0, JSEXN_RANGEERR, "source is too long") +MSG_DEF(JSMSG_BAD_WEAKMAP_KEY, 67, 0, JSEXN_TYPEERR, "cannot use the given object as a weak map key") +MSG_DEF(JSMSG_BAD_SCRIPT_MAGIC, 68, 0, JSEXN_INTERNALERR, "bad script XDR magic number") +MSG_DEF(JSMSG_PAREN_BEFORE_FORMAL, 69, 0, JSEXN_SYNTAXERR, "missing ( before formal parameters") +MSG_DEF(JSMSG_MISSING_FORMAL, 70, 0, JSEXN_SYNTAXERR, "missing formal parameter") +MSG_DEF(JSMSG_PAREN_AFTER_FORMAL, 71, 0, JSEXN_SYNTAXERR, "missing ) after formal parameters") +MSG_DEF(JSMSG_CURLY_BEFORE_BODY, 72, 0, JSEXN_SYNTAXERR, "missing { before function body") +MSG_DEF(JSMSG_CURLY_AFTER_BODY, 73, 0, JSEXN_SYNTAXERR, "missing } after function body") +MSG_DEF(JSMSG_PAREN_BEFORE_COND, 74, 0, JSEXN_SYNTAXERR, "missing ( before condition") +MSG_DEF(JSMSG_PAREN_AFTER_COND, 75, 0, JSEXN_SYNTAXERR, "missing ) after condition") +MSG_DEF(JSMSG_BAD_DUP_ARGS, 76, 0, JSEXN_SYNTAXERR, "duplicate argument names not allowed in this context") +MSG_DEF(JSMSG_NAME_AFTER_DOT, 77, 0, JSEXN_SYNTAXERR, "missing name after . operator") +MSG_DEF(JSMSG_BRACKET_IN_INDEX, 78, 0, JSEXN_SYNTAXERR, "missing ] in index expression") +MSG_DEF(JSMSG_ACCESSOR_DEF_DENIED, 79, 1, JSEXN_ERR, "Permission denied to define accessor property '{0}'") +MSG_DEF(JSMSG_PAREN_BEFORE_SWITCH, 80, 0, JSEXN_SYNTAXERR, "missing ( before switch expression") +MSG_DEF(JSMSG_PAREN_AFTER_SWITCH, 81, 0, JSEXN_SYNTAXERR, "missing ) after switch expression") +MSG_DEF(JSMSG_CURLY_BEFORE_SWITCH, 82, 0, JSEXN_SYNTAXERR, "missing { before switch body") +MSG_DEF(JSMSG_COLON_AFTER_CASE, 83, 0, JSEXN_SYNTAXERR, "missing : after case label") +MSG_DEF(JSMSG_WHILE_AFTER_DO, 84, 0, JSEXN_SYNTAXERR, "missing while after do-loop body") +MSG_DEF(JSMSG_PAREN_AFTER_FOR, 85, 0, JSEXN_SYNTAXERR, "missing ( after for") +MSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT, 86, 0, JSEXN_SYNTAXERR, "missing ; after for-loop initializer") +MSG_DEF(JSMSG_SEMI_AFTER_FOR_COND, 87, 0, JSEXN_SYNTAXERR, "missing ; after for-loop condition") +MSG_DEF(JSMSG_PAREN_AFTER_FOR_CTRL, 88, 0, JSEXN_SYNTAXERR, "missing ) after for-loop control") +MSG_DEF(JSMSG_CURLY_BEFORE_TRY, 89, 0, JSEXN_SYNTAXERR, "missing { before try block") +MSG_DEF(JSMSG_CURLY_AFTER_TRY, 90, 0, JSEXN_SYNTAXERR, "missing } after try block") +MSG_DEF(JSMSG_PAREN_BEFORE_CATCH, 91, 0, JSEXN_SYNTAXERR, "missing ( before catch") +MSG_DEF(JSMSG_CATCH_IDENTIFIER, 92, 0, JSEXN_SYNTAXERR, "missing identifier in catch") +MSG_DEF(JSMSG_PAREN_AFTER_CATCH, 93, 0, JSEXN_SYNTAXERR, "missing ) after catch") +MSG_DEF(JSMSG_CURLY_BEFORE_CATCH, 94, 0, JSEXN_SYNTAXERR, "missing { before catch block") +MSG_DEF(JSMSG_CURLY_AFTER_CATCH, 95, 0, JSEXN_SYNTAXERR, "missing } after catch block") +MSG_DEF(JSMSG_CURLY_BEFORE_FINALLY, 96, 0, JSEXN_SYNTAXERR, "missing { before finally block") +MSG_DEF(JSMSG_CURLY_AFTER_FINALLY, 97, 0, JSEXN_SYNTAXERR, "missing } after finally block") +MSG_DEF(JSMSG_CATCH_OR_FINALLY, 98, 0, JSEXN_SYNTAXERR, "missing catch or finally after try") +MSG_DEF(JSMSG_PAREN_BEFORE_WITH, 99, 0, JSEXN_SYNTAXERR, "missing ( before with-statement object") +MSG_DEF(JSMSG_PAREN_AFTER_WITH, 100, 0, JSEXN_SYNTAXERR, "missing ) after with-statement object") +MSG_DEF(JSMSG_CURLY_IN_COMPOUND, 101, 0, JSEXN_SYNTAXERR, "missing } in compound statement") +MSG_DEF(JSMSG_NO_VARIABLE_NAME, 102, 0, JSEXN_SYNTAXERR, "missing variable name") +MSG_DEF(JSMSG_COLON_IN_COND, 103, 0, JSEXN_SYNTAXERR, "missing : in conditional expression") +MSG_DEF(JSMSG_PAREN_AFTER_ARGS, 104, 0, JSEXN_SYNTAXERR, "missing ) after argument list") +MSG_DEF(JSMSG_BRACKET_AFTER_LIST, 105, 0, JSEXN_SYNTAXERR, "missing ] after element list") +MSG_DEF(JSMSG_COLON_AFTER_ID, 106, 0, JSEXN_SYNTAXERR, "missing : after property id") +MSG_DEF(JSMSG_CURLY_AFTER_LIST, 107, 0, JSEXN_SYNTAXERR, "missing } after property list") +MSG_DEF(JSMSG_PAREN_IN_PAREN, 108, 0, JSEXN_SYNTAXERR, "missing ) in parenthetical") +MSG_DEF(JSMSG_SEMI_BEFORE_STMNT, 109, 0, JSEXN_SYNTAXERR, "missing ; before statement") +MSG_DEF(JSMSG_NO_RETURN_VALUE, 110, 1, JSEXN_TYPEERR, "function {0} does not always return a value") +MSG_DEF(JSMSG_DUPLICATE_FORMAL, 111, 1, JSEXN_SYNTAXERR, "duplicate formal argument {0}") +MSG_DEF(JSMSG_EQUAL_AS_ASSIGN, 112, 0, JSEXN_SYNTAXERR, "test for equality (==) mistyped as assignment (=)?") +MSG_DEF(JSMSG_OPTIMIZED_CLOSURE_LEAK, 113, 0, JSEXN_INTERNALERR, "can't access optimized closure") +MSG_DEF(JSMSG_TOO_MANY_DEFAULTS, 114, 0, JSEXN_SYNTAXERR, "more than one switch default") +MSG_DEF(JSMSG_TOO_MANY_CASES, 115, 0, JSEXN_INTERNALERR, "too many switch cases") +MSG_DEF(JSMSG_BAD_SWITCH, 116, 0, JSEXN_SYNTAXERR, "invalid switch statement") +MSG_DEF(JSMSG_BAD_FOR_LEFTSIDE, 117, 0, JSEXN_SYNTAXERR, "invalid for/in left-hand side") +MSG_DEF(JSMSG_CATCH_AFTER_GENERAL, 118, 0, JSEXN_SYNTAXERR, "catch after unconditional catch") +MSG_DEF(JSMSG_CATCH_WITHOUT_TRY, 119, 0, JSEXN_SYNTAXERR, "catch without try") +MSG_DEF(JSMSG_FINALLY_WITHOUT_TRY, 120, 0, JSEXN_SYNTAXERR, "finally without try") +MSG_DEF(JSMSG_LABEL_NOT_FOUND, 121, 0, JSEXN_SYNTAXERR, "label not found") +MSG_DEF(JSMSG_TOUGH_BREAK, 122, 0, JSEXN_SYNTAXERR, "unlabeled break must be inside loop or switch") +MSG_DEF(JSMSG_BAD_CONTINUE, 123, 0, JSEXN_SYNTAXERR, "continue must be inside loop") +MSG_DEF(JSMSG_BAD_RETURN_OR_YIELD, 124, 1, JSEXN_SYNTAXERR, "{0} not in function") +MSG_DEF(JSMSG_BAD_LABEL, 125, 0, JSEXN_SYNTAXERR, "invalid label") +MSG_DEF(JSMSG_DUPLICATE_LABEL, 126, 0, JSEXN_SYNTAXERR, "duplicate label") +MSG_DEF(JSMSG_VAR_HIDES_ARG, 127, 1, JSEXN_TYPEERR, "variable {0} redeclares argument") +MSG_DEF(JSMSG_BAD_VAR_INIT, 128, 0, JSEXN_SYNTAXERR, "invalid variable initialization") +MSG_DEF(JSMSG_BAD_LEFTSIDE_OF_ASS, 129, 0, JSEXN_REFERENCEERR, "invalid assignment left-hand side") +MSG_DEF(JSMSG_BAD_OPERAND, 130, 1, JSEXN_SYNTAXERR, "invalid {0} operand") +MSG_DEF(JSMSG_BAD_PROP_ID, 131, 0, JSEXN_SYNTAXERR, "invalid property id") +MSG_DEF(JSMSG_RESERVED_ID, 132, 1, JSEXN_SYNTAXERR, "{0} is a reserved identifier") +MSG_DEF(JSMSG_SYNTAX_ERROR, 133, 0, JSEXN_SYNTAXERR, "syntax error") +MSG_DEF(JSMSG_UNUSED134, 134, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_BAD_PROTOTYPE, 135, 1, JSEXN_TYPEERR, "'prototype' property of {0} is not an object") +MSG_DEF(JSMSG_MISSING_EXPONENT, 136, 0, JSEXN_SYNTAXERR, "missing exponent") +MSG_DEF(JSMSG_OUT_OF_MEMORY, 137, 0, JSEXN_ERR, "out of memory") +MSG_DEF(JSMSG_UNTERMINATED_STRING, 138, 0, JSEXN_SYNTAXERR, "unterminated string literal") +MSG_DEF(JSMSG_TOO_MANY_PARENS, 139, 0, JSEXN_INTERNALERR, "too many parentheses in regular expression") +MSG_DEF(JSMSG_UNTERMINATED_COMMENT, 140, 0, JSEXN_SYNTAXERR, "unterminated comment") +MSG_DEF(JSMSG_UNTERMINATED_REGEXP, 141, 0, JSEXN_SYNTAXERR, "unterminated regular expression literal") +MSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, "bad cloned function scope chain") +MSG_DEF(JSMSG_UNUSED143, 143, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_ILLEGAL_CHARACTER, 144, 0, JSEXN_SYNTAXERR, "illegal character") +MSG_DEF(JSMSG_BAD_OCTAL, 145, 1, JSEXN_SYNTAXERR, "{0} is not a legal ECMA-262 octal constant") +MSG_DEF(JSMSG_UNUSED146, 146, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNCAUGHT_EXCEPTION, 147, 1, JSEXN_INTERNALERR, "uncaught exception: {0}") +MSG_DEF(JSMSG_INVALID_BACKREF, 148, 0, JSEXN_SYNTAXERR, "non-octal digit in an escape sequence that doesn't match a back-reference") +MSG_DEF(JSMSG_BAD_BACKREF, 149, 0, JSEXN_SYNTAXERR, "back-reference exceeds number of capturing parentheses") +MSG_DEF(JSMSG_PRECISION_RANGE, 150, 1, JSEXN_RANGEERR, "precision {0} out of range") +MSG_DEF(JSMSG_BAD_GETTER_OR_SETTER, 151, 1, JSEXN_TYPEERR, "invalid {0} usage") +MSG_DEF(JSMSG_BAD_ARRAY_LENGTH, 152, 0, JSEXN_RANGEERR, "invalid array length") +MSG_DEF(JSMSG_CANT_DESCRIBE_PROPS, 153, 1, JSEXN_TYPEERR, "can't describe non-native properties of class {0}") +MSG_DEF(JSMSG_BAD_APPLY_ARGS, 154, 1, JSEXN_TYPEERR, "second argument to Function.prototype.{0} must be an array") +MSG_DEF(JSMSG_REDECLARED_VAR, 155, 2, JSEXN_TYPEERR, "redeclaration of {0} {1}") +MSG_DEF(JSMSG_UNDECLARED_VAR, 156, 1, JSEXN_REFERENCEERR, "assignment to undeclared variable {0}") +MSG_DEF(JSMSG_ANON_NO_RETURN_VALUE, 157, 0, JSEXN_TYPEERR, "anonymous function does not always return a value") +MSG_DEF(JSMSG_DEPRECATED_USAGE, 158, 1, JSEXN_REFERENCEERR, "deprecated {0} usage") +MSG_DEF(JSMSG_BAD_URI, 159, 0, JSEXN_URIERR, "malformed URI sequence") +MSG_DEF(JSMSG_GETTER_ONLY, 160, 0, JSEXN_TYPEERR, "setting a property that has only a getter") +MSG_DEF(JSMSG_IDSTART_AFTER_NUMBER, 161, 0, JSEXN_SYNTAXERR, "identifier starts immediately after numeric literal") +MSG_DEF(JSMSG_UNDEFINED_PROP, 162, 1, JSEXN_REFERENCEERR, "reference to undefined property {0}") +MSG_DEF(JSMSG_USELESS_EXPR, 163, 0, JSEXN_TYPEERR, "useless expression") +MSG_DEF(JSMSG_REDECLARED_PARAM, 164, 1, JSEXN_TYPEERR, "redeclaration of formal parameter {0}") +MSG_DEF(JSMSG_NEWREGEXP_FLAGGED, 165, 0, JSEXN_TYPEERR, "can't supply flags when constructing one RegExp from another") +MSG_DEF(JSMSG_RESERVED_SLOT_RANGE, 166, 0, JSEXN_RANGEERR, "reserved slot index out of range") +MSG_DEF(JSMSG_CANT_DECODE_PRINCIPALS, 167, 0, JSEXN_INTERNALERR, "can't decode JSPrincipals") +MSG_DEF(JSMSG_CANT_SEAL_OBJECT, 168, 1, JSEXN_ERR, "can't seal {0} objects") +MSG_DEF(JSMSG_TOO_MANY_CATCH_VARS, 169, 0, JSEXN_SYNTAXERR, "too many catch variables") +MSG_DEF(JSMSG_UNUSED170, 170, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED171, 171, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED172, 172, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED173, 173, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED174, 174, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_NESTING_GENERATOR, 175, 0, JSEXN_TYPEERR, "already executing generator") +MSG_DEF(JSMSG_UNUSED176, 176, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED177, 177, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED178, 178, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED179, 179, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED180, 180, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED181, 181, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_BAD_GENERATOR_SEND, 182, 1, JSEXN_TYPEERR, "attempt to send {0} to newborn generator") +MSG_DEF(JSMSG_UNUSED183, 183, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED184, 184, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED185, 185, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED186, 186, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED187, 187, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_INCOMPATIBLE_METHOD, 188, 3, JSEXN_TYPEERR, "{0} {1} called on incompatible {2}") +MSG_DEF(JSMSG_UNUSED189, 189, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED190, 190, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED191, 191, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED192, 192, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_BAD_FOR_EACH_LOOP, 193, 0, JSEXN_SYNTAXERR, "invalid for each loop") +MSG_DEF(JSMSG_UNUSED194, 194, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED195, 195, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED196, 196, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNUSED197, 197, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR, 198, 0, JSEXN_ERR, "internal error getting the default locale") +MSG_DEF(JSMSG_TOO_MANY_LOCALS, 199, 0, JSEXN_SYNTAXERR, "too many local variables") +MSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG, 200, 0, JSEXN_INTERNALERR, "array initialiser too large") +MSG_DEF(JSMSG_REGEXP_TOO_COMPLEX, 201, 0, JSEXN_INTERNALERR, "regular expression too complex") +MSG_DEF(JSMSG_BUFFER_TOO_SMALL, 202, 0, JSEXN_INTERNALERR, "buffer too small") +MSG_DEF(JSMSG_BAD_SURROGATE_CHAR, 203, 1, JSEXN_TYPEERR, "bad surrogate character {0}") +MSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE, 204, 1, JSEXN_TYPEERR, "UTF-8 character {0} too large") +MSG_DEF(JSMSG_MALFORMED_UTF8_CHAR, 205, 1, JSEXN_TYPEERR, "malformed UTF-8 character sequence at offset {0}") +MSG_DEF(JSMSG_USER_DEFINED_ERROR, 206, 0, JSEXN_ERR, "JS_ReportError was called") +MSG_DEF(JSMSG_WRONG_CONSTRUCTOR, 207, 1, JSEXN_TYPEERR, "wrong constructor called for {0}") +MSG_DEF(JSMSG_BAD_GENERATOR_RETURN, 208, 1, JSEXN_TYPEERR, "generator function {0} returns a value") +MSG_DEF(JSMSG_BAD_ANON_GENERATOR_RETURN, 209, 0, JSEXN_TYPEERR, "anonymous generator function returns a value") +MSG_DEF(JSMSG_NAME_AFTER_FOR_PAREN, 210, 0, JSEXN_SYNTAXERR, "missing name after for (") +MSG_DEF(JSMSG_IN_AFTER_FOR_NAME, 211, 0, JSEXN_SYNTAXERR, "missing 'in' or 'of' after for") +MSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE, 212, 2, JSEXN_TYPEERR,"trap {1} for {0} returned a primitive value") +MSG_DEF(JSMSG_UNUSED213, 213, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_BAD_GENERATOR_YIELD, 214, 1, JSEXN_TYPEERR, "yield from closing generator {0}") +MSG_DEF(JSMSG_BAD_GENERATOR_SYNTAX, 215, 1, JSEXN_SYNTAXERR, "{0} expression must be parenthesized") +MSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE, 216, 0, JSEXN_SYNTAXERR, "invalid array comprehension left-hand side") +MSG_DEF(JSMSG_UNUSED217, 217, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE, 218, 0, JSEXN_TYPEERR, "reduce of empty array with no initial value") +MSG_DEF(JSMSG_UNUSED219, 219, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_BAD_DELETE_OPERAND, 220, 0, JSEXN_REFERENCEERR, "invalid delete operand") +MSG_DEF(JSMSG_BAD_INCOP_OPERAND, 221, 0, JSEXN_REFERENCEERR, "invalid increment/decrement operand") +MSG_DEF(JSMSG_UNEXPECTED_TYPE, 222, 2, JSEXN_TYPEERR, "{0} is {1}") +MSG_DEF(JSMSG_LET_DECL_NOT_IN_BLOCK, 223, 0, JSEXN_SYNTAXERR, "let declaration not directly within block") +MSG_DEF(JSMSG_BAD_OBJECT_INIT, 224, 0, JSEXN_SYNTAXERR, "invalid object initializer") +MSG_DEF(JSMSG_CANT_SET_ARRAY_ATTRS, 225, 0, JSEXN_INTERNALERR, "can't set attributes on indexed array properties") +MSG_DEF(JSMSG_EVAL_ARITY, 226, 0, JSEXN_TYPEERR, "eval accepts only one parameter") +MSG_DEF(JSMSG_MISSING_FUN_ARG, 227, 2, JSEXN_TYPEERR, "missing argument {0} when calling function {1}") +MSG_DEF(JSMSG_JSON_BAD_PARSE, 228, 1, JSEXN_SYNTAXERR, "JSON.parse: {0}") +MSG_DEF(JSMSG_JSON_BAD_STRINGIFY, 229, 0, JSEXN_ERR, "JSON.stringify") +MSG_DEF(JSMSG_NOT_CALLABLE_OR_UNDEFINED, 230, 0, JSEXN_TYPEERR, "value is not a function or undefined") +MSG_DEF(JSMSG_NOT_NONNULL_OBJECT, 231, 0, JSEXN_TYPEERR, "value is not a non-null object") +MSG_DEF(JSMSG_DEPRECATED_OCTAL, 232, 0, JSEXN_SYNTAXERR, "octal literals and octal escape sequences are deprecated") +MSG_DEF(JSMSG_STRICT_CODE_WITH, 233, 0, JSEXN_SYNTAXERR, "strict mode code may not contain 'with' statements") +MSG_DEF(JSMSG_DUPLICATE_PROPERTY, 234, 1, JSEXN_SYNTAXERR, "property name {0} appears more than once in object literal") +MSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 235, 0, JSEXN_SYNTAXERR, "applying the 'delete' operator to an unqualified name is deprecated") +MSG_DEF(JSMSG_DEPRECATED_ASSIGN, 236, 1, JSEXN_SYNTAXERR, "assignment to {0} is deprecated") +MSG_DEF(JSMSG_BAD_BINDING, 237, 1, JSEXN_SYNTAXERR, "redefining {0} is deprecated") +MSG_DEF(JSMSG_INVALID_DESCRIPTOR, 238, 0, JSEXN_TYPEERR, "property descriptors must not specify a value or be writable when a getter or setter has been specified") +MSG_DEF(JSMSG_OBJECT_NOT_EXTENSIBLE, 239, 1, JSEXN_TYPEERR, "{0} is not extensible") +MSG_DEF(JSMSG_CANT_REDEFINE_PROP, 240, 1, JSEXN_TYPEERR, "can't redefine non-configurable property '{0}'") +MSG_DEF(JSMSG_CANT_APPEND_TO_ARRAY, 241, 0, JSEXN_TYPEERR, "can't add elements past the end of an array if its length property is unwritable") +MSG_DEF(JSMSG_CANT_DEFINE_ARRAY_LENGTH,242, 0, JSEXN_INTERNALERR, "defining the length property on an array is not currently supported") +MSG_DEF(JSMSG_CANT_DEFINE_ARRAY_INDEX,243, 0, JSEXN_TYPEERR, "can't define array index property") +MSG_DEF(JSMSG_TYPED_ARRAY_BAD_INDEX, 244, 0, JSEXN_ERR, "invalid or out-of-range index") +MSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG, 245, 1, JSEXN_ERR, "argument {0} must be >= 0") +MSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS, 246, 0, JSEXN_ERR, "invalid arguments") +MSG_DEF(JSMSG_CSP_BLOCKED_FUNCTION, 247, 0, JSEXN_ERR, "call to Function() blocked by CSP") +MSG_DEF(JSMSG_BAD_GET_SET_FIELD, 248, 1, JSEXN_TYPEERR, "property descriptor's {0} field is neither undefined nor a function") +MSG_DEF(JSMSG_BAD_PROXY_FIX, 249, 0, JSEXN_TYPEERR, "proxy was fixed while executing the handler") +MSG_DEF(JSMSG_INVALID_EVAL_SCOPE_ARG, 250, 0, JSEXN_EVALERR, "invalid eval scope argument") +MSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS, 251, 3, JSEXN_SYNTAXERR, "{0} functions must have {1} argument{2}") +MSG_DEF(JSMSG_THROW_TYPE_ERROR, 252, 0, JSEXN_TYPEERR, "'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them") +MSG_DEF(JSMSG_BAD_TOISOSTRING_PROP, 253, 0, JSEXN_TYPEERR, "toISOString property is not callable") +MSG_DEF(JSMSG_BAD_PARSE_NODE, 254, 0, JSEXN_INTERNALERR, "bad parse node") +MSG_DEF(JSMSG_NOT_EXPECTED_TYPE, 255, 3, JSEXN_TYPEERR, "{0}: expected {1}, got {2}") +MSG_DEF(JSMSG_CALLER_IS_STRICT, 256, 0, JSEXN_TYPEERR, "access to strict mode caller function is censored") +MSG_DEF(JSMSG_NEED_DEBUG_MODE, 257, 0, JSEXN_ERR, "function can be called only in debug mode") +MSG_DEF(JSMSG_STRICT_CODE_LET_EXPR_STMT, 258, 0, JSEXN_ERR, "strict mode code may not contain unparenthesized let expression statements") +MSG_DEF(JSMSG_CANT_CHANGE_EXTENSIBILITY, 259, 0, JSEXN_TYPEERR, "can't change object's extensibility") +MSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA, 260, 1, JSEXN_INTERNALERR, "bad serialized structured data ({0})") +MSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE, 261, 0, JSEXN_TYPEERR, "unsupported type for structured data") +MSG_DEF(JSMSG_SC_RECURSION, 262, 0, JSEXN_INTERNALERR, "recursive object") +MSG_DEF(JSMSG_UNUSED263, 263, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_BAD_CLONE_VERSION, 264, 0, JSEXN_ERR, "unsupported structured clone version") +MSG_DEF(JSMSG_CANT_CLONE_OBJECT, 265, 0, JSEXN_TYPEERR, "can't clone object") +MSG_DEF(JSMSG_UNUSED266, 266, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, "in strict mode code, functions may be declared only at top level or immediately within another function") +MSG_DEF(JSMSG_INVALID_FOR_IN_INIT, 268, 0, JSEXN_SYNTAXERR, "for-in loop let declaration may not have an initializer") +MSG_DEF(JSMSG_CLEARED_SCOPE, 269, 0, JSEXN_TYPEERR, "attempt to run compile-and-go script on a cleared scope") +MSG_DEF(JSMSG_MALFORMED_ESCAPE, 270, 1, JSEXN_SYNTAXERR, "malformed {0} character escape sequence") +MSG_DEF(JSMSG_BAD_GENEXP_BODY, 271, 1, JSEXN_SYNTAXERR, "illegal use of {0} in generator expression") +MSG_DEF(JSMSG_UNUSED272, 272, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT, 273, 0, JSEXN_SYNTAXERR, "function statement requires a name") +MSG_DEF(JSMSG_CCW_REQUIRED, 274, 1, JSEXN_TYPEERR, "{0}: argument must be an object from a different compartment") +MSG_DEF(JSMSG_DEBUG_BAD_RESUMPTION, 275, 0, JSEXN_TYPEERR, "debugger resumption value must be undefined, {throw: val}, {return: val}, or null") +MSG_DEF(JSMSG_ASSIGN_FUNCTION_OR_NULL, 276, 1, JSEXN_TYPEERR, "value assigned to {0} must be a function or null") +MSG_DEF(JSMSG_DEBUG_NOT_LIVE, 277, 1, JSEXN_ERR, "{0} is not live") +MSG_DEF(JSMSG_DEBUG_OBJECT_WRONG_OWNER, 278, 0, JSEXN_TYPEERR, "Debugger.Object belongs to a different Debugger") +MSG_DEF(JSMSG_DEBUG_OBJECT_PROTO, 279, 0, JSEXN_TYPEERR, "Debugger.Object.prototype is not a valid Debugger.Object") +MSG_DEF(JSMSG_DEBUG_LOOP, 280, 0, JSEXN_TYPEERR, "cannot debug an object in same compartment as debugger or a compartment that is already debugging the debugger") +MSG_DEF(JSMSG_DEBUG_NOT_IDLE, 281, 0, JSEXN_ERR, "can't start debugging: a debuggee script is on the stack") +MSG_DEF(JSMSG_DEBUG_BAD_OFFSET, 282, 0, JSEXN_TYPEERR, "invalid script offset") +MSG_DEF(JSMSG_DEBUG_BAD_LINE, 283, 0, JSEXN_TYPEERR, "invalid line number") +MSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING, 284, 0, JSEXN_ERR, "can't set breakpoint: script global is not a debuggee") +MSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, "{0}: descriptor .{1} property is an object in a different compartment than the target object") +MSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, "stack frame is not running JavaScript code") +MSG_DEF(JSMSG_CANT_WATCH_PROP, 287, 0, JSEXN_TYPEERR, "properties whose names are objects can't be watched") +MSG_DEF(JSMSG_CSP_BLOCKED_EVAL, 288, 0, JSEXN_ERR, "call to eval() blocked by CSP") +MSG_DEF(JSMSG_DEBUG_NO_SCOPE_OBJECT, 289, 0, JSEXN_TYPEERR, "declarative Environments don't have binding objects") +MSG_DEF(JSMSG_EMPTY_CONSEQUENT, 290, 0, JSEXN_SYNTAXERR, "mistyped ; after conditional?") +MSG_DEF(JSMSG_NOT_ITERABLE, 291, 1, JSEXN_TYPEERR, "{0} is not iterable") +MSG_DEF(JSMSG_QUERY_LINE_WITHOUT_URL, 292, 0, JSEXN_TYPEERR, "findScripts query object has 'line' property, but no 'url' property") +MSG_DEF(JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL, 293, 0, JSEXN_TYPEERR, "findScripts query object has 'innermost' property without both 'url' and 'line' properties") +MSG_DEF(JSMSG_DEBUG_VARIABLE_NOT_FOUND, 294, 0, JSEXN_TYPEERR, "variable not found in environment") +MSG_DEF(JSMSG_PARAMETER_AFTER_REST, 295, 0, JSEXN_SYNTAXERR, "parameter after rest parameter") +MSG_DEF(JSMSG_NO_REST_NAME, 296, 0, JSEXN_SYNTAXERR, "no parameter name after ...") +MSG_DEF(JSMSG_ARGUMENTS_AND_REST, 297, 0, JSEXN_SYNTAXERR, "'arguments' object may not be used in conjunction with a rest parameter") +MSG_DEF(JSMSG_FUNCTION_ARGUMENTS_AND_REST, 298, 0, JSEXN_ERR, "the 'arguments' property of a function with a rest parameter may not be used") +MSG_DEF(JSMSG_REST_WITH_DEFAULT, 299, 0, JSEXN_SYNTAXERR, "rest parameter may not have a default") +MSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, "parameter(s) with default followed by parameter without default") +MSG_DEF(JSMSG_YIELD_IN_DEFAULT, 301, 0, JSEXN_SYNTAXERR, "yield in default expression") +MSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED, 302, 1, JSEXN_REFERENCEERR, "no intrinsic function {0}") +MSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP, 303, 1, JSEXN_ERR, "{0} is being assigned a source map, yet already has one") +MSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG, 304, 1, JSEXN_TYPEERR, "invalid ParallelArray{0} argument") +MSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, "argument must be divisible by outermost dimension") +MSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, "cannot reduce empty ParallelArray object") +MSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, "cannot flatten 1-dimensional ParallelArray object") +MSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, "no conflict resolution function provided") +MSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, "index in scatter vector out of bounds") +MSG_DEF(JSMSG_CANT_REPORT_NC_AS_NE, 310, 0, JSEXN_TYPEERR, "proxy can't report a non-configurable own property as non-existent") +MSG_DEF(JSMSG_CANT_REPORT_E_AS_NE, 311, 0, JSEXN_TYPEERR, "proxy can't report an existing own property as non-existent on a non-extensible object") +MSG_DEF(JSMSG_CANT_REPORT_NEW, 312, 0, JSEXN_TYPEERR, "proxy can't report a new property on a non-extensible object") +MSG_DEF(JSMSG_CANT_REPORT_INVALID, 313, 0, JSEXN_TYPEERR, "proxy can't report an incompatible property descriptor") +MSG_DEF(JSMSG_CANT_REPORT_NE_AS_NC, 314, 0, JSEXN_TYPEERR, "proxy can't report a non-existent property as non-configurable") +MSG_DEF(JSMSG_CANT_DEFINE_NEW, 315, 0, JSEXN_TYPEERR, "proxy can't define a new property on a non-extensible object") +MSG_DEF(JSMSG_CANT_DEFINE_INVALID, 316, 0, JSEXN_TYPEERR, "proxy can't define an incompatible property descriptor") +MSG_DEF(JSMSG_CANT_DEFINE_NE_AS_NC, 317, 0, JSEXN_TYPEERR, "proxy can't define a non-existent property as non-configurable") +MSG_DEF(JSMSG_INVALID_TRAP_RESULT, 318, 2, JSEXN_TYPEERR, "trap {1} for {0} returned an invalid result") +MSG_DEF(JSMSG_CANT_SKIP_NC, 319, 0, JSEXN_TYPEERR, "proxy can't skip a non-configurable property") +MSG_DEF(JSMSG_MUST_REPORT_SAME_VALUE, 320, 0, JSEXN_TYPEERR, "proxy must report the same value for a non-writable, non-configurable property") +MSG_DEF(JSMSG_MUST_REPORT_UNDEFINED, 321, 0, JSEXN_TYPEERR, "proxy must report undefined for a non-configurable accessor property without a getter") +MSG_DEF(JSMSG_CANT_SET_NW_NC, 322, 0, JSEXN_TYPEERR, "proxy can't successfully set a non-writable, non-configurable property") +MSG_DEF(JSMSG_CANT_SET_WO_SETTER, 323, 0, JSEXN_TYPEERR, "proxy can't succesfully set an accessor property without a setter") +MSG_DEF(JSMSG_DEBUG_BAD_REFERENT, 324, 2, JSEXN_TYPEERR, "{0} does not refer to {1}") +MSG_DEF(JSMSG_DEBUG_WRAPPER_IN_WAY, 325, 2, JSEXN_TYPEERR, "{0} is a wrapper around {1}, but a direct reference is required") +MSG_DEF(JSMSG_UNWRAP_DENIED, 326, 0, JSEXN_ERR, "permission denied to unwrap object") +MSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 327, 3, JSEXN_TYPEERR, "Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}") +MSG_DEF(JSMSG_INVALID_LOCALES_ELEMENT,328, 0, JSEXN_TYPEERR, "invalid element in locales argument") +MSG_DEF(JSMSG_INVALID_LANGUAGE_TAG, 329, 1, JSEXN_RANGEERR, "invalid language tag: {0}") +MSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, "invalid locale matcher in supportedLocalesOf(): {0}") +MSG_DEF(JSMSG_INVALID_OPTION_VALUE, 331, 2, JSEXN_RANGEERR, "invalid value {1} for option {0}") +MSG_DEF(JSMSG_INVALID_DIGITS_VALUE, 332, 1, JSEXN_RANGEERR, "invalid digits value: {0}") +MSG_DEF(JSMSG_INTL_OBJECT_REINITED, 333, 0, JSEXN_TYPEERR, "can't initialize object twice as an object of an Intl constructor") +MSG_DEF(JSMSG_INVALID_CURRENCY_CODE, 334, 1, JSEXN_RANGEERR, "invalid currency code in NumberFormat(): {0}") +MSG_DEF(JSMSG_UNDEFINED_CURRENCY, 335, 0, JSEXN_TYPEERR, "undefined currency in NumberFormat() with currency style") +MSG_DEF(JSMSG_INVALID_TIME_ZONE, 336, 1, JSEXN_RANGEERR, "invalid time zone in DateTimeFormat(): {0}") +MSG_DEF(JSMSG_DATE_NOT_FINITE, 337, 0, JSEXN_RANGEERR, "date value is not finite in DateTimeFormat.format()") diff --git a/scripting/javascript/spidermonkey-mac/include/js/Anchor.h b/scripting/javascript/spidermonkey-mac/include/js/Anchor.h new file mode 100644 index 0000000000..166ada5cd2 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/Anchor.h @@ -0,0 +1,163 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* JS::Anchor implementation. */ + +#ifndef js_Anchor_h___ +#define js_Anchor_h___ + +#include "mozilla/Attributes.h" + +class JSFunction; +class JSObject; +class JSScript; +class JSString; + +namespace JS { class Value; } + +namespace JS { + +/* + * Protecting non-Value, non-JSObject *, non-JSString * values from collection + * + * Most of the time, the garbage collector's conservative stack scanner works + * behind the scenes, finding all live values and protecting them from being + * collected. However, when JSAPI client code obtains a pointer to data the + * scanner does not know about, owned by an object the scanner does know about, + * Care Must Be Taken. + * + * The scanner recognizes only a select set of types: pointers to JSObjects and + * similar things (JSFunctions, and so on), pointers to JSStrings, and Values. + * So while the scanner finds all live |JSString| pointers, it does not notice + * |jschar| pointers. + * + * So suppose we have: + * + * void f(JSString *str) { + * const jschar *ch = JS_GetStringCharsZ(str); + * ... do stuff with ch, but no uses of str ...; + * } + * + * After the call to |JS_GetStringCharsZ|, there are no further uses of + * |str|, which means that the compiler is within its rights to not store + * it anywhere. But because the stack scanner will not notice |ch|, there + * is no longer any live value in this frame that would keep the string + * alive. If |str| is the last reference to that |JSString|, and the + * collector runs while we are using |ch|, the string's array of |jschar|s + * may be freed out from under us. + * + * Note that there is only an issue when 1) we extract a thing X the scanner + * doesn't recognize from 2) a thing Y the scanner does recognize, and 3) if Y + * gets garbage-collected, then X gets freed. If we have code like this: + * + * void g(JSObject *obj) { + * JS::Value x; + * JS_GetProperty(obj, "x", &x); + * ... do stuff with x ... + * } + * + * there's no problem, because the value we've extracted, x, is a Value, a + * type that the conservative scanner recognizes. + * + * Conservative GC frees us from the obligation to explicitly root the types it + * knows about, but when we work with derived values like |ch|, we must root + * their owners, as the derived value alone won't keep them alive. + * + * A JS::Anchor is a kind of GC root that allows us to keep the owners of + * derived values like |ch| alive throughout the Anchor's lifetime. We could + * fix the above code as follows: + * + * void f(JSString *str) { + * JS::Anchor a_str(str); + * const jschar *ch = JS_GetStringCharsZ(str); + * ... do stuff with ch, but no uses of str ...; + * } + * + * This simply ensures that |str| will be live until |a_str| goes out of scope. + * As long as we don't retain a pointer to the string's characters for longer + * than that, we have avoided all garbage collection hazards. + */ +template class AnchorPermitted; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; +template<> class AnchorPermitted { }; + +template +class Anchor : AnchorPermitted +{ + public: + Anchor() { } + explicit Anchor(T t) { hold = t; } + inline ~Anchor(); + T &get() { return hold; } + const T &get() const { return hold; } + void set(const T &t) { hold = t; } + void operator=(const T &t) { hold = t; } + void clear() { hold = 0; } + + private: + T hold; + Anchor(const Anchor &other) MOZ_DELETE; + void operator=(const Anchor &other) MOZ_DELETE; +}; + +template +inline Anchor::~Anchor() +{ +#ifdef __GNUC__ + /* + * No code is generated for this. But because this is marked 'volatile', G++ will + * assume it has important side-effects, and won't delete it. (G++ never looks at + * the actual text and notices it's empty.) And because we have passed |hold| to + * it, GCC will keep |hold| alive until this point. + * + * The "memory" clobber operand ensures that G++ will not move prior memory + * accesses after the asm --- it's a barrier. Unfortunately, it also means that + * G++ will assume that all memory has changed after the asm, as it would for a + * call to an unknown function. I don't know of a way to avoid that consequence. + */ + asm volatile("":: "g" (hold) : "memory"); +#else + /* + * An adequate portable substitute, for non-structure types. + * + * The compiler promises that, by the end of an expression statement, the + * last-stored value to a volatile object is the same as it would be in an + * unoptimized, direct implementation (the "abstract machine" whose behavior the + * language spec describes). However, the compiler is still free to reorder + * non-volatile accesses across this store --- which is what we must prevent. So + * assigning the held value to a volatile variable, as we do here, is not enough. + * + * In our case, however, garbage collection only occurs at function calls, so it + * is sufficient to ensure that the destructor's store isn't moved earlier across + * any function calls that could collect. It is hard to imagine the compiler + * analyzing the program so thoroughly that it could prove that such motion was + * safe. In practice, compilers treat calls to the collector as opaque operations + * --- in particular, as operations which could access volatile variables, across + * which this destructor must not be moved. + * + * ("Objection, your honor! *Alleged* killer whale!") + * + * The disadvantage of this approach is that it does generate code for the store. + * We do need to use Anchors in some cases where cycles are tight. + * + * Note that there is a Anchor::~Anchor() specialization in Value.h. + */ + volatile T sink; + sink = hold; +#endif /* defined(__GNUC__) */ +} + +} // namespace JS + +#endif /* js_Anchor_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h b/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h new file mode 100644 index 0000000000..2d336e4908 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=78: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_CharacterEncoding_h___ +#define js_CharacterEncoding_h___ + +#include "mozilla/Range.h" + +#include "js/Utility.h" + +#include "jspubtd.h" + +namespace JS { + +/* + * By default, all C/C++ 1-byte-per-character strings passed into the JSAPI + * are treated as ISO/IEC 8859-1, also known as Latin-1. That is, each + * byte is treated as a 2-byte character, and there is no way to pass in a + * string containing characters beyond U+00FF. + */ +class Latin1Chars : public mozilla::Range +{ + typedef mozilla::Range Base; + + public: + Latin1Chars() : Base() {} + Latin1Chars(char *aBytes, size_t aLength) : Base(reinterpret_cast(aBytes), aLength) {} + Latin1Chars(const char *aBytes, size_t aLength) + : Base(reinterpret_cast(const_cast(aBytes)), aLength) + {} +}; + +/* + * A Latin1Chars, but with \0 termination for C compatibility. + */ +class Latin1CharsZ : public mozilla::RangedPtr +{ + typedef mozilla::RangedPtr Base; + + public: + Latin1CharsZ() : Base(NULL, 0) {} + + Latin1CharsZ(char *aBytes, size_t aLength) + : Base(reinterpret_cast(aBytes), aLength) + { + JS_ASSERT(aBytes[aLength] == '\0'); + } + + Latin1CharsZ(unsigned char *aBytes, size_t aLength) + : Base(aBytes, aLength) + { + JS_ASSERT(aBytes[aLength] == '\0'); + } + + char *c_str() { return reinterpret_cast(get()); } +}; + +/* + * SpiderMonkey also deals directly with UTF-8 encoded text in some places. + */ +class UTF8CharsZ : public mozilla::RangedPtr +{ + typedef mozilla::RangedPtr Base; + + public: + UTF8CharsZ() : Base(NULL, 0) {} + + UTF8CharsZ(char *aBytes, size_t aLength) + : Base(reinterpret_cast(aBytes), aLength) + { + JS_ASSERT(aBytes[aLength] == '\0'); + } +}; + +/* + * SpiderMonkey uses a 2-byte character representation: it is a + * 2-byte-at-a-time view of a UTF-16 byte stream. This is similar to UCS-2, + * but unlike UCS-2, we do not strip UTF-16 extension bytes. This allows a + * sufficiently dedicated JavaScript program to be fully unicode-aware by + * manually interpreting UTF-16 extension characters embedded in the JS + * string. + */ +class TwoByteChars : public mozilla::Range +{ + typedef mozilla::Range Base; + + public: + TwoByteChars() : Base() {} + TwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {} + TwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast(aChars), aLength) {} +}; + +/* + * A non-convertible variant of TwoByteChars that does not refer to characters + * inlined inside a JSShortString or a JSInlineString. StableTwoByteChars are + * thus safe to hold across a GC. + */ +class StableTwoByteChars : public mozilla::Range +{ + typedef mozilla::Range Base; + + public: + StableTwoByteChars() : Base() {} + StableTwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {} + StableTwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast(aChars), aLength) {} +}; + +/* + * A TwoByteChars, but \0 terminated for compatibility with JSFlatString. + */ +class TwoByteCharsZ : public mozilla::RangedPtr +{ + typedef mozilla::RangedPtr Base; + + public: + TwoByteCharsZ(jschar *chars, size_t length) + : Base(chars, length) + { + JS_ASSERT(chars[length] = '\0'); + } +}; + +/* + * Convert a 2-byte character sequence to "ISO-Latin-1". This works by + * truncating each 2-byte pair in the sequence to a 1-byte pair. If the source + * contains any UTF-16 extension characters, then this may give invalid Latin1 + * output. The returned string is zero terminated. The returned string or the + * returned string's |start()| must be freed with JS_free or js_free, + * respectively. If allocation fails, an OOM error will be set and the method + * will return a NULL chars (which can be tested for with the ! operator). + * This method cannot trigger GC. + */ +extern Latin1CharsZ +LossyTwoByteCharsToNewLatin1CharsZ(JSContext *cx, TwoByteChars tbchars); + +} // namespace JS + +inline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); } + +#endif // js_CharacterEncoding_h___ diff --git a/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h b/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h new file mode 100644 index 0000000000..db09eaef50 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h @@ -0,0 +1,247 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_gc_api_h___ +#define js_gc_api_h___ + +#include "HeapAPI.h" + +namespace JS { + +#define GCREASONS(D) \ + /* Reasons internal to the JS engine */ \ + D(API) \ + D(MAYBEGC) \ + D(LAST_CONTEXT) \ + D(DESTROY_CONTEXT) \ + D(LAST_DITCH) \ + D(TOO_MUCH_MALLOC) \ + D(ALLOC_TRIGGER) \ + D(DEBUG_GC) \ + D(DEBUG_MODE_GC) \ + D(TRANSPLANT) \ + D(RESET) \ + \ + /* Reasons from Firefox */ \ + D(DOM_WINDOW_UTILS) \ + D(COMPONENT_UTILS) \ + D(MEM_PRESSURE) \ + D(CC_WAITING) \ + D(CC_FORCED) \ + D(LOAD_END) \ + D(POST_COMPARTMENT) \ + D(PAGE_HIDE) \ + D(NSJSCONTEXT_DESTROY) \ + D(SET_NEW_DOCUMENT) \ + D(SET_DOC_SHELL) \ + D(DOM_UTILS) \ + D(DOM_IPC) \ + D(DOM_WORKER) \ + D(INTER_SLICE_GC) \ + D(REFRESH_FRAME) \ + D(FULL_GC_TIMER) \ + D(SHUTDOWN_CC) + +namespace gcreason { + +/* GCReasons will end up looking like JSGC_MAYBEGC */ +enum Reason { +#define MAKE_REASON(name) name, + GCREASONS(MAKE_REASON) +#undef MAKE_REASON + NO_REASON, + NUM_REASONS, + + /* + * For telemetry, we want to keep a fixed max bucket size over time so we + * don't have to switch histograms. 100 is conservative; as of this writing + * there are 26. But the cost of extra buckets seems to be low while the + * cost of switching histograms is high. + */ + NUM_TELEMETRY_REASONS = 100 +}; + +} /* namespace gcreason */ + +extern JS_FRIEND_API(void) +PrepareZoneForGC(Zone *zone); + +extern JS_FRIEND_API(void) +PrepareForFullGC(JSRuntime *rt); + +extern JS_FRIEND_API(void) +PrepareForIncrementalGC(JSRuntime *rt); + +extern JS_FRIEND_API(bool) +IsGCScheduled(JSRuntime *rt); + +extern JS_FRIEND_API(void) +SkipZoneForGC(Zone *zone); + +/* + * When triggering a GC using one of the functions below, it is first necessary + * to select the compartments to be collected. To do this, you can call + * PrepareZoneForGC on each compartment, or you can call PrepareForFullGC + * to select all compartments. Failing to select any compartment is an error. + */ + +extern JS_FRIEND_API(void) +GCForReason(JSRuntime *rt, gcreason::Reason reason); + +extern JS_FRIEND_API(void) +ShrinkingGC(JSRuntime *rt, gcreason::Reason reason); + +extern JS_FRIEND_API(void) +ShrinkGCBuffers(JSRuntime *rt); + +extern JS_FRIEND_API(void) +IncrementalGC(JSRuntime *rt, gcreason::Reason reason, int64_t millis = 0); + +extern JS_FRIEND_API(void) +FinishIncrementalGC(JSRuntime *rt, gcreason::Reason reason); + +enum GCProgress { + /* + * During non-incremental GC, the GC is bracketed by JSGC_CYCLE_BEGIN/END + * callbacks. During an incremental GC, the sequence of callbacks is as + * follows: + * JSGC_CYCLE_BEGIN, JSGC_SLICE_END (first slice) + * JSGC_SLICE_BEGIN, JSGC_SLICE_END (second slice) + * ... + * JSGC_SLICE_BEGIN, JSGC_CYCLE_END (last slice) + */ + + GC_CYCLE_BEGIN, + GC_SLICE_BEGIN, + GC_SLICE_END, + GC_CYCLE_END +}; + +struct JS_FRIEND_API(GCDescription) { + bool isCompartment_; + + GCDescription(bool isCompartment) + : isCompartment_(isCompartment) {} + + jschar *formatMessage(JSRuntime *rt) const; + jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const; +}; + +typedef void +(* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc); + +extern JS_FRIEND_API(GCSliceCallback) +SetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback); + +/* + * Signals a good place to do an incremental slice, because the browser is + * drawing a frame. + */ +extern JS_FRIEND_API(void) +NotifyDidPaint(JSRuntime *rt); + +extern JS_FRIEND_API(bool) +IsIncrementalGCEnabled(JSRuntime *rt); + +JS_FRIEND_API(bool) +IsIncrementalGCInProgress(JSRuntime *rt); + +extern JS_FRIEND_API(void) +DisableIncrementalGC(JSRuntime *rt); + +extern JS_FRIEND_API(bool) +IsIncrementalBarrierNeeded(JSRuntime *rt); + +extern JS_FRIEND_API(bool) +IsIncrementalBarrierNeeded(JSContext *cx); + +extern JS_FRIEND_API(void) +IncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind); + +extern JS_FRIEND_API(void) +IncrementalValueBarrier(const Value &v); + +extern JS_FRIEND_API(void) +IncrementalObjectBarrier(JSObject *obj); + +extern JS_FRIEND_API(void) +PokeGC(JSRuntime *rt); + +/* Was the most recent GC run incrementally? */ +extern JS_FRIEND_API(bool) +WasIncrementalGC(JSRuntime *rt); + +class ObjectPtr +{ + JSObject *value; + + public: + ObjectPtr() : value(NULL) {} + + ObjectPtr(JSObject *obj) : value(obj) {} + + /* Always call finalize before the destructor. */ + ~ObjectPtr() { JS_ASSERT(!value); } + + void finalize(JSRuntime *rt) { + if (IsIncrementalBarrierNeeded(rt)) + IncrementalObjectBarrier(value); + value = NULL; + } + + void init(JSObject *obj) { value = obj; } + + JSObject *get() const { return value; } + + void writeBarrierPre(JSRuntime *rt) { + IncrementalObjectBarrier(value); + } + + ObjectPtr &operator=(JSObject *obj) { + IncrementalObjectBarrier(value); + value = obj; + return *this; + } + + JSObject &operator*() const { return *value; } + JSObject *operator->() const { return value; } + operator JSObject *() const { return value; } +}; + +/* + * Unsets the gray bit for anything reachable from |thing|. |kind| should not be + * JSTRACE_SHAPE. |thing| should be non-null. + */ +extern JS_FRIEND_API(void) +UnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind); + +/* + * This should be called when an object that is marked gray is exposed to the JS + * engine (by handing it to running JS code or writing it into live JS + * data). During incremental GC, since the gray bits haven't been computed yet, + * we conservatively mark the object black. + */ +static JS_ALWAYS_INLINE void +ExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind) +{ + JS_ASSERT(kind != JSTRACE_SHAPE); + + if (GCThingIsMarkedGray(thing)) + UnmarkGrayGCThingRecursively(thing, kind); + else if (IsIncrementalBarrierNeededOnGCThing(thing, kind)) + IncrementalReferenceBarrier(thing, kind); +} + +static JS_ALWAYS_INLINE void +ExposeValueToActiveJS(const Value &v) +{ + if (v.isMarkable()) + ExposeGCThingToActiveJS(v.toGCThing(), v.gcKind()); +} + +} /* namespace JS */ + +#endif /* js_gc_api_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/HashTable.h b/scripting/javascript/spidermonkey-mac/include/js/HashTable.h new file mode 100644 index 0000000000..1db926ffd1 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/HashTable.h @@ -0,0 +1,1442 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_HashTable_h__ +#define js_HashTable_h__ + +#include "mozilla/Attributes.h" +#include "mozilla/DebugOnly.h" +#include "mozilla/TypeTraits.h" +#include "mozilla/Util.h" + +#include "js/TemplateLib.h" +#include "js/Utility.h" + +namespace js { + +class TempAllocPolicy; +template struct DefaultHasher; +template class HashMapEntry; +namespace detail { + template class HashTableEntry; + template class HashTable; +} + +/*****************************************************************************/ + +// A JS-friendly, STL-like container providing a hash-based map from keys to +// values. In particular, HashMap calls constructors and destructors of all +// objects added so non-PODs may be used safely. +// +// Key/Value requirements: +// - movable, destructible, assignable +// HashPolicy requirements: +// - see Hash Policy section below +// AllocPolicy: +// - see jsalloc.h +// +// Note: +// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members +// called by HashMap must not call back into the same HashMap object. +// - Due to the lack of exception handling, the user must call |init()|. +template , + class AllocPolicy = TempAllocPolicy> +class HashMap +{ + typedef HashMapEntry TableEntry; + + struct MapHashPolicy : HashPolicy + { + typedef Key KeyType; + static const Key &getKey(TableEntry &e) { return e.key; } + static void setKey(TableEntry &e, Key &k) { const_cast(e.key) = k; } + }; + + typedef detail::HashTable Impl; + Impl impl; + + public: + typedef typename HashPolicy::Lookup Lookup; + typedef TableEntry Entry; + + // HashMap construction is fallible (due to OOM); thus the user must call + // init after constructing a HashMap and check the return value. + HashMap(AllocPolicy a = AllocPolicy()) : impl(a) {} + bool init(uint32_t len = 16) { return impl.init(len); } + bool initialized() const { return impl.initialized(); } + + // Return whether the given lookup value is present in the map. E.g.: + // + // typedef HashMap HM; + // HM h; + // if (HM::Ptr p = h.lookup(3)) { + // const HM::Entry &e = *p; // p acts like a pointer to Entry + // assert(p->key == 3); // Entry contains the key + // char val = p->value; // and value + // } + // + // Also see the definition of Ptr in HashTable above (with T = Entry). + typedef typename Impl::Ptr Ptr; + Ptr lookup(const Lookup &l) const { return impl.lookup(l); } + + // Assuming |p.found()|, remove |*p|. + void remove(Ptr p) { impl.remove(p); } + + // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient + // insertion of Key |k| (where |HashPolicy::match(k,l) == true|) using + // |add(p,k,v)|. After |add(p,k,v)|, |p| points to the new Entry. E.g.: + // + // typedef HashMap HM; + // HM h; + // HM::AddPtr p = h.lookupForAdd(3); + // if (!p) { + // if (!h.add(p, 3, 'a')) + // return false; + // } + // const HM::Entry &e = *p; // p acts like a pointer to Entry + // assert(p->key == 3); // Entry contains the key + // char val = p->value; // and value + // + // Also see the definition of AddPtr in HashTable above (with T = Entry). + // + // N.B. The caller must ensure that no mutating hash table operations + // occur between a pair of |lookupForAdd| and |add| calls. To avoid + // looking up the key a second time, the caller may use the more efficient + // relookupOrAdd method. This method reuses part of the hashing computation + // to more efficiently insert the key if it has not been added. For + // example, a mutation-handling version of the previous example: + // + // HM::AddPtr p = h.lookupForAdd(3); + // if (!p) { + // call_that_may_mutate_h(); + // if (!h.relookupOrAdd(p, 3, 'a')) + // return false; + // } + // const HM::Entry &e = *p; + // assert(p->key == 3); + // char val = p->value; + typedef typename Impl::AddPtr AddPtr; + AddPtr lookupForAdd(const Lookup &l) const { + return impl.lookupForAdd(l); + } + + template + bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) { + Entry e(k, v); + return impl.add(p, Move(e)); + } + + bool add(AddPtr &p, const Key &k) { + Entry e(k, Value()); + return impl.add(p, Move(e)); + } + + template + bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) { + Entry e(k, v); + return impl.relookupOrAdd(p, k, Move(e)); + } + + // |all()| returns a Range containing |count()| elements. E.g.: + // + // typedef HashMap HM; + // HM h; + // for (HM::Range r = h.all(); !r.empty(); r.popFront()) + // char c = r.front().value; + // + // Also see the definition of Range in HashTable above (with T = Entry). + typedef typename Impl::Range Range; + Range all() const { return impl.all(); } + + // Typedef for the enumeration class. An Enum may be used to examine and + // remove table entries: + // + // typedef HashMap HM; + // HM s; + // for (HM::Enum e(s); !e.empty(); e.popFront()) + // if (e.front().value == 'l') + // e.removeFront(); + // + // Table resize may occur in Enum's destructor. Also see the definition of + // Enum in HashTable above (with T = Entry). + typedef typename Impl::Enum Enum; + + // Remove all entries. This does not shrink the table. For that consider + // using the finish() method. + void clear() { impl.clear(); } + + // Remove all entries without triggering destructors. This method is unsafe. + void clearWithoutCallingDestructors() { impl.clearWithoutCallingDestructors(); } + + // Remove all the entries and release all internal buffers. The map must + // be initialized again before any use. + void finish() { impl.finish(); } + + // Does the table contain any entries? + bool empty() const { return impl.empty(); } + + // Number of live elements in the map. + uint32_t count() const { return impl.count(); } + + // Total number of allocation in the dynamic table. Note: resize will + // happen well before count() == capacity(). + size_t capacity() const { return impl.capacity(); } + + // Don't just call |impl.sizeOfExcludingThis()| because there's no + // guarantee that |impl| is the first field in HashMap. + size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const { + return impl.sizeOfExcludingThis(mallocSizeOf); + } + size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const { + return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf); + } + + // If |generation()| is the same before and after a HashMap operation, + // pointers into the table remain valid. + unsigned generation() const { return impl.generation(); } + + /************************************************** Shorthand operations */ + + bool has(const Lookup &l) const { + return impl.lookup(l) != NULL; + } + + // Overwrite existing value with v. Return false on oom. + template + bool put(const KeyInput &k, const ValueInput &v) { + AddPtr p = lookupForAdd(k); + if (p) { + p->value = v; + return true; + } + return add(p, k, v); + } + + // Like put, but assert that the given key is not already present. + template + bool putNew(const KeyInput &k, const ValueInput &v) { + Entry e(k, v); + return impl.putNew(k, Move(e)); + } + + // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom. + Ptr lookupWithDefault(const Key &k, const Value &defaultValue) { + AddPtr p = lookupForAdd(k); + if (p) + return p; + (void)add(p, k, defaultValue); // p is left false-y on oom. + return p; + } + + // Remove if present. + void remove(const Lookup &l) { + if (Ptr p = lookup(l)) + remove(p); + } + + // HashMap is movable + HashMap(MoveRef rhs) : impl(Move(rhs->impl)) {} + void operator=(MoveRef rhs) { impl = Move(rhs->impl); } + + private: + // HashMap is not copyable or assignable + HashMap(const HashMap &hm) MOZ_DELETE; + HashMap &operator=(const HashMap &hm) MOZ_DELETE; + + friend class Impl::Enum; + + typedef typename tl::StaticAssert::result>::result keyAssert; + typedef typename tl::StaticAssert::result>::result valAssert; +}; + +/*****************************************************************************/ + +// A JS-friendly, STL-like container providing a hash-based set of values. In +// particular, HashSet calls constructors and destructors of all objects added +// so non-PODs may be used safely. +// +// T requirements: +// - movable, destructible, assignable +// HashPolicy requirements: +// - see Hash Policy section below +// AllocPolicy: +// - see jsalloc.h +// +// Note: +// - HashSet is not reentrant: T/HashPolicy/AllocPolicy members called by +// HashSet must not call back into the same HashSet object. +// - Due to the lack of exception handling, the user must call |init()|. +template , + class AllocPolicy = TempAllocPolicy> +class HashSet +{ + struct SetOps : HashPolicy + { + typedef T KeyType; + static const KeyType &getKey(const T &t) { return t; } + static void setKey(T &t, KeyType &k) { t = k; } + }; + + typedef detail::HashTable Impl; + Impl impl; + + public: + typedef typename HashPolicy::Lookup Lookup; + typedef T Entry; + + // HashSet construction is fallible (due to OOM); thus the user must call + // init after constructing a HashSet and check the return value. + HashSet(AllocPolicy a = AllocPolicy()) : impl(a) {} + bool init(uint32_t len = 16) { return impl.init(len); } + bool initialized() const { return impl.initialized(); } + + // Return whether the given lookup value is present in the map. E.g.: + // + // typedef HashSet HS; + // HS h; + // if (HS::Ptr p = h.lookup(3)) { + // assert(*p == 3); // p acts like a pointer to int + // } + // + // Also see the definition of Ptr in HashTable above. + typedef typename Impl::Ptr Ptr; + Ptr lookup(const Lookup &l) const { return impl.lookup(l); } + + // Assuming |p.found()|, remove |*p|. + void remove(Ptr p) { impl.remove(p); } + + // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient + // insertion of T value |t| (where |HashPolicy::match(t,l) == true|) using + // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.: + // + // typedef HashSet HS; + // HS h; + // HS::AddPtr p = h.lookupForAdd(3); + // if (!p) { + // if (!h.add(p, 3)) + // return false; + // } + // assert(*p == 3); // p acts like a pointer to int + // + // Also see the definition of AddPtr in HashTable above. + // + // N.B. The caller must ensure that no mutating hash table operations + // occur between a pair of |lookupForAdd| and |add| calls. To avoid + // looking up the key a second time, the caller may use the more efficient + // relookupOrAdd method. This method reuses part of the hashing computation + // to more efficiently insert the key if it has not been added. For + // example, a mutation-handling version of the previous example: + // + // HS::AddPtr p = h.lookupForAdd(3); + // if (!p) { + // call_that_may_mutate_h(); + // if (!h.relookupOrAdd(p, 3, 3)) + // return false; + // } + // assert(*p == 3); + // + // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the + // entry |t|, where the caller ensures match(l,t). + typedef typename Impl::AddPtr AddPtr; + AddPtr lookupForAdd(const Lookup &l) const { return impl.lookupForAdd(l); } + + bool add(AddPtr &p, const T &t) { return impl.add(p, t); } + + bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) { + return impl.relookupOrAdd(p, l, t); + } + + // |all()| returns a Range containing |count()| elements: + // + // typedef HashSet HS; + // HS h; + // for (HS::Range r = h.all(); !r.empty(); r.popFront()) + // int i = r.front(); + // + // Also see the definition of Range in HashTable above. + typedef typename Impl::Range Range; + Range all() const { return impl.all(); } + + // Typedef for the enumeration class. An Enum may be used to examine and + // remove table entries: + // + // typedef HashSet HS; + // HS s; + // for (HS::Enum e(s); !e.empty(); e.popFront()) + // if (e.front() == 42) + // e.removeFront(); + // + // Table resize may occur in Enum's destructor. Also see the definition of + // Enum in HashTable above. + typedef typename Impl::Enum Enum; + + // Remove all entries. This does not shrink the table. For that consider + // using the finish() method. + void clear() { impl.clear(); } + + // Remove all the entries and release all internal buffers. The set must + // be initialized again before any use. + void finish() { impl.finish(); } + + // Does the table contain any entries? + bool empty() const { return impl.empty(); } + + // Number of live elements in the map. + uint32_t count() const { return impl.count(); } + + // Total number of allocation in the dynamic table. Note: resize will + // happen well before count() == capacity(). + size_t capacity() const { return impl.capacity(); } + + // Don't just call |impl.sizeOfExcludingThis()| because there's no + // guarantee that |impl| is the first field in HashSet. + size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const { + return impl.sizeOfExcludingThis(mallocSizeOf); + } + size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const { + return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf); + } + + // If |generation()| is the same before and after a HashSet operation, + // pointers into the table remain valid. + unsigned generation() const { return impl.generation(); } + + /************************************************** Shorthand operations */ + + bool has(const Lookup &l) const { + return impl.lookup(l) != NULL; + } + + // Overwrite existing value with v. Return false on oom. + bool put(const T &t) { + AddPtr p = lookupForAdd(t); + return p ? true : add(p, t); + } + + // Like put, but assert that the given key is not already present. + bool putNew(const T &t) { + return impl.putNew(t, t); + } + + bool putNew(const Lookup &l, const T &t) { + return impl.putNew(l, t); + } + + void remove(const Lookup &l) { + if (Ptr p = lookup(l)) + remove(p); + } + + // HashSet is movable + HashSet(MoveRef rhs) : impl(Move(rhs->impl)) {} + void operator=(MoveRef rhs) { impl = Move(rhs->impl); } + + private: + // HashSet is not copyable or assignable + HashSet(const HashSet &hs) MOZ_DELETE; + HashSet &operator=(const HashSet &hs) MOZ_DELETE; + + friend class Impl::Enum; + + typedef typename tl::StaticAssert::result>::result _; +}; + +/*****************************************************************************/ + +// Hash Policy +// +// A hash policy P for a hash table with key-type Key must provide: +// - a type |P::Lookup| to use to lookup table entries; +// - a static member function |P::hash| with signature +// +// static js::HashNumber hash(Lookup) +// +// to use to hash the lookup type; and +// - a static member function |P::match| with signature +// +// static bool match(Key, Lookup) +// +// to use to test equality of key and lookup values. +// +// Normally, Lookup = Key. In general, though, different values and types of +// values can be used to lookup and store. If a Lookup value |l| is != to the +// added Key value |k|, the user must ensure that |P::match(k,l)|. E.g.: +// +// js::HashSet::AddPtr p = h.lookup(l); +// if (!p) { +// assert(P::match(k, l)); // must hold +// h.add(p, k); +// } + +// Pointer hashing policy that strips the lowest zeroBits when calculating the +// hash to improve key distribution. +template +struct PointerHasher +{ + typedef Key Lookup; + static HashNumber hash(const Lookup &l) { + JS_ASSERT(!js::IsPoisonedPtr(l)); + size_t word = reinterpret_cast(l) >> zeroBits; + JS_STATIC_ASSERT(sizeof(HashNumber) == 4); +#if JS_BYTES_PER_WORD == 4 + return HashNumber(word); +#else + JS_STATIC_ASSERT(sizeof word == 8); + return HashNumber((word >> 32) ^ word); +#endif + } + static bool match(const Key &k, const Lookup &l) { + JS_ASSERT(!js::IsPoisonedPtr(k)); + JS_ASSERT(!js::IsPoisonedPtr(l)); + return k == l; + } +}; + +// Default hash policy: just use the 'lookup' value. This of course only +// works if the lookup value is integral. HashTable applies ScrambleHashCode to +// the result of the 'hash' which means that it is 'ok' if the lookup value is +// not well distributed over the HashNumber domain. +template +struct DefaultHasher +{ + typedef Key Lookup; + static HashNumber hash(const Lookup &l) { + // Hash if can implicitly cast to hash number type. + return l; + } + static bool match(const Key &k, const Lookup &l) { + // Use builtin or overloaded operator==. + return k == l; + } +}; + +// Specialize hashing policy for pointer types. It assumes that the type is +// at least word-aligned. For types with smaller size use PointerHasher. +template +struct DefaultHasher : PointerHasher::result> +{}; + +/*****************************************************************************/ + +// Both HashMap and HashSet are implemented by a single HashTable that is even +// more heavily parameterized than the other two. This leaves HashTable gnarly +// and extremely coupled to HashMap and HashSet; thus code should not use +// HashTable directly. + +template +class HashMapEntry +{ + template friend class detail::HashTable; + template friend class detail::HashTableEntry; + + HashMapEntry(const HashMapEntry &) MOZ_DELETE; + void operator=(const HashMapEntry &) MOZ_DELETE; + + public: + template + HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {} + + HashMapEntry(MoveRef rhs) + : key(Move(rhs->key)), value(Move(rhs->value)) { } + + const Key key; + Value value; +}; + +} // namespace js + +namespace mozilla { + +template +struct IsPod > +{ + static const bool value = IsPod::value; +}; + +template +struct IsPod > +{ + static const bool value = IsPod::value && IsPod::value; +}; + +} // namespace mozilla + +namespace js { + +namespace detail { + +template +class HashTable; + +template +class HashTableEntry +{ + template friend class HashTable; + typedef typename tl::StripConst::result NonConstT; + + HashNumber keyHash; + mozilla::AlignedStorage2 mem; + + static const HashNumber sFreeKey = 0; + static const HashNumber sRemovedKey = 1; + static const HashNumber sCollisionBit = 1; + + // Assumed by calloc in createTable. + JS_STATIC_ASSERT(sFreeKey == 0); + + static bool isLiveHash(HashNumber hash) + { + return hash > sRemovedKey; + } + + HashTableEntry(const HashTableEntry &) MOZ_DELETE; + void operator=(const HashTableEntry &) MOZ_DELETE; + ~HashTableEntry() MOZ_DELETE; + + public: + // NB: HashTableEntry is treated as a POD: no constructor or destructor calls. + + void destroyIfLive() { + if (isLive()) + mem.addr()->~T(); + } + + void destroy() { + JS_ASSERT(isLive()); + mem.addr()->~T(); + } + + void swap(HashTableEntry *other) { + Swap(keyHash, other->keyHash); + Swap(mem, other->mem); + } + + T &get() { JS_ASSERT(isLive()); return *mem.addr(); } + + bool isFree() const { return keyHash == sFreeKey; } + void clearLive() { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); } + void clear() { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; } + void clearNoDtor() { keyHash = sFreeKey; } + bool isRemoved() const { return keyHash == sRemovedKey; } + void removeLive() { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); } + bool isLive() const { return isLiveHash(keyHash); } + void setCollision() { JS_ASSERT(isLive()); keyHash |= sCollisionBit; } + void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; } + void unsetCollision() { keyHash &= ~sCollisionBit; } + bool hasCollision() const { return keyHash & sCollisionBit; } + bool matchHash(HashNumber hn) { return (keyHash & ~sCollisionBit) == hn; } + HashNumber getKeyHash() const { return keyHash & ~sCollisionBit; } + + template + void setLive(HashNumber hn, const U &u) + { + JS_ASSERT(!isLive()); + keyHash = hn; + new(mem.addr()) T(u); + JS_ASSERT(isLive()); + } +}; + +template +class HashTable : private AllocPolicy +{ + typedef typename tl::StripConst::result NonConstT; + typedef typename HashPolicy::KeyType Key; + typedef typename HashPolicy::Lookup Lookup; + + public: + typedef HashTableEntry Entry; + + // A nullable pointer to a hash table element. A Ptr |p| can be tested + // either explicitly |if (p.found()) p->...| or using boolean conversion + // |if (p) p->...|. Ptr objects must not be used after any mutating hash + // table operations unless |generation()| is tested. + class Ptr + { + friend class HashTable; + typedef void (Ptr::* ConvertibleToBool)(); + void nonNull() {} + + Entry *entry_; + + protected: + Ptr(Entry &entry) : entry_(&entry) {} + + public: + // Leaves Ptr uninitialized. + Ptr() { +#ifdef DEBUG + entry_ = (Entry *)0xbad; +#endif + } + + bool found() const { return entry_->isLive(); } + operator ConvertibleToBool() const { return found() ? &Ptr::nonNull : 0; } + bool operator==(const Ptr &rhs) const { JS_ASSERT(found() && rhs.found()); return entry_ == rhs.entry_; } + bool operator!=(const Ptr &rhs) const { return !(*this == rhs); } + + T &operator*() const { return entry_->get(); } + T *operator->() const { return &entry_->get(); } + }; + + // A Ptr that can be used to add a key after a failed lookup. + class AddPtr : public Ptr + { + friend class HashTable; + HashNumber keyHash; + mozilla::DebugOnly mutationCount; + + AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {} + public: + // Leaves AddPtr uninitialized. + AddPtr() {} + }; + + // A collection of hash table entries. The collection is enumerated by + // calling |front()| followed by |popFront()| as long as |!empty()|. As + // with Ptr/AddPtr, Range objects must not be used after any mutating hash + // table operation unless the |generation()| is tested. + class Range + { + protected: + friend class HashTable; + + Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) { + while (cur < end && !cur->isLive()) + ++cur; + } + + Entry *cur, *end; + mozilla::DebugOnly validEntry; + + public: + Range() : cur(NULL), end(NULL), validEntry(false) {} + + bool empty() const { + return cur == end; + } + + T &front() const { + JS_ASSERT(validEntry); + JS_ASSERT(!empty()); + return cur->get(); + } + + void popFront() { + JS_ASSERT(!empty()); + while (++cur < end && !cur->isLive()) + continue; + validEntry = true; + } + }; + + // A Range whose lifetime delimits a mutating enumeration of a hash table. + // Since rehashing when elements were removed during enumeration would be + // bad, it is postponed until the Enum is destructed. Since the Enum's + // destructor touches the hash table, the user must ensure that the hash + // table is still alive when the destructor runs. + class Enum : public Range + { + friend class HashTable; + + HashTable &table; + bool rekeyed; + bool removed; + + /* Not copyable. */ + Enum(const Enum &); + void operator=(const Enum &); + + public: + template explicit + Enum(Map &map) : Range(map.all()), table(map.impl), rekeyed(false), removed(false) {} + + // Removes the |front()| element from the table, leaving |front()| + // invalid until the next call to |popFront()|. For example: + // + // HashSet s; + // for (HashSet::Enum e(s); !e.empty(); e.popFront()) + // if (e.front() == 42) + // e.removeFront(); + void removeFront() { + table.remove(*this->cur); + removed = true; + this->validEntry = false; + } + + // Removes the |front()| element and re-inserts it into the table with + // a new key at the new Lookup position. |front()| is invalid after + // this operation until the next call to |popFront()|. + void rekeyFront(const Lookup &l, const Key &k) { + typename HashTableEntry::NonConstT t(Move(this->cur->get())); + HashPolicy::setKey(t, const_cast(k)); + table.remove(*this->cur); + table.putNewInfallible(l, Move(t)); + rekeyed = true; + this->validEntry = false; + } + + void rekeyFront(const Key &k) { + rekeyFront(k, k); + } + + // Potentially rehashes the table. + ~Enum() { + if (rekeyed) + table.checkOverRemoved(); + + if (removed) + table.compactIfUnderloaded(); + } + }; + + // HashTable is movable + HashTable(MoveRef rhs) + : AllocPolicy(*rhs) + { + PodAssign(this, &*rhs); + rhs->table = NULL; + } + void operator=(MoveRef rhs) { + if (table) + destroyTable(*this, table, capacity()); + PodAssign(this, &*rhs); + rhs->table = NULL; + } + + private: + // HashTable is not copyable or assignable + HashTable(const HashTable &) MOZ_DELETE; + void operator=(const HashTable &) MOZ_DELETE; + + private: + uint32_t hashShift; // multiplicative hash shift + uint32_t entryCount; // number of entries in table + uint32_t gen; // entry storage generation number + uint32_t removedCount; // removed entry sentinels in table + Entry *table; // entry storage + + void setTableSizeLog2(unsigned sizeLog2) + { + hashShift = sHashBits - sizeLog2; + } + +#ifdef DEBUG + mutable struct Stats + { + uint32_t searches; // total number of table searches + uint32_t steps; // hash chain links traversed + uint32_t hits; // searches that found key + uint32_t misses; // searches that didn't find key + uint32_t addOverRemoved; // adds that recycled a removed entry + uint32_t removes; // calls to remove + uint32_t removeFrees; // calls to remove that freed the entry + uint32_t grows; // table expansions + uint32_t shrinks; // table contractions + uint32_t compresses; // table compressions + uint32_t rehashes; // tombstone decontaminations + } stats; +# define METER(x) x +#else +# define METER(x) +#endif + + friend class js::ReentrancyGuard; + mutable mozilla::DebugOnly entered; + mozilla::DebugOnly mutationCount; + + // The default initial capacity is 32 (enough to hold 16 elements), but it + // can be as low as 4. + static const unsigned sMinCapacityLog2 = 2; + static const unsigned sMinCapacity = 1 << sMinCapacityLog2; + static const unsigned sMaxInit = JS_BIT(23); + static const unsigned sMaxCapacity = JS_BIT(24); + static const unsigned sHashBits = tl::BitSize::result; + static const uint8_t sMinAlphaFrac = 64; // (0x100 * .25) + static const uint8_t sMaxAlphaFrac = 192; // (0x100 * .75) + static const uint8_t sInvMaxAlpha = 171; // (ceil(0x100 / .75) >> 1) + static const HashNumber sFreeKey = Entry::sFreeKey; + static const HashNumber sRemovedKey = Entry::sRemovedKey; + static const HashNumber sCollisionBit = Entry::sCollisionBit; + + static void staticAsserts() + { + // Rely on compiler "constant overflow warnings". + JS_STATIC_ASSERT(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity); + JS_STATIC_ASSERT((sMaxCapacity * sInvMaxAlpha) <= UINT32_MAX); + JS_STATIC_ASSERT((sMaxCapacity * sizeof(Entry)) <= UINT32_MAX); + } + + static bool isLiveHash(HashNumber hash) + { + return Entry::isLiveHash(hash); + } + + static HashNumber prepareHash(const Lookup& l) + { + HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l)); + + // Avoid reserved hash codes. + if (!isLiveHash(keyHash)) + keyHash -= (sRemovedKey + 1); + return keyHash & ~sCollisionBit; + } + + static Entry *createTable(AllocPolicy &alloc, uint32_t capacity) + { + // See JS_STATIC_ASSERT(sFreeKey == 0) in HashTableEntry. + return (Entry *)alloc.calloc_(capacity * sizeof(Entry)); + } + + static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity) + { + for (Entry *e = oldTable, *end = e + capacity; e < end; ++e) + e->destroyIfLive(); + alloc.free_(oldTable); + } + + public: + HashTable(AllocPolicy ap) + : AllocPolicy(ap), + hashShift(sHashBits), + entryCount(0), + gen(0), + removedCount(0), + table(NULL), + entered(false), + mutationCount(0) + {} + + MOZ_WARN_UNUSED_RESULT bool init(uint32_t length) + { + JS_ASSERT(!initialized()); + + // Correct for sMaxAlphaFrac such that the table will not resize + // when adding 'length' entries. + if (length > sMaxInit) { + this->reportAllocOverflow(); + return false; + } + uint32_t newCapacity = (length * sInvMaxAlpha) >> 7; + + if (newCapacity < sMinCapacity) + newCapacity = sMinCapacity; + + // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034). + uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2; + while (roundUp < newCapacity) { + roundUp <<= 1; + ++roundUpLog2; + } + + newCapacity = roundUp; + JS_ASSERT(newCapacity <= sMaxCapacity); + + table = createTable(*this, newCapacity); + if (!table) + return false; + + setTableSizeLog2(roundUpLog2); + METER(memset(&stats, 0, sizeof(stats))); + return true; + } + + bool initialized() const + { + return !!table; + } + + ~HashTable() + { + if (table) + destroyTable(*this, table, capacity()); + } + + private: + HashNumber hash1(HashNumber hash0) const + { + return hash0 >> hashShift; + } + + struct DoubleHash + { + HashNumber h2; + HashNumber sizeMask; + }; + + DoubleHash hash2(HashNumber curKeyHash) const + { + unsigned sizeLog2 = sHashBits - hashShift; + DoubleHash dh = { + ((curKeyHash << sizeLog2) >> hashShift) | 1, + (HashNumber(1) << sizeLog2) - 1 + }; + return dh; + } + + static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh) + { + return (h1 - dh.h2) & dh.sizeMask; + } + + bool overloaded() + { + return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8); + } + + // Would the table be underloaded if it had the given capacity and entryCount? + static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount) + { + return capacity > sMinCapacity && entryCount <= ((sMinAlphaFrac * capacity) >> 8); + } + + bool underloaded() + { + return wouldBeUnderloaded(capacity(), entryCount); + } + + static bool match(Entry &e, const Lookup &l) + { + return HashPolicy::match(HashPolicy::getKey(e.get()), l); + } + + Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const + { + JS_ASSERT(isLiveHash(keyHash)); + JS_ASSERT(!(keyHash & sCollisionBit)); + JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit); + JS_ASSERT(table); + METER(stats.searches++); + + // Compute the primary hash address. + HashNumber h1 = hash1(keyHash); + Entry *entry = &table[h1]; + + // Miss: return space for a new entry. + if (entry->isFree()) { + METER(stats.misses++); + return *entry; + } + + // Hit: return entry. + if (entry->matchHash(keyHash) && match(*entry, l)) { + METER(stats.hits++); + return *entry; + } + + // Collision: double hash. + DoubleHash dh = hash2(keyHash); + + // Save the first removed entry pointer so we can recycle later. + Entry *firstRemoved = NULL; + + while(true) { + if (JS_UNLIKELY(entry->isRemoved())) { + if (!firstRemoved) + firstRemoved = entry; + } else { + entry->setCollision(collisionBit); + } + + METER(stats.steps++); + h1 = applyDoubleHash(h1, dh); + + entry = &table[h1]; + if (entry->isFree()) { + METER(stats.misses++); + return firstRemoved ? *firstRemoved : *entry; + } + + if (entry->matchHash(keyHash) && match(*entry, l)) { + METER(stats.hits++); + return *entry; + } + } + } + + // This is a copy of lookup hardcoded to the assumptions: + // 1. the lookup is a lookupForAdd + // 2. the key, whose |keyHash| has been passed is not in the table, + // 3. no entries have been removed from the table. + // This specialized search avoids the need for recovering lookup values + // from entries, which allows more flexible Lookup/Key types. + Entry &findFreeEntry(HashNumber keyHash) + { + JS_ASSERT(!(keyHash & sCollisionBit)); + JS_ASSERT(table); + METER(stats.searches++); + + // We assume 'keyHash' has already been distributed. + + // Compute the primary hash address. + HashNumber h1 = hash1(keyHash); + Entry *entry = &table[h1]; + + // Miss: return space for a new entry. + if (!entry->isLive()) { + METER(stats.misses++); + return *entry; + } + + // Collision: double hash. + DoubleHash dh = hash2(keyHash); + + while(true) { + JS_ASSERT(!entry->isRemoved()); + entry->setCollision(); + + METER(stats.steps++); + h1 = applyDoubleHash(h1, dh); + + entry = &table[h1]; + if (!entry->isLive()) { + METER(stats.misses++); + return *entry; + } + } + } + + enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed }; + + RebuildStatus changeTableSize(int deltaLog2) + { + // Look, but don't touch, until we succeed in getting new entry store. + Entry *oldTable = table; + uint32_t oldCap = capacity(); + uint32_t newLog2 = sHashBits - hashShift + deltaLog2; + uint32_t newCapacity = JS_BIT(newLog2); + if (newCapacity > sMaxCapacity) { + this->reportAllocOverflow(); + return RehashFailed; + } + + Entry *newTable = createTable(*this, newCapacity); + if (!newTable) + return RehashFailed; + + // We can't fail from here on, so update table parameters. + setTableSizeLog2(newLog2); + removedCount = 0; + gen++; + table = newTable; + + // Copy only live entries, leaving removed ones behind. + for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) { + if (src->isLive()) { + HashNumber hn = src->getKeyHash(); + findFreeEntry(hn).setLive(hn, Move(src->get())); + src->destroy(); + } + } + + // All entries have been destroyed, no need to destroyTable. + this->free_(oldTable); + return Rehashed; + } + + RebuildStatus checkOverloaded() + { + if (!overloaded()) + return NotOverloaded; + + // Compress if a quarter or more of all entries are removed. + int deltaLog2; + if (removedCount >= (capacity() >> 2)) { + METER(stats.compresses++); + deltaLog2 = 0; + } else { + METER(stats.grows++); + deltaLog2 = 1; + } + + return changeTableSize(deltaLog2); + } + + // Infallibly rehash the table if we are overloaded with removals. + void checkOverRemoved() + { + if (overloaded()) { + METER(stats.rehashes++); + rehashTable(); + JS_ASSERT(!overloaded()); + } + } + + void remove(Entry &e) + { + JS_ASSERT(table); + METER(stats.removes++); + + if (e.hasCollision()) { + e.removeLive(); + removedCount++; + } else { + METER(stats.removeFrees++); + e.clearLive(); + } + entryCount--; + mutationCount++; + } + + void checkUnderloaded() + { + if (underloaded()) { + METER(stats.shrinks++); + (void) changeTableSize(-1); + } + } + + // Resize the table down to the largest capacity which doesn't underload the + // table. Since we call checkUnderloaded() on every remove, you only need + // to call this after a bulk removal of items done without calling remove(). + void compactIfUnderloaded() + { + int32_t resizeLog2 = 0; + uint32_t newCapacity = capacity(); + while (wouldBeUnderloaded(newCapacity, entryCount)) { + newCapacity = newCapacity >> 1; + resizeLog2--; + } + + if (resizeLog2 != 0) { + changeTableSize(resizeLog2); + } + } + + // This is identical to changeTableSize(currentSize), but without requiring + // a second table. We do this by recycling the collision bits to tell us if + // the element is already inserted or still waiting to be inserted. Since + // already-inserted elements win any conflicts, we get the same table as we + // would have gotten through random insertion order. + void rehashTable() + { + removedCount = 0; + for (size_t i = 0; i < capacity(); ++i) + table[i].unsetCollision(); + + for (size_t i = 0; i < capacity();) { + Entry *src = &table[i]; + + if (!src->isLive() || src->hasCollision()) { + ++i; + continue; + } + + HashNumber keyHash = src->getKeyHash(); + HashNumber h1 = hash1(keyHash); + DoubleHash dh = hash2(keyHash); + Entry *tgt = &table[h1]; + while (true) { + if (!tgt->hasCollision()) { + src->swap(tgt); + tgt->setCollision(); + break; + } + + h1 = applyDoubleHash(h1, dh); + tgt = &table[h1]; + } + } + + // TODO: this algorithm leaves collision bits on *all* elements, even if + // they are on no collision path. We have the option of setting the + // collision bits correctly on a subsequent pass or skipping the rehash + // unless we are totally filled with tombstones: benchmark to find out + // which approach is best. + } + + public: + void clear() + { + if (mozilla::IsPod::value) { + memset(table, 0, sizeof(*table) * capacity()); + } else { + uint32_t tableCapacity = capacity(); + for (Entry *e = table, *end = table + tableCapacity; e < end; ++e) + e->clear(); + } + removedCount = 0; + entryCount = 0; + mutationCount++; + } + + void clearWithoutCallingDestructors() + { + if (mozilla::IsPod::value) { + memset(table, 0, sizeof(*table) * capacity()); + } else { + uint32_t tableCapacity = capacity(); + for (Entry *e = table, *end = table + tableCapacity; e < end; ++e) + e->clearNoDtor(); + } + removedCount = 0; + entryCount = 0; + mutationCount++; + } + + void finish() + { + JS_ASSERT(!entered); + + if (!table) + return; + + destroyTable(*this, table, capacity()); + table = NULL; + gen++; + entryCount = 0; + removedCount = 0; + mutationCount++; + } + + Range all() const + { + JS_ASSERT(table); + return Range(table, table + capacity()); + } + + bool empty() const + { + JS_ASSERT(table); + return !entryCount; + } + + uint32_t count() const + { + JS_ASSERT(table); + return entryCount; + } + + uint32_t capacity() const + { + JS_ASSERT(table); + return JS_BIT(sHashBits - hashShift); + } + + uint32_t generation() const + { + JS_ASSERT(table); + return gen; + } + + size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const + { + return mallocSizeOf(table); + } + + size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const + { + return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf); + } + + Ptr lookup(const Lookup &l) const + { + ReentrancyGuard g(*this); + HashNumber keyHash = prepareHash(l); + return Ptr(lookup(l, keyHash, 0)); + } + + AddPtr lookupForAdd(const Lookup &l) const + { + ReentrancyGuard g(*this); + HashNumber keyHash = prepareHash(l); + Entry &entry = lookup(l, keyHash, sCollisionBit); + AddPtr p(entry, keyHash); + p.mutationCount = mutationCount; + return p; + } + + template + bool add(AddPtr &p, const U &rhs) + { + ReentrancyGuard g(*this); + JS_ASSERT(mutationCount == p.mutationCount); + JS_ASSERT(table); + JS_ASSERT(!p.found()); + JS_ASSERT(!(p.keyHash & sCollisionBit)); + + // Changing an entry from removed to live does not affect whether we + // are overloaded and can be handled separately. + if (p.entry_->isRemoved()) { + METER(stats.addOverRemoved++); + removedCount--; + p.keyHash |= sCollisionBit; + } else { + // Preserve the validity of |p.entry_|. + RebuildStatus status = checkOverloaded(); + if (status == RehashFailed) + return false; + if (status == Rehashed) + p.entry_ = &findFreeEntry(p.keyHash); + } + + p.entry_->setLive(p.keyHash, rhs); + entryCount++; + mutationCount++; + return true; + } + + template + void putNewInfallible(const Lookup &l, const U &u) + { + JS_ASSERT(table); + + HashNumber keyHash = prepareHash(l); + Entry *entry = &findFreeEntry(keyHash); + + if (entry->isRemoved()) { + METER(stats.addOverRemoved++); + removedCount--; + keyHash |= sCollisionBit; + } + + entry->setLive(keyHash, u); + entryCount++; + mutationCount++; + } + + template + bool putNew(const Lookup &l, const U &u) + { + if (checkOverloaded() == RehashFailed) + return false; + + putNewInfallible(l, u); + return true; + } + + template + bool relookupOrAdd(AddPtr& p, const Lookup &l, const U &u) + { + p.mutationCount = mutationCount; + { + ReentrancyGuard g(*this); + p.entry_ = &lookup(l, p.keyHash, sCollisionBit); + } + return p.found() || add(p, u); + } + + void remove(Ptr p) + { + JS_ASSERT(table); + ReentrancyGuard g(*this); + JS_ASSERT(p.found()); + remove(*p.entry_); + checkUnderloaded(); + } + +#undef METER +}; + +} // namespace detail +} // namespace js + +#endif // js_HashTable_h__ + diff --git a/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h b/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h new file mode 100644 index 0000000000..c634d5fd3e --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h @@ -0,0 +1,160 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_heap_api_h___ +#define js_heap_api_h___ + +/* These values are private to the JS engine. */ +namespace js { +namespace gc { + +/* + * Page size must be static to support our arena pointer optimizations, so we + * are forced to support each platform with non-4096 pages as a special case. + * Note: The freelist supports a maximum arena shift of 15. + * Note: Do not use JS_CPU_SPARC here, this header is used outside JS. + */ +#if (defined(SOLARIS) || defined(__FreeBSD__)) && \ + (defined(__sparc) || defined(__sparcv9) || defined(__ia64)) +const size_t PageShift = 13; +const size_t ArenaShift = PageShift; +#elif defined(__powerpc64__) +const size_t PageShift = 16; +const size_t ArenaShift = 12; +#else +const size_t PageShift = 12; +const size_t ArenaShift = PageShift; +#endif +const size_t PageSize = size_t(1) << PageShift; +const size_t ArenaSize = size_t(1) << ArenaShift; +const size_t ArenaMask = ArenaSize - 1; + +const size_t ChunkShift = 20; +const size_t ChunkSize = size_t(1) << ChunkShift; +const size_t ChunkMask = ChunkSize - 1; + +const size_t CellShift = 3; +const size_t CellSize = size_t(1) << CellShift; +const size_t CellMask = CellSize - 1; + +/* These are magic constants derived from actual offsets in gc/Heap.h. */ +const size_t ChunkMarkBitmapOffset = 1032368; +const size_t ChunkMarkBitmapBits = 129024; + +/* + * Live objects are marked black. How many other additional colors are available + * depends on the size of the GCThing. Objects marked gray are eligible for + * cycle collection. + */ +static const uint32_t BLACK = 0; +static const uint32_t GRAY = 1; + +} /* namespace gc */ +} /* namespace js */ + +namespace JS { +typedef JSCompartment Zone; +} /* namespace JS */ + +namespace JS { +namespace shadow { + +struct ArenaHeader +{ + js::Zone *zone; +}; + +struct Zone +{ + bool needsBarrier_; + + Zone() : needsBarrier_(false) {} +}; + +} /* namespace shadow */ +} /* namespace JS */ + +namespace js { +namespace gc { + +static JS_ALWAYS_INLINE uintptr_t * +GetGCThingMarkBitmap(const void *thing) +{ + uintptr_t addr = uintptr_t(thing); + addr &= ~js::gc::ChunkMask; + addr |= js::gc::ChunkMarkBitmapOffset; + return reinterpret_cast(addr); +} + +static JS_ALWAYS_INLINE void +GetGCThingMarkWordAndMask(const void *thing, uint32_t color, + uintptr_t **wordp, uintptr_t *maskp) +{ + uintptr_t addr = uintptr_t(thing); + size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color; + JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits); + uintptr_t *bitmap = GetGCThingMarkBitmap(thing); + *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD); + *wordp = &bitmap[bit / JS_BITS_PER_WORD]; +} + +static JS_ALWAYS_INLINE JS::shadow::ArenaHeader * +GetGCThingArena(void *thing) +{ + uintptr_t addr = uintptr_t(thing); + addr &= ~js::gc::ArenaMask; + return reinterpret_cast(addr); +} + +} /* namespace gc */ +} /* namespace js */ + +namespace JS { + +static JS_ALWAYS_INLINE JSCompartment * +GetGCThingCompartment(void *thing) +{ + JS_ASSERT(thing); + return js::gc::GetGCThingArena(thing)->zone; +} + +static JS_ALWAYS_INLINE Zone * +GetGCThingZone(void *thing) +{ + JS_ASSERT(thing); + return js::gc::GetGCThingArena(thing)->zone; +} + +static JS_ALWAYS_INLINE JSCompartment * +GetObjectCompartment(JSObject *obj) +{ + return GetGCThingCompartment(obj); +} + +static JS_ALWAYS_INLINE Zone * +GetObjectZone(JSObject *obj) +{ + return GetGCThingZone(obj); +} + +static JS_ALWAYS_INLINE bool +GCThingIsMarkedGray(void *thing) +{ + uintptr_t *word, mask; + js::gc::GetGCThingMarkWordAndMask(thing, js::gc::GRAY, &word, &mask); + return *word & mask; +} + +static JS_ALWAYS_INLINE bool +IsIncrementalBarrierNeededOnGCThing(void *thing, JSGCTraceKind kind) +{ + js::Zone *zone = GetGCThingZone(thing); + return reinterpret_cast(zone)->needsBarrier_; +} + +} /* namespace JS */ + +#endif /* js_heap_api_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/LegacyIntTypes.h b/scripting/javascript/spidermonkey-mac/include/js/LegacyIntTypes.h new file mode 100644 index 0000000000..30944efda6 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/LegacyIntTypes.h @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * This section typedefs the old 'native' types to the new types. + * These redefinitions are provided solely to allow JSAPI users to more easily + * transition to types. They are not to be used in the JSAPI, and + * new JSAPI user code should not use them. This mapping file may eventually + * be removed from SpiderMonkey, so don't depend on it in the long run. + */ + +/* + * BEWARE: Comity with other implementers of these types is not guaranteed. + * Indeed, if you use this header and third-party code defining these + * types, *expect* to encounter either compile errors or link errors, + * depending how these types are used and on the order of inclusion. + * It is safest to use only the JSAPI -style types, + * customizing those types using MOZ_CUSTOM_STDINT_H if necessary. + */ +#ifndef PROTYPES_H +#define PROTYPES_H + +#include "mozilla/StandardInteger.h" + +#include "js-config.h" + +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef uint64_t uint64; + +/* + * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very + * common header file) defines the types int8, int16, int32, and int64. + * So we don't define these four types here to avoid conflicts in case + * the code also includes sys/types.h. + */ +#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H) +#include +#else +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef int64_t int64; +#endif /* AIX && HAVE_SYS_INTTYPES_H */ + +typedef uint8_t JSUint8; +typedef uint16_t JSUint16; +typedef uint32_t JSUint32; +typedef uint64_t JSUint64; + +typedef int8_t JSInt8; +typedef int16_t JSInt16; +typedef int32_t JSInt32; +typedef int64_t JSInt64; + +#endif /* !defined(PROTYPES_H) */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h b/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h new file mode 100644 index 0000000000..f0e77941e8 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h @@ -0,0 +1,400 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_MemoryMetrics_h +#define js_MemoryMetrics_h + +// These declarations are not within jsapi.h because they are highly likely to +// change in the future. Depend on them at your own risk. + +#include + +#include "jsalloc.h" +#include "jspubtd.h" + +#include "js/Utility.h" +#include "js/Vector.h" + +class nsISupports; // This is needed for ObjectPrivateVisitor. + +namespace js { + +// In memory reporting, we have concept of "sundries", line items which are too +// small to be worth reporting individually. Under some circumstances, a memory +// reporter gets tossed into the sundries bucket if it's smaller than +// MemoryReportingSundriesThreshold() bytes. +// +// We need to define this value here, rather than in the code which actually +// generates the memory reports, because HugeStringInfo uses this value. +JS_FRIEND_API(size_t) MemoryReportingSundriesThreshold(); + +} // namespace js + +namespace JS { + +// Data for tracking memory usage of things hanging off objects. +struct ObjectsExtraSizes { + size_t slots; + size_t elements; + size_t argumentsData; + size_t regExpStatics; + size_t propertyIteratorData; + size_t ctypesData; + size_t private_; // The '_' suffix is required because |private| is a keyword. + // Note that this field is measured separately from the others. + + ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); } + + void add(ObjectsExtraSizes &sizes) { + this->slots += sizes.slots; + this->elements += sizes.elements; + this->argumentsData += sizes.argumentsData; + this->regExpStatics += sizes.regExpStatics; + this->propertyIteratorData += sizes.propertyIteratorData; + this->ctypesData += sizes.ctypesData; + this->private_ += sizes.private_; + } +}; + +// Data for tracking analysis/inference memory usage. +struct TypeInferenceSizes +{ + size_t typeScripts; + size_t typeResults; + size_t analysisPool; + size_t typePool; + size_t pendingArrays; + size_t allocationSiteTables; + size_t arrayTypeTables; + size_t objectTypeTables; + size_t typeObjects; + + TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); } + + void add(TypeInferenceSizes &sizes) { + this->typeScripts += sizes.typeScripts; + this->typeResults += sizes.typeResults; + this->analysisPool += sizes.analysisPool; + this->typePool += sizes.typePool; + this->pendingArrays += sizes.pendingArrays; + this->allocationSiteTables += sizes.allocationSiteTables; + this->arrayTypeTables += sizes.arrayTypeTables; + this->objectTypeTables += sizes.objectTypeTables; + this->typeObjects += sizes.typeObjects; + } +}; + +// Holds data about a huge string (one which uses more HugeStringInfo::MinSize +// bytes of memory), so we can report it individually. +struct HugeStringInfo +{ + HugeStringInfo() + : length(0) + , size(0) + { + memset(&buffer, 0, sizeof(buffer)); + } + + // A string needs to take up this many bytes of storage before we consider + // it to be "huge". + static size_t MinSize() + { + return js::MemoryReportingSundriesThreshold(); + } + + // A string's size in memory is not necessarily equal to twice its length + // because the allocator and the JS engine both may round up. + size_t length; + size_t size; + + // We record the first 32 chars of the escaped string here. (We escape the + // string so we can use a char[] instead of a jschar[] here. + char buffer[32]; +}; + +// These measurements relate directly to the JSRuntime, and not to +// compartments within it. +struct RuntimeSizes +{ + RuntimeSizes() { memset(this, 0, sizeof(RuntimeSizes)); } + + size_t object; + size_t atomsTable; + size_t contexts; + size_t dtoa; + size_t temporary; + size_t jaegerCode; + size_t ionCode; + size_t regexpCode; + size_t unusedCode; + size_t regexpData; + size_t stack; + size_t gcMarker; + size_t mathCache; + size_t scriptFilenames; + size_t scriptData; + size_t scriptSources; +}; + +struct CompartmentStats +{ + CompartmentStats() + : extra1(0) + , extra2(0) + , gcHeapArenaAdmin(0) + , gcHeapUnusedGcThings(0) + , gcHeapObjectsOrdinary(0) + , gcHeapObjectsFunction(0) + , gcHeapObjectsDenseArray(0) + , gcHeapObjectsSlowArray(0) + , gcHeapObjectsCrossCompartmentWrapper(0) + , gcHeapStringsNormal(0) + , gcHeapStringsShort(0) + , gcHeapShapesTreeGlobalParented(0) + , gcHeapShapesTreeNonGlobalParented(0) + , gcHeapShapesDict(0) + , gcHeapShapesBase(0) + , gcHeapScripts(0) + , gcHeapTypeObjects(0) + , gcHeapIonCodes(0) + , objectsExtra() + , stringCharsNonHuge(0) + , shapesExtraTreeTables(0) + , shapesExtraDictTables(0) + , shapesExtraTreeShapeKids(0) + , shapesCompartmentTables(0) + , scriptData(0) + , jaegerData(0) + , ionData(0) + , compartmentObject(0) + , crossCompartmentWrappersTable(0) + , regexpCompartment(0) + , debuggeesSet(0) + , typeInference() + , hugeStrings() + {} + + CompartmentStats(const CompartmentStats &other) + : extra1(other.extra1) + , extra2(other.extra2) + , gcHeapArenaAdmin(other.gcHeapArenaAdmin) + , gcHeapUnusedGcThings(other.gcHeapUnusedGcThings) + , gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary) + , gcHeapObjectsFunction(other.gcHeapObjectsFunction) + , gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray) + , gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray) + , gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper) + , gcHeapStringsNormal(other.gcHeapStringsNormal) + , gcHeapStringsShort(other.gcHeapStringsShort) + , gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented) + , gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented) + , gcHeapShapesDict(other.gcHeapShapesDict) + , gcHeapShapesBase(other.gcHeapShapesBase) + , gcHeapScripts(other.gcHeapScripts) + , gcHeapTypeObjects(other.gcHeapTypeObjects) + , gcHeapIonCodes(other.gcHeapIonCodes) + , objectsExtra(other.objectsExtra) + , stringCharsNonHuge(other.stringCharsNonHuge) + , shapesExtraTreeTables(other.shapesExtraTreeTables) + , shapesExtraDictTables(other.shapesExtraDictTables) + , shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids) + , shapesCompartmentTables(other.shapesCompartmentTables) + , scriptData(other.scriptData) + , jaegerData(other.jaegerData) + , ionData(other.ionData) + , compartmentObject(other.compartmentObject) + , crossCompartmentWrappersTable(other.crossCompartmentWrappersTable) + , regexpCompartment(other.regexpCompartment) + , debuggeesSet(other.debuggeesSet) + , typeInference(other.typeInference) + { + hugeStrings.append(other.hugeStrings); + } + + // These fields can be used by embedders. + void *extra1; + void *extra2; + + // If you add a new number, remember to update the constructors, add(), and + // maybe gcHeapThingsSize()! + size_t gcHeapArenaAdmin; + size_t gcHeapUnusedGcThings; + + size_t gcHeapObjectsOrdinary; + size_t gcHeapObjectsFunction; + size_t gcHeapObjectsDenseArray; + size_t gcHeapObjectsSlowArray; + size_t gcHeapObjectsCrossCompartmentWrapper; + size_t gcHeapStringsNormal; + size_t gcHeapStringsShort; + size_t gcHeapShapesTreeGlobalParented; + size_t gcHeapShapesTreeNonGlobalParented; + size_t gcHeapShapesDict; + size_t gcHeapShapesBase; + size_t gcHeapScripts; + size_t gcHeapTypeObjects; + size_t gcHeapIonCodes; + ObjectsExtraSizes objectsExtra; + + size_t stringCharsNonHuge; + size_t shapesExtraTreeTables; + size_t shapesExtraDictTables; + size_t shapesExtraTreeShapeKids; + size_t shapesCompartmentTables; + size_t scriptData; + size_t jaegerData; + size_t ionData; + size_t compartmentObject; + size_t crossCompartmentWrappersTable; + size_t regexpCompartment; + size_t debuggeesSet; + + TypeInferenceSizes typeInference; + js::Vector hugeStrings; + + // Add cStats's numbers to this object's numbers. + void add(CompartmentStats &cStats) + { + #define ADD(x) this->x += cStats.x + + ADD(gcHeapArenaAdmin); + ADD(gcHeapUnusedGcThings); + + ADD(gcHeapObjectsOrdinary); + ADD(gcHeapObjectsFunction); + ADD(gcHeapObjectsDenseArray); + ADD(gcHeapObjectsSlowArray); + ADD(gcHeapObjectsCrossCompartmentWrapper); + ADD(gcHeapStringsNormal); + ADD(gcHeapStringsShort); + ADD(gcHeapShapesTreeGlobalParented); + ADD(gcHeapShapesTreeNonGlobalParented); + ADD(gcHeapShapesDict); + ADD(gcHeapShapesBase); + ADD(gcHeapScripts); + ADD(gcHeapTypeObjects); + ADD(gcHeapIonCodes); + objectsExtra.add(cStats.objectsExtra); + + ADD(stringCharsNonHuge); + ADD(shapesExtraTreeTables); + ADD(shapesExtraDictTables); + ADD(shapesExtraTreeShapeKids); + ADD(shapesCompartmentTables); + ADD(scriptData); + ADD(jaegerData); + ADD(ionData); + ADD(compartmentObject); + ADD(crossCompartmentWrappersTable); + ADD(regexpCompartment); + ADD(debuggeesSet); + + #undef ADD + + typeInference.add(cStats.typeInference); + hugeStrings.append(cStats.hugeStrings); + } + + // The size of all the live things in the GC heap. + size_t gcHeapThingsSize(); +}; + +struct RuntimeStats +{ + RuntimeStats(JSMallocSizeOfFun mallocSizeOf) + : runtime() + , gcHeapChunkTotal(0) + , gcHeapDecommittedArenas(0) + , gcHeapUnusedChunks(0) + , gcHeapUnusedArenas(0) + , gcHeapUnusedGcThings(0) + , gcHeapChunkAdmin(0) + , gcHeapGcThings(0) + , totals() + , compartmentStatsVector() + , currCompartmentStats(NULL) + , mallocSizeOf_(mallocSizeOf) + {} + + RuntimeSizes runtime; + + // If you add a new number, remember to update the constructor! + + // Here's a useful breakdown of the GC heap. + // + // - rtStats.gcHeapChunkTotal + // - decommitted bytes + // - rtStats.gcHeapDecommittedArenas (decommitted arenas in non-empty chunks) + // - unused bytes + // - rtStats.gcHeapUnusedChunks (empty chunks) + // - rtStats.gcHeapUnusedArenas (empty arenas within non-empty chunks) + // - rtStats.total.gcHeapUnusedGcThings (empty GC thing slots within non-empty arenas) + // - used bytes + // - rtStats.gcHeapChunkAdmin + // - rtStats.total.gcHeapArenaAdmin + // - rtStats.gcHeapGcThings (in-use GC things) + // + // It's possible that some arenas in empty chunks may be decommitted, but + // we don't count those under rtStats.gcHeapDecommittedArenas because (a) + // it's rare, and (b) this means that rtStats.gcHeapUnusedChunks is a + // multiple of the chunk size, which is good. + + size_t gcHeapChunkTotal; + size_t gcHeapDecommittedArenas; + size_t gcHeapUnusedChunks; + size_t gcHeapUnusedArenas; + size_t gcHeapUnusedGcThings; + size_t gcHeapChunkAdmin; + size_t gcHeapGcThings; + + // The sum of all compartment's measurements. + CompartmentStats totals; + + js::Vector compartmentStatsVector; + CompartmentStats *currCompartmentStats; + + JSMallocSizeOfFun mallocSizeOf_; + + virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0; +}; + +#ifdef JS_THREADSAFE + +class ObjectPrivateVisitor +{ +public: + // Within CollectRuntimeStats, this method is called for each JS object + // that has an nsISupports pointer. + virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0; + + // A callback that gets a JSObject's nsISupports pointer, if it has one. + // Note: this function does *not* addref |iface|. + typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface); + GetISupportsFun getISupports_; + + ObjectPrivateVisitor(GetISupportsFun getISupports) + : getISupports_(getISupports) + {} +}; + +extern JS_PUBLIC_API(bool) +CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv); + +extern JS_PUBLIC_API(int64_t) +GetExplicitNonHeapForRuntime(JSRuntime *rt, JSMallocSizeOfFun mallocSizeOf); + +#endif // JS_THREADSAFE + +extern JS_PUBLIC_API(size_t) +SystemCompartmentCount(const JSRuntime *rt); + +extern JS_PUBLIC_API(size_t) +UserCompartmentCount(const JSRuntime *rt); + +} // namespace JS + +#endif // js_MemoryMetrics_h diff --git a/scripting/javascript/spidermonkey-mac/include/js/PropertyKey.h b/scripting/javascript/spidermonkey-mac/include/js/PropertyKey.h new file mode 100644 index 0000000000..5d048195f5 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/PropertyKey.h @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* JS::PropertyKey implementation. */ + +#ifndef js_PropertyKey_h___ +#define js_PropertyKey_h___ + +#include "mozilla/Attributes.h" + +#include "js/Value.h" + +struct JSContext; + +namespace JS { + +class PropertyKey; + +namespace detail { + +extern JS_PUBLIC_API(bool) +ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key); + +} // namespace detail + +/* + * A PropertyKey is a key used to access some property on an object. It is a + * natural way to represent a property accessed using a JavaScript value. + * + * PropertyKey can represent indexes, named properties, and ES6 symbols. The + * latter aren't implemented in SpiderMonkey yet, but PropertyKey carves out + * space for them. + */ +class PropertyKey +{ + Value v; + friend JS_PUBLIC_API(bool) detail::ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key); + + public: + explicit PropertyKey(uint32_t index) : v(PrivateUint32Value(index)) {} + + /* + * An index is a string property name whose characters exactly spell out an + * unsigned 32-bit integer in decimal: "0", "1", "2", ...., "4294967294", + * "4294967295". + */ + bool isIndex(uint32_t *index) { + // The implementation here assumes that private uint32_t are stored + // using the int32_t representation. This is purely an implementation + // detail: embedders must not rely upon this! + if (!v.isInt32()) + return false; + *index = v.toPrivateUint32(); + return true; + } + + /* + * A name is a string property name which is *not* an index. Note that by + * the ECMAScript language grammar, any dotted property access |obj.prop| + * will access a named property. + */ + bool isName(JSString **str) { + uint32_t dummy; + if (isIndex(&dummy)) + return false; + *str = v.toString(); + return true; + } + + /* + * A symbol is a property name that's a Symbol, a particular kind of object + * in ES6. It is the only kind of property name that's not a string. + * + * SpiderMonkey doesn't yet implement symbols, but we're carving out API + * space for them in advance. + */ + bool isSymbol() { + return false; + } +}; + +inline bool +ToPropertyKey(JSContext *cx, HandleValue v, PropertyKey *key) +{ + if (v.isInt32() && v.toInt32() >= 0) { + *key = PropertyKey(uint32_t(v.toInt32())); + return true; + } + + return detail::ToPropertyKeySlow(cx, v, key); +} + +} // namespace JS + +#endif /* js_PropertyKey_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/RequiredDefines.h b/scripting/javascript/spidermonkey-mac/include/js/RequiredDefines.h new file mode 100644 index 0000000000..8dc47e251c --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/RequiredDefines.h @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=79: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Various #defines required to build SpiderMonkey. Embedders should add this + * file to the start of the command line via -include or a similar mechanism, + * or SpiderMonkey public headers may not work correctly. + */ + +#ifndef js_RequiredDefines_h___ +#define js_RequiredDefines_h___ + +/* + * The c99 defining the limit macros (UINT32_MAX for example), says: + * C++ implementations should define these macros only when __STDC_LIMIT_MACROS + * is defined before is included. + */ +#define __STDC_LIMIT_MACROS + +#endif /* js_RequiredDefines_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h b/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h new file mode 100644 index 0000000000..6d35f74ec6 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_template_lib_h__ +#define js_template_lib_h__ + +#include "jstypes.h" + +/* + * Library of reusable template meta-functions (that is, functions on types and + * compile-time values). Meta-functions are placed inside the 'tl' namespace to + * avoid conflict with non-meta functions that logically have the same name + * (e.g., js::tl::Min vs. js::Min). + */ + +namespace js { +namespace tl { + +/* Compute min/max/clamp. */ +template struct Min { + static const size_t result = i < j ? i : j; +}; +template struct Max { + static const size_t result = i > j ? i : j; +}; +template struct Clamp { + static const size_t result = i < min ? min : (i > max ? max : i); +}; + +/* Compute x^y. */ +template struct Pow { + static const size_t result = x * Pow::result; +}; +template struct Pow { + static const size_t result = 1; +}; + +/* Compute floor(log2(i)). */ +template struct FloorLog2 { + static const size_t result = 1 + FloorLog2::result; +}; +template <> struct FloorLog2<0> { /* Error */ }; +template <> struct FloorLog2<1> { static const size_t result = 0; }; + +/* Compute ceiling(log2(i)). */ +template struct CeilingLog2 { + static const size_t result = FloorLog2<2 * i - 1>::result; +}; + +/* Round up to the nearest power of 2. */ +template struct RoundUpPow2 { + static const size_t result = size_t(1) << CeilingLog2::result; +}; +template <> struct RoundUpPow2<0> { + static const size_t result = 1; +}; + +/* Compute the number of bits in the given unsigned type. */ +template struct BitSize { + static const size_t result = sizeof(T) * JS_BITS_PER_BYTE; +}; + +/* Allow Assertions by only including the 'result' typedef if 'true'. */ +template struct StaticAssert {}; +template <> struct StaticAssert { typedef int result; }; + +/* + * Produce an N-bit mask, where N <= BitSize::result. Handle the + * language-undefined edge case when N = BitSize::result. + */ +template struct NBitMask { + typedef typename StaticAssert::result>::result _; + static const size_t result = (size_t(1) << N) - 1; +}; +template <> struct NBitMask::result> { + static const size_t result = size_t(-1); +}; + +/* + * For the unsigned integral type size_t, compute a mask M for N such that + * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t) + */ +template struct MulOverflowMask { + static const size_t result = + ~NBitMask::result - CeilingLog2::result>::result; +}; +template <> struct MulOverflowMask<0> { /* Error */ }; +template <> struct MulOverflowMask<1> { static const size_t result = 0; }; + +/* + * Generate a mask for T such that if (X & sUnsafeRangeSizeMask), an X-sized + * array of T's is big enough to cause a ptrdiff_t overflow when subtracting + * a pointer to the end of the array from the beginning. + */ +template struct UnsafeRangeSizeMask { + /* + * The '2' factor means the top bit is clear, sizeof(T) converts from + * units of elements to bytes. + */ + static const size_t result = MulOverflowMask<2 * sizeof(T)>::result; +}; + +/* Return T stripped of any const-ness. */ +template struct StripConst { typedef T result; }; +template struct StripConst { typedef T result; }; + +template struct If { static const T result = v1; }; +template struct If { static const T result = v2; }; + +/* + * Traits class for identifying types that are implicitly barriered. + */ +template struct IsRelocatableHeapType { static const bool result = true; }; + +} /* namespace tl */ +} /* namespace js */ + +#endif /* js_template_lib_h__ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/Utility.h b/scripting/javascript/spidermonkey-mac/include/js/Utility.h new file mode 100644 index 0000000000..0020be6b46 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/Utility.h @@ -0,0 +1,866 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_utility_h__ +#define js_utility_h__ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" +#include "mozilla/Scoped.h" + +#include +#include + +#ifdef JS_OOM_DO_BACKTRACES +#include +#include +#endif + +#include "jstypes.h" + +#include "js/TemplateLib.h" + +/* The public JS engine namespace. */ +namespace JS {} + +/* The mozilla-shared reusable template/utility namespace. */ +namespace mozilla {} + +/* The private JS engine namespace. */ +namespace js { + +/* The private namespace is a superset of the public/shared namespaces. */ +using namespace JS; + +} /* namespace js */ + +/* + * Pattern used to overwrite freed memory. If you are accessing an object with + * this pattern, you probably have a dangling pointer. + */ +#define JS_FREE_PATTERN 0xDA + +#define JS_ASSERT(expr) MOZ_ASSERT(expr) +#define JS_ASSERT_IF(cond, expr) MOZ_ASSERT_IF(cond, expr) +#define JS_NOT_REACHED(reason) MOZ_NOT_REACHED(reason) +#define JS_ALWAYS_TRUE(expr) MOZ_ALWAYS_TRUE(expr) +#define JS_ALWAYS_FALSE(expr) MOZ_ALWAYS_FALSE(expr) + +#ifdef DEBUG +# ifdef JS_THREADSAFE +# define JS_THREADSAFE_ASSERT(expr) JS_ASSERT(expr) +# else +# define JS_THREADSAFE_ASSERT(expr) ((void) 0) +# endif +#else +# define JS_THREADSAFE_ASSERT(expr) ((void) 0) +#endif + +#if defined(DEBUG) +# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr) +#elif defined(JS_CRASH_DIAGNOSTICS) +# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0) +#else +# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0) +#endif + +#define JS_STATIC_ASSERT(cond) MOZ_STATIC_ASSERT(cond, "JS_STATIC_ASSERT") +#define JS_STATIC_ASSERT_IF(cond, expr) MOZ_STATIC_ASSERT_IF(cond, expr, "JS_STATIC_ASSERT_IF") + +extern MOZ_NORETURN JS_PUBLIC_API(void) +JS_Assert(const char *s, const char *file, int ln); + +/* + * Abort the process in a non-graceful manner. This will cause a core file, + * call to the debugger or other moral equivalent as well as causing the + * entire process to stop. + */ +extern JS_PUBLIC_API(void) JS_Abort(void); + +/* + * Custom allocator support for SpiderMonkey + */ +#if defined JS_USE_CUSTOM_ALLOCATOR +# include "jscustomallocator.h" +#else +# ifdef DEBUG +/* + * In order to test OOM conditions, when the shell command-line option + * |-A NUM| is passed, we fail continuously after the NUM'th allocation. + */ +extern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set from shell/js.cpp */ +extern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */ + +#ifdef JS_OOM_DO_BACKTRACES +#define JS_OOM_BACKTRACE_SIZE 32 +static JS_ALWAYS_INLINE void +PrintBacktrace() +{ + void* OOM_trace[JS_OOM_BACKTRACE_SIZE]; + char** OOM_traceSymbols = NULL; + int32_t OOM_traceSize = 0; + int32_t OOM_traceIdx = 0; + OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE); + OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize); + + if (!OOM_traceSymbols) + return; + + for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) { + fprintf(stderr, "#%d %s\n", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]); + } + + free(OOM_traceSymbols); +} + +#define JS_OOM_EMIT_BACKTRACE() \ + do {\ + fprintf(stderr, "Forcing artificial memory allocation function failure:\n");\ + PrintBacktrace();\ + } while (0) +# else +# define JS_OOM_EMIT_BACKTRACE() do {} while(0) +#endif /* JS_OOM_DO_BACKTRACES */ + +# define JS_OOM_POSSIBLY_FAIL() \ + do \ + { \ + if (++OOM_counter > OOM_maxAllocations) { \ + JS_OOM_EMIT_BACKTRACE();\ + return NULL; \ + } \ + } while (0) + +# define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \ + do \ + { \ + if (++OOM_counter > OOM_maxAllocations) { \ + JS_OOM_EMIT_BACKTRACE();\ + js_ReportOutOfMemory(cx);\ + return NULL; \ + } \ + } while (0) + +# else +# define JS_OOM_POSSIBLY_FAIL() do {} while(0) +# define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0) +# endif /* DEBUG */ + +static JS_INLINE void* js_malloc(size_t bytes) +{ + JS_OOM_POSSIBLY_FAIL(); + return malloc(bytes); +} + +static JS_INLINE void* js_calloc(size_t bytes) +{ + JS_OOM_POSSIBLY_FAIL(); + return calloc(bytes, 1); +} + +static JS_INLINE void* js_realloc(void* p, size_t bytes) +{ + JS_OOM_POSSIBLY_FAIL(); + return realloc(p, bytes); +} + +static JS_INLINE void js_free(void* p) +{ + free(p); +} +#endif/* JS_USE_CUSTOM_ALLOCATOR */ + +JS_BEGIN_EXTERN_C + +/* + * Replace bit-scanning code sequences with CPU-specific instructions to + * speedup calculations of ceiling/floor log2. + * + * With GCC 3.4 or later we can use __builtin_clz for that, see bug 327129. + * + * SWS: Added MSVC intrinsic bitscan support. See bugs 349364 and 356856. + */ +#if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)) + +unsigned char _BitScanForward(unsigned long * Index, unsigned long Mask); +unsigned char _BitScanReverse(unsigned long * Index, unsigned long Mask); +# pragma intrinsic(_BitScanForward,_BitScanReverse) + +__forceinline static int +__BitScanForward32(unsigned int val) +{ + unsigned long idx; + + _BitScanForward(&idx, (unsigned long)val); + return (int)idx; +} +__forceinline static int +__BitScanReverse32(unsigned int val) +{ + unsigned long idx; + + _BitScanReverse(&idx, (unsigned long)val); + return (int)(31-idx); +} +# define js_bitscan_ctz32(val) __BitScanForward32(val) +# define js_bitscan_clz32(val) __BitScanReverse32(val) +# define JS_HAS_BUILTIN_BITSCAN32 + +#if defined(_M_AMD64) || defined(_M_X64) +unsigned char _BitScanForward64(unsigned long * Index, unsigned __int64 Mask); +unsigned char _BitScanReverse64(unsigned long * Index, unsigned __int64 Mask); +# pragma intrinsic(_BitScanForward64,_BitScanReverse64) + +__forceinline static int +__BitScanForward64(unsigned __int64 val) +{ + unsigned long idx; + + _BitScanForward64(&idx, val); + return (int)idx; +} +__forceinline static int +__BitScanReverse64(unsigned __int64 val) +{ + unsigned long idx; + + _BitScanReverse64(&idx, val); + return (int)(63-idx); +} +# define js_bitscan_ctz64(val) __BitScanForward64(val) +# define js_bitscan_clz64(val) __BitScanReverse64(val) +# define JS_HAS_BUILTIN_BITSCAN64 +#endif +#elif (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) + +# define js_bitscan_ctz32(val) __builtin_ctz(val) +# define js_bitscan_clz32(val) __builtin_clz(val) +# define JS_HAS_BUILTIN_BITSCAN32 +# if (JS_BYTES_PER_WORD == 8) +# define js_bitscan_ctz64(val) __builtin_ctzll(val) +# define js_bitscan_clz64(val) __builtin_clzll(val) +# define JS_HAS_BUILTIN_BITSCAN64 +# endif + +#endif + +/* +** Macro version of JS_CeilingLog2: Compute the log of the least power of +** 2 greater than or equal to _n. The result is returned in _log2. +*/ +#ifdef JS_HAS_BUILTIN_BITSCAN32 +/* + * Use intrinsic function or count-leading-zeros to calculate ceil(log2(_n)). + * The macro checks for "n <= 1" and not "n != 0" as js_bitscan_clz32(0) is + * undefined. + */ +# define JS_CEILING_LOG2(_log2,_n) \ + JS_BEGIN_MACRO \ + unsigned int j_ = (unsigned int)(_n); \ + (_log2) = (j_ <= 1 ? 0 : 32 - js_bitscan_clz32(j_ - 1)); \ + JS_END_MACRO +#else +# define JS_CEILING_LOG2(_log2,_n) \ + JS_BEGIN_MACRO \ + uint32_t j_ = (uint32_t)(_n); \ + (_log2) = 0; \ + if ((j_) & ((j_)-1)) \ + (_log2) += 1; \ + if ((j_) >> 16) \ + (_log2) += 16, (j_) >>= 16; \ + if ((j_) >> 8) \ + (_log2) += 8, (j_) >>= 8; \ + if ((j_) >> 4) \ + (_log2) += 4, (j_) >>= 4; \ + if ((j_) >> 2) \ + (_log2) += 2, (j_) >>= 2; \ + if ((j_) >> 1) \ + (_log2) += 1; \ + JS_END_MACRO +#endif + +/* +** Macro version of JS_FloorLog2: Compute the log of the greatest power of +** 2 less than or equal to _n. The result is returned in _log2. +** +** This is equivalent to finding the highest set bit in the word. +*/ +#ifdef JS_HAS_BUILTIN_BITSCAN32 +/* + * Use js_bitscan_clz32 or count-leading-zeros to calculate floor(log2(_n)). + * Since js_bitscan_clz32(0) is undefined, the macro set the loweset bit to 1 + * to ensure 0 result when _n == 0. + */ +# define JS_FLOOR_LOG2(_log2,_n) \ + JS_BEGIN_MACRO \ + (_log2) = 31 - js_bitscan_clz32(((unsigned int)(_n)) | 1); \ + JS_END_MACRO +#else +# define JS_FLOOR_LOG2(_log2,_n) \ + JS_BEGIN_MACRO \ + uint32_t j_ = (uint32_t)(_n); \ + (_log2) = 0; \ + if ((j_) >> 16) \ + (_log2) += 16, (j_) >>= 16; \ + if ((j_) >> 8) \ + (_log2) += 8, (j_) >>= 8; \ + if ((j_) >> 4) \ + (_log2) += 4, (j_) >>= 4; \ + if ((j_) >> 2) \ + (_log2) += 2, (j_) >>= 2; \ + if ((j_) >> 1) \ + (_log2) += 1; \ + JS_END_MACRO +#endif + +#if JS_BYTES_PER_WORD == 4 +# ifdef JS_HAS_BUILTIN_BITSCAN32 +# define js_FloorLog2wImpl(n) \ + ((size_t)(JS_BITS_PER_WORD - 1 - js_bitscan_clz32(n))) +# else +JS_PUBLIC_API(size_t) js_FloorLog2wImpl(size_t n); +# endif +#elif JS_BYTES_PER_WORD == 8 +# ifdef JS_HAS_BUILTIN_BITSCAN64 +# define js_FloorLog2wImpl(n) \ + ((size_t)(JS_BITS_PER_WORD - 1 - js_bitscan_clz64(n))) +# else +JS_PUBLIC_API(size_t) js_FloorLog2wImpl(size_t n); +# endif +#else +# error "NOT SUPPORTED" +#endif + +JS_END_EXTERN_C + +/* + * Internal function. + * Compute the log of the least power of 2 greater than or equal to n. This is + * a version of JS_CeilingLog2 that operates on unsigned integers with + * CPU-dependant size. + */ +#define JS_CEILING_LOG2W(n) ((n) <= 1 ? 0 : 1 + JS_FLOOR_LOG2W((n) - 1)) + +/* + * Internal function. + * Compute the log of the greatest power of 2 less than or equal to n. + * This is a version of JS_FloorLog2 that operates on unsigned integers with + * CPU-dependant size and requires that n != 0. + */ +static MOZ_ALWAYS_INLINE size_t +JS_FLOOR_LOG2W(size_t n) +{ + JS_ASSERT(n != 0); + return js_FloorLog2wImpl(n); +} + +/* + * JS_ROTATE_LEFT32 + * + * There is no rotate operation in the C Language so the construct (a << 4) | + * (a >> 28) is used instead. Most compilers convert this to a rotate + * instruction but some versions of MSVC don't without a little help. To get + * MSVC to generate a rotate instruction, we have to use the _rotl intrinsic + * and use a pragma to make _rotl inline. + * + * MSVC in VS2005 will do an inline rotate instruction on the above construct. + */ +#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \ + defined(_M_X64)) +#include +#pragma intrinsic(_rotl) +#define JS_ROTATE_LEFT32(a, bits) _rotl(a, bits) +#else +#define JS_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits)))) +#endif + +#include + +/* + * Low-level memory management in SpiderMonkey: + * + * ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these + * to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's + * these symbols. + * + * ** Do not use the builtin C++ operator new and delete: these throw on + * error and we cannot override them not to. + * + * Allocation: + * + * - If the lifetime of the allocation is tied to the lifetime of a GC-thing + * (that is, finalizing the GC-thing will free the allocation), call one of + * the following functions: + * + * JSContext::{malloc_,realloc_,calloc_,new_} + * JSRuntime::{malloc_,realloc_,calloc_,new_} + * + * These functions accumulate the number of bytes allocated which is used as + * part of the GC-triggering heuristic. + * + * The difference between the JSContext and JSRuntime versions is that the + * cx version reports an out-of-memory error on OOM. (This follows from the + * general SpiderMonkey idiom that a JSContext-taking function reports its + * own errors.) + * + * - Otherwise, use js_malloc/js_realloc/js_calloc/js_free/js_new + * + * Deallocation: + * + * - Ordinarily, use js_free/js_delete. + * + * - For deallocations during GC finalization, use one of the following + * operations on the FreeOp provided to the finalizer: + * + * FreeOp::{free_,delete_} + * + * The advantage of these operations is that the memory is batched and freed + * on another thread. + */ + +#define JS_NEW_BODY(allocator, t, parms) \ + void *memory = allocator(sizeof(t)); \ + return memory ? new(memory) t parms : NULL; + +/* + * Given a class which should provide 'new' methods, add + * JS_DECLARE_NEW_METHODS (see JSContext for a usage example). This + * adds news with up to 12 parameters. Add more versions of new below if + * you need more than 12 parameters. + * + * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS, + * or the build will break. + */ +#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\ + template \ + QUALIFIERS T *NEWNAME() {\ + JS_NEW_BODY(ALLOCATOR, T, ())\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))\ + }\ +\ + template \ + QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\ + JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\ + }\ + +JS_DECLARE_NEW_METHODS(js_new, js_malloc, static JS_ALWAYS_INLINE) + +template +static JS_ALWAYS_INLINE void +js_delete(T *p) +{ + if (p) { + p->~T(); + js_free(p); + } +} + +template +static JS_ALWAYS_INLINE T * +js_pod_malloc() +{ + return (T *)js_malloc(sizeof(T)); +} + +template +static JS_ALWAYS_INLINE T * +js_pod_calloc() +{ + return (T *)js_calloc(sizeof(T)); +} + +template +static JS_ALWAYS_INLINE T * +js_pod_malloc(size_t numElems) +{ + if (numElems & js::tl::MulOverflowMask::result) + return NULL; + return (T *)js_malloc(numElems * sizeof(T)); +} + +template +static JS_ALWAYS_INLINE T * +js_pod_calloc(size_t numElems) +{ + if (numElems & js::tl::MulOverflowMask::result) + return NULL; + return (T *)js_calloc(numElems * sizeof(T)); +} + +namespace js { + +template +struct ScopedFreePtrTraits +{ + typedef T* type; + static T* empty() { return NULL; } + static void release(T* ptr) { js_free(ptr); } +}; +SCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits) + +template +struct ScopedDeletePtrTraits : public ScopedFreePtrTraits +{ + static void release(T *ptr) { js_delete(ptr); } +}; +SCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits) + +} /* namespace js */ + +namespace js { + +/* + * "Move" References + * + * Some types can be copied much more efficiently if we know the original's + * value need not be preserved --- that is, if we are doing a "move", not a + * "copy". For example, if we have: + * + * Vector u; + * Vector v(u); + * + * the constructor for v must apply a copy constructor to each element of u --- + * taking time linear in the length of u. However, if we know we will not need u + * any more once v has been initialized, then we could initialize v very + * efficiently simply by stealing u's dynamically allocated buffer and giving it + * to v --- a constant-time operation, regardless of the size of u. + * + * Moves often appear in container implementations. For example, when we append + * to a vector, we may need to resize its buffer. This entails moving each of + * its extant elements from the old, smaller buffer to the new, larger buffer. + * But once the elements have been migrated, we're just going to throw away the + * old buffer; we don't care if they still have their values. So if the vector's + * element type can implement "move" more efficiently than "copy", the vector + * resizing should by all means use a "move" operation. Hash tables also need to + * be resized. + * + * The details of the optimization, and whether it's worth applying, vary from + * one type to the next. And while some constructor calls are moves, many really + * are copies, and can't be optimized this way. So we need: + * + * 1) a way for a particular invocation of a copy constructor to say that it's + * really a move, and that the value of the original isn't important + * afterwards (althought it must still be safe to destroy); and + * + * 2) a way for a type (like Vector) to announce that it can be moved more + * efficiently than it can be copied, and provide an implementation of that + * move operation. + * + * The Move(T &) function takes a reference to a T, and returns an MoveRef + * referring to the same value; that's 1). An MoveRef is simply a reference + * to a T, annotated to say that a copy constructor applied to it may move that + * T, instead of copying it. Finally, a constructor that accepts an MoveRef + * should perform a more efficient move, instead of a copy, providing 2). + * + * So, where we might define a copy constructor for a class C like this: + * + * C(const C &rhs) { ... copy rhs to this ... } + * + * we would declare a move constructor like this: + * + * C(MoveRef rhs) { ... move rhs to this ... } + * + * And where we might perform a copy like this: + * + * C c2(c1); + * + * we would perform a move like this: + * + * C c2(Move(c1)) + * + * Note that MoveRef implicitly converts to T &, so you can pass an + * MoveRef to an ordinary copy constructor for a type that doesn't support a + * special move constructor, and you'll just get a copy. This means that + * templates can use Move whenever they know they won't use the original value + * any more, even if they're not sure whether the type at hand has a specialized + * move constructor. If it doesn't, the MoveRef will just convert to a T &, + * and the ordinary copy constructor will apply. + * + * A class with a move constructor can also provide a move assignment operator, + * which runs this's destructor, and then applies the move constructor to + * *this's memory. A typical definition: + * + * C &operator=(MoveRef rhs) { + * this->~C(); + * new(this) C(rhs); + * return *this; + * } + * + * With that in place, one can write move assignments like this: + * + * c2 = Move(c1); + * + * This destroys c1, moves c1's value to c2, and leaves c1 in an undefined but + * destructible state. + * + * This header file defines MoveRef and Move in the js namespace. It's up to + * individual containers to annotate moves as such, by calling Move; and it's up + * to individual types to define move constructors. + * + * One hint: if you're writing a move constructor where the type has members + * that should be moved themselves, it's much nicer to write this: + * + * C(MoveRef c) : x(c->x), y(c->y) { } + * + * than the equivalent: + * + * C(MoveRef c) { new(&x) X(c->x); new(&y) Y(c->y); } + * + * especially since GNU C++ fails to notice that this does indeed initialize x + * and y, which may matter if they're const. + */ +template +class MoveRef { + public: + typedef T Referent; + explicit MoveRef(T &t) : pointer(&t) { } + T &operator*() const { return *pointer; } + T *operator->() const { return pointer; } + operator T& () const { return *pointer; } + private: + T *pointer; +}; + +template +MoveRef Move(T &t) { return MoveRef(t); } + +template +MoveRef Move(const T &t) { return MoveRef(const_cast(t)); } + +/* Useful for implementing containers that assert non-reentrancy */ +class ReentrancyGuard +{ + /* ReentrancyGuard is not copyable. */ + ReentrancyGuard(const ReentrancyGuard &); + void operator=(const ReentrancyGuard &); + +#ifdef DEBUG + bool &entered; +#endif + public: + template +#ifdef DEBUG + ReentrancyGuard(T &obj) + : entered(obj.entered) +#else + ReentrancyGuard(T &/*obj*/) +#endif + { +#ifdef DEBUG + JS_ASSERT(!entered); + entered = true; +#endif + } + ~ReentrancyGuard() + { +#ifdef DEBUG + entered = false; +#endif + } +}; + +template +JS_ALWAYS_INLINE static void +Swap(T &t, T &u) +{ + T tmp(Move(t)); + t = Move(u); + u = Move(tmp); +} + +/* + * Round x up to the nearest power of 2. This function assumes that the most + * significant bit of x is not set, which would lead to overflow. + */ +JS_ALWAYS_INLINE size_t +RoundUpPow2(size_t x) +{ + return size_t(1) << JS_CEILING_LOG2W(x); +} + +/* Integral types for all hash functions. */ +typedef uint32_t HashNumber; +const unsigned HashNumberSizeBits = 32; + +namespace detail { + +/* + * Given a raw hash code, h, return a number that can be used to select a hash + * bucket. + * + * This function aims to produce as uniform an output distribution as possible, + * especially in the most significant (leftmost) bits, even though the input + * distribution may be highly nonrandom, given the constraints that this must + * be deterministic and quick to compute. + * + * Since the leftmost bits of the result are best, the hash bucket index is + * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent + * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask. + * + * FIXME: OrderedHashTable uses a bit-mask; see bug 775896. + */ +inline HashNumber +ScrambleHashCode(HashNumber h) +{ + /* + * Simply returning h would not cause any hash tables to produce wrong + * answers. But it can produce pathologically bad performance: The caller + * right-shifts the result, keeping only the highest bits. The high bits of + * hash codes are very often completely entropy-free. (So are the lowest + * bits.) + * + * So we use Fibonacci hashing, as described in Knuth, The Art of Computer + * Programming, 6.4. This mixes all the bits of the input hash code h. + * + * The value of goldenRatio is taken from the hex + * expansion of the golden ratio, which starts 1.9E3779B9.... + * This value is especially good if values with consecutive hash codes + * are stored in a hash table; see Knuth for details. + */ + static const HashNumber goldenRatio = 0x9E3779B9U; + return h * goldenRatio; +} + +} /* namespace detail */ + +} /* namespace js */ + +namespace JS { + +/* + * Methods for poisoning GC heap pointer words and checking for poisoned words. + * These are in this file for use in Value methods and so forth. + * + * If the moving GC hazard analysis is in use and detects a non-rooted stack + * pointer to a GC thing, one byte of that pointer is poisoned to refer to an + * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the + * pointer is overwritten, to reduce the likelihood of accidentally changing + * a live integer value. + */ + +inline void PoisonPtr(void *v) +{ +#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG) + uint8_t *ptr = (uint8_t *) v + 3; + *ptr = JS_FREE_PATTERN; +#endif +} + +template +inline bool IsPoisonedPtr(T *v) +{ +#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG) + uint32_t mask = uintptr_t(v) & 0xff000000; + return mask == uint32_t(JS_FREE_PATTERN << 24); +#else + return false; +#endif +} + +} + +/* + * This is SpiderMonkey's equivalent to |nsMallocSizeOfFun|. + */ +typedef size_t(*JSMallocSizeOfFun)(const void *p); + +/* sixgill annotation defines */ +#ifndef HAVE_STATIC_ANNOTATIONS +# define HAVE_STATIC_ANNOTATIONS +# ifdef XGILL_PLUGIN +# define STATIC_PRECONDITION(COND) __attribute__((precondition(#COND))) +# define STATIC_PRECONDITION_ASSUME(COND) __attribute__((precondition_assume(#COND))) +# define STATIC_POSTCONDITION(COND) __attribute__((postcondition(#COND))) +# define STATIC_POSTCONDITION_ASSUME(COND) __attribute__((postcondition_assume(#COND))) +# define STATIC_INVARIANT(COND) __attribute__((invariant(#COND))) +# define STATIC_INVARIANT_ASSUME(COND) __attribute__((invariant_assume(#COND))) +# define STATIC_PASTE2(X,Y) X ## Y +# define STATIC_PASTE1(X,Y) STATIC_PASTE2(X,Y) +# define STATIC_ASSERT(COND) \ + JS_BEGIN_MACRO \ + __attribute__((assert_static(#COND), unused)) \ + int STATIC_PASTE1(assert_static_, __COUNTER__); \ + JS_END_MACRO +# define STATIC_ASSUME(COND) \ + JS_BEGIN_MACRO \ + __attribute__((assume_static(#COND), unused)) \ + int STATIC_PASTE1(assume_static_, __COUNTER__); \ + JS_END_MACRO +# define STATIC_ASSERT_RUNTIME(COND) \ + JS_BEGIN_MACRO \ + __attribute__((assert_static_runtime(#COND), unused)) \ + int STATIC_PASTE1(assert_static_runtime_, __COUNTER__); \ + JS_END_MACRO +# else /* XGILL_PLUGIN */ +# define STATIC_PRECONDITION(COND) /* nothing */ +# define STATIC_PRECONDITION_ASSUME(COND) /* nothing */ +# define STATIC_POSTCONDITION(COND) /* nothing */ +# define STATIC_POSTCONDITION_ASSUME(COND) /* nothing */ +# define STATIC_INVARIANT(COND) /* nothing */ +# define STATIC_INVARIANT_ASSUME(COND) /* nothing */ +# define STATIC_ASSERT(COND) JS_BEGIN_MACRO /* nothing */ JS_END_MACRO +# define STATIC_ASSUME(COND) JS_BEGIN_MACRO /* nothing */ JS_END_MACRO +# define STATIC_ASSERT_RUNTIME(COND) JS_BEGIN_MACRO /* nothing */ JS_END_MACRO +# endif /* XGILL_PLUGIN */ +# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference()) +#endif /* HAVE_STATIC_ANNOTATIONS */ + +#endif /* js_utility_h__ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/Value.h b/scripting/javascript/spidermonkey-mac/include/js/Value.h new file mode 100644 index 0000000000..f01f8dff7b --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/Value.h @@ -0,0 +1,1819 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* JS::Value implementation. */ + +#ifndef js_Value_h___ +#define js_Value_h___ + +#include "mozilla/Attributes.h" +#include "mozilla/FloatingPoint.h" +#include "mozilla/Likely.h" + +#include /* for std::numeric_limits */ + +#include "gc/Root.h" +#include "js/Anchor.h" +#include "js/Utility.h" + +namespace JS { class Value; } + +/* JS::Value can store a full int32_t. */ +#define JSVAL_INT_BITS 32 +#define JSVAL_INT_MIN ((int32_t)0x80000000) +#define JSVAL_INT_MAX ((int32_t)0x7fffffff) + +/* + * Try to get jsvals 64-bit aligned. We could almost assert that all values are + * aligned, but MSVC and GCC occasionally break alignment. + */ +#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__) +# define JSVAL_ALIGNMENT __attribute__((aligned (8))) +#elif defined(_MSC_VER) + /* + * Structs can be aligned with MSVC, but not if they are used as parameters, + * so we just don't try to align. + */ +# define JSVAL_ALIGNMENT +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define JSVAL_ALIGNMENT +#elif defined(__HP_cc) || defined(__HP_aCC) +# define JSVAL_ALIGNMENT +#endif + +#if JS_BITS_PER_WORD == 64 +# define JSVAL_TAG_SHIFT 47 +#endif + +/* + * We try to use enums so that printing a jsval_layout in the debugger shows + * nice symbolic type tags, however we can only do this when we can force the + * underlying type of the enum to be the desired size. + */ +#if defined(__cplusplus) && !defined(__SUNPRO_CC) && !defined(__xlC__) + +#if defined(_MSC_VER) +# define JS_ENUM_HEADER(id, type) enum id : type +# define JS_ENUM_FOOTER(id) +#else +# define JS_ENUM_HEADER(id, type) enum id +# define JS_ENUM_FOOTER(id) __attribute__((packed)) +#endif + +/* Remember to propagate changes to the C defines below. */ +JS_ENUM_HEADER(JSValueType, uint8_t) +{ + JSVAL_TYPE_DOUBLE = 0x00, + JSVAL_TYPE_INT32 = 0x01, + JSVAL_TYPE_UNDEFINED = 0x02, + JSVAL_TYPE_BOOLEAN = 0x03, + JSVAL_TYPE_MAGIC = 0x04, + JSVAL_TYPE_STRING = 0x05, + JSVAL_TYPE_NULL = 0x06, + JSVAL_TYPE_OBJECT = 0x07, + + /* These never appear in a jsval; they are only provided as an out-of-band value. */ + JSVAL_TYPE_UNKNOWN = 0x20, + JSVAL_TYPE_MISSING = 0x21 +} JS_ENUM_FOOTER(JSValueType); + +JS_STATIC_ASSERT(sizeof(JSValueType) == 1); + +#if JS_BITS_PER_WORD == 32 + +/* Remember to propagate changes to the C defines below. */ +JS_ENUM_HEADER(JSValueTag, uint32_t) +{ + JSVAL_TAG_CLEAR = 0xFFFFFF80, + JSVAL_TAG_INT32 = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32, + JSVAL_TAG_UNDEFINED = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED, + JSVAL_TAG_STRING = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING, + JSVAL_TAG_BOOLEAN = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN, + JSVAL_TAG_MAGIC = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC, + JSVAL_TAG_NULL = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL, + JSVAL_TAG_OBJECT = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT +} JS_ENUM_FOOTER(JSValueTag); + +JS_STATIC_ASSERT(sizeof(JSValueTag) == 4); + +#elif JS_BITS_PER_WORD == 64 + +/* Remember to propagate changes to the C defines below. */ +JS_ENUM_HEADER(JSValueTag, uint32_t) +{ + JSVAL_TAG_MAX_DOUBLE = 0x1FFF0, + JSVAL_TAG_INT32 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32, + JSVAL_TAG_UNDEFINED = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED, + JSVAL_TAG_STRING = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING, + JSVAL_TAG_BOOLEAN = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN, + JSVAL_TAG_MAGIC = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC, + JSVAL_TAG_NULL = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL, + JSVAL_TAG_OBJECT = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT +} JS_ENUM_FOOTER(JSValueTag); + +JS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32_t)); + +JS_ENUM_HEADER(JSValueShiftedTag, uint64_t) +{ + JSVAL_SHIFTED_TAG_MAX_DOUBLE = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF), + JSVAL_SHIFTED_TAG_INT32 = (((uint64_t)JSVAL_TAG_INT32) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_UNDEFINED = (((uint64_t)JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_STRING = (((uint64_t)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_BOOLEAN = (((uint64_t)JSVAL_TAG_BOOLEAN) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_MAGIC = (((uint64_t)JSVAL_TAG_MAGIC) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_NULL = (((uint64_t)JSVAL_TAG_NULL) << JSVAL_TAG_SHIFT), + JSVAL_SHIFTED_TAG_OBJECT = (((uint64_t)JSVAL_TAG_OBJECT) << JSVAL_TAG_SHIFT) +} JS_ENUM_FOOTER(JSValueShiftedTag); + +JS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t)); + +#endif + +#else /* defined(__cplusplus) */ + +typedef uint8_t JSValueType; +#define JSVAL_TYPE_DOUBLE ((uint8_t)0x00) +#define JSVAL_TYPE_INT32 ((uint8_t)0x01) +#define JSVAL_TYPE_UNDEFINED ((uint8_t)0x02) +#define JSVAL_TYPE_BOOLEAN ((uint8_t)0x03) +#define JSVAL_TYPE_MAGIC ((uint8_t)0x04) +#define JSVAL_TYPE_STRING ((uint8_t)0x05) +#define JSVAL_TYPE_NULL ((uint8_t)0x06) +#define JSVAL_TYPE_OBJECT ((uint8_t)0x07) +#define JSVAL_TYPE_UNKNOWN ((uint8_t)0x20) + +#if JS_BITS_PER_WORD == 32 + +typedef uint32_t JSValueTag; +#define JSVAL_TAG_CLEAR ((uint32_t)(0xFFFFFF80)) +#define JSVAL_TAG_INT32 ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32)) +#define JSVAL_TAG_UNDEFINED ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED)) +#define JSVAL_TAG_STRING ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING)) +#define JSVAL_TAG_BOOLEAN ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN)) +#define JSVAL_TAG_MAGIC ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC)) +#define JSVAL_TAG_NULL ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL)) +#define JSVAL_TAG_OBJECT ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT)) + +#elif JS_BITS_PER_WORD == 64 + +typedef uint32_t JSValueTag; +#define JSVAL_TAG_MAX_DOUBLE ((uint32_t)(0x1FFF0)) +#define JSVAL_TAG_INT32 (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32) +#define JSVAL_TAG_UNDEFINED (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED) +#define JSVAL_TAG_STRING (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING) +#define JSVAL_TAG_BOOLEAN (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN) +#define JSVAL_TAG_MAGIC (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC) +#define JSVAL_TAG_NULL (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL) +#define JSVAL_TAG_OBJECT (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT) + +typedef uint64_t JSValueShiftedTag; +#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF) +#define JSVAL_SHIFTED_TAG_INT32 (((uint64_t)JSVAL_TAG_INT32) << JSVAL_TAG_SHIFT) +#define JSVAL_SHIFTED_TAG_UNDEFINED (((uint64_t)JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT) +#define JSVAL_SHIFTED_TAG_STRING (((uint64_t)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT) +#define JSVAL_SHIFTED_TAG_BOOLEAN (((uint64_t)JSVAL_TAG_BOOLEAN) << JSVAL_TAG_SHIFT) +#define JSVAL_SHIFTED_TAG_MAGIC (((uint64_t)JSVAL_TAG_MAGIC) << JSVAL_TAG_SHIFT) +#define JSVAL_SHIFTED_TAG_NULL (((uint64_t)JSVAL_TAG_NULL) << JSVAL_TAG_SHIFT) +#define JSVAL_SHIFTED_TAG_OBJECT (((uint64_t)JSVAL_TAG_OBJECT) << JSVAL_TAG_SHIFT) + +#endif /* JS_BITS_PER_WORD */ +#endif /* defined(__cplusplus) && !defined(__SUNPRO_CC) */ + +#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET JSVAL_TYPE_NULL +#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET JSVAL_TYPE_OBJECT +#define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET JSVAL_TYPE_INT32 +#define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET JSVAL_TYPE_MAGIC + +#if JS_BITS_PER_WORD == 32 + +#define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_CLEAR | (type))) + +#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET JSVAL_TAG_NULL +#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET JSVAL_TAG_OBJECT +#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET JSVAL_TAG_INT32 +#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET JSVAL_TAG_STRING + +#elif JS_BITS_PER_WORD == 64 + +#define JSVAL_PAYLOAD_MASK 0x00007FFFFFFFFFFFLL +#define JSVAL_TAG_MASK 0xFFFF800000000000LL +#define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type))) +#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT) + +#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET JSVAL_TAG_NULL +#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET JSVAL_TAG_OBJECT +#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET JSVAL_TAG_INT32 +#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET JSVAL_TAG_STRING + +#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET JSVAL_SHIFTED_TAG_NULL +#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET JSVAL_SHIFTED_TAG_OBJECT +#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET JSVAL_SHIFTED_TAG_UNDEFINED +#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET JSVAL_SHIFTED_TAG_STRING + +#endif /* JS_BITS_PER_WORD */ + +typedef enum JSWhyMagic +{ + JS_ELEMENTS_HOLE, /* a hole in a native object's elements */ + JS_NATIVE_ENUMERATE, /* indicates that a custom enumerate hook forwarded + * to JS_EnumerateState, which really means the object can be + * enumerated like a native object. */ + JS_NO_ITER_VALUE, /* there is not a pending iterator value */ + JS_GENERATOR_CLOSING, /* exception value thrown when closing a generator */ + JS_NO_CONSTANT, /* compiler sentinel value */ + JS_THIS_POISON, /* used in debug builds to catch tracing errors */ + JS_ARG_POISON, /* used in debug builds to catch tracing errors */ + JS_SERIALIZE_NO_NODE, /* an empty subnode in the AST serializer */ + JS_LAZY_ARGUMENTS, /* lazy arguments value on the stack */ + JS_OPTIMIZED_ARGUMENTS, /* optimized-away 'arguments' value */ + JS_IS_CONSTRUCTING, /* magic value passed to natives to indicate construction */ + JS_OVERWRITTEN_CALLEE, /* arguments.callee has been overwritten */ + JS_FORWARD_TO_CALL_OBJECT, /* args object element stored in call object */ + JS_BLOCK_NEEDS_CLONE, /* value of static block object slot */ + JS_HASH_KEY_EMPTY, /* see class js::HashableValue */ + JS_ION_ERROR, /* error while running Ion code */ + JS_ION_BAILOUT, /* status code to signal EnterIon will OSR into Interpret */ + JS_GENERIC_MAGIC /* for local use */ +} JSWhyMagic; + +#if defined(IS_LITTLE_ENDIAN) +# if JS_BITS_PER_WORD == 32 +typedef union jsval_layout +{ + uint64_t asBits; + struct { + union { + int32_t i32; + uint32_t u32; + JSBool boo; + JSString *str; + JSObject *obj; + void *ptr; + JSWhyMagic why; + size_t word; + uintptr_t uintptr; + } payload; + JSValueTag tag; + } s; + double asDouble; + void *asPtr; +} JSVAL_ALIGNMENT jsval_layout; +# elif JS_BITS_PER_WORD == 64 +typedef union jsval_layout +{ + uint64_t asBits; +#if (!defined(_WIN64) && defined(__cplusplus)) + /* MSVC does not pack these correctly :-( */ + struct { + uint64_t payload47 : 47; + JSValueTag tag : 17; + } debugView; +#endif + struct { + union { + int32_t i32; + uint32_t u32; + JSWhyMagic why; + } payload; + } s; + double asDouble; + void *asPtr; + size_t asWord; + uintptr_t asUIntPtr; +} JSVAL_ALIGNMENT jsval_layout; +# endif /* JS_BITS_PER_WORD */ +#else /* defined(IS_LITTLE_ENDIAN) */ +# if JS_BITS_PER_WORD == 32 +typedef union jsval_layout +{ + uint64_t asBits; + struct { + JSValueTag tag; + union { + int32_t i32; + uint32_t u32; + JSBool boo; + JSString *str; + JSObject *obj; + void *ptr; + JSWhyMagic why; + size_t word; + uintptr_t uintptr; + } payload; + } s; + double asDouble; + void *asPtr; +} JSVAL_ALIGNMENT jsval_layout; +# elif JS_BITS_PER_WORD == 64 +typedef union jsval_layout +{ + uint64_t asBits; + struct { + JSValueTag tag : 17; + uint64_t payload47 : 47; + } debugView; + struct { + uint32_t padding; + union { + int32_t i32; + uint32_t u32; + JSWhyMagic why; + } payload; + } s; + double asDouble; + void *asPtr; + size_t asWord; + uintptr_t asUIntPtr; +} JSVAL_ALIGNMENT jsval_layout; +# endif /* JS_BITS_PER_WORD */ +#endif /* defined(IS_LITTLE_ENDIAN) */ + +JS_STATIC_ASSERT(sizeof(jsval_layout) == 8); + +#if JS_BITS_PER_WORD == 32 + +/* + * N.B. GCC, in some but not all cases, chooses to emit signed comparison of + * JSValueTag even though its underlying type has been forced to be uint32_t. + * Thus, all comparisons should explicitly cast operands to uint32_t. + */ + +static MOZ_ALWAYS_INLINE jsval_layout +BUILD_JSVAL(JSValueTag tag, uint32_t payload) +{ + jsval_layout l; + l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_DOUBLE_IMPL(jsval_layout l) +{ + return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR; +} + +static MOZ_ALWAYS_INLINE jsval_layout +DOUBLE_TO_JSVAL_IMPL(double d) +{ + jsval_layout l; + l.asDouble = d; + MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l)); + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_INT32_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_INT32; +} + +static MOZ_ALWAYS_INLINE int32_t +JSVAL_TO_INT32_IMPL(jsval_layout l) +{ + return l.s.payload.i32; +} + +static MOZ_ALWAYS_INLINE jsval_layout +INT32_TO_JSVAL_IMPL(int32_t i) +{ + jsval_layout l; + l.s.tag = JSVAL_TAG_INT32; + l.s.payload.i32 = i; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_NUMBER_IMPL(jsval_layout l) +{ + JSValueTag tag = l.s.tag; + MOZ_ASSERT(tag != JSVAL_TAG_CLEAR); + return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_UNDEFINED_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_UNDEFINED; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_STRING_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_STRING; +} + +static MOZ_ALWAYS_INLINE jsval_layout +STRING_TO_JSVAL_IMPL(JSString *str) +{ + jsval_layout l; + MOZ_ASSERT(str); + l.s.tag = JSVAL_TAG_STRING; + l.s.payload.str = str; + return l; +} + +static MOZ_ALWAYS_INLINE JSString * +JSVAL_TO_STRING_IMPL(jsval_layout l) +{ + return l.s.payload.str; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_BOOLEAN_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_BOOLEAN; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_TO_BOOLEAN_IMPL(jsval_layout l) +{ + return l.s.payload.boo; +} + +static MOZ_ALWAYS_INLINE jsval_layout +BOOLEAN_TO_JSVAL_IMPL(JSBool b) +{ + jsval_layout l; + MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE); + l.s.tag = JSVAL_TAG_BOOLEAN; + l.s.payload.boo = b; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_MAGIC_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_MAGIC; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_OBJECT_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_OBJECT; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l) +{ + return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l) +{ + MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT); + return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET; +} + +static MOZ_ALWAYS_INLINE JSObject * +JSVAL_TO_OBJECT_IMPL(jsval_layout l) +{ + return l.s.payload.obj; +} + +static MOZ_ALWAYS_INLINE jsval_layout +OBJECT_TO_JSVAL_IMPL(JSObject *obj) +{ + jsval_layout l; + MOZ_ASSERT(obj); + l.s.tag = JSVAL_TAG_OBJECT; + l.s.payload.obj = obj; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_NULL_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_NULL; +} + +static MOZ_ALWAYS_INLINE jsval_layout +PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr) +{ + jsval_layout l; + MOZ_ASSERT(((uint32_t)ptr & 1) == 0); + l.s.tag = (JSValueTag)0; + l.s.payload.ptr = ptr; + MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l)); + return l; +} + +static MOZ_ALWAYS_INLINE void * +JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l) +{ + return l.s.payload.ptr; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_GCTHING_IMPL(jsval_layout l) +{ + /* gcc sometimes generates signed < without explicit casts. */ + return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET; +} + +static MOZ_ALWAYS_INLINE void * +JSVAL_TO_GCTHING_IMPL(jsval_layout l) +{ + return l.s.payload.ptr; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) +{ + return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT; +} + +static MOZ_ALWAYS_INLINE uint32_t +JSVAL_TRACE_KIND_IMPL(jsval_layout l) +{ + return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32) +{ + return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b) +{ + return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b); +} + +static MOZ_ALWAYS_INLINE jsval_layout +MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) +{ + jsval_layout l; + l.s.tag = JSVAL_TAG_MAGIC; + l.s.payload.why = why; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs) +{ + JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag; + return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR); +} + +static MOZ_ALWAYS_INLINE JSValueType +JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l) +{ + uint32_t type = l.s.tag & 0xF; + MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE); + return (JSValueType)type; +} + +#elif JS_BITS_PER_WORD == 64 + +static MOZ_ALWAYS_INLINE jsval_layout +BUILD_JSVAL(JSValueTag tag, uint64_t payload) +{ + jsval_layout l; + l.asBits = (((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_DOUBLE_IMPL(jsval_layout l) +{ + return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE; +} + +static MOZ_ALWAYS_INLINE jsval_layout +DOUBLE_TO_JSVAL_IMPL(double d) +{ + jsval_layout l; + l.asDouble = d; + MOZ_ASSERT(l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE); + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_INT32_IMPL(jsval_layout l) +{ + return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32; +} + +static MOZ_ALWAYS_INLINE int32_t +JSVAL_TO_INT32_IMPL(jsval_layout l) +{ + return (int32_t)l.asBits; +} + +static MOZ_ALWAYS_INLINE jsval_layout +INT32_TO_JSVAL_IMPL(int32_t i32) +{ + jsval_layout l; + l.asBits = ((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_NUMBER_IMPL(jsval_layout l) +{ + return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_UNDEFINED_IMPL(jsval_layout l) +{ + return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_STRING_IMPL(jsval_layout l) +{ + return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING; +} + +static MOZ_ALWAYS_INLINE jsval_layout +STRING_TO_JSVAL_IMPL(JSString *str) +{ + jsval_layout l; + uint64_t strBits = (uint64_t)str; + MOZ_ASSERT(str); + MOZ_ASSERT((strBits >> JSVAL_TAG_SHIFT) == 0); + l.asBits = strBits | JSVAL_SHIFTED_TAG_STRING; + return l; +} + +static MOZ_ALWAYS_INLINE JSString * +JSVAL_TO_STRING_IMPL(jsval_layout l) +{ + return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_BOOLEAN_IMPL(jsval_layout l) +{ + return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_TO_BOOLEAN_IMPL(jsval_layout l) +{ + return (JSBool)l.asBits; +} + +static MOZ_ALWAYS_INLINE jsval_layout +BOOLEAN_TO_JSVAL_IMPL(JSBool b) +{ + jsval_layout l; + MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE); + l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_MAGIC_IMPL(jsval_layout l) +{ + return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l) +{ + return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_OBJECT_IMPL(jsval_layout l) +{ + MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT); + return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l) +{ + MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT); + return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET; +} + +static MOZ_ALWAYS_INLINE JSObject * +JSVAL_TO_OBJECT_IMPL(jsval_layout l) +{ + uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK; + MOZ_ASSERT((ptrBits & 0x7) == 0); + return (JSObject *)ptrBits; +} + +static MOZ_ALWAYS_INLINE jsval_layout +OBJECT_TO_JSVAL_IMPL(JSObject *obj) +{ + jsval_layout l; + uint64_t objBits = (uint64_t)obj; + MOZ_ASSERT(obj); + MOZ_ASSERT((objBits >> JSVAL_TAG_SHIFT) == 0); + l.asBits = objBits | JSVAL_SHIFTED_TAG_OBJECT; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_NULL_IMPL(jsval_layout l) +{ + return l.asBits == JSVAL_SHIFTED_TAG_NULL; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_GCTHING_IMPL(jsval_layout l) +{ + return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET; +} + +static MOZ_ALWAYS_INLINE void * +JSVAL_TO_GCTHING_IMPL(jsval_layout l) +{ + uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK; + MOZ_ASSERT((ptrBits & 0x7) == 0); + return (void *)ptrBits; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) +{ + return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l); +} + +static MOZ_ALWAYS_INLINE uint32_t +JSVAL_TRACE_KIND_IMPL(jsval_layout l) +{ + return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l)); +} + +static MOZ_ALWAYS_INLINE jsval_layout +PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr) +{ + jsval_layout l; + uint64_t ptrBits = (uint64_t)ptr; + MOZ_ASSERT((ptrBits & 1) == 0); + l.asBits = ptrBits >> 1; + MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l)); + return l; +} + +static MOZ_ALWAYS_INLINE void * +JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l) +{ + MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0); + return (void *)(l.asBits << 1); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32) +{ + return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b) +{ + return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN); +} + +static MOZ_ALWAYS_INLINE jsval_layout +MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) +{ + jsval_layout l; + l.asBits = ((uint64_t)(uint32_t)why) | JSVAL_SHIFTED_TAG_MAGIC; + return l; +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs) +{ + uint64_t lbits = lhs.asBits, rbits = rhs.asBits; + return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) || + (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0); +} + +static MOZ_ALWAYS_INLINE JSValueType +JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l) +{ + uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF; + MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE); + return (JSValueType)type; +} + +#endif /* JS_BITS_PER_WORD */ + +static MOZ_ALWAYS_INLINE double +JS_CANONICALIZE_NAN(double d) +{ + if (MOZ_UNLIKELY(d != d)) { + jsval_layout l; + l.asBits = 0x7FF8000000000000LL; + return l.asDouble; + } + return d; +} + +static MOZ_ALWAYS_INLINE jsval_layout JSVAL_TO_IMPL(JS::Value v); +static MOZ_ALWAYS_INLINE JS::Value IMPL_TO_JSVAL(jsval_layout l); + +namespace JS { + +/* + * JS::Value is the interface for a single JavaScript Engine value. A few + * general notes on JS::Value: + * + * - JS::Value has setX() and isX() members for X in + * + * { Int32, Double, String, Boolean, Undefined, Null, Object, Magic } + * + * JS::Value also contains toX() for each of the non-singleton types. + * + * - Magic is a singleton type whose payload contains a JSWhyMagic "reason" for + * the magic value. By providing JSWhyMagic values when creating and checking + * for magic values, it is possible to assert, at runtime, that only magic + * values with the expected reason flow through a particular value. For + * example, if cx->exception has a magic value, the reason must be + * JS_GENERATOR_CLOSING. + * + * - The JS::Value operations are preferred. The JSVAL_* operations remain for + * compatibility; they may be removed at some point. These operations mostly + * provide similar functionality. But there are a few key differences. One + * is that JS::Value gives null a separate type. Thus + * + * JSVAL_IS_OBJECT(v) === v.isObjectOrNull() + * !JSVAL_IS_PRIMITIVE(v) === v.isObject() + * + * Also, to help prevent mistakenly boxing a nullable JSObject* as an object, + * Value::setObject takes a JSObject&. (Conversely, Value::asObject returns a + * JSObject&.) A convenience member Value::setObjectOrNull is provided. + * + * - JSVAL_VOID is the same as the singleton value of the Undefined type. + * + * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on + * 32-bit user code should avoid copying jsval/JS::Value as much as possible, + * preferring to pass by const Value &. + */ +class Value +{ + public: + /* + * N.B. the default constructor leaves Value unitialized. Adding a default + * constructor prevents Value from being stored in a union. + */ + + /*** Mutators ***/ + + MOZ_ALWAYS_INLINE + void setNull() { + data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits; + } + + MOZ_ALWAYS_INLINE + void setUndefined() { + data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits; + } + + MOZ_ALWAYS_INLINE + void setInt32(int32_t i) { + data = INT32_TO_JSVAL_IMPL(i); + } + + MOZ_ALWAYS_INLINE + int32_t &getInt32Ref() { + MOZ_ASSERT(isInt32()); + return data.s.payload.i32; + } + + MOZ_ALWAYS_INLINE + void setDouble(double d) { + data = DOUBLE_TO_JSVAL_IMPL(d); + } + + MOZ_ALWAYS_INLINE + double &getDoubleRef() { + MOZ_ASSERT(isDouble()); + return data.asDouble; + } + + MOZ_ALWAYS_INLINE + void setString(JSString *str) { + MOZ_ASSERT(!IsPoisonedPtr(str)); + data = STRING_TO_JSVAL_IMPL(str); + } + + MOZ_ALWAYS_INLINE + void setString(const JS::Anchor &str) { + setString(str.get()); + } + + MOZ_ALWAYS_INLINE + void setObject(JSObject &obj) { + MOZ_ASSERT(!IsPoisonedPtr(&obj)); + data = OBJECT_TO_JSVAL_IMPL(&obj); + } + + MOZ_ALWAYS_INLINE + void setBoolean(bool b) { + data = BOOLEAN_TO_JSVAL_IMPL(b); + } + + MOZ_ALWAYS_INLINE + void setMagic(JSWhyMagic why) { + data = MAGIC_TO_JSVAL_IMPL(why); + } + + MOZ_ALWAYS_INLINE + bool setNumber(uint32_t ui) { + if (ui > JSVAL_INT_MAX) { + setDouble((double)ui); + return false; + } else { + setInt32((int32_t)ui); + return true; + } + } + + MOZ_ALWAYS_INLINE + bool setNumber(double d) { + int32_t i; + if (MOZ_DOUBLE_IS_INT32(d, &i)) { + setInt32(i); + return true; + } else { + setDouble(d); + return false; + } + } + + MOZ_ALWAYS_INLINE + void setObjectOrNull(JSObject *arg) { + if (arg) + setObject(*arg); + else + setNull(); + } + + MOZ_ALWAYS_INLINE + void swap(Value &rhs) { + uint64_t tmp = rhs.data.asBits; + rhs.data.asBits = data.asBits; + data.asBits = tmp; + } + + /*** Value type queries ***/ + + MOZ_ALWAYS_INLINE + bool isUndefined() const { + return JSVAL_IS_UNDEFINED_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isNull() const { + return JSVAL_IS_NULL_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isNullOrUndefined() const { + return isNull() || isUndefined(); + } + + MOZ_ALWAYS_INLINE + bool isInt32() const { + return JSVAL_IS_INT32_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isInt32(int32_t i32) const { + return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32); + } + + MOZ_ALWAYS_INLINE + bool isDouble() const { + return JSVAL_IS_DOUBLE_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isNumber() const { + return JSVAL_IS_NUMBER_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isString() const { + return JSVAL_IS_STRING_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isObject() const { + return JSVAL_IS_OBJECT_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isPrimitive() const { + return JSVAL_IS_PRIMITIVE_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isObjectOrNull() const { + return JSVAL_IS_OBJECT_OR_NULL_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isGCThing() const { + return JSVAL_IS_GCTHING_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isBoolean() const { + return JSVAL_IS_BOOLEAN_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isTrue() const { + return JSVAL_IS_SPECIFIC_BOOLEAN(data, true); + } + + MOZ_ALWAYS_INLINE + bool isFalse() const { + return JSVAL_IS_SPECIFIC_BOOLEAN(data, false); + } + + MOZ_ALWAYS_INLINE + bool isMagic() const { + return JSVAL_IS_MAGIC_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isMagic(JSWhyMagic why) const { + MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why); + return JSVAL_IS_MAGIC_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool isMarkable() const { + return JSVAL_IS_TRACEABLE_IMPL(data); + } + + MOZ_ALWAYS_INLINE + JSGCTraceKind gcKind() const { + MOZ_ASSERT(isMarkable()); + return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data)); + } + + MOZ_ALWAYS_INLINE + JSWhyMagic whyMagic() const { + MOZ_ASSERT(isMagic()); + return data.s.payload.why; + } + + /*** Comparison ***/ + + MOZ_ALWAYS_INLINE + bool operator==(const Value &rhs) const { + return data.asBits == rhs.data.asBits; + } + + MOZ_ALWAYS_INLINE + bool operator!=(const Value &rhs) const { + return data.asBits != rhs.data.asBits; + } + + friend inline bool SameType(const Value &lhs, const Value &rhs); + + /*** Extract the value's typed payload ***/ + + MOZ_ALWAYS_INLINE + int32_t toInt32() const { + MOZ_ASSERT(isInt32()); + return JSVAL_TO_INT32_IMPL(data); + } + + MOZ_ALWAYS_INLINE + double toDouble() const { + MOZ_ASSERT(isDouble()); + return data.asDouble; + } + + MOZ_ALWAYS_INLINE + double toNumber() const { + MOZ_ASSERT(isNumber()); + return isDouble() ? toDouble() : double(toInt32()); + } + + MOZ_ALWAYS_INLINE + JSString *toString() const { + MOZ_ASSERT(isString()); + return JSVAL_TO_STRING_IMPL(data); + } + + MOZ_ALWAYS_INLINE + JSObject &toObject() const { + MOZ_ASSERT(isObject()); + return *JSVAL_TO_OBJECT_IMPL(data); + } + + MOZ_ALWAYS_INLINE + JSObject *toObjectOrNull() const { + MOZ_ASSERT(isObjectOrNull()); + return JSVAL_TO_OBJECT_IMPL(data); + } + + MOZ_ALWAYS_INLINE + void *toGCThing() const { + MOZ_ASSERT(isGCThing()); + return JSVAL_TO_GCTHING_IMPL(data); + } + + MOZ_ALWAYS_INLINE + bool toBoolean() const { + MOZ_ASSERT(isBoolean()); + return JSVAL_TO_BOOLEAN_IMPL(data); + } + + MOZ_ALWAYS_INLINE + uint32_t payloadAsRawUint32() const { + MOZ_ASSERT(!isDouble()); + return data.s.payload.u32; + } + + MOZ_ALWAYS_INLINE + uint64_t asRawBits() const { + return data.asBits; + } + + MOZ_ALWAYS_INLINE + JSValueType extractNonDoubleType() const { + return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data); + } + + /* + * Private API + * + * Private setters/getters allow the caller to read/write arbitrary types + * that fit in the 64-bit payload. It is the caller's responsibility, after + * storing to a value with setPrivateX to read only using getPrivateX. + * Privates values are given a type type which ensures they are not marked. + */ + + MOZ_ALWAYS_INLINE + void setPrivate(void *ptr) { + data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr); + } + + MOZ_ALWAYS_INLINE + void *toPrivate() const { + MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data)); + return JSVAL_TO_PRIVATE_PTR_IMPL(data); + } + + MOZ_ALWAYS_INLINE + void setPrivateUint32(uint32_t ui) { + MOZ_ASSERT(uint32_t(int32_t(ui)) == ui); + setInt32(int32_t(ui)); + } + + MOZ_ALWAYS_INLINE + uint32_t toPrivateUint32() const { + return uint32_t(toInt32()); + } + + /* + * An unmarked value is just a void* cast as a Value. Thus, the Value is + * not safe for GC and must not be marked. This API avoids raw casts + * and the ensuing strict-aliasing warnings. + */ + + MOZ_ALWAYS_INLINE + void setUnmarkedPtr(void *ptr) { + data.asPtr = ptr; + } + + MOZ_ALWAYS_INLINE + void *toUnmarkedPtr() const { + return data.asPtr; + } + + const size_t *payloadWord() const { +#if JS_BITS_PER_WORD == 32 + return &data.s.payload.word; +#elif JS_BITS_PER_WORD == 64 + return &data.asWord; +#endif + } + + const uintptr_t *payloadUIntPtr() const { +#if JS_BITS_PER_WORD == 32 + return &data.s.payload.uintptr; +#elif JS_BITS_PER_WORD == 64 + return &data.asUIntPtr; +#endif + } + +#if !defined(_MSC_VER) && !defined(__sparc) + // Value must be POD so that MSVC will pass it by value and not in memory + // (bug 689101); the same is true for SPARC as well (bug 737344). More + // precisely, we don't want Value return values compiled as out params. + private: +#endif + + jsval_layout data; + + private: + void staticAssertions() { + JS_STATIC_ASSERT(sizeof(JSValueType) == 1); + JS_STATIC_ASSERT(sizeof(JSValueTag) == 4); + JS_STATIC_ASSERT(sizeof(JSBool) == 4); + JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4); + JS_STATIC_ASSERT(sizeof(Value) == 8); + } + + friend jsval_layout (::JSVAL_TO_IMPL)(Value); + friend Value (::IMPL_TO_JSVAL)(jsval_layout l); +}; + +inline bool +IsPoisonedValue(const Value &v) +{ + if (v.isString()) + return IsPoisonedPtr(v.toString()); + if (v.isObject()) + return IsPoisonedPtr(&v.toObject()); + return false; +} + +/************************************************************************/ + +static MOZ_ALWAYS_INLINE Value +NullValue() +{ + Value v; + v.setNull(); + return v; +} + +static MOZ_ALWAYS_INLINE Value +UndefinedValue() +{ + Value v; + v.setUndefined(); + return v; +} + +static MOZ_ALWAYS_INLINE Value +Int32Value(int32_t i32) +{ + Value v; + v.setInt32(i32); + return v; +} + +static MOZ_ALWAYS_INLINE Value +DoubleValue(double dbl) +{ + Value v; + v.setDouble(dbl); + return v; +} + +static MOZ_ALWAYS_INLINE Value +StringValue(JSString *str) +{ + Value v; + v.setString(str); + return v; +} + +static MOZ_ALWAYS_INLINE Value +BooleanValue(bool boo) +{ + Value v; + v.setBoolean(boo); + return v; +} + +static MOZ_ALWAYS_INLINE Value +ObjectValue(JSObject &obj) +{ + Value v; + v.setObject(obj); + return v; +} + +static MOZ_ALWAYS_INLINE Value +ObjectValueCrashOnTouch() +{ + Value v; + v.setObject(*reinterpret_cast(0x42)); + return v; +} + +static MOZ_ALWAYS_INLINE Value +MagicValue(JSWhyMagic why) +{ + Value v; + v.setMagic(why); + return v; +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(float f) +{ + Value v; + v.setNumber(f); + return v; +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(double dbl) +{ + Value v; + v.setNumber(dbl); + return v; +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(int8_t i) +{ + return Int32Value(i); +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(uint8_t i) +{ + return Int32Value(i); +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(int16_t i) +{ + return Int32Value(i); +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(uint16_t i) +{ + return Int32Value(i); +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(int32_t i) +{ + return Int32Value(i); +} + +static MOZ_ALWAYS_INLINE Value +NumberValue(uint32_t i) +{ + Value v; + v.setNumber(i); + return v; +} + +namespace detail { + +template +class MakeNumberValue +{ + public: + template + static inline Value create(const T t) + { + Value v; + if (JSVAL_INT_MIN <= t && t <= JSVAL_INT_MAX) + v.setInt32(int32_t(t)); + else + v.setDouble(double(t)); + return v; + } +}; + +template <> +class MakeNumberValue +{ + public: + template + static inline Value create(const T t) + { + Value v; + if (t <= JSVAL_INT_MAX) + v.setInt32(int32_t(t)); + else + v.setDouble(double(t)); + return v; + } +}; + +} // namespace detail + +template +static MOZ_ALWAYS_INLINE Value +NumberValue(const T t) +{ + MOZ_ASSERT(T(double(t)) == t, "value creation would be lossy"); + return detail::MakeNumberValue::is_signed>::create(t); +} + +static MOZ_ALWAYS_INLINE Value +ObjectOrNullValue(JSObject *obj) +{ + Value v; + v.setObjectOrNull(obj); + return v; +} + +static MOZ_ALWAYS_INLINE Value +PrivateValue(void *ptr) +{ + Value v; + v.setPrivate(ptr); + return v; +} + +static MOZ_ALWAYS_INLINE Value +PrivateUint32Value(uint32_t ui) +{ + Value v; + v.setPrivateUint32(ui); + return v; +} + +MOZ_ALWAYS_INLINE bool +SameType(const Value &lhs, const Value &rhs) +{ + return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data); +} + +} // namespace JS + +/************************************************************************/ + +namespace js { + +template <> struct RootMethods +{ + static JS::Value initial() { return UndefinedValue(); } + static ThingRootKind kind() { return THING_ROOT_VALUE; } + static bool poisoned(const JS::Value &v) { return IsPoisonedValue(v); } +}; + +template <> struct RootMethods +{ + static JS::Value initial() { return UndefinedValue(); } + static ThingRootKind kind() { return THING_ROOT_VALUE; } + static bool poisoned(const JS::Value &v) { return IsPoisonedValue(v); } +}; + +template class MutableValueOperations; + +/* + * A class designed for CRTP use in implementing the non-mutating parts of the + * Value interface in Value-like classes. Outer must be a class inheriting + * ValueOperations with a visible extract() method returning the + * const Value* abstracted by Outer. + */ +template +class ValueOperations +{ + friend class MutableValueOperations; + const JS::Value * value() const { return static_cast(this)->extract(); } + + public: + bool isUndefined() const { return value()->isUndefined(); } + bool isNull() const { return value()->isNull(); } + bool isBoolean() const { return value()->isBoolean(); } + bool isTrue() const { return value()->isTrue(); } + bool isFalse() const { return value()->isFalse(); } + bool isNumber() const { return value()->isNumber(); } + bool isInt32() const { return value()->isInt32(); } + bool isDouble() const { return value()->isDouble(); } + bool isString() const { return value()->isString(); } + bool isObject() const { return value()->isObject(); } + bool isMagic() const { return value()->isMagic(); } + bool isMagic(JSWhyMagic why) const { return value()->isMagic(why); } + bool isMarkable() const { return value()->isMarkable(); } + bool isPrimitive() const { return value()->isPrimitive(); } + bool isGCThing() const { return value()->isGCThing(); } + + bool isNullOrUndefined() const { return value()->isNullOrUndefined(); } + bool isObjectOrNull() const { return value()->isObjectOrNull(); } + + bool toBoolean() const { return value()->toBoolean(); } + double toNumber() const { return value()->toNumber(); } + int32_t toInt32() const { return value()->toInt32(); } + double toDouble() const { return value()->toDouble(); } + JSString *toString() const { return value()->toString(); } + JSObject &toObject() const { return value()->toObject(); } + JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); } + void *toGCThing() const { return value()->toGCThing(); } + + JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); } + + JSWhyMagic whyMagic() const { return value()->whyMagic(); } +}; + +/* + * A class designed for CRTP use in implementing the mutating parts of the + * Value interface in Value-like classes. Outer must be a class inheriting + * MutableValueOperations with visible extractMutable() and extract() + * methods returning the const Value* and Value* abstracted by Outer. + */ +template +class MutableValueOperations : public ValueOperations +{ + JS::Value * value() { return static_cast(this)->extractMutable(); } + + public: + void setNull() { value()->setNull(); } + void setUndefined() { value()->setUndefined(); } + void setInt32(int32_t i) { value()->setInt32(i); } + void setDouble(double d) { value()->setDouble(d); } + void setString(JSString *str) { value()->setString(str); } + void setString(const JS::Anchor &str) { value()->setString(str); } + void setObject(JSObject &obj) { value()->setObject(obj); } + void setBoolean(bool b) { value()->setBoolean(b); } + void setMagic(JSWhyMagic why) { value()->setMagic(why); } + bool setNumber(uint32_t ui) { return value()->setNumber(ui); } + bool setNumber(double d) { return value()->setNumber(d); } + void setObjectOrNull(JSObject *arg) { value()->setObjectOrNull(arg); } +}; + +/* + * Augment the generic Handle interface when T = Value with type-querying + * and value-extracting operations. + */ +template <> +class HandleBase : public ValueOperations > +{ + friend class ValueOperations >; + const JS::Value * extract() const { + return static_cast*>(this)->address(); + } +}; + +/* + * Augment the generic MutableHandle interface when T = Value with + * type-querying, value-extracting, and mutating operations. + */ +template <> +class MutableHandleBase : public MutableValueOperations > +{ + friend class ValueOperations >; + const JS::Value * extract() const { + return static_cast*>(this)->address(); + } + + friend class MutableValueOperations >; + JS::Value * extractMutable() { + return static_cast*>(this)->address(); + } +}; + +/* + * Augment the generic Rooted interface when T = Value with type-querying, + * value-extracting, and mutating operations. + */ +template <> +class RootedBase : public MutableValueOperations > +{ + friend class ValueOperations >; + const JS::Value * extract() const { + return static_cast*>(this)->address(); + } + + friend class MutableValueOperations >; + JS::Value * extractMutable() { + return static_cast*>(this)->address(); + } +}; + +} // namespace js + +MOZ_ALWAYS_INLINE jsval_layout +JSVAL_TO_IMPL(JS::Value v) +{ + return v.data; +} + +MOZ_ALWAYS_INLINE JS::Value +IMPL_TO_JSVAL(jsval_layout l) +{ + JS::Value v; + v.data = l; + return v; +} + +namespace JS { + +#ifndef __GNUC__ +/* + * The default assignment operator for |struct C| has the signature: + * + * C& C::operator=(const C&) + * + * And in particular requires implicit conversion of |this| to type |C| for the + * return value. But |volatile C| cannot thus be converted to |C|, so just + * doing |sink = hold| as in the non-specialized version would fail to compile. + * Do the assignment on asBits instead, since I don't think we want to give + * jsval_layout an assignment operator returning |volatile jsval_layout|. + */ +template<> +inline Anchor::~Anchor() +{ + volatile uint64_t bits; + bits = JSVAL_TO_IMPL(hold).asBits; +} +#endif + +#ifdef DEBUG +namespace detail { + +struct ValueAlignmentTester { char c; JS::Value v; }; +MOZ_STATIC_ASSERT(sizeof(ValueAlignmentTester) == 16, + "JS::Value must be 16-byte-aligned"); + +struct LayoutAlignmentTester { char c; jsval_layout l; }; +MOZ_STATIC_ASSERT(sizeof(LayoutAlignmentTester) == 16, + "jsval_layout must be 16-byte-aligned"); + +} // namespace detail +#endif /* DEBUG */ + +} // namespace JS + +/* + * JS::Value and jsval are the same type; jsval is the old name, kept around + * for backwards compatibility along with all the JSVAL_* operations below. + * jsval_layout is an implementation detail and should not be used externally. + */ +typedef JS::Value jsval; + +MOZ_STATIC_ASSERT(sizeof(jsval_layout) == sizeof(JS::Value), + "jsval_layout and JS::Value must have identical layouts"); + +/************************************************************************/ + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_NULL(jsval v) +{ + return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_VOID(jsval v) +{ + return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_INT(jsval v) +{ + return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE int32_t +JSVAL_TO_INT(jsval v) +{ + MOZ_ASSERT(JSVAL_IS_INT(v)); + return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE jsval +INT_TO_JSVAL(int32_t i) +{ + return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_DOUBLE(jsval v) +{ + return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE double +JSVAL_TO_DOUBLE(jsval v) +{ + jsval_layout l; + MOZ_ASSERT(JSVAL_IS_DOUBLE(v)); + l = JSVAL_TO_IMPL(v); + return l.asDouble; +} + +static MOZ_ALWAYS_INLINE jsval +DOUBLE_TO_JSVAL(double d) +{ + /* + * This is a manually inlined version of: + * d = JS_CANONICALIZE_NAN(d); + * return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d)); + * because GCC from XCode 3.1.4 miscompiles the above code. + */ + jsval_layout l; + if (MOZ_UNLIKELY(d != d)) + l.asBits = 0x7FF8000000000000LL; + else + l.asDouble = d; + return IMPL_TO_JSVAL(l); +} + +static MOZ_ALWAYS_INLINE jsval +UINT_TO_JSVAL(uint32_t i) +{ + if (i <= JSVAL_INT_MAX) + return INT_TO_JSVAL((int32_t)i); + return DOUBLE_TO_JSVAL((double)i); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_NUMBER(jsval v) +{ + return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_STRING(jsval v) +{ + return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE JSString * +JSVAL_TO_STRING(jsval v) +{ + MOZ_ASSERT(JSVAL_IS_STRING(v)); + return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE jsval +STRING_TO_JSVAL(JSString *str) +{ + return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str)); +} + +static MOZ_ALWAYS_INLINE JSObject * +JSVAL_TO_OBJECT(jsval v) +{ + MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v))); + return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE jsval +OBJECT_TO_JSVAL(JSObject *obj) +{ + if (obj) + return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj)); + return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_BOOLEAN(jsval v) +{ + return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_TO_BOOLEAN(jsval v) +{ + MOZ_ASSERT(JSVAL_IS_BOOLEAN(v)); + return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE jsval +BOOLEAN_TO_JSVAL(JSBool b) +{ + return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_PRIMITIVE(jsval v) +{ + return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE JSBool +JSVAL_IS_GCTHING(jsval v) +{ + return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v)); +} + +static MOZ_ALWAYS_INLINE void * +JSVAL_TO_GCTHING(jsval v) +{ + MOZ_ASSERT(JSVAL_IS_GCTHING(v)); + return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v)); +} + +/* To be GC-safe, privates are tagged as doubles. */ + +static MOZ_ALWAYS_INLINE jsval +PRIVATE_TO_JSVAL(void *ptr) +{ + return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr)); +} + +static MOZ_ALWAYS_INLINE void * +JSVAL_TO_PRIVATE(jsval v) +{ + MOZ_ASSERT(JSVAL_IS_DOUBLE(v)); + return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v)); +} + +#endif /* js_Value_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/Vector.h b/scripting/javascript/spidermonkey-mac/include/js/Vector.h new file mode 100644 index 0000000000..0a625e346a --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/Vector.h @@ -0,0 +1,1076 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsvector_h_ +#define jsvector_h_ + +#include "mozilla/Attributes.h" +#include "mozilla/TypeTraits.h" + +#include "TemplateLib.h" +#include "Utility.h" + +/* Silence dire "bugs in previous versions of MSVC have been fixed" warnings */ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4345) +#endif + +namespace js { + +class TempAllocPolicy; + +template +class Vector; + +/* + * Check that the given capacity wastes the minimal amount of space if + * allocated on the heap. This means that cap*sizeof(T) is as close to a + * power-of-two as possible. growStorageBy() is responsible for ensuring + * this. + */ +template +static bool CapacityHasExcessSpace(size_t cap) +{ + size_t size = cap * sizeof(T); + return RoundUpPow2(size) - size >= sizeof(T); +} + +/* + * This template class provides a default implementation for vector operations + * when the element type is not known to be a POD, as judged by IsPod. + */ +template +struct VectorImpl +{ + /* Destroys constructed objects in the range [begin, end). */ + static inline void destroy(T *begin, T *end) { + for (T *p = begin; p != end; ++p) + p->~T(); + } + + /* Constructs objects in the uninitialized range [begin, end). */ + static inline void initialize(T *begin, T *end) { + for (T *p = begin; p != end; ++p) + new(p) T(); + } + + /* + * Copy-constructs objects in the uninitialized range + * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend). + */ + template + static inline void copyConstruct(T *dst, const U *srcbeg, const U *srcend) { + for (const U *p = srcbeg; p != srcend; ++p, ++dst) + new(dst) T(*p); + } + + /* + * Move-constructs objects in the uninitialized range + * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend). + */ + template + static inline void moveConstruct(T *dst, const U *srcbeg, const U *srcend) { + for (const U *p = srcbeg; p != srcend; ++p, ++dst) + new(dst) T(Move(*p)); + } + + /* + * Copy-constructs objects in the uninitialized range [dst, dst+n) from the + * same object u. + */ + template + static inline void copyConstructN(T *dst, size_t n, const U &u) { + for (T *end = dst + n; dst != end; ++dst) + new(dst) T(u); + } + + /* + * Grows the given buffer to have capacity newCap, preserving the objects + * constructed in the range [begin, end) and updating v. Assumes that (1) + * newCap has not overflowed, and (2) multiplying newCap by sizeof(T) will + * not overflow. + */ + static inline bool growTo(Vector &v, size_t newCap) { + JS_ASSERT(!v.usingInlineStorage()); + JS_ASSERT(!CapacityHasExcessSpace(newCap)); + T *newbuf = reinterpret_cast(v.malloc_(newCap * sizeof(T))); + if (!newbuf) + return false; + for (T *dst = newbuf, *src = v.beginNoCheck(); src != v.endNoCheck(); ++dst, ++src) + new(dst) T(Move(*src)); + VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck()); + v.free_(v.mBegin); + v.mBegin = newbuf; + /* v.mLength is unchanged. */ + v.mCapacity = newCap; + return true; + } +}; + +/* + * This partial template specialization provides a default implementation for + * vector operations when the element type is known to be a POD, as judged by + * IsPod. + */ +template +struct VectorImpl +{ + static inline void destroy(T *, T *) {} + + static inline void initialize(T *begin, T *end) { + /* + * You would think that memset would be a big win (or even break even) + * when we know T is a POD. But currently it's not. This is probably + * because |append| tends to be given small ranges and memset requires + * a function call that doesn't get inlined. + * + * memset(begin, 0, sizeof(T) * (end-begin)); + */ + for (T *p = begin; p != end; ++p) + new(p) T(); + } + + template + static inline void copyConstruct(T *dst, const U *srcbeg, const U *srcend) { + /* + * See above memset comment. Also, notice that copyConstruct is + * currently templated (T != U), so memcpy won't work without + * requiring T == U. + * + * memcpy(dst, srcbeg, sizeof(T) * (srcend - srcbeg)); + */ + for (const U *p = srcbeg; p != srcend; ++p, ++dst) + *dst = *p; + } + + template + static inline void moveConstruct(T *dst, const U *srcbeg, const U *srcend) { + copyConstruct(dst, srcbeg, srcend); + } + + static inline void copyConstructN(T *dst, size_t n, const T &t) { + for (T *p = dst, *end = dst + n; p != end; ++p) + *p = t; + } + + static inline bool growTo(Vector &v, size_t newCap) { + JS_ASSERT(!v.usingInlineStorage()); + JS_ASSERT(!CapacityHasExcessSpace(newCap)); + size_t oldSize = sizeof(T) * v.mCapacity; + size_t newSize = sizeof(T) * newCap; + T *newbuf = reinterpret_cast(v.realloc_(v.mBegin, oldSize, newSize)); + if (!newbuf) + return false; + v.mBegin = newbuf; + /* v.mLength is unchanged. */ + v.mCapacity = newCap; + return true; + } +}; + +/* + * JS-friendly, STL-like container providing a short-lived, dynamic buffer. + * Vector calls the constructors/destructors of all elements stored in + * its internal buffer, so non-PODs may be safely used. Additionally, + * Vector will store the first N elements in-place before resorting to + * dynamic allocation. + * + * T requirements: + * - default and copy constructible, assignable, destructible + * - operations do not throw + * N requirements: + * - any value, however, N is clamped to min/max values + * AllocPolicy: + * - see "Allocation policies" in jsalloc.h (default js::TempAllocPolicy) + * + * N.B: Vector is not reentrant: T member functions called during Vector member + * functions must not call back into the same object. + */ +template +class Vector : private AllocPolicy +{ + // typedef typename tl::StaticAssert::result>::result _; + + /* utilities */ + + static const bool sElemIsPod = mozilla::IsPod::value; + typedef VectorImpl Impl; + friend struct VectorImpl; + + bool growStorageBy(size_t incr); + bool convertToHeapStorage(size_t newCap); + + template inline bool growByImpl(size_t inc); + + /* magic constants */ + + static const int sMaxInlineBytes = 1024; + + /* compute constants */ + + /* + * Consider element size to be 1 for buffer sizing if there are + * 0 inline elements. This allows us to compile when the definition + * of the element type is not visible here. + * + * Explicit specialization is only allowed at namespace scope, so + * in order to keep everything here, we use a dummy template + * parameter with partial specialization. + */ + template + struct ElemSize { + static const size_t result = sizeof(T); + }; + template + struct ElemSize<0, Dummy> { + static const size_t result = 1; + }; + + static const size_t sInlineCapacity = + tl::Min::result>::result; + + /* Calculate inline buffer size; avoid 0-sized array. */ + static const size_t sInlineBytes = + tl::Max<1, sInlineCapacity * ElemSize::result>::result; + + /* member data */ + + /* + * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin, + * mBegin + mLength) hold valid constructed T objects. The range [mBegin + + * mLength, mBegin + mCapacity) holds uninitialized memory. The range + * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory + * previously allocated by a call to reserve(). + */ + T *mBegin; + size_t mLength; /* Number of elements in the Vector. */ + size_t mCapacity; /* Max number of elements storable in the Vector without resizing. */ +#ifdef DEBUG + size_t mReserved; /* Max elements of reserved or used space in this vector. */ +#endif + + mozilla::AlignedStorage storage; + +#ifdef DEBUG + friend class ReentrancyGuard; + bool entered; +#endif + + Vector(const Vector &) MOZ_DELETE; + Vector &operator=(const Vector &) MOZ_DELETE; + + /* private accessors */ + + bool usingInlineStorage() const { + return mBegin == inlineStorage(); + } + + T *inlineStorage() const { + return (T *)storage.addr(); + } + + T *beginNoCheck() const { + return mBegin; + } + + T *endNoCheck() { + return mBegin + mLength; + } + + const T *endNoCheck() const { + return mBegin + mLength; + } + +#ifdef DEBUG + size_t reserved() const { + JS_ASSERT(mReserved <= mCapacity); + JS_ASSERT(mLength <= mReserved); + return mReserved; + } +#endif + + /* Append operations guaranteed to succeed due to pre-reserved space. */ + template void internalAppend(U t); + void internalAppendN(const T &t, size_t n); + template void internalAppend(const U *begin, size_t length); + template void internalAppend(const Vector &other); + + public: + static const size_t sMaxInlineStorage = N; + + typedef T ElementType; + + Vector(AllocPolicy = AllocPolicy()); + Vector(MoveRef); /* Move constructor. */ + Vector &operator=(MoveRef); /* Move assignment. */ + ~Vector(); + + /* accessors */ + + const AllocPolicy &allocPolicy() const { + return *this; + } + + AllocPolicy &allocPolicy() { + return *this; + } + + enum { InlineLength = N }; + + size_t length() const { + return mLength; + } + + bool empty() const { + return mLength == 0; + } + + size_t capacity() const { + return mCapacity; + } + + T *begin() { + JS_ASSERT(!entered); + return mBegin; + } + + const T *begin() const { + JS_ASSERT(!entered); + return mBegin; + } + + T *end() { + JS_ASSERT(!entered); + return mBegin + mLength; + } + + const T *end() const { + JS_ASSERT(!entered); + return mBegin + mLength; + } + + T &operator[](size_t i) { + JS_ASSERT(!entered && i < mLength); + return begin()[i]; + } + + const T &operator[](size_t i) const { + JS_ASSERT(!entered && i < mLength); + return begin()[i]; + } + + T &back() { + JS_ASSERT(!entered && !empty()); + return *(end() - 1); + } + + const T &back() const { + JS_ASSERT(!entered && !empty()); + return *(end() - 1); + } + + class Range { + friend class Vector; + T *cur_, *end_; + Range(T *cur, T *end) : cur_(cur), end_(end) {} + public: + Range() {} + bool empty() const { return cur_ == end_; } + size_t remain() const { return end_ - cur_; } + T &front() const { return *cur_; } + void popFront() { JS_ASSERT(!empty()); ++cur_; } + T popCopyFront() { JS_ASSERT(!empty()); return *cur_++; } + }; + + Range all() { + return Range(begin(), end()); + } + + /* mutators */ + + /* If reserve(length() + N) succeeds, the N next appends are guaranteed to succeed. */ + bool reserve(size_t capacity); + + /* + * Destroy elements in the range [end() - incr, end()). Does not deallocate + * or unreserve storage for those elements. + */ + void shrinkBy(size_t incr); + + /* Grow the vector by incr elements. */ + bool growBy(size_t incr); + + /* Call shrinkBy or growBy based on whether newSize > length(). */ + bool resize(size_t newLength); + + /* Leave new elements as uninitialized memory. */ + bool growByUninitialized(size_t incr); + bool resizeUninitialized(size_t newLength); + + /* Shorthand for shrinkBy(length()). */ + void clear(); + + /* Clears and releases any heap-allocated storage. */ + void clearAndFree(); + + /* If true, appending |needed| elements will not call realloc(). */ + bool canAppendWithoutRealloc(size_t needed) const; + + /* + * Potentially fallible append operations. + * + * The function templates that take an unspecified type U require a + * const T & or a MoveRef. The MoveRef variants move their + * operands into the vector, instead of copying them. If they fail, the + * operand is left unmoved. + */ + template bool append(U t); + bool appendN(const T &t, size_t n); + template bool append(const U *begin, const U *end); + template bool append(const U *begin, size_t length); + template bool append(const Vector &other); + + /* + * Guaranteed-infallible append operations for use upon vectors whose + * memory has been pre-reserved. + */ + void infallibleAppend(const T &t) { + internalAppend(t); + } + void infallibleAppendN(const T &t, size_t n) { + internalAppendN(t, n); + } + template void infallibleAppend(const U *aBegin, const U *aEnd) { + internalAppend(aBegin, mozilla::PointerRangeSize(aBegin, aEnd)); + } + template void infallibleAppend(const U *aBegin, size_t aLength) { + internalAppend(aBegin, aLength); + } + template void infallibleAppend(const Vector &other) { + internalAppend(other); + } + + void popBack(); + + T popCopy(); + + /* + * Transfers ownership of the internal buffer used by Vector to the caller. + * After this call, the Vector is empty. Since the returned buffer may need + * to be allocated (if the elements are currently stored in-place), the + * call can fail, returning NULL. + * + * N.B. Although a T*, only the range [0, length()) is constructed. + */ + T *extractRawBuffer(); + + /* + * Transfer ownership of an array of objects into the Vector. + * N.B. This call assumes that there are no uninitialized elements in the + * passed array. + */ + void replaceRawBuffer(T *p, size_t length); + + /* + * Places |val| at position |p|, shifting existing elements + * from |p| onward one position higher. + */ + bool insert(T *p, const T &val); + + /* + * Removes the element |t|, which must fall in the bounds [begin, end), + * shifting existing elements from |t + 1| onward one position lower. + */ + void erase(T *t); + + /* + * Measure the size of the Vector's heap-allocated storage. + */ + size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const; + + /* + * Like sizeOfExcludingThis, but also measures the size of the Vector + * object (which must be heap-allocated) itself. + */ + size_t sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const; + + void swap(Vector &other); +}; + +/* This does the re-entrancy check plus several other sanity checks. */ +#define REENTRANCY_GUARD_ET_AL \ + ReentrancyGuard g(*this); \ + JS_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); \ + JS_ASSERT(reserved() <= mCapacity); \ + JS_ASSERT(mLength <= reserved()); \ + JS_ASSERT(mLength <= mCapacity) + +/* Vector Implementation */ + +template +JS_ALWAYS_INLINE +Vector::Vector(AllocPolicy ap) + : AllocPolicy(ap), mBegin((T *)storage.addr()), mLength(0), + mCapacity(sInlineCapacity) +#ifdef DEBUG + , mReserved(0), entered(false) +#endif +{} + +/* Move constructor. */ +template +JS_ALWAYS_INLINE +Vector::Vector(MoveRef rhs) + : AllocPolicy(rhs) +#ifdef DEBUG + , entered(false) +#endif +{ + mLength = rhs->mLength; + mCapacity = rhs->mCapacity; +#ifdef DEBUG + mReserved = rhs->mReserved; +#endif + + if (rhs->usingInlineStorage()) { + /* We can't move the buffer over in this case, so copy elements. */ + mBegin = (T *)storage.addr(); + Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck()); + /* + * Leave rhs's mLength, mBegin, mCapacity, and mReserved as they are. + * The elements in its in-line storage still need to be destroyed. + */ + } else { + /* + * Take src's buffer, and turn src into an empty vector using + * in-line storage. + */ + mBegin = rhs->mBegin; + rhs->mBegin = (T *) rhs->storage.addr(); + rhs->mCapacity = sInlineCapacity; + rhs->mLength = 0; +#ifdef DEBUG + rhs->mReserved = 0; +#endif + } +} + +/* Move assignment. */ +template +JS_ALWAYS_INLINE +Vector & +Vector::operator=(MoveRef rhs) +{ + this->~Vector(); + new(this) Vector(rhs); + return *this; +} + +template +JS_ALWAYS_INLINE +Vector::~Vector() +{ + REENTRANCY_GUARD_ET_AL; + Impl::destroy(beginNoCheck(), endNoCheck()); + if (!usingInlineStorage()) + this->free_(beginNoCheck()); +} + +/* + * This function will create a new heap buffer with capacity newCap, + * move all elements in the inline buffer to this new buffer, + * and fail on OOM. + */ +template +inline bool +Vector::convertToHeapStorage(size_t newCap) +{ + JS_ASSERT(usingInlineStorage()); + + /* Allocate buffer. */ + JS_ASSERT(!CapacityHasExcessSpace(newCap)); + T *newBuf = reinterpret_cast(this->malloc_(newCap * sizeof(T))); + if (!newBuf) + return false; + + /* Copy inline elements into heap buffer. */ + Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck()); + Impl::destroy(beginNoCheck(), endNoCheck()); + + /* Switch in heap buffer. */ + mBegin = newBuf; + /* mLength is unchanged. */ + mCapacity = newCap; + return true; +} + +template +JS_NEVER_INLINE bool +Vector::growStorageBy(size_t incr) +{ + JS_ASSERT(mLength + incr > mCapacity); + JS_ASSERT_IF(!usingInlineStorage(), !CapacityHasExcessSpace(mCapacity)); + + /* + * When choosing a new capacity, its size should is as close to 2^N bytes + * as possible. 2^N-sized requests are best because they are unlikely to + * be rounded up by the allocator. Asking for a 2^N number of elements + * isn't as good, because if sizeof(T) is not a power-of-two that would + * result in a non-2^N request size. + */ + + size_t newCap; + + if (incr == 1) { + if (usingInlineStorage()) { + /* This case occurs in ~70--80% of the calls to this function. */ + size_t newSize = tl::RoundUpPow2<(sInlineCapacity + 1) * sizeof(T)>::result; + newCap = newSize / sizeof(T); + goto convert; + } + + if (mLength == 0) { + /* This case occurs in ~0--10% of the calls to this function. */ + newCap = 1; + goto grow; + } + + /* This case occurs in ~15--20% of the calls to this function. */ + + /* + * Will mLength*4*sizeof(T) overflow? This condition limits a Vector + * to 1GB of memory on a 32-bit system, which is a reasonable limit. + * It also ensures that the ((char *)end() - (char *)begin()) does not + * overflow ptrdiff_t (see Bug 510319). + */ + if (mLength & tl::MulOverflowMask<4 * sizeof(T)>::result) { + this->reportAllocOverflow(); + return false; + } + + /* + * If we reach here, the existing capacity will have a size that is + * already as close to 2^N as sizeof(T) will allow. Just double the + * capacity, and then there might be space for one more element. + */ + newCap = mLength * 2; + if (CapacityHasExcessSpace(newCap)) + newCap += 1; + + } else { + /* This case occurs in ~2% of the calls to this function. */ + size_t newMinCap = mLength + incr; + + /* Did mLength+incr overflow? Will newCap*sizeof(T) overflow? */ + if (newMinCap < mLength || + newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::result) + { + this->reportAllocOverflow(); + return false; + } + + size_t newMinSize = newMinCap * sizeof(T); + size_t newSize = RoundUpPow2(newMinSize); + newCap = newSize / sizeof(T); + } + + if (usingInlineStorage()) { + convert: + return convertToHeapStorage(newCap); + } + + grow: + return Impl::growTo(*this, newCap); +} + +template +inline bool +Vector::reserve(size_t request) +{ + REENTRANCY_GUARD_ET_AL; + if (request > mCapacity && !growStorageBy(request - mLength)) + return false; + +#ifdef DEBUG + if (request > mReserved) + mReserved = request; + JS_ASSERT(mLength <= mReserved); + JS_ASSERT(mReserved <= mCapacity); +#endif + return true; +} + +template +inline void +Vector::shrinkBy(size_t incr) +{ + REENTRANCY_GUARD_ET_AL; + JS_ASSERT(incr <= mLength); + Impl::destroy(endNoCheck() - incr, endNoCheck()); + mLength -= incr; +} + +template +template +JS_ALWAYS_INLINE bool +Vector::growByImpl(size_t incr) +{ + REENTRANCY_GUARD_ET_AL; + if (incr > mCapacity - mLength && !growStorageBy(incr)) + return false; + + JS_ASSERT(mLength + incr <= mCapacity); + T *newend = endNoCheck() + incr; + if (InitNewElems) + Impl::initialize(endNoCheck(), newend); + mLength += incr; +#ifdef DEBUG + if (mLength > mReserved) + mReserved = mLength; +#endif + return true; +} + +template +JS_ALWAYS_INLINE bool +Vector::growBy(size_t incr) +{ + return growByImpl(incr); +} + +template +JS_ALWAYS_INLINE bool +Vector::growByUninitialized(size_t incr) +{ + return growByImpl(incr); +} + +template +STATIC_POSTCONDITION(!return || ubound(this->begin()) >= newLength) +inline bool +Vector::resize(size_t newLength) +{ + size_t curLength = mLength; + if (newLength > curLength) + return growBy(newLength - curLength); + shrinkBy(curLength - newLength); + return true; +} + +template +JS_ALWAYS_INLINE bool +Vector::resizeUninitialized(size_t newLength) +{ + size_t curLength = mLength; + if (newLength > curLength) + return growByUninitialized(newLength - curLength); + shrinkBy(curLength - newLength); + return true; +} + +template +inline void +Vector::clear() +{ + REENTRANCY_GUARD_ET_AL; + Impl::destroy(beginNoCheck(), endNoCheck()); + mLength = 0; +} + +template +inline void +Vector::clearAndFree() +{ + clear(); + + if (usingInlineStorage()) + return; + + this->free_(beginNoCheck()); + mBegin = (T *)storage.addr(); + mCapacity = sInlineCapacity; +#ifdef DEBUG + mReserved = 0; +#endif +} + +template +inline bool +Vector::canAppendWithoutRealloc(size_t needed) const +{ + return mLength + needed <= mCapacity; +} + +template +template +JS_ALWAYS_INLINE bool +Vector::append(U t) +{ + REENTRANCY_GUARD_ET_AL; + if (mLength == mCapacity && !growStorageBy(1)) + return false; + +#ifdef DEBUG + if (mLength + 1 > mReserved) + mReserved = mLength + 1; +#endif + internalAppend(t); + return true; +} + +template +template +JS_ALWAYS_INLINE void +Vector::internalAppend(U t) +{ + JS_ASSERT(mLength + 1 <= mReserved); + JS_ASSERT(mReserved <= mCapacity); + new(endNoCheck()) T(t); + ++mLength; +} + +template +JS_ALWAYS_INLINE bool +Vector::appendN(const T &t, size_t needed) +{ + REENTRANCY_GUARD_ET_AL; + if (mLength + needed > mCapacity && !growStorageBy(needed)) + return false; + +#ifdef DEBUG + if (mLength + needed > mReserved) + mReserved = mLength + needed; +#endif + internalAppendN(t, needed); + return true; +} + +template +JS_ALWAYS_INLINE void +Vector::internalAppendN(const T &t, size_t needed) +{ + JS_ASSERT(mLength + needed <= mReserved); + JS_ASSERT(mReserved <= mCapacity); + Impl::copyConstructN(endNoCheck(), needed, t); + mLength += needed; +} + +template +inline bool +Vector::insert(T *p, const T &val) +{ + JS_ASSERT(begin() <= p && p <= end()); + size_t pos = p - begin(); + JS_ASSERT(pos <= mLength); + size_t oldLength = mLength; + if (pos == oldLength) + return append(val); + { + T oldBack = back(); + if (!append(oldBack)) /* Dup the last element. */ + return false; + } + for (size_t i = oldLength; i > pos; --i) + (*this)[i] = (*this)[i - 1]; + (*this)[pos] = val; + return true; +} + +template +inline void +Vector::erase(T *it) +{ + JS_ASSERT(begin() <= it && it < end()); + while (it + 1 != end()) { + *it = *(it + 1); + ++it; + } + popBack(); +} + +template +template +JS_ALWAYS_INLINE bool +Vector::append(const U *insBegin, const U *insEnd) +{ + REENTRANCY_GUARD_ET_AL; + size_t needed = mozilla::PointerRangeSize(insBegin, insEnd); + if (mLength + needed > mCapacity && !growStorageBy(needed)) + return false; + +#ifdef DEBUG + if (mLength + needed > mReserved) + mReserved = mLength + needed; +#endif + internalAppend(insBegin, needed); + return true; +} + +template +template +JS_ALWAYS_INLINE void +Vector::internalAppend(const U *insBegin, size_t insLength) +{ + JS_ASSERT(mLength + insLength <= mReserved); + JS_ASSERT(mReserved <= mCapacity); + Impl::copyConstruct(endNoCheck(), insBegin, insBegin + insLength); + mLength += insLength; +} + +template +template +inline bool +Vector::append(const Vector &other) +{ + return append(other.begin(), other.end()); +} + +template +template +inline void +Vector::internalAppend(const Vector &other) +{ + internalAppend(other.begin(), other.length()); +} + +template +template +JS_ALWAYS_INLINE bool +Vector::append(const U *insBegin, size_t insLength) +{ + return this->append(insBegin, insBegin + insLength); +} + +template +JS_ALWAYS_INLINE void +Vector::popBack() +{ + REENTRANCY_GUARD_ET_AL; + JS_ASSERT(!empty()); + --mLength; + endNoCheck()->~T(); +} + +template +JS_ALWAYS_INLINE T +Vector::popCopy() +{ + T ret = back(); + popBack(); + return ret; +} + +template +inline T * +Vector::extractRawBuffer() +{ + T *ret; + if (usingInlineStorage()) { + ret = reinterpret_cast(this->malloc_(mLength * sizeof(T))); + if (!ret) + return NULL; + Impl::copyConstruct(ret, beginNoCheck(), endNoCheck()); + Impl::destroy(beginNoCheck(), endNoCheck()); + /* mBegin, mCapacity are unchanged. */ + mLength = 0; + } else { + ret = mBegin; + mBegin = (T *)storage.addr(); + mLength = 0; + mCapacity = sInlineCapacity; +#ifdef DEBUG + mReserved = 0; +#endif + } + return ret; +} + +template +inline void +Vector::replaceRawBuffer(T *p, size_t aLength) +{ + REENTRANCY_GUARD_ET_AL; + + /* Destroy what we have. */ + Impl::destroy(beginNoCheck(), endNoCheck()); + if (!usingInlineStorage()) + this->free_(beginNoCheck()); + + /* Take in the new buffer. */ + if (aLength <= sInlineCapacity) { + /* + * We convert to inline storage if possible, even though p might + * otherwise be acceptable. Maybe this behaviour should be + * specifiable with an argument to this function. + */ + mBegin = (T *)storage.addr(); + mLength = aLength; + mCapacity = sInlineCapacity; + Impl::moveConstruct(mBegin, p, p + aLength); + Impl::destroy(p, p + aLength); + this->free_(p); + } else { + mBegin = p; + mLength = aLength; + mCapacity = aLength; + } +#ifdef DEBUG + mReserved = aLength; +#endif +} + +template +inline size_t +Vector::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf) const +{ + return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck()); +} + +template +inline size_t +Vector::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const +{ + return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf); +} + +template +inline void +Vector::swap(Vector &other) +{ + // TODO Implement N != 0 + JS_STATIC_ASSERT(N == 0); + + // This only works when inline storage is always empty. + if (!usingInlineStorage() && other.usingInlineStorage()) { + other.mBegin = mBegin; + mBegin = inlineStorage(); + } else if (usingInlineStorage() && !other.usingInlineStorage()) { + mBegin = other.mBegin; + other.mBegin = other.inlineStorage(); + } else if (!usingInlineStorage() && !other.usingInlineStorage()) { + Swap(mBegin, other.mBegin); + } else { + // This case is a no-op, since we'd set both to use their inline storage. + } + + Swap(mLength, other.mLength); + Swap(mCapacity, other.mCapacity); +#ifdef DEBUG + Swap(mReserved, other.mReserved); +#endif +} + +} /* namespace js */ + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif /* jsvector_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsalloc.h b/scripting/javascript/spidermonkey-mac/include/jsalloc.h new file mode 100644 index 0000000000..7d76a7c701 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsalloc.h @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsalloc_h_ +#define jsalloc_h_ + +#include "jsutil.h" + +namespace js { + +/* + * Allocation policies. These model the concept: + * - public copy constructor, assignment, destructor + * - void *malloc_(size_t) + * Responsible for OOM reporting on NULL return value. + * - void *calloc_(size_t) + * Responsible for OOM reporting on NULL return value. + * - void *realloc_(size_t) + * Responsible for OOM reporting on NULL return value. + * The *used* bytes of the previous buffer is passed in + * (rather than the old allocation size), in addition to + * the *new* allocation size requested. + * - void free_(void *) + * - reportAllocOverflow() + * Called on overflow before the container returns NULL. + */ + +/* Policy for using system memory functions and doing no error reporting. */ +class SystemAllocPolicy +{ + public: + void *malloc_(size_t bytes) { return js_malloc(bytes); } + void *calloc_(size_t bytes) { return js_calloc(bytes); } + void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); } + void free_(void *p) { js_free(p); } + void reportAllocOverflow() const {} +}; + +/* + * Allocation policy that calls the system memory functions and reports errors + * to the context. Since the JSContext given on construction is stored for + * the lifetime of the container, this policy may only be used for containers + * whose lifetime is a shorter than the given JSContext. + * + * FIXME bug 647103 - rewrite this in terms of temporary allocation functions, + * not the system ones. + */ +class TempAllocPolicy +{ + JSContext *const cx_; + + /* + * Non-inline helper to call JSRuntime::onOutOfMemory with minimal + * code bloat. + */ + JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes); + + public: + TempAllocPolicy(JSContext *cx) : cx_(cx) {} + + JSContext *context() const { + return cx_; + } + + void *malloc_(size_t bytes) { + void *p = js_malloc(bytes); + if (JS_UNLIKELY(!p)) + p = onOutOfMemory(NULL, bytes); + return p; + } + + void *calloc_(size_t bytes) { + void *p = js_calloc(bytes); + if (JS_UNLIKELY(!p)) + p = onOutOfMemory(NULL, bytes); + return p; + } + + void *realloc_(void *p, size_t oldBytes, size_t bytes) { + void *p2 = js_realloc(p, bytes); + if (JS_UNLIKELY(!p2)) + p2 = onOutOfMemory(p2, bytes); + return p2; + } + + void free_(void *p) { + js_free(p); + } + + JS_FRIEND_API(void) reportAllocOverflow() const; +}; + +} /* namespace js */ + +#endif /* jsalloc_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id b/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id new file mode 100644 index 0000000000..91ec3c73fe --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id @@ -0,0 +1 @@ +c21bc2527f0aff3248f11faab8102827c3728aab \ No newline at end of file diff --git a/scripting/javascript/spidermonkey-mac/include/jsclass.h b/scripting/javascript/spidermonkey-mac/include/jsclass.h new file mode 100644 index 0000000000..71aabc50f7 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsclass.h @@ -0,0 +1,401 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsclass_h__ +#define jsclass_h__ +/* + * A JSClass acts as a vtable for JS objects that allows JSAPI clients to + * control various aspects of the behavior of an object like property lookup. + * js::Class is an engine-private extension that allows more control over + * object behavior and, e.g., allows custom slow layout. + */ +#include "jsapi.h" +#include "jsprvtd.h" + +#ifdef __cplusplus + +namespace js { + +class PropertyName; +class SpecialId; +class PropertyId; + +static JS_ALWAYS_INLINE jsid +SPECIALID_TO_JSID(const SpecialId &sid); + +/* + * We partition the ways to refer to a property into three: by an index + * (uint32_t); by a string whose characters do not represent an index + * (PropertyName, see vm/String.h); and by various special values. + * + * Special values are encoded using SpecialId, which is layout-compatible but + * non-interconvertible with jsid. A SpecialId is used for JSID_VOID, which + * does not occur in JS scripts but may be used to indicate the absence of a + * valid identifier. In the future, a SpecialId may also be an object used by + * Harmony-proposed private names. + */ +class SpecialId +{ + uintptr_t bits_; + + /* Needs access to raw bits. */ + friend JS_ALWAYS_INLINE jsid SPECIALID_TO_JSID(const SpecialId &sid); + friend class PropertyId; + + static const uintptr_t TYPE_VOID = JSID_TYPE_VOID; + static const uintptr_t TYPE_OBJECT = JSID_TYPE_OBJECT; + static const uintptr_t TYPE_MASK = JSID_TYPE_MASK; + + SpecialId(uintptr_t bits) : bits_(bits) { } + + public: + SpecialId() : bits_(TYPE_VOID) { } + + /* Object-valued */ + + SpecialId(JSObject &obj) + : bits_(uintptr_t(&obj) | TYPE_OBJECT) + { + JS_ASSERT(&obj != NULL); + JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0); + } + + bool isObject() const { + return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT; + } + + JSObject *toObject() const { + JS_ASSERT(isObject()); + return reinterpret_cast(bits_ & ~TYPE_MASK); + } + + /* Empty */ + + static SpecialId empty() { + SpecialId sid(TYPE_OBJECT); + JS_ASSERT(sid.isEmpty()); + return sid; + } + + bool isEmpty() const { + return bits_ == TYPE_OBJECT; + } + + /* Void */ + + static SpecialId voidId() { + SpecialId sid(TYPE_VOID); + JS_ASSERT(sid.isVoid()); + return sid; + } + + bool isVoid() const { + return bits_ == TYPE_VOID; + } +}; + +static JS_ALWAYS_INLINE jsid +SPECIALID_TO_JSID(const SpecialId &sid) +{ + jsid id; + JSID_BITS(id) = sid.bits_; + JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject()); + JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id)); + JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id)); + return id; +} + +static JS_ALWAYS_INLINE bool +JSID_IS_SPECIAL(jsid id) +{ + return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id); +} + +static JS_ALWAYS_INLINE SpecialId +JSID_TO_SPECIALID(jsid id) +{ + JS_ASSERT(JSID_IS_SPECIAL(id)); + if (JSID_IS_OBJECT(id)) + return SpecialId(*JSID_TO_OBJECT(id)); + if (JSID_IS_EMPTY(id)) + return SpecialId::empty(); + JS_ASSERT(JSID_IS_VOID(id)); + return SpecialId::voidId(); +} + +typedef JS::Handle HandleSpecialId; + +/* js::Class operation signatures. */ + +typedef JSBool +(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id, + MutableHandleObject objp, MutableHandleShape propp); +typedef JSBool +(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, + MutableHandleObject objp, MutableHandleShape propp); +typedef JSBool +(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index, + MutableHandleObject objp, MutableHandleShape propp); +typedef JSBool +(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, + MutableHandleObject objp, MutableHandleShape propp); +typedef JSBool +(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); +typedef JSBool +(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); +typedef JSBool +(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); +typedef JSBool +(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value, + PropertyOp getter, StrictPropertyOp setter, unsigned attrs); +typedef JSBool +(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp); +typedef JSBool +(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp); +typedef JSBool +(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp); +typedef JSBool +(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present); +typedef JSBool +(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp); +typedef JSBool +(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict); +typedef JSBool +(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict); +typedef JSBool +(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict); +typedef JSBool +(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict); +typedef JSBool +(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp); +typedef JSBool +(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp); +typedef JSBool +(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp); +typedef JSBool +(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp); +typedef JSBool +(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict); +typedef JSBool +(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict); +typedef JSBool +(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict); + + +typedef JSObject * +(* ObjectOp)(JSContext *cx, HandleObject obj); +typedef void +(* FinalizeOp)(FreeOp *fop, RawObject obj); + +#define JS_CLASS_MEMBERS \ + const char *name; \ + uint32_t flags; \ + \ + /* Mandatory non-null function pointer members. */ \ + JSPropertyOp addProperty; \ + JSPropertyOp delProperty; \ + JSPropertyOp getProperty; \ + JSStrictPropertyOp setProperty; \ + JSEnumerateOp enumerate; \ + JSResolveOp resolve; \ + JSConvertOp convert; \ + FinalizeOp finalize; \ + \ + /* Optionally non-null members start here. */ \ + JSCheckAccessOp checkAccess; \ + JSNative call; \ + JSHasInstanceOp hasInstance; \ + JSNative construct; \ + JSTraceOp trace + +/* + * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much + * we have to padd js::Class to match the size of JSClass; + */ +struct ClassSizeMeasurement +{ + JS_CLASS_MEMBERS; +}; + +struct ClassExtension +{ + JSObjectOp outerObject; + JSObjectOp innerObject; + JSIteratorOp iteratorObject; + + /* + * isWrappedNative is true only if the class is an XPCWrappedNative. + * WeakMaps use this to override the wrapper disposal optimization. + */ + bool isWrappedNative; + + /* + * If an object is used as a key in a weakmap, it may be desirable for the + * garbage collector to keep that object around longer than it otherwise + * would. A common case is when the key is a wrapper around an object in + * another compartment, and we want to avoid collecting the wrapper (and + * removing the weakmap entry) as long as the wrapped object is alive. In + * that case, the wrapped object is returned by the wrapper's + * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap + * key, it will not be collected (and remain in the weakmap) until the + * wrapped object is collected. + */ + JSWeakmapKeyDelegateOp weakmapKeyDelegateOp; +}; + +#define JS_NULL_CLASS_EXT {NULL,NULL,NULL,false,NULL} + +struct ObjectOps +{ + LookupGenericOp lookupGeneric; + LookupPropOp lookupProperty; + LookupElementOp lookupElement; + LookupSpecialOp lookupSpecial; + DefineGenericOp defineGeneric; + DefinePropOp defineProperty; + DefineElementOp defineElement; + DefineSpecialOp defineSpecial; + GenericIdOp getGeneric; + PropertyIdOp getProperty; + ElementIdOp getElement; + ElementIfPresentOp getElementIfPresent; /* can be null */ + SpecialIdOp getSpecial; + StrictGenericIdOp setGeneric; + StrictPropertyIdOp setProperty; + StrictElementIdOp setElement; + StrictSpecialIdOp setSpecial; + GenericAttributesOp getGenericAttributes; + PropertyAttributesOp getPropertyAttributes; + ElementAttributesOp getElementAttributes; + SpecialAttributesOp getSpecialAttributes; + GenericAttributesOp setGenericAttributes; + PropertyAttributesOp setPropertyAttributes; + ElementAttributesOp setElementAttributes; + SpecialAttributesOp setSpecialAttributes; + DeletePropertyOp deleteProperty; + DeleteElementOp deleteElement; + DeleteSpecialOp deleteSpecial; + + JSNewEnumerateOp enumerate; + ObjectOp thisObject; +}; + +#define JS_NULL_OBJECT_OPS \ + {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, \ + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, \ + NULL,NULL,NULL} + +struct Class +{ + JS_CLASS_MEMBERS; + ClassExtension ext; + ObjectOps ops; + uint8_t pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) - + sizeof(ClassExtension) - sizeof(ObjectOps)]; + + /* Class is not native and its map is not a scope. */ + static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2; + + bool isNative() const { + return !(flags & NON_NATIVE); + } + + bool hasPrivate() const { + return !!(flags & JSCLASS_HAS_PRIVATE); + } + + bool emulatesUndefined() const { + return flags & JSCLASS_EMULATES_UNDEFINED; + } + + static size_t offsetOfFlags() { return offsetof(Class, flags); } +}; + +JS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name)); +JS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags)); +JS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty)); +JS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty)); +JS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty)); +JS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty)); +JS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate)); +JS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve)); +JS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert)); +JS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize)); +JS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess)); +JS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call)); +JS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct)); +JS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance)); +JS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace)); +JS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class)); + +static JS_ALWAYS_INLINE JSClass * +Jsvalify(Class *c) +{ + return (JSClass *)c; +} +static JS_ALWAYS_INLINE const JSClass * +Jsvalify(const Class *c) +{ + return (const JSClass *)c; +} + +static JS_ALWAYS_INLINE Class * +Valueify(JSClass *c) +{ + return (Class *)c; +} +static JS_ALWAYS_INLINE const Class * +Valueify(const JSClass *c) +{ + return (const Class *)c; +} + +/* + * Enumeration describing possible values of the [[Class]] internal property + * value of objects. + */ +enum ESClassValue { + ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean, + ESClass_RegExp, ESClass_ArrayBuffer +}; + +/* + * Return whether the given object has the given [[Class]] internal property + * value. Beware, this query says nothing about the js::Class of the JSObject + * so the caller must not assume anything about obj's representation (e.g., obj + * may be a proxy). + */ +inline bool +ObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx); + +/* Just a helper that checks v.isObject before calling ObjectClassIs. */ +inline bool +IsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx); + +inline bool +IsPoisonedSpecialId(js::SpecialId iden) +{ + if (iden.isObject()) + return IsPoisonedPtr(iden.toObject()); + return false; +} + +template <> struct RootMethods +{ + static SpecialId initial() { return SpecialId(); } + static ThingRootKind kind() { return THING_ROOT_ID; } + static bool poisoned(SpecialId id) { return IsPoisonedSpecialId(id); } +}; + +} /* namespace js */ + +#endif /* __cplusplus */ + +#endif /* jsclass_h__ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsclist.h b/scripting/javascript/spidermonkey-mac/include/jsclist.h new file mode 100644 index 0000000000..4881104eee --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsclist.h @@ -0,0 +1,106 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsclist_h___ +#define jsclist_h___ + +#include "jstypes.h" + +/* +** Circular linked list +*/ +typedef struct JSCListStr { + struct JSCListStr *next; + struct JSCListStr *prev; +} JSCList; + +/* +** Insert element "_e" into the list, before "_l". +*/ +#define JS_INSERT_BEFORE(_e,_l) \ + JS_BEGIN_MACRO \ + (_e)->next = (_l); \ + (_e)->prev = (_l)->prev; \ + (_l)->prev->next = (_e); \ + (_l)->prev = (_e); \ + JS_END_MACRO + +/* +** Insert element "_e" into the list, after "_l". +*/ +#define JS_INSERT_AFTER(_e,_l) \ + JS_BEGIN_MACRO \ + (_e)->next = (_l)->next; \ + (_e)->prev = (_l); \ + (_l)->next->prev = (_e); \ + (_l)->next = (_e); \ + JS_END_MACRO + +/* +** Return the element following element "_e" +*/ +#define JS_NEXT_LINK(_e) \ + ((_e)->next) +/* +** Return the element preceding element "_e" +*/ +#define JS_PREV_LINK(_e) \ + ((_e)->prev) + +/* +** Append an element "_e" to the end of the list "_l" +*/ +#define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l) + +/* +** Insert an element "_e" at the head of the list "_l" +*/ +#define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l) + +/* Return the head/tail of the list */ +#define JS_LIST_HEAD(_l) (_l)->next +#define JS_LIST_TAIL(_l) (_l)->prev + +/* +** Remove the element "_e" from it's circular list. +*/ +#define JS_REMOVE_LINK(_e) \ + JS_BEGIN_MACRO \ + (_e)->prev->next = (_e)->next; \ + (_e)->next->prev = (_e)->prev; \ + JS_END_MACRO + +/* +** Remove the element "_e" from it's circular list. Also initializes the +** linkage. +*/ +#define JS_REMOVE_AND_INIT_LINK(_e) \ + JS_BEGIN_MACRO \ + (_e)->prev->next = (_e)->next; \ + (_e)->next->prev = (_e)->prev; \ + (_e)->next = (_e); \ + (_e)->prev = (_e); \ + JS_END_MACRO + +/* +** Return non-zero if the given circular list "_l" is empty, zero if the +** circular list is not empty +*/ +#define JS_CLIST_IS_EMPTY(_l) \ + ((_l)->next == (_l)) + +/* +** Initialize a circular list +*/ +#define JS_INIT_CLIST(_l) \ + JS_BEGIN_MACRO \ + (_l)->next = (_l); \ + (_l)->prev = (_l); \ + JS_END_MACRO + +#define JS_INIT_STATIC_CLIST(_l) \ + {(_l), (_l)} + +#endif /* jsclist_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jscpucfg.h b/scripting/javascript/spidermonkey-mac/include/jscpucfg.h new file mode 100644 index 0000000000..3d2022dbe2 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jscpucfg.h @@ -0,0 +1,121 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef js_cpucfg___ +#define js_cpucfg___ + +#define JS_HAVE_LONG_LONG + +#if defined(_WIN64) + +# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) +# define IS_LITTLE_ENDIAN 1 +# undef IS_BIG_ENDIAN +# define JS_BYTES_PER_DOUBLE 8 +# define JS_BYTES_PER_WORD 8 +# define JS_BITS_PER_WORD_LOG2 6 +# define JS_ALIGN_OF_POINTER 8 +# else /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */ +# error "CPU type is unknown" +# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */ + +#elif defined(_WIN32) || defined(XP_OS2) + +# ifdef __WATCOMC__ +# define HAVE_VA_LIST_AS_ARRAY 1 +# endif + +# define IS_LITTLE_ENDIAN 1 +# undef IS_BIG_ENDIAN +# define JS_BYTES_PER_DOUBLE 8 +# define JS_BYTES_PER_WORD 4 +# define JS_BITS_PER_WORD_LOG2 5 +# define JS_ALIGN_OF_POINTER 4 + +#elif defined(__APPLE__) +# if __LITTLE_ENDIAN__ +# define IS_LITTLE_ENDIAN 1 +# undef IS_BIG_ENDIAN +# elif __BIG_ENDIAN__ +# undef IS_LITTLE_ENDIAN +# define IS_BIG_ENDIAN 1 +# endif + +#elif defined(JS_HAVE_ENDIAN_H) +# include + +# if defined(__BYTE_ORDER) +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define IS_LITTLE_ENDIAN 1 +# undef IS_BIG_ENDIAN +# elif __BYTE_ORDER == __BIG_ENDIAN +# undef IS_LITTLE_ENDIAN +# define IS_BIG_ENDIAN 1 +# endif +# else /* !defined(__BYTE_ORDER) */ +# error "endian.h does not define __BYTE_ORDER. Cannot determine endianness." +# endif + +/* BSDs */ +#elif defined(JS_HAVE_MACHINE_ENDIAN_H) +# include +# include + +# if defined(_BYTE_ORDER) +# if _BYTE_ORDER == _LITTLE_ENDIAN +# define IS_LITTLE_ENDIAN 1 +# undef IS_BIG_ENDIAN +# elif _BYTE_ORDER == _BIG_ENDIAN +# undef IS_LITTLE_ENDIAN +# define IS_BIG_ENDIAN 1 +# endif +# else /* !defined(_BYTE_ORDER) */ +# error "machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness." +# endif + +#elif defined(JS_HAVE_SYS_ISA_DEFS_H) +# include + +# if defined(_BIG_ENDIAN) +# undef IS_LITTLE_ENDIAN +# define IS_BIG_ENDIAN 1 +# elif defined(_LITTLE_ENDIAN) +# define IS_LITTLE_ENDIAN 1 +# undef IS_BIG_ENDIAN +# else /* !defined(_LITTLE_ENDIAN) */ +# error "sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness." +# endif +# if !defined(JS_STACK_GROWTH_DIRECTION) +# if defined(_STACK_GROWS_UPWARD) +# define JS_STACK_GROWTH_DIRECTION (1) +# elif defined(_STACK_GROWS_DOWNWARD) +# define JS_STACK_GROWTH_DIRECTION (-1) +# endif +# endif + +#elif defined(__sparc) || defined(__sparc__) || \ + defined(_POWER) || defined(__powerpc__) || \ + defined(__ppc__) || defined(__hppa) || \ + defined(_MIPSEB) || defined(_BIG_ENDIAN) +/* IA64 running HP-UX will have _BIG_ENDIAN defined. + * IA64 running Linux will have endian.h and be handled above. + */ +# undef IS_LITTLE_ENDIAN +# define IS_BIG_ENDIAN 1 + +#else /* !defined(__sparc) && !defined(__sparc__) && ... */ +# error "Cannot determine endianness of your platform. Please add support to jscpucfg.h." +#endif + +#ifndef JS_STACK_GROWTH_DIRECTION +# ifdef __hppa +# define JS_STACK_GROWTH_DIRECTION (1) +# else +# define JS_STACK_GROWTH_DIRECTION (-1) +# endif +#endif + +#endif /* js_cpucfg___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h b/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h new file mode 100644 index 0000000000..195e900b27 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h @@ -0,0 +1,486 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsdbgapi_h___ +#define jsdbgapi_h___ +/* + * JS debugger API. + */ +#include "jsapi.h" +#include "jsprvtd.h" + +namespace JS { + +struct FrameDescription +{ + JSScript *script; + unsigned lineno; + JSFunction *fun; +}; + +struct StackDescription +{ + unsigned nframes; + FrameDescription *frames; +}; + +extern JS_PUBLIC_API(StackDescription *) +DescribeStack(JSContext *cx, unsigned maxFrames); + +extern JS_PUBLIC_API(void) +FreeStackDescription(JSContext *cx, StackDescription *desc); + +extern JS_PUBLIC_API(char *) +FormatStackDump(JSContext *cx, char *buf, + JSBool showArgs, JSBool showLocals, + JSBool showThisProps); + +} + +# ifdef DEBUG +JS_FRIEND_API(void) js_DumpValue(const js::Value &val); +JS_FRIEND_API(void) js_DumpId(jsid id); +JS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL); +# endif + +JS_FRIEND_API(void) +js_DumpBacktrace(JSContext *cx); + +extern JS_PUBLIC_API(JSCompartment *) +JS_EnterCompartmentOfScript(JSContext *cx, JSScript *target); + +extern JS_PUBLIC_API(JSString *) +JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent); + +/* + * Currently, we only support runtime-wide debugging. In the future, we should + * be able to support compartment-wide debugging. + */ +extern JS_PUBLIC_API(void) +JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug); + +/* + * Debug mode is a compartment-wide mode that enables a debugger to attach + * to and interact with running methodjit-ed frames. In particular, it causes + * every function to be compiled as if an eval was present (so eval-in-frame) + * can work, and it ensures that functions can be re-JITed for other debug + * features. In general, it is not safe to interact with frames that were live + * before debug mode was enabled. For this reason, it is also not safe to + * enable debug mode while frames are live. + */ + +/* Get current state of debugging mode. */ +extern JS_PUBLIC_API(JSBool) +JS_GetDebugMode(JSContext *cx); + +/* + * Turn on/off debugging mode for all compartments. This returns false if any code + * from any of the runtime's compartments is running or on the stack. + */ +JS_FRIEND_API(JSBool) +JS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug); + +/* + * Turn on/off debugging mode for a single compartment. This should only be + * used when no code from this compartment is running or on the stack in any + * thread. + */ +JS_FRIEND_API(JSBool) +JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug); + +/* + * Turn on/off debugging mode for a context's compartment. + */ +JS_FRIEND_API(JSBool) +JS_SetDebugMode(JSContext *cx, JSBool debug); + +/* Turn on single step mode. */ +extern JS_PUBLIC_API(JSBool) +JS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep); + +/* The closure argument will be marked. */ +extern JS_PUBLIC_API(JSBool) +JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc, + JSTrapHandler handler, jsval closure); + +extern JS_PUBLIC_API(void) +JS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc, + JSTrapHandler *handlerp, jsval *closurep); + +extern JS_PUBLIC_API(void) +JS_ClearScriptTraps(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(void) +JS_ClearAllTrapsForCompartment(JSContext *cx); + +extern JS_PUBLIC_API(JSBool) +JS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure); + +extern JS_PUBLIC_API(JSBool) +JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep); + +/************************************************************************/ + +extern JS_PUBLIC_API(JSBool) +JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id, + JSWatchPointHandler handler, JSObject *closure); + +extern JS_PUBLIC_API(JSBool) +JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id, + JSWatchPointHandler *handlerp, JSObject **closurep); + +extern JS_PUBLIC_API(JSBool) +JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj); + +extern JS_PUBLIC_API(JSBool) +JS_ClearAllWatchPoints(JSContext *cx); + +/************************************************************************/ + +// RawScript because this needs to be callable from a signal handler +extern JS_PUBLIC_API(unsigned) +JS_PCToLineNumber(JSContext *cx, js::RawScript script, jsbytecode *pc); + +extern JS_PUBLIC_API(jsbytecode *) +JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno); + +extern JS_PUBLIC_API(jsbytecode *) +JS_EndPC(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(JSBool) +JS_GetLinePCs(JSContext *cx, JSScript *script, + unsigned startLine, unsigned maxLines, + unsigned* count, unsigned** lines, jsbytecode*** pcs); + +extern JS_PUBLIC_API(unsigned) +JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun); + +extern JS_PUBLIC_API(JSBool) +JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun); + +/* + * N.B. The mark is in the context temp pool and thus the caller must take care + * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other + * call that may use the temp pool. + */ +extern JS_PUBLIC_API(uintptr_t *) +JS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp); + +extern JS_PUBLIC_API(JSAtom *) +JS_LocalNameToAtom(uintptr_t w); + +extern JS_PUBLIC_API(JSString *) +JS_AtomKey(JSAtom *atom); + +extern JS_PUBLIC_API(void) +JS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark); + +extern JS_PUBLIC_API(JSScript *) +JS_GetFunctionScript(JSContext *cx, JSFunction *fun); + +extern JS_PUBLIC_API(JSNative) +JS_GetFunctionNative(JSContext *cx, JSFunction *fun); + +extern JS_PUBLIC_API(JSPrincipals *) +JS_GetScriptPrincipals(JSScript *script); + +extern JS_PUBLIC_API(JSPrincipals *) +JS_GetScriptOriginPrincipals(JSScript *script); + +JS_PUBLIC_API(JSFunction *) +JS_GetScriptFunction(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(JSObject *) +JS_GetParentOrScopeChain(JSContext *cx, JSObject *obj); + +/************************************************************************/ + +/* + * This is almost JS_GetClass(obj)->name except that certain debug-only + * proxies are made transparent. In particular, this function turns the class + * of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject) + * from "Proxy" to "Call", "Block", "With" etc. + */ +extern JS_PUBLIC_API(const char *) +JS_GetDebugClassName(JSObject *obj); + +/************************************************************************/ + +extern JS_PUBLIC_API(const char *) +JS_GetScriptFilename(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(const jschar *) +JS_GetScriptSourceMap(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(unsigned) +JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(unsigned) +JS_GetScriptLineExtent(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(JSVersion) +JS_GetScriptVersion(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(bool) +JS_GetScriptUserBit(JSScript *script); + +extern JS_PUBLIC_API(void) +JS_SetScriptUserBit(JSScript *script, bool b); + +extern JS_PUBLIC_API(bool) +JS_GetScriptIsSelfHosted(JSScript *script); + +/************************************************************************/ + +/* + * Hook setters for script creation and destruction, see jsprvtd.h for the + * typedefs. These macros provide binary compatibility and newer, shorter + * synonyms. + */ +#define JS_SetNewScriptHook JS_SetNewScriptHookProc +#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc + +extern JS_PUBLIC_API(void) +JS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata); + +extern JS_PUBLIC_API(void) +JS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook, + void *callerdata); + +/************************************************************************/ + +typedef struct JSPropertyDesc { + jsval id; /* primary id, atomized string, or int */ + jsval value; /* property value */ + uint8_t flags; /* flags, see below */ + uint8_t spare; /* unused */ + jsval alias; /* alias id if JSPD_ALIAS flag */ +} JSPropertyDesc; + +#define JSPD_ENUMERATE 0x01 /* visible to for/in loop */ +#define JSPD_READONLY 0x02 /* assignment is error */ +#define JSPD_PERMANENT 0x04 /* property cannot be deleted */ +#define JSPD_ALIAS 0x08 /* property has an alias id */ +#define JSPD_EXCEPTION 0x40 /* exception occurred fetching the property, */ + /* value is exception */ +#define JSPD_ERROR 0x80 /* native getter returned JS_FALSE without */ + /* throwing an exception */ + +typedef struct JSPropertyDescArray { + uint32_t length; /* number of elements in array */ + JSPropertyDesc *array; /* alloc'd by Get, freed by Put */ +} JSPropertyDescArray; + +typedef struct JSScopeProperty JSScopeProperty; + +extern JS_PUBLIC_API(JSBool) +JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda); + +extern JS_PUBLIC_API(void) +JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda); + +/************************************************************************/ + +/* + * JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a + * StackFrame or baseline JIT frame. + */ +class JS_PUBLIC_API(JSAbstractFramePtr) +{ + uintptr_t ptr_; + + protected: + JSAbstractFramePtr() + : ptr_(0) + { } + + public: + explicit JSAbstractFramePtr(void *raw); + + uintptr_t raw() const { return ptr_; } + + operator bool() const { return !!ptr_; } + + JSObject *scopeChain(JSContext *cx); + JSObject *callObject(JSContext *cx); + + JSFunction *maybeFun(); + JSScript *script(); + + bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv); + + bool isDebuggerFrame(); + + bool evaluateInStackFrame(JSContext *cx, + const char *bytes, unsigned length, + const char *filename, unsigned lineno, + JS::MutableHandleValue rval); + + bool evaluateUCInStackFrame(JSContext *cx, + const jschar *chars, unsigned length, + const char *filename, unsigned lineno, + JS::MutableHandleValue rval); +}; + +class JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr +{ + public: + JSNullFramePtr() + : JSAbstractFramePtr() + {} +}; + +/* + * This class does not work when IonMonkey is active. It's only used by jsd, + * which can only be used when IonMonkey is disabled. + * + * To find the calling script and line number, use JS_DescribeSciptedCaller. + * To summarize the call stack, use JS::DescribeStack. + */ +class JS_PUBLIC_API(JSBrokenFrameIterator) +{ + void *data_; + + public: + JSBrokenFrameIterator(JSContext *cx); + ~JSBrokenFrameIterator(); + + bool done() const; + JSBrokenFrameIterator& operator++(); + + JSAbstractFramePtr abstractFramePtr() const; + jsbytecode *pc() const; + + bool isConstructing() const; +}; + +/* + * This hook captures high level script execution and function calls (JS or + * native). It is used by JS_SetExecuteHook to hook top level scripts and by + * JS_SetCallHook to hook function calls. It will get called twice per script + * or function call: just before execution begins and just after it finishes. + * In both cases the 'current' frame is that of the executing code. + * + * The 'before' param is JS_TRUE for the hook invocation before the execution + * and JS_FALSE for the invocation after the code has run. + * + * The 'ok' param is significant only on the post execution invocation to + * signify whether or not the code completed 'normally'. + * + * The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook + * for the 'before'invocation, but is whatever value is returned from that + * invocation for the 'after' invocation. Thus, the hook implementor *could* + * allocate a structure in the 'before' invocation and return a pointer to that + * structure. The pointer would then be handed to the hook for the 'after' + * invocation. Alternately, the 'before' could just return the same value as + * in 'closure' to cause the 'after' invocation to be called with the same + * 'closure' value as the 'before'. + * + * Returning NULL in the 'before' hook will cause the 'after' hook *not* to + * be called. + */ +typedef void * +(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing, + JSBool before, JSBool *ok, void *closure); + +typedef JSBool +(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report, + void *closure); + +typedef struct JSDebugHooks { + JSInterruptHook interruptHook; + void *interruptHookData; + JSNewScriptHook newScriptHook; + void *newScriptHookData; + JSDestroyScriptHook destroyScriptHook; + void *destroyScriptHookData; + JSDebuggerHandler debuggerHandler; + void *debuggerHandlerData; + JSSourceHandler sourceHandler; + void *sourceHandlerData; + JSInterpreterHook executeHook; + void *executeHookData; + JSInterpreterHook callHook; + void *callHookData; + JSThrowHook throwHook; + void *throwHookData; + JSDebugErrorHook debugErrorHook; + void *debugErrorHookData; +} JSDebugHooks; + +/************************************************************************/ + +extern JS_PUBLIC_API(JSBool) +JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure); + +extern JS_PUBLIC_API(JSBool) +JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure); + +extern JS_PUBLIC_API(JSBool) +JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure); + +extern JS_PUBLIC_API(JSBool) +JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure); + +extern JS_PUBLIC_API(JSBool) +JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure); + +extern JS_PUBLIC_API(JSBool) +JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure); + +/************************************************************************/ + +extern JS_PUBLIC_API(size_t) +JS_GetObjectTotalSize(JSContext *cx, JSObject *obj); + +extern JS_PUBLIC_API(size_t) +JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun); + +extern JS_PUBLIC_API(size_t) +JS_GetScriptTotalSize(JSContext *cx, JSScript *script); + +/************************************************************************/ + +extern JS_FRIEND_API(void) +js_RevertVersion(JSContext *cx); + +extern JS_PUBLIC_API(const JSDebugHooks *) +JS_GetGlobalDebugHooks(JSRuntime *rt); + +/** + * Add various profiling-related functions as properties of the given object. + */ +extern JS_PUBLIC_API(JSBool) +JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj); + +/* Defined in vm/Debugger.cpp. */ +extern JS_PUBLIC_API(JSBool) +JS_DefineDebuggerObject(JSContext *cx, JSObject *obj); + +extern JS_PUBLIC_API(void) +JS_DumpBytecode(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(void) +JS_DumpCompartmentBytecode(JSContext *cx); + +extern JS_PUBLIC_API(void) +JS_DumpPCCounts(JSContext *cx, JSScript *script); + +extern JS_PUBLIC_API(void) +JS_DumpCompartmentPCCounts(JSContext *cx); + +extern JS_PUBLIC_API(JSObject *) +JS_UnwrapObject(JSObject *obj); + +extern JS_PUBLIC_API(JSObject *) +JS_UnwrapObjectAndInnerize(JSObject *obj); + +/* Call the context debug handler on the topmost scripted frame. */ +extern JS_FRIEND_API(JSBool) +js_CallContextDebugHandler(JSContext *cx); + +#endif /* jsdbgapi_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsdhash.h b/scripting/javascript/spidermonkey-mac/include/jsdhash.h new file mode 100644 index 0000000000..c8f02b18b7 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsdhash.h @@ -0,0 +1,611 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsdhash_h___ +#define jsdhash_h___ + +/* + * Double hashing, a la Knuth 6. + * + * Try to keep this file in sync with xpcom/glue/pldhash.h. + */ +#include "jstypes.h" +#include "jsutil.h" + +#if defined(__GNUC__) && defined(__i386__) && !defined(XP_OS2) +#define JS_DHASH_FASTCALL __attribute__ ((regparm (3),stdcall)) +#elif defined(XP_WIN) +#define JS_DHASH_FASTCALL __fastcall +#else +#define JS_DHASH_FASTCALL +#endif + +#ifdef DEBUG_XXXbrendan +#define JS_DHASHMETER 1 +#endif + +/* Table size limit, do not equal or exceed (see min&maxAlphaFrac, below). */ +#undef JS_DHASH_SIZE_LIMIT +#define JS_DHASH_SIZE_LIMIT JS_BIT(24) + +/* Minimum table size, or gross entry count (net is at most .75 loaded). */ +#ifndef JS_DHASH_MIN_SIZE +#define JS_DHASH_MIN_SIZE 16 +#elif (JS_DHASH_MIN_SIZE & (JS_DHASH_MIN_SIZE - 1)) != 0 +#error "JS_DHASH_MIN_SIZE must be a power of two!" +#endif + +/* + * Multiplicative hash uses an unsigned 32 bit integer and the golden ratio, + * expressed as a fixed-point 32-bit fraction. + */ +#define JS_DHASH_BITS 32 +#define JS_DHASH_GOLDEN_RATIO 0x9E3779B9U + +/* Primitive and forward-struct typedefs. */ +typedef uint32_t JSDHashNumber; +typedef struct JSDHashEntryHdr JSDHashEntryHdr; +typedef struct JSDHashEntryStub JSDHashEntryStub; +typedef struct JSDHashTable JSDHashTable; +typedef struct JSDHashTableOps JSDHashTableOps; + +/* + * Table entry header structure. + * + * In order to allow in-line allocation of key and value, we do not declare + * either here. Instead, the API uses const void *key as a formal parameter. + * The key need not be stored in the entry; it may be part of the value, but + * need not be stored at all. + * + * Callback types are defined below and grouped into the JSDHashTableOps + * structure, for single static initialization per hash table sub-type. + * + * Each hash table sub-type should nest the JSDHashEntryHdr structure at the + * front of its particular entry type. The keyHash member contains the result + * of multiplying the hash code returned from the hashKey callback (see below) + * by JS_DHASH_GOLDEN_RATIO, then constraining the result to avoid the magic 0 + * and 1 values. The stored keyHash value is table size invariant, and it is + * maintained automatically by JS_DHashTableOperate -- users should never set + * it, and its only uses should be via the entry macros below. + * + * The JS_DHASH_ENTRY_IS_LIVE macro tests whether entry is neither free nor + * removed. An entry may be either busy or free; if busy, it may be live or + * removed. Consumers of this API should not access members of entries that + * are not live. + * + * However, use JS_DHASH_ENTRY_IS_BUSY for faster liveness testing of entries + * returned by JS_DHashTableOperate, as JS_DHashTableOperate never returns a + * non-live, busy (i.e., removed) entry pointer to its caller. See below for + * more details on JS_DHashTableOperate's calling rules. + */ +struct JSDHashEntryHdr { + JSDHashNumber keyHash; /* every entry must begin like this */ +}; + +MOZ_ALWAYS_INLINE bool +JS_DHASH_ENTRY_IS_FREE(JSDHashEntryHdr* entry) +{ + return entry->keyHash == 0; +} +MOZ_ALWAYS_INLINE bool +JS_DHASH_ENTRY_IS_BUSY(JSDHashEntryHdr* entry) +{ + return !JS_DHASH_ENTRY_IS_FREE(entry); +} +MOZ_ALWAYS_INLINE bool +JS_DHASH_ENTRY_IS_LIVE(JSDHashEntryHdr* entry) +{ + return entry->keyHash >= 2; +} + +/* + * A JSDHashTable is currently 8 words (without the JS_DHASHMETER overhead) + * on most architectures, and may be allocated on the stack or within another + * structure or class (see below for the Init and Finish functions to use). + * + * To decide whether to use double hashing vs. chaining, we need to develop a + * trade-off relation, as follows: + * + * Let alpha be the load factor, esize the entry size in words, count the + * entry count, and pow2 the power-of-two table size in entries. + * + * (JSDHashTable overhead) > (JSHashTable overhead) + * (unused table entry space) > (malloc and .next overhead per entry) + + * (buckets overhead) + * (1 - alpha) * esize * pow2 > 2 * count + pow2 + * + * Notice that alpha is by definition (count / pow2): + * + * (1 - alpha) * esize * pow2 > 2 * alpha * pow2 + pow2 + * (1 - alpha) * esize > 2 * alpha + 1 + * + * esize > (1 + 2 * alpha) / (1 - alpha) + * + * This assumes both tables must keep keyHash, key, and value for each entry, + * where key and value point to separately allocated strings or structures. + * If key and value can be combined into one pointer, then the trade-off is: + * + * esize > (1 + 3 * alpha) / (1 - alpha) + * + * If the entry value can be a subtype of JSDHashEntryHdr, rather than a type + * that must be allocated separately and referenced by an entry.value pointer + * member, and provided key's allocation can be fused with its entry's, then + * k (the words wasted per entry with chaining) is 4. + * + * To see these curves, feed gnuplot input like so: + * + * gnuplot> f(x,k) = (1 + k * x) / (1 - x) + * gnuplot> plot [0:.75] f(x,2), f(x,3), f(x,4) + * + * For k of 2 and a well-loaded table (alpha > .5), esize must be more than 4 + * words for chaining to be more space-efficient than double hashing. + * + * Solving for alpha helps us decide when to shrink an underloaded table: + * + * esize > (1 + k * alpha) / (1 - alpha) + * esize - alpha * esize > 1 + k * alpha + * esize - 1 > (k + esize) * alpha + * (esize - 1) / (k + esize) > alpha + * + * alpha < (esize - 1) / (esize + k) + * + * Therefore double hashing should keep alpha >= (esize - 1) / (esize + k), + * assuming esize is not too large (in which case, chaining should probably be + * used for any alpha). For esize=2 and k=3, we want alpha >= .2; for esize=3 + * and k=2, we want alpha >= .4. For k=4, esize could be 6, and alpha >= .5 + * would still obtain. See the JS_DHASH_MIN_ALPHA macro further below. + * + * The current implementation uses a configurable lower bound on alpha, which + * defaults to .25, when deciding to shrink the table (while still respecting + * JS_DHASH_MIN_SIZE). + * + * Note a qualitative difference between chaining and double hashing: under + * chaining, entry addresses are stable across table shrinks and grows. With + * double hashing, you can't safely hold an entry pointer and use it after an + * ADD or REMOVE operation, unless you sample table->generation before adding + * or removing, and compare the sample after, dereferencing the entry pointer + * only if table->generation has not changed. + * + * The moral of this story: there is no one-size-fits-all hash table scheme, + * but for small table entry size, and assuming entry address stability is not + * required, double hashing wins. + */ +struct JSDHashTable { + const JSDHashTableOps *ops; /* virtual operations, see below */ + void *data; /* ops- and instance-specific data */ + int16_t hashShift; /* multiplicative hash shift */ + uint8_t maxAlphaFrac; /* 8-bit fixed point max alpha */ + uint8_t minAlphaFrac; /* 8-bit fixed point min alpha */ + uint32_t entrySize; /* number of bytes in an entry */ + uint32_t entryCount; /* number of entries in table */ + uint32_t removedCount; /* removed entry sentinels in table */ + uint32_t generation; /* entry storage generation number */ + char *entryStore; /* entry storage */ +#ifdef JS_DHASHMETER + struct JSDHashStats { + uint32_t searches; /* total number of table searches */ + uint32_t steps; /* hash chain links traversed */ + uint32_t hits; /* searches that found key */ + uint32_t misses; /* searches that didn't find key */ + uint32_t lookups; /* number of JS_DHASH_LOOKUPs */ + uint32_t addMisses; /* adds that miss, and do work */ + uint32_t addOverRemoved; /* adds that recycled a removed entry */ + uint32_t addHits; /* adds that hit an existing entry */ + uint32_t addFailures; /* out-of-memory during add growth */ + uint32_t removeHits; /* removes that hit, and do work */ + uint32_t removeMisses; /* useless removes that miss */ + uint32_t removeFrees; /* removes that freed entry directly */ + uint32_t removeEnums; /* removes done by Enumerate */ + uint32_t grows; /* table expansions */ + uint32_t shrinks; /* table contractions */ + uint32_t compresses; /* table compressions */ + uint32_t enumShrinks; /* contractions after Enumerate */ + } stats; +#endif +}; + +/* + * Size in entries (gross, not net of free and removed sentinels) for table. + * We store hashShift rather than sizeLog2 to optimize the collision-free case + * in SearchTable. + */ +#define JS_DHASH_TABLE_SIZE(table) JS_BIT(JS_DHASH_BITS - (table)->hashShift) + +/* + * Table space at entryStore is allocated and freed using these callbacks. + * The allocator should return null on error only (not if called with nbytes + * equal to 0; but note that jsdhash.c code will never call with 0 nbytes). + */ +typedef void * +(* JSDHashAllocTable)(JSDHashTable *table, uint32_t nbytes); + +typedef void +(* JSDHashFreeTable) (JSDHashTable *table, void *ptr); + +/* + * Compute the hash code for a given key to be looked up, added, or removed + * from table. A hash code may have any JSDHashNumber value. + */ +typedef JSDHashNumber +(* JSDHashHashKey) (JSDHashTable *table, const void *key); + +/* + * Compare the key identifying entry in table with the provided key parameter. + * Return JS_TRUE if keys match, JS_FALSE otherwise. + */ +typedef JSBool +(* JSDHashMatchEntry)(JSDHashTable *table, const JSDHashEntryHdr *entry, + const void *key); + +/* + * Copy the data starting at from to the new entry storage at to. Do not add + * reference counts for any strong references in the entry, however, as this + * is a "move" operation: the old entry storage at from will be freed without + * any reference-decrementing callback shortly. + */ +typedef void +(* JSDHashMoveEntry)(JSDHashTable *table, const JSDHashEntryHdr *from, + JSDHashEntryHdr *to); + +/* + * Clear the entry and drop any strong references it holds. This callback is + * invoked during a JS_DHASH_REMOVE operation (see below for operation codes), + * but only if the given key is found in the table. + */ +typedef void +(* JSDHashClearEntry)(JSDHashTable *table, JSDHashEntryHdr *entry); + +/* + * Called when a table (whether allocated dynamically by itself, or nested in + * a larger structure, or allocated on the stack) is finished. This callback + * allows table->ops-specific code to finalize table->data. + */ +typedef void +(* JSDHashFinalize) (JSDHashTable *table); + +/* + * Initialize a new entry, apart from keyHash. This function is called when + * JS_DHashTableOperate's JS_DHASH_ADD case finds no existing entry for the + * given key, and must add a new one. At that point, entry->keyHash is not + * set yet, to avoid claiming the last free entry in a severely overloaded + * table. + */ +typedef JSBool +(* JSDHashInitEntry)(JSDHashTable *table, JSDHashEntryHdr *entry, + const void *key); + +/* + * Finally, the "vtable" structure for JSDHashTable. The first eight hooks + * must be provided by implementations; they're called unconditionally by the + * generic jsdhash.c code. Hooks after these may be null. + * + * Summary of allocation-related hook usage with C++ placement new emphasis: + * allocTable Allocate raw bytes with malloc, no ctors run. + * freeTable Free raw bytes with free, no dtors run. + * initEntry Call placement new using default key-based ctor. + * Return JS_TRUE on success, JS_FALSE on error. + * moveEntry Call placement new using copy ctor, run dtor on old + * entry storage. + * clearEntry Run dtor on entry. + * finalize Stub unless table->data was initialized and needs to + * be finalized. + * + * Note the reason why initEntry is optional: the default hooks (stubs) clear + * entry storage: On successful JS_DHashTableOperate(tbl, key, JS_DHASH_ADD), + * the returned entry pointer addresses an entry struct whose keyHash member + * has been set non-zero, but all other entry members are still clear (null). + * JS_DHASH_ADD callers can test such members to see whether the entry was + * newly created by the JS_DHASH_ADD call that just succeeded. If placement + * new or similar initialization is required, define an initEntry hook. Of + * course, the clearEntry hook must zero or null appropriately. + * + * XXX assumes 0 is null for pointer types. + */ +struct JSDHashTableOps { + /* Mandatory hooks. All implementations must provide these. */ + JSDHashAllocTable allocTable; + JSDHashFreeTable freeTable; + JSDHashHashKey hashKey; + JSDHashMatchEntry matchEntry; + JSDHashMoveEntry moveEntry; + JSDHashClearEntry clearEntry; + JSDHashFinalize finalize; + + /* Optional hooks start here. If null, these are not called. */ + JSDHashInitEntry initEntry; +}; + +/* + * Default implementations for the above ops. + */ +extern JS_PUBLIC_API(void *) +JS_DHashAllocTable(JSDHashTable *table, uint32_t nbytes); + +extern JS_PUBLIC_API(void) +JS_DHashFreeTable(JSDHashTable *table, void *ptr); + +extern JS_PUBLIC_API(JSDHashNumber) +JS_DHashStringKey(JSDHashTable *table, const void *key); + +/* A minimal entry contains a keyHash header and a void key pointer. */ +struct JSDHashEntryStub { + JSDHashEntryHdr hdr; + const void *key; +}; + +extern JS_PUBLIC_API(JSDHashNumber) +JS_DHashVoidPtrKeyStub(JSDHashTable *table, const void *key); + +extern JS_PUBLIC_API(JSBool) +JS_DHashMatchEntryStub(JSDHashTable *table, + const JSDHashEntryHdr *entry, + const void *key); + +extern JS_PUBLIC_API(JSBool) +JS_DHashMatchStringKey(JSDHashTable *table, + const JSDHashEntryHdr *entry, + const void *key); + +extern JS_PUBLIC_API(void) +JS_DHashMoveEntryStub(JSDHashTable *table, + const JSDHashEntryHdr *from, + JSDHashEntryHdr *to); + +extern JS_PUBLIC_API(void) +JS_DHashClearEntryStub(JSDHashTable *table, JSDHashEntryHdr *entry); + +extern JS_PUBLIC_API(void) +JS_DHashFreeStringKey(JSDHashTable *table, JSDHashEntryHdr *entry); + +extern JS_PUBLIC_API(void) +JS_DHashFinalizeStub(JSDHashTable *table); + +/* + * If you use JSDHashEntryStub or a subclass of it as your entry struct, and + * if your entries move via memcpy and clear via memset(0), you can use these + * stub operations. + */ +extern JS_PUBLIC_API(const JSDHashTableOps *) +JS_DHashGetStubOps(void); + +/* + * Dynamically allocate a new JSDHashTable using malloc, initialize it using + * JS_DHashTableInit, and return its address. Return null on malloc failure. + * Note that the entry storage at table->entryStore will be allocated using + * the ops->allocTable callback. + */ +extern JS_PUBLIC_API(JSDHashTable *) +JS_NewDHashTable(const JSDHashTableOps *ops, void *data, uint32_t entrySize, + uint32_t capacity); + +/* + * Finalize table's data, free its entry storage (via table->ops->freeTable), + * and return the memory starting at table to the malloc heap. + */ +extern JS_PUBLIC_API(void) +JS_DHashTableDestroy(JSDHashTable *table); + +/* + * Initialize table with ops, data, entrySize, and capacity. Capacity is a + * guess for the smallest table size at which the table will usually be less + * than 75% loaded (the table will grow or shrink as needed; capacity serves + * only to avoid inevitable early growth from JS_DHASH_MIN_SIZE). + */ +extern JS_PUBLIC_API(JSBool) +JS_DHashTableInit(JSDHashTable *table, const JSDHashTableOps *ops, void *data, + uint32_t entrySize, uint32_t capacity); + +/* + * Set maximum and minimum alpha for table. The defaults are 0.75 and .25. + * maxAlpha must be in [0.5, 0.9375] for the default JS_DHASH_MIN_SIZE; or if + * MinSize=JS_DHASH_MIN_SIZE <= 256, in [0.5, (float)(MinSize-1)/MinSize]; or + * else in [0.5, 255.0/256]. minAlpha must be in [0, maxAlpha / 2), so that + * we don't shrink on the very next remove after growing a table upon adding + * an entry that brings entryCount past maxAlpha * tableSize. + */ +extern JS_PUBLIC_API(void) +JS_DHashTableSetAlphaBounds(JSDHashTable *table, + float maxAlpha, + float minAlpha); + +/* + * Call this macro with k, the number of pointer-sized words wasted per entry + * under chaining, to compute the minimum alpha at which double hashing still + * beats chaining. + */ +#define JS_DHASH_MIN_ALPHA(table, k) \ + ((float)((table)->entrySize / sizeof(void *) - 1) \ + / ((table)->entrySize / sizeof(void *) + (k))) + +/* + * Default max/min alpha, and macros to compute the value for the |capacity| + * parameter to JS_NewDHashTable and JS_DHashTableInit, given default or any + * max alpha, such that adding entryCount entries right after initializing the + * table will not require a reallocation (so JS_DHASH_ADD can't fail for those + * JS_DHashTableOperate calls). + * + * NB: JS_DHASH_CAP is a helper macro meant for use only in JS_DHASH_CAPACITY. + * Don't use it directly! + */ +#define JS_DHASH_DEFAULT_MAX_ALPHA 0.75 +#define JS_DHASH_DEFAULT_MIN_ALPHA 0.25 + +#define JS_DHASH_CAP(entryCount, maxAlpha) \ + ((uint32_t)((double)(entryCount) / (maxAlpha))) + +#define JS_DHASH_CAPACITY(entryCount, maxAlpha) \ + (JS_DHASH_CAP(entryCount, maxAlpha) + \ + (((JS_DHASH_CAP(entryCount, maxAlpha) * (uint8_t)(0x100 * (maxAlpha))) \ + >> 8) < (entryCount))) + +#define JS_DHASH_DEFAULT_CAPACITY(entryCount) \ + JS_DHASH_CAPACITY(entryCount, JS_DHASH_DEFAULT_MAX_ALPHA) + +/* + * Finalize table's data, free its entry storage using table->ops->freeTable, + * and leave its members unchanged from their last live values (which leaves + * pointers dangling). If you want to burn cycles clearing table, it's up to + * your code to call memset. + */ +extern JS_PUBLIC_API(void) +JS_DHashTableFinish(JSDHashTable *table); + +/* + * To consolidate keyHash computation and table grow/shrink code, we use a + * single entry point for lookup, add, and remove operations. The operation + * codes are declared here, along with codes returned by JSDHashEnumerator + * functions, which control JS_DHashTableEnumerate's behavior. + */ +typedef enum JSDHashOperator { + JS_DHASH_LOOKUP = 0, /* lookup entry */ + JS_DHASH_ADD = 1, /* add entry */ + JS_DHASH_REMOVE = 2, /* remove entry, or enumerator says remove */ + JS_DHASH_NEXT = 0, /* enumerator says continue */ + JS_DHASH_STOP = 1 /* enumerator says stop */ +} JSDHashOperator; + +/* + * To lookup a key in table, call: + * + * entry = JS_DHashTableOperate(table, key, JS_DHASH_LOOKUP); + * + * If JS_DHASH_ENTRY_IS_BUSY(entry) is true, key was found and it identifies + * entry. If JS_DHASH_ENTRY_IS_FREE(entry) is true, key was not found. + * + * To add an entry identified by key to table, call: + * + * entry = JS_DHashTableOperate(table, key, JS_DHASH_ADD); + * + * If entry is null upon return, then either the table is severely overloaded, + * and memory can't be allocated for entry storage via table->ops->allocTable; + * Or if table->ops->initEntry is non-null, the table->ops->initEntry op may + * have returned false. + * + * Otherwise, entry->keyHash has been set so that JS_DHASH_ENTRY_IS_BUSY(entry) + * is true, and it is up to the caller to initialize the key and value parts + * of the entry sub-type, if they have not been set already (i.e. if entry was + * not already in the table, and if the optional initEntry hook was not used). + * + * To remove an entry identified by key from table, call: + * + * (void) JS_DHashTableOperate(table, key, JS_DHASH_REMOVE); + * + * If key's entry is found, it is cleared (via table->ops->clearEntry) and + * the entry is marked so that JS_DHASH_ENTRY_IS_FREE(entry). This operation + * returns null unconditionally; you should ignore its return value. + */ +extern JS_PUBLIC_API(JSDHashEntryHdr *) JS_DHASH_FASTCALL +JS_DHashTableOperate(JSDHashTable *table, const void *key, JSDHashOperator op); + +/* + * Remove an entry already accessed via LOOKUP or ADD. + * + * NB: this is a "raw" or low-level routine, intended to be used only where + * the inefficiency of a full JS_DHashTableOperate (which rehashes in order + * to find the entry given its key) is not tolerable. This function does not + * shrink the table if it is underloaded. It does not update stats #ifdef + * JS_DHASHMETER, either. + */ +extern JS_PUBLIC_API(void) +JS_DHashTableRawRemove(JSDHashTable *table, JSDHashEntryHdr *entry); + +/* + * Enumerate entries in table using etor: + * + * count = JS_DHashTableEnumerate(table, etor, arg); + * + * JS_DHashTableEnumerate calls etor like so: + * + * op = etor(table, entry, number, arg); + * + * where number is a zero-based ordinal assigned to live entries according to + * their order in table->entryStore. + * + * The return value, op, is treated as a set of flags. If op is JS_DHASH_NEXT, + * then continue enumerating. If op contains JS_DHASH_REMOVE, then clear (via + * table->ops->clearEntry) and free entry. Then we check whether op contains + * JS_DHASH_STOP; if so, stop enumerating and return the number of live entries + * that were enumerated so far. Return the total number of live entries when + * enumeration completes normally. + * + * If etor calls JS_DHashTableOperate on table with op != JS_DHASH_LOOKUP, it + * must return JS_DHASH_STOP; otherwise undefined behavior results. + * + * If any enumerator returns JS_DHASH_REMOVE, table->entryStore may be shrunk + * or compressed after enumeration, but before JS_DHashTableEnumerate returns. + * Such an enumerator therefore can't safely set aside entry pointers, but an + * enumerator that never returns JS_DHASH_REMOVE can set pointers to entries + * aside, e.g., to avoid copying live entries into an array of the entry type. + * Copying entry pointers is cheaper, and safe so long as the caller of such a + * "stable" Enumerate doesn't use the set-aside pointers after any call either + * to PL_DHashTableOperate, or to an "unstable" form of Enumerate, which might + * grow or shrink entryStore. + * + * If your enumerator wants to remove certain entries, but set aside pointers + * to other entries that it retains, it can use JS_DHashTableRawRemove on the + * entries to be removed, returning JS_DHASH_NEXT to skip them. Likewise, if + * you want to remove entries, but for some reason you do not want entryStore + * to be shrunk or compressed, you can call JS_DHashTableRawRemove safely on + * the entry being enumerated, rather than returning JS_DHASH_REMOVE. + */ +typedef JSDHashOperator +(* JSDHashEnumerator)(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32_t number, void *arg); + +extern JS_PUBLIC_API(uint32_t) +JS_DHashTableEnumerate(JSDHashTable *table, JSDHashEnumerator etor, void *arg); + +typedef size_t +(* JSDHashSizeOfEntryExcludingThisFun)(JSDHashEntryHdr *hdr, + JSMallocSizeOfFun mallocSizeOf, + void *arg); + +/** + * Measure the size of the table's entry storage, and if + * |sizeOfEntryExcludingThis| is non-NULL, measure the size of things pointed + * to by entries. Doesn't measure |ops| because it's often shared between + * tables, nor |data| because it's opaque. + */ +extern JS_PUBLIC_API(size_t) +JS_DHashTableSizeOfExcludingThis(const JSDHashTable *table, + JSDHashSizeOfEntryExcludingThisFun sizeOfEntryExcludingThis, + JSMallocSizeOfFun mallocSizeOf, + void *arg = NULL); + +/** + * Like JS_DHashTableSizeOfExcludingThis, but includes sizeof(*this). + */ +extern JS_PUBLIC_API(size_t) +JS_DHashTableSizeOfIncludingThis(const JSDHashTable *table, + JSDHashSizeOfEntryExcludingThisFun sizeOfEntryExcludingThis, + JSMallocSizeOfFun mallocSizeOf, + void *arg = NULL); + +#ifdef DEBUG +/** + * Mark a table as immutable for the remainder of its lifetime. This + * changes the implementation from ASSERTing one set of invariants to + * ASSERTing a different set. + * + * When a table is NOT marked as immutable, the table implementation + * asserts that the table is not mutated from its own callbacks. It + * assumes the caller protects the table from being accessed on multiple + * threads simultaneously. + * + * When the table is marked as immutable, the re-entry assertions will + * no longer trigger erroneously due to multi-threaded access. Instead, + * mutations will cause assertions. + */ +extern JS_PUBLIC_API(void) +JS_DHashMarkTableImmutable(JSDHashTable *table); +#endif + +#ifdef JS_DHASHMETER +#include + +extern JS_PUBLIC_API(void) +JS_DHashTableDumpMeter(JSDHashTable *table, JSDHashEnumerator dump, FILE *fp); +#endif + +#endif /* jsdhash_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h b/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h new file mode 100644 index 0000000000..0fb00e637e --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h @@ -0,0 +1,1421 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsfriendapi_h___ +#define jsfriendapi_h___ + +#include "mozilla/GuardObjects.h" + +#include "jsclass.h" +#include "jscpucfg.h" +#include "jspubtd.h" +#include "jsprvtd.h" + +/* + * This macro checks if the stack pointer has exceeded a given limit. If + * |tolerance| is non-zero, it returns true only if the stack pointer has + * exceeded the limit by more than |tolerance| bytes. + */ +#if JS_STACK_GROWTH_DIRECTION > 0 +# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance) \ + ((uintptr_t)(sp) < (limit)+(tolerance)) +#else +# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance) \ + ((uintptr_t)(sp) > (limit)-(tolerance)) +#endif + +#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0) + +extern JS_FRIEND_API(void) +JS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data); + +extern JS_FRIEND_API(JSString *) +JS_GetAnonymousString(JSRuntime *rt); + +extern JS_FRIEND_API(JSObject *) +JS_FindCompilationScope(JSContext *cx, JSRawObject obj); + +extern JS_FRIEND_API(JSFunction *) +JS_GetObjectFunction(JSRawObject obj); + +extern JS_FRIEND_API(JSBool) +JS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto); + +extern JS_FRIEND_API(JSObject *) +JS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent); + +extern JS_FRIEND_API(uint32_t) +JS_ObjectCountDynamicSlots(JSHandleObject obj); + +extern JS_FRIEND_API(size_t) +JS_SetProtoCalled(JSContext *cx); + +extern JS_FRIEND_API(size_t) +JS_GetCustomIteratorCount(JSContext *cx); + +extern JS_FRIEND_API(JSBool) +JS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret); + +/* + * Determine whether the given object is backed by a DeadObjectProxy. + * + * Such objects hold no other objects (they have no outgoing reference edges) + * and will throw if you touch them (e.g. by reading/writing a property). + */ +extern JS_FRIEND_API(JSBool) +JS_IsDeadWrapper(JSObject *obj); + +/* + * Used by the cycle collector to trace through the shape and all + * shapes it reaches, marking all non-shape children found in the + * process. Uses bounded stack space. + */ +extern JS_FRIEND_API(void) +JS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape); + +enum { + JS_TELEMETRY_GC_REASON, + JS_TELEMETRY_GC_IS_COMPARTMENTAL, + JS_TELEMETRY_GC_MS, + JS_TELEMETRY_GC_MAX_PAUSE_MS, + JS_TELEMETRY_GC_MARK_MS, + JS_TELEMETRY_GC_SWEEP_MS, + JS_TELEMETRY_GC_MARK_ROOTS_MS, + JS_TELEMETRY_GC_MARK_GRAY_MS, + JS_TELEMETRY_GC_SLICE_MS, + JS_TELEMETRY_GC_MMU_50, + JS_TELEMETRY_GC_RESET, + JS_TELEMETRY_GC_INCREMENTAL_DISABLED, + JS_TELEMETRY_GC_NON_INCREMENTAL, + JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS, + JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS +}; + +typedef void +(* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample); + +extern JS_FRIEND_API(void) +JS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback); + +extern JS_FRIEND_API(JSPrincipals *) +JS_GetCompartmentPrincipals(JSCompartment *compartment); + +extern JS_FRIEND_API(void) +JS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals); + +/* Safe to call with input obj == NULL. Returns non-NULL iff obj != NULL. */ +extern JS_FRIEND_API(JSObject *) +JS_ObjectToInnerObject(JSContext *cx, JSObject *obj); + +/* Requires obj != NULL. */ +extern JS_FRIEND_API(JSObject *) +JS_ObjectToOuterObject(JSContext *cx, JSObject *obj); + +extern JS_FRIEND_API(JSObject *) +JS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent); + +extern JS_FRIEND_API(JSBool) +js_GetterOnlyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp); + +JS_FRIEND_API(void) +js_ReportOverRecursed(JSContext *maybecx); + +#ifdef DEBUG + +/* + * Routines to print out values during debugging. These are FRIEND_API to help + * the debugger find them and to support temporarily hacking js_Dump* calls + * into other code. + */ + +extern JS_FRIEND_API(void) +js_DumpString(JSString *str); + +extern JS_FRIEND_API(void) +js_DumpAtom(JSAtom *atom); + +extern JS_FRIEND_API(void) +js_DumpObject(JSObject *obj); + +extern JS_FRIEND_API(void) +js_DumpChars(const jschar *s, size_t n); +#endif + +extern JS_FRIEND_API(bool) +JS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj); + +extern JS_FRIEND_API(JSBool) +JS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc); + +extern JS_FRIEND_API(JSBool) +JS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props); + +extern JS_FRIEND_API(JSBool) +JS_EnumerateState(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op, + js::MutableHandleValue statep, js::MutableHandleId idp); + +struct JSFunctionSpecWithHelp { + const char *name; + JSNative call; + uint16_t nargs; + uint16_t flags; + const char *usage; + const char *help; +}; + +#define JS_FN_HELP(name,call,nargs,flags,usage,help) \ + {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help} +#define JS_FS_HELP_END \ + {NULL, NULL, 0, 0, NULL, NULL} + +extern JS_FRIEND_API(bool) +JS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs); + +typedef bool (* JS_SourceHook)(JSContext *cx, JSScript *script, jschar **src, uint32_t *length); + +extern JS_FRIEND_API(void) +JS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook); + +namespace js { + +extern mozilla::ThreadLocal TlsPerThreadData; + +inline JSRuntime * +GetRuntime(const JSContext *cx) +{ + return ContextFriendFields::get(cx)->runtime; +} + +inline JSCompartment * +GetContextCompartment(const JSContext *cx) +{ + return ContextFriendFields::get(cx)->compartment; +} + +typedef bool +(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj); + + /* + * Dump the complete object graph of heap-allocated things. + * fp is the file for the dump output. + */ +extern JS_FRIEND_API(void) +DumpHeapComplete(JSRuntime *rt, FILE *fp); + +class JS_FRIEND_API(AutoSwitchCompartment) { + private: + JSContext *cx; + JSCompartment *oldCompartment; + public: + AutoSwitchCompartment(JSContext *cx, JSCompartment *newCompartment + MOZ_GUARD_OBJECT_NOTIFIER_PARAM); + AutoSwitchCompartment(JSContext *cx, JSHandleObject target + MOZ_GUARD_OBJECT_NOTIFIER_PARAM); + ~AutoSwitchCompartment(); + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + +#ifdef OLD_GETTER_SETTER_METHODS +JS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp); +JS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp); +#endif + +extern JS_FRIEND_API(bool) +IsSystemCompartment(const JSCompartment *compartment); + +extern JS_FRIEND_API(bool) +IsAtomsCompartment(const JSCompartment *c); + +/* + * Check whether it is OK to assign an undeclared variable with the name + * |propname| at the current location in script. It is not an error if there is + * no current script location, or if that location is not an assignment to an + * undeclared variable. Reports an error if one needs to be reported (and, + * particularly, always reports when it returns false). + */ +extern JS_FRIEND_API(bool) +ReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname); + +struct WeakMapTracer; + +/* + * Weak map tracer callback, called once for every binding of every + * weak map that was live at the time of the last garbage collection. + * + * m will be NULL if the weak map is not contained in a JS Object. + */ +typedef void +(* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m, + void *k, JSGCTraceKind kkind, + void *v, JSGCTraceKind vkind); + +struct WeakMapTracer { + JSRuntime *runtime; + WeakMapTraceCallback callback; + + WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb) + : runtime(rt), callback(cb) {} +}; + +extern JS_FRIEND_API(void) +TraceWeakMaps(WeakMapTracer *trc); + +extern JS_FRIEND_API(bool) +AreGCGrayBitsValid(JSRuntime *rt); + +typedef void +(*GCThingCallback)(void *closure, void *gcthing); + +extern JS_FRIEND_API(void) +VisitGrayWrapperTargets(JSCompartment *comp, GCThingCallback callback, void *closure); + +extern JS_FRIEND_API(JSObject *) +GetWeakmapKeyDelegate(JSObject *key); + +JS_FRIEND_API(JSGCTraceKind) +GCThingTraceKind(void *thing); + +/* + * Invoke cellCallback on every gray JS_OBJECT in the given compartment. + */ +extern JS_FRIEND_API(void) +IterateGrayObjects(JSCompartment *compartment, GCThingCallback cellCallback, void *data); + +#ifdef JS_HAS_CTYPES +extern JS_FRIEND_API(size_t) +SizeOfDataIfCDataObject(JSMallocSizeOfFun mallocSizeOf, JSObject *obj); +#endif + +/* + * Shadow declarations of JS internal structures, for access by inline access + * functions below. Do not use these structures in any other way. When adding + * new fields for access by inline methods, make sure to add static asserts to + * the original header file to ensure that offsets are consistent. + */ +namespace shadow { + +struct TypeObject { + Class *clasp; + JSObject *proto; +}; + +struct BaseShape { + js::Class *clasp; + JSObject *parent; +}; + +class Shape { +public: + shadow::BaseShape *base; + jsid _1; + uint32_t slotInfo; + + static const uint32_t FIXED_SLOTS_SHIFT = 27; +}; + +struct Object { + shadow::Shape *shape; + shadow::TypeObject *type; + js::Value *slots; + js::Value *_1; + + size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; } + Value *fixedSlots() const { + return (Value *)(uintptr_t(this) + sizeof(shadow::Object)); + } + + js::Value &slotRef(size_t slot) const { + size_t nfixed = numFixedSlots(); + if (slot < nfixed) + return fixedSlots()[slot]; + return slots[slot - nfixed]; + } +}; + +struct Function { + Object base; + uint16_t nargs; + uint16_t flags; + /* Used only for natives */ + Native native; + const JSJitInfo *jitinfo; + void *_1; +}; + +struct Atom { + size_t _; + const jschar *chars; +}; + +} /* namespace shadow */ + +extern JS_FRIEND_DATA(js::Class) CallClass; +extern JS_FRIEND_DATA(js::Class) DeclEnvClass; +extern JS_FRIEND_DATA(js::Class) FunctionClass; +extern JS_FRIEND_DATA(js::Class) FunctionProxyClass; +extern JS_FRIEND_DATA(js::Class) OuterWindowProxyClass; +extern JS_FRIEND_DATA(js::Class) ObjectProxyClass; +extern JS_FRIEND_DATA(js::Class) ObjectClass; + +inline js::Class * +GetObjectClass(RawObject obj) +{ + return reinterpret_cast(obj)->type->clasp; +} + +inline JSClass * +GetObjectJSClass(RawObject obj) +{ + return js::Jsvalify(GetObjectClass(obj)); +} + +inline bool +IsInnerObject(JSObject *obj) { + return !!GetObjectClass(obj)->ext.outerObject; +} + +inline bool +IsOuterObject(JSObject *obj) { + return !!GetObjectClass(obj)->ext.innerObject; +} + +JS_FRIEND_API(bool) +IsScopeObject(RawObject obj); + +inline JSObject * +GetObjectParent(RawObject obj) +{ + JS_ASSERT(!IsScopeObject(obj)); + return reinterpret_cast(obj)->shape->base->parent; +} + +JS_FRIEND_API(JSObject *) +GetObjectParentMaybeScope(RawObject obj); + +JS_FRIEND_API(JSObject *) +GetGlobalForObjectCrossCompartment(RawObject obj); + +JS_FRIEND_API(void) +NotifyAnimationActivity(RawObject obj); + +JS_FRIEND_API(bool) +IsOriginalScriptFunction(JSFunction *fun); + +/* + * Return the outermost enclosing function (script) of the scripted caller. + * This function returns NULL in several cases: + * - no script is running on the context + * - the caller is in global or eval code + * In particular, this function will "stop" its outermost search at eval() and + * thus it will really return the outermost enclosing function *since the + * innermost eval*. + */ +JS_FRIEND_API(JSScript *) +GetOutermostEnclosingFunctionOfScriptedCaller(JSContext *cx); + +JS_FRIEND_API(JSFunction *) +DefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call, + unsigned nargs, unsigned attrs); + +JS_FRIEND_API(JSFunction *) +NewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags, + JSObject *parent, const char *name); + +JS_FRIEND_API(JSFunction *) +NewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags, + JSObject *parent, jsid id); + +JS_FRIEND_API(JSObject *) +InitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto, + JSClass *clasp, JSNative constructor, unsigned nargs, + JSPropertySpec *ps, JSFunctionSpec *fs, + JSPropertySpec *static_ps, JSFunctionSpec *static_fs); + +JS_FRIEND_API(const Value &) +GetFunctionNativeReserved(RawObject fun, size_t which); + +JS_FRIEND_API(void) +SetFunctionNativeReserved(RawObject fun, size_t which, const Value &val); + +inline bool +GetObjectProto(JSContext *cx, JSObject *obj, JSObject **proto) +{ + js::Class *clasp = GetObjectClass(obj); + if (clasp == &js::ObjectProxyClass || + clasp == &js::OuterWindowProxyClass || + clasp == &js::FunctionProxyClass) + { + return JS_GetPrototype(cx, obj, proto); + } + + *proto = reinterpret_cast(obj)->type->proto; + return true; +} + +inline void * +GetObjectPrivate(RawObject obj) +{ + const shadow::Object *nobj = reinterpret_cast(obj); + void **addr = reinterpret_cast(&nobj->fixedSlots()[nobj->numFixedSlots()]); + return *addr; +} + +/* + * Get a slot that is both reserved for object's clasp *and* is fixed (fits + * within the maximum capacity for the object's fixed slots). + */ +inline const Value & +GetReservedSlot(RawObject obj, size_t slot) +{ + JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj))); + return reinterpret_cast(obj)->slotRef(slot); +} + +JS_FRIEND_API(void) +SetReservedSlotWithBarrier(RawObject obj, size_t slot, const Value &value); + +inline void +SetReservedSlot(RawObject obj, size_t slot, const Value &value) +{ + JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj))); + shadow::Object *sobj = reinterpret_cast(obj); + if (sobj->slotRef(slot).isMarkable() +#ifdef JSGC_GENERATIONAL + || value.isMarkable() +#endif + ) + { + SetReservedSlotWithBarrier(obj, slot, value); + } else { + sobj->slotRef(slot) = value; + } +} + +JS_FRIEND_API(uint32_t) +GetObjectSlotSpan(RawObject obj); + +inline const Value & +GetObjectSlot(RawObject obj, size_t slot) +{ + JS_ASSERT(slot < GetObjectSlotSpan(obj)); + return reinterpret_cast(obj)->slotRef(slot); +} + +inline const jschar * +GetAtomChars(JSAtom *atom) +{ + return reinterpret_cast(atom)->chars; +} + +inline JSLinearString * +AtomToLinearString(JSAtom *atom) +{ + return reinterpret_cast(atom); +} + +static inline js::PropertyOp +CastAsJSPropertyOp(RawObject object) +{ + return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object); +} + +static inline js::StrictPropertyOp +CastAsJSStrictPropertyOp(RawObject object) +{ + return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object); +} + +JS_FRIEND_API(bool) +GetPropertyNames(JSContext *cx, RawObject obj, unsigned flags, js::AutoIdVector *props); + +JS_FRIEND_API(bool) +AppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others); + +JS_FRIEND_API(bool) +GetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp); + +JS_FRIEND_API(bool) +StringIsArrayIndex(JSLinearString *str, uint32_t *indexp); + +JS_FRIEND_API(void) +SetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback); + +JS_FRIEND_API(bool) +IsObjectInContextCompartment(RawObject obj, const JSContext *cx); + +/* + * NB: these flag bits are encoded into the bytecode stream in the immediate + * operand of JSOP_ITER, so don't change them without advancing vm/Xdr.h's + * XDR_BYTECODE_VERSION. + */ +#define JSITER_ENUMERATE 0x1 /* for-in compatible hidden default iterator */ +#define JSITER_FOREACH 0x2 /* return [key, value] pair rather than key */ +#define JSITER_KEYVALUE 0x4 /* destructuring for-in wants [key, value] */ +#define JSITER_OWNONLY 0x8 /* iterate over obj's own properties only */ +#define JSITER_HIDDEN 0x10 /* also enumerate non-enumerable properties */ +#define JSITER_FOR_OF 0x20 /* harmony for-of loop */ + +inline uintptr_t +GetNativeStackLimit(const JSRuntime *rt) +{ + return PerThreadDataFriendFields::getMainThread(rt)->nativeStackLimit; +} + +/* + * These macros report a stack overflow and run |onerror| if we are close to + * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a little + * extra space so that we can ensure that crucial code is able to run. + */ + +#define JS_CHECK_RECURSION(cx, onerror) \ + JS_BEGIN_MACRO \ + int stackDummy_; \ + if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(js::GetRuntime(cx)), &stackDummy_)) { \ + js_ReportOverRecursed(cx); \ + onerror; \ + } \ + JS_END_MACRO + +#define JS_CHECK_CHROME_RECURSION(cx, onerror) \ + JS_BEGIN_MACRO \ + int stackDummy_; \ + if (!JS_CHECK_STACK_SIZE_WITH_TOLERANCE(js::GetNativeStackLimit(js::GetRuntime(cx)), \ + &stackDummy_, \ + 1024 * sizeof(size_t))) \ + { \ + js_ReportOverRecursed(cx); \ + onerror; \ + } \ + JS_END_MACRO + +JS_FRIEND_API(void) +StartPCCountProfiling(JSContext *cx); + +JS_FRIEND_API(void) +StopPCCountProfiling(JSContext *cx); + +JS_FRIEND_API(void) +PurgePCCounts(JSContext *cx); + +JS_FRIEND_API(size_t) +GetPCCountScriptCount(JSContext *cx); + +JS_FRIEND_API(JSString *) +GetPCCountScriptSummary(JSContext *cx, size_t script); + +JS_FRIEND_API(JSString *) +GetPCCountScriptContents(JSContext *cx, size_t script); + +/* + * A call stack can be specified to the JS engine such that all JS entry/exits + * to functions push/pop an entry to/from the specified stack. + * + * For more detailed information, see vm/SPSProfiler.h + */ +class ProfileEntry +{ + /* + * All fields are marked volatile to prevent the compiler from re-ordering + * instructions. Namely this sequence: + * + * entry[size] = ...; + * size++; + * + * If the size modification were somehow reordered before the stores, then + * if a sample were taken it would be examining bogus information. + * + * A ProfileEntry represents both a C++ profile entry and a JS one. Both use + * the string as a description, but JS uses the sp as NULL to indicate that + * it is a JS entry. The script_ is then only ever examined for a JS entry, + * and the idx is used by both, but with different meanings. + */ + const char * volatile string; // Descriptive string of this entry + void * volatile sp; // Relevant stack pointer for the entry + JSScript * volatile script_; // if js(), non-null script which is running + int32_t volatile idx; // if js(), idx of pc, otherwise line number + + public: + /* + * All of these methods are marked with the 'volatile' keyword because SPS's + * representation of the stack is stored such that all ProfileEntry + * instances are volatile. These methods would not be available unless they + * were marked as volatile as well + */ + + bool js() volatile { + JS_ASSERT_IF(sp == NULL, script_ != NULL); + return sp == NULL; + } + + uint32_t line() volatile { JS_ASSERT(!js()); return idx; } + JSScript *script() volatile { JS_ASSERT(js()); return script_; } + void *stackAddress() volatile { return sp; } + const char *label() volatile { return string; } + + void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; } + void setLabel(const char *aString) volatile { string = aString; } + void setStackAddress(void *aSp) volatile { sp = aSp; } + void setScript(JSScript *aScript) volatile { script_ = aScript; } + + /* we can't know the layout of JSScript, so look in vm/SPSProfiler.cpp */ + JS_FRIEND_API(jsbytecode *) pc() volatile; + JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile; + + static size_t offsetOfString() { return offsetof(ProfileEntry, string); } + static size_t offsetOfStackAddress() { return offsetof(ProfileEntry, sp); } + static size_t offsetOfPCIdx() { return offsetof(ProfileEntry, idx); } + static size_t offsetOfScript() { return offsetof(ProfileEntry, script_); } + + /* + * The index used in the entry can either be a line number or the offset of + * a pc into a script's code. To signify a NULL pc, use a -1 index. This is + * checked against in pc() and setPC() to set/get the right pc. + */ + static const int32_t NullPCIndex = -1; +}; + +JS_FRIEND_API(void) +SetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size, + uint32_t max); + +JS_FRIEND_API(void) +EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled); + +// Use RawScript rather than UnrootedScript because it may be called from a +// signal handler +JS_FRIEND_API(jsbytecode*) +ProfilingGetPC(JSRuntime *rt, RawScript script, void *ip); + +#ifdef JS_THREADSAFE +JS_FRIEND_API(void *) +GetOwnerThread(const JSContext *cx); + +JS_FRIEND_API(bool) +ContextHasOutstandingRequests(const JSContext *cx); +#endif + +JS_FRIEND_API(bool) +HasUnrootedGlobal(const JSContext *cx); + +typedef void +(* ActivityCallback)(void *arg, JSBool active); + +/* + * Sets a callback that is run whenever the runtime goes idle - the + * last active request ceases - and begins activity - when it was + * idle and a request begins. + */ +JS_FRIEND_API(void) +SetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg); + +extern JS_FRIEND_API(const JSStructuredCloneCallbacks *) +GetContextStructuredCloneCallbacks(JSContext *cx); + +extern JS_FRIEND_API(bool) +CanCallContextDebugHandler(JSContext *cx); + +extern JS_FRIEND_API(JSTrapStatus) +CallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval); + +extern JS_FRIEND_API(bool) +IsContextRunningJS(JSContext *cx); + +class SystemAllocPolicy; +typedef Vector CompartmentVector; +extern JS_FRIEND_API(const CompartmentVector&) +GetRuntimeCompartments(JSRuntime *rt); + +typedef void +(* AnalysisPurgeCallback)(JSRuntime *rt, JSFlatString *desc); + +extern JS_FRIEND_API(AnalysisPurgeCallback) +SetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback); + +typedef JSBool +(* DOMInstanceClassMatchesProto)(JSHandleObject protoObject, uint32_t protoID, + uint32_t depth); +struct JSDOMCallbacks { + DOMInstanceClassMatchesProto instanceClassMatchesProto; +}; +typedef struct JSDOMCallbacks DOMCallbacks; + +extern JS_FRIEND_API(void) +SetDOMCallbacks(JSRuntime *rt, const DOMCallbacks *callbacks); + +extern JS_FRIEND_API(const DOMCallbacks *) +GetDOMCallbacks(JSRuntime *rt); + +extern JS_FRIEND_API(JSObject *) +GetTestingFunctions(JSContext *cx); + +/* + * Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not + * available and the compiler does not know that FreeOp inherits from + * JSFreeOp. + */ +inline JSFreeOp * +CastToJSFreeOp(FreeOp *fop) +{ + return reinterpret_cast(fop); +} + +/* Implemented in jsexn.cpp. */ + +/* + * Get an error type name from a JSExnType constant. + * Returns NULL for invalid arguments and JSEXN_INTERNALERR + */ +extern JS_FRIEND_API(const jschar*) +GetErrorTypeName(JSContext* cx, int16_t exnType); + +#ifdef DEBUG +extern JS_FRIEND_API(unsigned) +GetEnterCompartmentDepth(JSContext* cx); +#endif + +/* Implemented in jswrapper.cpp. */ +typedef enum NukeReferencesToWindow { + NukeWindowReferences, + DontNukeWindowReferences +} NukeReferencesToWindow; + +/* + * These filters are designed to be ephemeral stack classes, and thus don't + * do any rooting or holding of their members. + */ +struct CompartmentFilter { + virtual bool match(JSCompartment *c) const = 0; +}; + +struct AllCompartments : public CompartmentFilter { + virtual bool match(JSCompartment *c) const { return true; } +}; + +struct ContentCompartmentsOnly : public CompartmentFilter { + virtual bool match(JSCompartment *c) const { + return !IsSystemCompartment(c); + } +}; + +struct ChromeCompartmentsOnly : public CompartmentFilter { + virtual bool match(JSCompartment *c) const { + return IsSystemCompartment(c); + } +}; + +struct SingleCompartment : public CompartmentFilter { + JSCompartment *ours; + SingleCompartment(JSCompartment *c) : ours(c) {} + virtual bool match(JSCompartment *c) const { return c == ours; } +}; + +struct CompartmentsWithPrincipals : public CompartmentFilter { + JSPrincipals *principals; + CompartmentsWithPrincipals(JSPrincipals *p) : principals(p) {} + virtual bool match(JSCompartment *c) const { + return JS_GetCompartmentPrincipals(c) == principals; + } +}; + +extern JS_FRIEND_API(JSBool) +NukeCrossCompartmentWrappers(JSContext* cx, + const CompartmentFilter& sourceFilter, + const CompartmentFilter& targetFilter, + NukeReferencesToWindow nukeReferencesToWindow); + +/* Specify information about ListBase proxies in the DOM, for use by ICs. */ +JS_FRIEND_API(void) +SetListBaseInformation(void *listBaseHandlerFamily, uint32_t listBaseExpandoSlot); + +void *GetListBaseHandlerFamily(); +uint32_t GetListBaseExpandoSlot(); + +} /* namespace js */ + +/* Implemented in jsdate.cpp. */ + +/* + * Detect whether the internal date value is NaN. (Because failure is + * out-of-band for js_DateGet*) + */ +extern JS_FRIEND_API(JSBool) +js_DateIsValid(JSObject* obj); + +extern JS_FRIEND_API(double) +js_DateGetMsecSinceEpoch(JSRawObject obj); + +/* Implemented in jscntxt.cpp. */ + +/* + * Report an exception, which is currently realized as a printf-style format + * string and its arguments. + */ +typedef enum JSErrNum { +#define MSG_DEF(name, number, count, exception, format) \ + name = number, +#include "js.msg" +#undef MSG_DEF + JSErr_Limit +} JSErrNum; + +extern JS_FRIEND_API(const JSErrorFormatString *) +js_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber); + +/* Implemented in jsclone.cpp. */ + +extern JS_FRIEND_API(uint64_t) +js_GetSCOffset(JSStructuredCloneWriter* writer); + +/* Typed Array functions, implemented in jstypedarray.cpp */ + +namespace js { +namespace ArrayBufferView { + +enum ViewType { + TYPE_INT8 = 0, + TYPE_UINT8, + TYPE_INT16, + TYPE_UINT16, + TYPE_INT32, + TYPE_UINT32, + TYPE_FLOAT32, + TYPE_FLOAT64, + + /* + * Special type that is a uint8_t, but assignments are clamped to [0, 256). + * Treat the raw data type as a uint8_t. + */ + TYPE_UINT8_CLAMPED, + + /* + * Type returned for a DataView. Note that there is no single element type + * in this case. + */ + TYPE_DATAVIEW, + + TYPE_MAX +}; + +} /* namespace ArrayBufferView */ +} /* namespace js */ + +typedef js::ArrayBufferView::ViewType JSArrayBufferViewType; + +/* + * Create a new typed array with nelements elements. + * + * These functions (except the WithBuffer variants) fill in the array with zeros. + */ + +extern JS_FRIEND_API(JSObject *) +JS_NewInt8Array(JSContext *cx, uint32_t nelements); +extern JS_FRIEND_API(JSObject *) +JS_NewUint8Array(JSContext *cx, uint32_t nelements); +extern JS_FRIEND_API(JSObject *) +JS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements); + +extern JS_FRIEND_API(JSObject *) +JS_NewInt16Array(JSContext *cx, uint32_t nelements); +extern JS_FRIEND_API(JSObject *) +JS_NewUint16Array(JSContext *cx, uint32_t nelements); +extern JS_FRIEND_API(JSObject *) +JS_NewInt32Array(JSContext *cx, uint32_t nelements); +extern JS_FRIEND_API(JSObject *) +JS_NewUint32Array(JSContext *cx, uint32_t nelements); +extern JS_FRIEND_API(JSObject *) +JS_NewFloat32Array(JSContext *cx, uint32_t nelements); +extern JS_FRIEND_API(JSObject *) +JS_NewFloat64Array(JSContext *cx, uint32_t nelements); + +/* + * Create a new typed array and copy in values from the given object. The + * object is used as if it were an array; that is, the new array (if + * successfully created) will have length given by array.length, and its + * elements will be those specified by array[0], array[1], and so on, after + * conversion to the typed array element type. + */ + +extern JS_FRIEND_API(JSObject *) +JS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array); +extern JS_FRIEND_API(JSObject *) +JS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array); + +/* + * Create a new typed array using the given ArrayBuffer for storage. byteOffset + * must not exceed (signed) INT32_MAX. The length value is optional; if -1 is + * passed, enough elements to use up the remainder of the byte array is used as + * the default value. + */ + +extern JS_FRIEND_API(JSObject *) +JS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); +extern JS_FRIEND_API(JSObject *) +JS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer, + uint32_t byteOffset, int32_t length); + +/* + * Create a new ArrayBuffer with the given byte length. + */ +extern JS_FRIEND_API(JSObject *) +JS_NewArrayBuffer(JSContext *cx, uint32_t nbytes); + +/* + * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return + * false if a security wrapper is encountered that denies the unwrapping. If + * this test or one of the JS_Is*Array tests succeeds, then it is safe to call + * the various accessor JSAPI calls defined below. + */ +extern JS_FRIEND_API(JSBool) +JS_IsTypedArrayObject(JSObject *obj); + +/* + * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may + * return false if a security wrapper is encountered that denies the + * unwrapping. If this test or one of the more specific tests succeeds, then it + * is safe to call the various ArrayBufferView accessor JSAPI calls defined + * below. + */ +extern JS_FRIEND_API(JSBool) +JS_IsArrayBufferViewObject(JSObject *obj); + +/* + * Test for specific typed array types (ArrayBufferView subtypes) + */ + +extern JS_FRIEND_API(JSBool) +JS_IsInt8Array(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsUint8Array(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsUint8ClampedArray(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsInt16Array(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsUint16Array(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsInt32Array(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsUint32Array(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsFloat32Array(JSObject *obj); +extern JS_FRIEND_API(JSBool) +JS_IsFloat64Array(JSObject *obj); + +/* + * Unwrap Typed arrays all at once. Return NULL without throwing if the object + * cannot be viewed as the correct typed array, or the typed array object on + * success, filling both outparameters. + */ +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsInt8Array(JSObject *obj, uint32_t *length, int8_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsUint8Array(JSObject *obj, uint32_t *length, uint8_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsUint8ClampedArray(JSObject *obj, uint32_t *length, uint8_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsInt16Array(JSObject *obj, uint32_t *length, int16_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsUint16Array(JSObject *obj, uint32_t *length, uint16_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsInt32Array(JSObject *obj, uint32_t *length, int32_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsUint32Array(JSObject *obj, uint32_t *length, uint32_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsFloat32Array(JSObject *obj, uint32_t *length, float **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsFloat64Array(JSObject *obj, uint32_t *length, double **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsArrayBufferView(JSObject *obj, uint32_t *length, uint8_t **data); +extern JS_FRIEND_API(JSObject *) +JS_GetObjectAsArrayBuffer(JSObject *obj, uint32_t *length, uint8_t **data); + +/* + * Get the type of elements in a typed array, or TYPE_DATAVIEW if a DataView. + * + * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow + * be known that it would pass such a test: it is an ArrayBufferView or a + * wrapper of an ArrayBufferView, and the unwrapping will succeed. + */ +extern JS_FRIEND_API(JSArrayBufferViewType) +JS_GetArrayBufferViewType(JSObject *obj); + +/* + * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may + * return false if a security wrapper is encountered that denies the + * unwrapping. If this test succeeds, then it is safe to call the various + * accessor JSAPI calls defined below. + */ +extern JS_FRIEND_API(JSBool) +JS_IsArrayBufferObject(JSObject *obj); + +/* + * Return the available byte length of an array buffer. + * + * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known + * that it would pass such a test: it is an ArrayBuffer or a wrapper of an + * ArrayBuffer, and the unwrapping will succeed. + */ +extern JS_FRIEND_API(uint32_t) +JS_GetArrayBufferByteLength(JSObject *obj); + +/* + * Return a pointer to an array buffer's data. The buffer is still owned by the + * array buffer object, and should not be modified on another thread. The + * returned pointer is stable across GCs. + * + * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known + * that it would pass such a test: it is an ArrayBuffer or a wrapper of an + * ArrayBuffer, and the unwrapping will succeed. + */ +extern JS_FRIEND_API(uint8_t *) +JS_GetArrayBufferData(JSObject *obj); + +/* + * Return the number of elements in a typed array. + * + * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow + * be known that it would pass such a test: it is a typed array or a wrapper of + * a typed array, and the unwrapping will succeed. + */ +extern JS_FRIEND_API(uint32_t) +JS_GetTypedArrayLength(JSObject *obj); + +/* + * Return the byte offset from the start of an array buffer to the start of a + * typed array view. + * + * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow + * be known that it would pass such a test: it is a typed array or a wrapper of + * a typed array, and the unwrapping will succeed. + */ +extern JS_FRIEND_API(uint32_t) +JS_GetTypedArrayByteOffset(JSObject *obj); + +/* + * Return the byte length of a typed array. + * + * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow + * be known that it would pass such a test: it is a typed array or a wrapper of + * a typed array, and the unwrapping will succeed. + */ +extern JS_FRIEND_API(uint32_t) +JS_GetTypedArrayByteLength(JSObject *obj); + +/* + * Check whether obj supports JS_ArrayBufferView* APIs. Note that this may + * return false if a security wrapper is encountered that denies the + * unwrapping. + */ +extern JS_FRIEND_API(JSBool) +JS_IsArrayBufferViewObject(JSObject *obj); + +/* + * More generic name for JS_GetTypedArrayByteLength to cover DataViews as well + */ +extern JS_FRIEND_API(uint32_t) +JS_GetArrayBufferViewByteLength(JSObject *obj); + +/* + * Return a pointer to the start of the data referenced by a typed array. The + * data is still owned by the typed array, and should not be modified on + * another thread. + * + * |obj| must have passed a JS_Is*Array test, or somehow be known that it would + * pass such a test: it is a typed array or a wrapper of a typed array, and the + * unwrapping will succeed. + */ + +extern JS_FRIEND_API(int8_t *) +JS_GetInt8ArrayData(JSObject *obj); +extern JS_FRIEND_API(uint8_t *) +JS_GetUint8ArrayData(JSObject *obj); +extern JS_FRIEND_API(uint8_t *) +JS_GetUint8ClampedArrayData(JSObject *obj); +extern JS_FRIEND_API(int16_t *) +JS_GetInt16ArrayData(JSObject *obj); +extern JS_FRIEND_API(uint16_t *) +JS_GetUint16ArrayData(JSObject *obj); +extern JS_FRIEND_API(int32_t *) +JS_GetInt32ArrayData(JSObject *obj); +extern JS_FRIEND_API(uint32_t *) +JS_GetUint32ArrayData(JSObject *obj); +extern JS_FRIEND_API(float *) +JS_GetFloat32ArrayData(JSObject *obj); +extern JS_FRIEND_API(double *) +JS_GetFloat64ArrayData(JSObject *obj); + +/* + * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific + * versions when possible. + */ +extern JS_FRIEND_API(void *) +JS_GetArrayBufferViewData(JSObject *obj); + +/* + * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been + * neutered, this will still return the neutered buffer. |obj| must be an + * object that would return true for JS_IsArrayBufferViewObject(). + */ +extern JS_FRIEND_API(JSObject *) +JS_GetArrayBufferViewBuffer(JSObject *obj); + +/* + * Check whether obj supports JS_GetDataView* APIs. + */ +JS_FRIEND_API(JSBool) +JS_IsDataViewObject(JSObject *obj); + +/* + * Return the byte offset of a data view into its array buffer. |obj| must be a + * DataView. + * + * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that + * it would pass such a test: it is a data view or a wrapper of a data view, + * and the unwrapping will succeed. + */ +JS_FRIEND_API(uint32_t) +JS_GetDataViewByteOffset(JSObject *obj); + +/* + * Return the byte length of a data view. + * + * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that + * it would pass such a test: it is a data view or a wrapper of a data view, + * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be + * unable to assert when unwrapping should be disallowed. + */ +JS_FRIEND_API(uint32_t) +JS_GetDataViewByteLength(JSObject *obj); + +/* + * Return a pointer to the beginning of the data referenced by a DataView. + * + * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that + * it would pass such a test: it is a data view or a wrapper of a data view, + * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be + * unable to assert when unwrapping should be disallowed. + */ +JS_FRIEND_API(void *) +JS_GetDataViewData(JSObject *obj); + +/* + * This struct contains metadata passed from the DOM to the JS Engine for JIT + * optimizations on DOM property accessors. Eventually, this should be made + * available to general JSAPI users, but we are not currently ready to do so. + */ +typedef bool +(* JSJitPropertyOp)(JSContext *cx, JSHandleObject thisObj, + void *specializedThis, JS::Value *vp); +typedef bool +(* JSJitMethodOp)(JSContext *cx, JSHandleObject thisObj, + void *specializedThis, unsigned argc, JS::Value *vp); + +struct JSJitInfo { + enum OpType { + Getter, + Setter, + Method + }; + + JSJitPropertyOp op; + uint32_t protoID; + uint32_t depth; + OpType type; + bool isInfallible; /* Is op fallible? False in setters. */ + bool isConstant; /* Getting a construction-time constant? */ + bool isPure; /* As long as no non-pure DOM things happen, will + keep returning the same value for the given + "this" object" */ + JSValueType returnType; /* The return type tag. Might be JSVAL_TYPE_UNKNOWN */ +}; + +static JS_ALWAYS_INLINE const JSJitInfo * +FUNCTION_VALUE_TO_JITINFO(const JS::Value& v) +{ + JS_ASSERT(js::GetObjectClass(&v.toObject()) == &js::FunctionClass); + return reinterpret_cast(&v.toObject())->jitinfo; +} + +/* Statically asserted in jsfun.h. */ +static const unsigned JS_FUNCTION_INTERPRETED_BIT = 0x1; + +static JS_ALWAYS_INLINE void +SET_JITINFO(JSFunction * func, const JSJitInfo *info) +{ + js::shadow::Function *fun = reinterpret_cast(func); + JS_ASSERT(!(fun->flags & JS_FUNCTION_INTERPRETED_BIT)); + fun->jitinfo = info; +} + +/* + * Engine-internal extensions of jsid. This code is here only until we + * eliminate Gecko's dependencies on it! + */ + +static JS_ALWAYS_INLINE jsid +JSID_FROM_BITS(size_t bits) +{ + jsid id; + JSID_BITS(id) = bits; + return id; +} + +/* + * Must not be used on atoms that are representable as integer jsids. + * Prefer NameToId or AtomToId over this function: + * + * A PropertyName is an atom that does not contain an integer in the range + * [0, UINT32_MAX]. However, jsid can only hold an integer in the range + * [0, JSID_INT_MAX] (where JSID_INT_MAX == 2^31-1). Thus, for the range of + * integers (JSID_INT_MAX, UINT32_MAX], to represent as a jsid 'id', it must be + * the case JSID_IS_ATOM(id) and !JSID_TO_ATOM(id)->isPropertyName(). In most + * cases when creating a jsid, code does not have to care about this corner + * case because: + * + * - When given an arbitrary JSAtom*, AtomToId must be used, which checks for + * integer atoms representable as integer jsids, and does this conversion. + * + * - When given a PropertyName*, NameToId can be used which which does not need + * to do any dynamic checks. + * + * Thus, it is only the rare third case which needs this function, which + * handles any JSAtom* that is known not to be representable with an int jsid. + */ +static JS_ALWAYS_INLINE jsid +NON_INTEGER_ATOM_TO_JSID(JSAtom *atom) +{ + JS_ASSERT(((size_t)atom & 0x7) == 0); + jsid id = JSID_FROM_BITS((size_t)atom); + JS_ASSERT(id == INTERNED_STRING_TO_JSID(NULL, (JSString*)atom)); + return id; +} + +/* All strings stored in jsids are atomized, but are not necessarily property names. */ +static JS_ALWAYS_INLINE JSBool +JSID_IS_ATOM(jsid id) +{ + return JSID_IS_STRING(id); +} + +static JS_ALWAYS_INLINE JSBool +JSID_IS_ATOM(jsid id, JSAtom *atom) +{ + return id == JSID_FROM_BITS((size_t)atom); +} + +static JS_ALWAYS_INLINE JSAtom * +JSID_TO_ATOM(jsid id) +{ + return (JSAtom *)JSID_TO_STRING(id); +} + +JS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD); + +namespace js { + +static JS_ALWAYS_INLINE Value +IdToValue(jsid id) +{ + if (JSID_IS_STRING(id)) + return StringValue(JSID_TO_STRING(id)); + if (JS_LIKELY(JSID_IS_INT(id))) + return Int32Value(JSID_TO_INT(id)); + if (JS_LIKELY(JSID_IS_OBJECT(id))) + return ObjectValue(*JSID_TO_OBJECT(id)); + JS_ASSERT(JSID_IS_VOID(id)); + return UndefinedValue(); +} + +static JS_ALWAYS_INLINE jsval +IdToJsval(jsid id) +{ + return IdToValue(id); +} + +extern JS_FRIEND_API(bool) +IsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method); + +extern JS_FRIEND_API(bool) +IsTypedArrayThisCheck(JS::IsAcceptableThis test); + +enum CTypesActivityType { + CTYPES_CALL_BEGIN, + CTYPES_CALL_END, + CTYPES_CALLBACK_BEGIN, + CTYPES_CALLBACK_END +}; + +typedef void +(* CTypesActivityCallback)(JSContext *cx, CTypesActivityType type); + +/* + * Sets a callback that is run whenever js-ctypes is about to be used when + * calling into C. + */ +JS_FRIEND_API(void) +SetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb); + +class JS_FRIEND_API(AutoCTypesActivityCallback) { + private: + JSContext *cx; + CTypesActivityCallback callback; + CTypesActivityType endType; + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER + + public: + AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType, + CTypesActivityType endType + MOZ_GUARD_OBJECT_NOTIFIER_PARAM); + ~AutoCTypesActivityCallback() { + DoEndCallback(); + } + void DoEndCallback() { + if (callback) { + callback(cx, endType); + callback = NULL; + } + } +}; + +} /* namespace js */ + +#endif /* jsfriendapi_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jslock.h b/scripting/javascript/spidermonkey-mac/include/jslock.h new file mode 100644 index 0000000000..025aaea0af --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jslock.h @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef jslock_h__ +#define jslock_h__ + +#include "jsapi.h" + +#ifdef JS_THREADSAFE + +# include "pratom.h" +# include "prlock.h" +# include "prcvar.h" +# include "prthread.h" +# include "prinit.h" + +# define JS_ATOMIC_INCREMENT(p) PR_ATOMIC_INCREMENT((int32_t *)(p)) +# define JS_ATOMIC_DECREMENT(p) PR_ATOMIC_DECREMENT((int32_t *)(p)) +# define JS_ATOMIC_ADD(p,v) PR_ATOMIC_ADD((int32_t *)(p), (int32_t)(v)) +# define JS_ATOMIC_SET(p,v) PR_ATOMIC_SET((int32_t *)(p), (int32_t)(v)) + +namespace js { + // Defined in jsgc.cpp. + unsigned GetCPUCount(); +} + +#else /* JS_THREADSAFE */ + +typedef struct PRThread PRThread; +typedef struct PRCondVar PRCondVar; +typedef struct PRLock PRLock; + +# define JS_ATOMIC_INCREMENT(p) (++*(p)) +# define JS_ATOMIC_DECREMENT(p) (--*(p)) +# define JS_ATOMIC_ADD(p,v) (*(p) += (v)) +# define JS_ATOMIC_SET(p,v) (*(p) = (v)) + +#endif /* JS_THREADSAFE */ + +#endif /* jslock_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/json.h b/scripting/javascript/spidermonkey-mac/include/json.h new file mode 100644 index 0000000000..bb21f91451 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/json.h @@ -0,0 +1,46 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef json_h___ +#define json_h___ + +#include "jsprvtd.h" +#include "jspubtd.h" +#include "jsapi.h" + +#include "js/Vector.h" + +#define JSON_MAX_DEPTH 2048 +#define JSON_PARSER_BUFSIZE 1024 + +extern JSObject * +js_InitJSONClass(JSContext *cx, js::HandleObject obj); + +extern JSBool +js_Stringify(JSContext *cx, js::MutableHandleValue vp, + JSObject *replacer, js::Value space, + js::StringBuffer &sb); + +// Avoid build errors on certain platforms that define these names as constants +#undef STRICT +#undef LEGACY + +/* + * The type of JSON decoding to perform. Strict decoding is to-the-spec; + * legacy decoding accepts a few non-JSON syntaxes historically accepted by the + * implementation. (Full description of these deviations is deliberately + * omitted.) New users should use strict decoding rather than legacy decoding, + * as legacy decoding might be removed at a future time. + */ +enum DecodingMode { STRICT, LEGACY }; + +namespace js { + +extern JS_FRIEND_API(JSBool) +ParseJSONWithReviver(JSContext *cx, JS::StableCharPtr chars, size_t length, HandleValue filter, + MutableHandleValue vp, DecodingMode decodingMode = STRICT); + +} /* namespace js */ + +#endif /* json_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsperf.h b/scripting/javascript/spidermonkey-mac/include/jsperf.h new file mode 100644 index 0000000000..265478c33e --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsperf.h @@ -0,0 +1,130 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsperf_h___ +#define jsperf_h___ + +#include "jsapi.h" + +namespace JS { + +/* + * JS::PerfMeasurement is a generic way to access detailed performance + * measurement APIs provided by your operating system. The details of + * exactly how this works and what can be measured are highly + * system-specific, but this interface is (one hopes) implementable + * on top of all of them. + * + * To use this API, create a PerfMeasurement object, passing its + * constructor a bitmask indicating which events you are interested + * in. Thereafter, Start() zeroes all counters and starts timing; + * Stop() stops timing again; and the counters for the events you + * requested are available as data values after calling Stop(). The + * object may be reused for many measurements. + */ +class JS_FRIEND_API(PerfMeasurement) +{ + protected: + // Implementation-specific data, if any. + void* impl; + + public: + /* + * Events that may be measured. Taken directly from the list of + * "generalized hardware performance event types" in the Linux + * perf_event API, plus some of the "software events". + */ + enum EventMask { + CPU_CYCLES = 0x00000001, + INSTRUCTIONS = 0x00000002, + CACHE_REFERENCES = 0x00000004, + CACHE_MISSES = 0x00000008, + BRANCH_INSTRUCTIONS = 0x00000010, + BRANCH_MISSES = 0x00000020, + BUS_CYCLES = 0x00000040, + PAGE_FAULTS = 0x00000080, + MAJOR_PAGE_FAULTS = 0x00000100, + CONTEXT_SWITCHES = 0x00000200, + CPU_MIGRATIONS = 0x00000400, + + ALL = 0x000007ff, + NUM_MEASURABLE_EVENTS = 11 + }; + + /* + * Bitmask of events that will be measured when this object is + * active (between Start() and Stop()). This may differ from the + * bitmask passed to the constructor if the platform does not + * support measuring all of the requested events. + */ + const EventMask eventsMeasured; + + /* + * Counters for each measurable event. + * Immediately after one of these objects is created, all of the + * counters for enabled events will be zero, and all of the + * counters for disabled events will be uint64_t(-1). + */ + uint64_t cpu_cycles; + uint64_t instructions; + uint64_t cache_references; + uint64_t cache_misses; + uint64_t branch_instructions; + uint64_t branch_misses; + uint64_t bus_cycles; + uint64_t page_faults; + uint64_t major_page_faults; + uint64_t context_switches; + uint64_t cpu_migrations; + + /* + * Prepare to measure the indicated set of events. If not all of + * the requested events can be measured on the current platform, + * then the eventsMeasured bitmask will only include the subset of + * |toMeasure| corresponding to the events that can be measured. + */ + PerfMeasurement(EventMask toMeasure); + + /* Done with this set of measurements, tear down OS-level state. */ + ~PerfMeasurement(); + + /* Start a measurement cycle. */ + void start(); + + /* + * End a measurement cycle, and for each enabled counter, add the + * number of measured events of that type to the appropriate + * visible variable. + */ + void stop(); + + /* Reset all enabled counters to zero. */ + void reset(); + + /* + * True if this platform supports measuring _something_, i.e. it's + * not using the stub implementation. + */ + static bool canMeasureSomething(); +}; + +/* Inject a Javascript wrapper around the above C++ class into the + * Javascript object passed as an argument (this will normally be a + * global object). The JS-visible API is identical to the C++ API. + */ +extern JS_FRIEND_API(JSObject*) + RegisterPerfMeasurement(JSContext *cx, JSRawObject global); + +/* + * Given a jsval which contains an instance of the aforementioned + * wrapper class, extract the C++ object. Returns NULL if the + * jsval is not an instance of the wrapper. + */ +extern JS_FRIEND_API(PerfMeasurement*) + ExtractPerfMeasurement(jsval wrapper); + +} // namespace JS + +#endif // jsperf_h___ diff --git a/scripting/javascript/spidermonkey-mac/include/jsprf.h b/scripting/javascript/spidermonkey-mac/include/jsprf.h new file mode 100644 index 0000000000..4c2bef91d2 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsprf.h @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsprf_h___ +#define jsprf_h___ + +/* +** API for PR printf like routines. Supports the following formats +** %d - decimal +** %u - unsigned decimal +** %x - unsigned hex +** %X - unsigned uppercase hex +** %o - unsigned octal +** %hd, %hu, %hx, %hX, %ho - 16-bit versions of above +** %ld, %lu, %lx, %lX, %lo - 32-bit versions of above +** %lld, %llu, %llx, %llX, %llo - 64 bit versions of above +** %s - ascii string +** %hs - ucs2 string +** %c - character +** %p - pointer (deals with machine dependent pointer size) +** %f - float +** %g - float +*/ +#include "jstypes.h" +#include +#include + +/* +** sprintf into a fixed size buffer. Guarantees that a NUL is at the end +** of the buffer. Returns the length of the written output, NOT including +** the NUL, or (uint32_t)-1 if an error occurs. +*/ +extern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...); + +/* +** sprintf into a malloc'd buffer. Return a pointer to the malloc'd +** buffer on success, NULL on failure. Call "JS_smprintf_free" to release +** the memory returned. +*/ +extern JS_PUBLIC_API(char*) JS_smprintf(const char *fmt, ...); + +/* +** Free the memory allocated, for the caller, by JS_smprintf +*/ +extern JS_PUBLIC_API(void) JS_smprintf_free(char *mem); + +/* +** "append" sprintf into a malloc'd buffer. "last" is the last value of +** the malloc'd buffer. sprintf will append data to the end of last, +** growing it as necessary using realloc. If last is NULL, JS_sprintf_append +** will allocate the initial string. The return value is the new value of +** last for subsequent calls, or NULL if there is a malloc failure. +*/ +extern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...); + +/* +** sprintf into a function. The function "f" is called with a string to +** place into the output. "arg" is an opaque pointer used by the stuff +** function to hold any state needed to do the storage of the output +** data. The return value is a count of the number of characters fed to +** the stuff function, or (uint32_t)-1 if an error occurs. +*/ +typedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen); + +extern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...); + +/* +** va_list forms of the above. +*/ +extern JS_PUBLIC_API(uint32_t) JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap); +extern JS_PUBLIC_API(char*) JS_vsmprintf(const char *fmt, va_list ap); +extern JS_PUBLIC_API(char*) JS_vsprintf_append(char *last, const char *fmt, va_list ap); +extern JS_PUBLIC_API(uint32_t) JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap); + +#endif /* jsprf_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsprototypes.h b/scripting/javascript/spidermonkey-mac/include/jsprototypes.h new file mode 100644 index 0000000000..27f5c84450 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsprototypes.h @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* A higher-order macro for enumerating all JSProtoKey values. */ + +#ifndef jsprototypes_h___ +#define jsprototypes_h___ + +#include "jsversion.h" + +/* + * Enumerator codes in the second column must not change -- they are part of + * the JS XDR API. Also note the symbols in the third column are extern "C"; + * clients should use extern "C" {} as appropriate when using this macro. + */ + +#define JS_FOR_EACH_PROTOTYPE(macro) \ + macro(Null, 0, js_InitNullClass) \ + macro(Object, 1, js_InitObjectClass) \ + macro(Function, 2, js_InitFunctionClass) \ + macro(Array, 3, js_InitArrayClass) \ + macro(Boolean, 4, js_InitBooleanClass) \ + macro(JSON, 5, js_InitJSONClass) \ + macro(Date, 6, js_InitDateClass) \ + macro(Math, 7, js_InitMathClass) \ + macro(Number, 8, js_InitNumberClass) \ + macro(String, 9, js_InitStringClass) \ + macro(RegExp, 10, js_InitRegExpClass) \ + macro(Error, 11, js_InitExceptionClasses) \ + macro(InternalError, 12, js_InitExceptionClasses) \ + macro(EvalError, 13, js_InitExceptionClasses) \ + macro(RangeError, 14, js_InitExceptionClasses) \ + macro(ReferenceError, 15, js_InitExceptionClasses) \ + macro(SyntaxError, 16, js_InitExceptionClasses) \ + macro(TypeError, 17, js_InitExceptionClasses) \ + macro(URIError, 18, js_InitExceptionClasses) \ + macro(Iterator, 19, js_InitIteratorClasses) \ + macro(StopIteration, 20, js_InitIteratorClasses) \ + macro(ArrayBuffer, 21, js_InitTypedArrayClasses) \ + macro(Int8Array, 22, js_InitTypedArrayClasses) \ + macro(Uint8Array, 23, js_InitTypedArrayClasses) \ + macro(Int16Array, 24, js_InitTypedArrayClasses) \ + macro(Uint16Array, 25, js_InitTypedArrayClasses) \ + macro(Int32Array, 26, js_InitTypedArrayClasses) \ + macro(Uint32Array, 27, js_InitTypedArrayClasses) \ + macro(Float32Array, 28, js_InitTypedArrayClasses) \ + macro(Float64Array, 29, js_InitTypedArrayClasses) \ + macro(Uint8ClampedArray, 30, js_InitTypedArrayClasses) \ + macro(Proxy, 31, js_InitProxyClass) \ + macro(WeakMap, 32, js_InitWeakMapClass) \ + macro(Map, 33, js_InitMapClass) \ + macro(Set, 34, js_InitSetClass) \ + macro(DataView, 35, js_InitTypedArrayClasses) \ + macro(ParallelArray, 36, js_InitParallelArrayClass) \ + macro(Intl, 37, js_InitIntlClass) \ + +#endif /* jsprototypes_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsproxy.h b/scripting/javascript/spidermonkey-mac/include/jsproxy.h new file mode 100644 index 0000000000..304f04a2a5 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsproxy.h @@ -0,0 +1,327 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsproxy_h___ +#define jsproxy_h___ + +#include "jsapi.h" +#include "jsfriendapi.h" + +namespace js { + +class JS_FRIEND_API(Wrapper); + +/* + * A proxy is a JSObject that implements generic behavior by providing custom + * implementations for each object trap. The implementation for each trap is + * provided by a C++ object stored on the proxy, known as its handler. + * + * A major use case for proxies is to forward each trap to another object, + * known as its target. The target can be an arbitrary C++ object. Not every + * proxy has the notion of a target, however. + * + * Proxy traps are grouped into fundamental and derived traps. Every proxy has + * to at least provide implementations for the fundamental traps, but the + * derived traps can be implemented in terms of the fundamental ones + * BaseProxyHandler provides implementations of the derived traps in terms of + * the (pure virtual) fundamental traps. + * + * To minimize code duplication, a set of abstract proxy handler classes is + * provided, from which other handlers may inherit. These abstract classes + * are organized in the following hierarchy: + * + * BaseProxyHandler + * | + * DirectProxyHandler + * | + * Wrapper + */ + +/* + * BaseProxyHandler is the most generic kind of proxy handler. It does not make + * any assumptions about the target. Consequently, it does not provide any + * default implementation for the fundamental traps. It does, however, implement + * the derived traps in terms of the fundamental ones. This allows consumers of + * this class to define any custom behavior they want. + */ +class JS_FRIEND_API(BaseProxyHandler) { + void *mFamily; + bool mHasPrototype; + protected: + // Subclasses may set this in their constructor. + void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; } + + public: + explicit BaseProxyHandler(void *family); + virtual ~BaseProxyHandler(); + + bool hasPrototype() { + return mHasPrototype; + } + + inline void *family() { + return mFamily; + } + + virtual bool isOuterWindow() { + return false; + } + + /* ES5 Harmony fundamental proxy traps. */ + virtual bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + PropertyDescriptor *desc, unsigned flags) = 0; + virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, + jsid id, PropertyDescriptor *desc, unsigned flags) = 0; + virtual bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, + PropertyDescriptor *desc) = 0; + virtual bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, + AutoIdVector &props) = 0; + virtual bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp) = 0; + virtual bool enumerate(JSContext *cx, JSObject *proxy, + AutoIdVector &props) = 0; + + /* ES5 Harmony derived proxy traps. */ + virtual bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp); + virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp); + virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, + jsid id, Value *vp); + virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, + jsid id, bool strict, Value *vp); + virtual bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props); + virtual bool iterate(JSContext *cx, JSObject *proxy, unsigned flags, + Value *vp); + + /* Spidermonkey extensions. */ + virtual bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp); + virtual bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval); + virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args); + virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp); + virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx); + virtual JSString *obj_toString(JSContext *cx, JSObject *proxy); + virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent); + virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g); + virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp); + virtual void finalize(JSFreeOp *fop, JSObject *proxy); + virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, + uint32_t index, Value *vp, bool *present); + virtual bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + + /* See comment for weakmapKeyDelegateOp in jsclass.h. */ + virtual JSObject *weakmapKeyDelegate(JSObject *proxy); +}; + +/* + * DirectProxyHandler includes a notion of a target object. All traps are + * reimplemented such that they forward their behavior to the target. This + * allows consumers of this class to forward to another object as transparently + * and efficiently as possible. + */ +class JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler { +public: + explicit DirectProxyHandler(void *family); + + /* ES5 Harmony fundamental proxy traps. */ + virtual bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; + virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, + jsid id, PropertyDescriptor *desc, + unsigned flags) MOZ_OVERRIDE; + virtual bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, + PropertyDescriptor *desc) MOZ_OVERRIDE; + virtual bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, + AutoIdVector &props) MOZ_OVERRIDE; + virtual bool delete_(JSContext *cx, JSObject *proxy, jsid id, + bool *bp) MOZ_OVERRIDE; + virtual bool enumerate(JSContext *cx, JSObject *proxy, + AutoIdVector &props) MOZ_OVERRIDE; + + /* ES5 Harmony derived proxy traps. */ + virtual bool has(JSContext *cx, JSObject *proxy, jsid id, + bool *bp) MOZ_OVERRIDE; + virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, + bool *bp) MOZ_OVERRIDE; + virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, + jsid id, Value *vp) MOZ_OVERRIDE; + virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, + jsid id, bool strict, Value *vp) MOZ_OVERRIDE; + virtual bool keys(JSContext *cx, JSObject *proxy, + AutoIdVector &props) MOZ_OVERRIDE; + virtual bool iterate(JSContext *cx, JSObject *proxy, unsigned flags, + Value *vp) MOZ_OVERRIDE; + + /* Spidermonkey extensions. */ + virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, + CallArgs args) MOZ_OVERRIDE; + virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, + bool *bp) MOZ_OVERRIDE; + virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, + JSContext *cx) MOZ_OVERRIDE; + virtual JSString *obj_toString(JSContext *cx, JSObject *proxy) MOZ_OVERRIDE; + virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, + unsigned indent) MOZ_OVERRIDE; + virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, + RegExpGuard *g) MOZ_OVERRIDE; + virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, + Value *vp) MOZ_OVERRIDE; + virtual JSObject *weakmapKeyDelegate(JSObject *proxy); +}; + +/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */ +class Proxy { + public: + /* ES5 Harmony fundamental proxy traps. */ + static bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + PropertyDescriptor *desc, unsigned flags); + static bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, unsigned flags, jsid id, + Value *vp); + static bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + PropertyDescriptor *desc, unsigned flags); + static bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, unsigned flags, jsid id, + Value *vp); + static bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, PropertyDescriptor *desc); + static bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, const Value &v); + static bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &props); + static bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp); + static bool enumerate(JSContext *cx, JSObject *proxy, AutoIdVector &props); + + /* ES5 Harmony derived proxy traps. */ + static bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp); + static bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp); + static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, MutableHandleValue vp); + static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver, + uint32_t index, MutableHandleValue vp, bool *present); + static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, bool strict, + MutableHandleValue vp); + static bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props); + static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp); + + /* Spidermonkey extensions. */ + static bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp); + static bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval); + static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args); + static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp); + static bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx); + static JSString *obj_toString(JSContext *cx, JSObject *proxy); + static JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent); + static bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g); + static bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp); + static bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + + static JSObject * const LazyProto; +}; + +inline bool IsObjectProxyClass(const Class *clasp) +{ + return clasp == &js::ObjectProxyClass || clasp == &js::OuterWindowProxyClass; +} + +inline bool IsFunctionProxyClass(const Class *clasp) +{ + return clasp == &js::FunctionProxyClass; +} + +inline bool IsObjectProxy(RawObject obj) +{ + return IsObjectProxyClass(GetObjectClass(obj)); +} + +inline bool IsFunctionProxy(RawObject obj) +{ + return IsFunctionProxyClass(GetObjectClass(obj)); +} + +inline bool IsProxy(RawObject obj) +{ + Class *clasp = GetObjectClass(obj); + return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp); +} + +/* Shared between object and function proxies. */ +/* + * NOTE: JSSLOT_PROXY_PRIVATE is 0, because that way slot 0 is usable by API + * clients for both proxy and non-proxy objects. So an API client that only + * needs to store one slot's worth of data doesn't need to branch on what sort + * of object it has. + */ +const uint32_t JSSLOT_PROXY_PRIVATE = 0; +const uint32_t JSSLOT_PROXY_HANDLER = 1; +const uint32_t JSSLOT_PROXY_EXTRA = 2; +/* Function proxies only. */ +const uint32_t JSSLOT_PROXY_CALL = 4; +const uint32_t JSSLOT_PROXY_CONSTRUCT = 5; + +inline BaseProxyHandler * +GetProxyHandler(RawObject obj) +{ + JS_ASSERT(IsProxy(obj)); + return (BaseProxyHandler *) GetReservedSlot(obj, JSSLOT_PROXY_HANDLER).toPrivate(); +} + +inline const Value & +GetProxyPrivate(RawObject obj) +{ + JS_ASSERT(IsProxy(obj)); + return GetReservedSlot(obj, JSSLOT_PROXY_PRIVATE); +} + +inline JSObject * +GetProxyTargetObject(RawObject obj) +{ + JS_ASSERT(IsProxy(obj)); + return GetProxyPrivate(obj).toObjectOrNull(); +} + +inline const Value & +GetProxyCall(RawObject obj) +{ + JS_ASSERT(IsFunctionProxy(obj)); + return GetReservedSlot(obj, JSSLOT_PROXY_CALL); +} + +inline const Value & +GetProxyExtra(RawObject obj, size_t n) +{ + JS_ASSERT(IsProxy(obj)); + return GetReservedSlot(obj, JSSLOT_PROXY_EXTRA + n); +} + +inline void +SetProxyHandler(RawObject obj, BaseProxyHandler *handler) +{ + JS_ASSERT(IsProxy(obj)); + SetReservedSlot(obj, JSSLOT_PROXY_HANDLER, PrivateValue(handler)); +} + +inline void +SetProxyPrivate(RawObject obj, const Value &value) +{ + JS_ASSERT(IsProxy(obj)); + SetReservedSlot(obj, JSSLOT_PROXY_PRIVATE, value); +} + +inline void +SetProxyExtra(RawObject obj, size_t n, const Value &extra) +{ + JS_ASSERT(IsProxy(obj)); + JS_ASSERT(n <= 1); + SetReservedSlot(obj, JSSLOT_PROXY_EXTRA + n, extra); +} + +JS_FRIEND_API(JSObject *) +NewProxyObject(JSContext *cx, BaseProxyHandler *handler, const Value &priv, + JSObject *proto, JSObject *parent, + JSObject *call = NULL, JSObject *construct = NULL); + +JSObject * +RenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv); + +} /* namespace js */ + +extern JS_FRIEND_API(JSObject *) +js_InitProxyClass(JSContext *cx, JSHandleObject obj); + +#endif diff --git a/scripting/javascript/spidermonkey-mac/include/jsprvtd.h b/scripting/javascript/spidermonkey-mac/include/jsprvtd.h new file mode 100644 index 0000000000..6d9a2061f5 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsprvtd.h @@ -0,0 +1,303 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsprvtd_h___ +#define jsprvtd_h___ +/* + * JS private typename definitions. + * + * This header is included only in other .h files, for convenience and for + * simplicity of type naming. The alternative for structures is to use tags, + * which are named the same as their typedef names (legal in C/C++, and less + * noisy than suffixing the typedef name with "Struct" or "Str"). Instead, + * all .h files that include this file may use the same typedef name, whether + * declaring a pointer to struct type, or defining a member of struct type. + * + * A few fundamental scalar types are defined here too. Neither the scalar + * nor the struct typedefs should change much, therefore the nearly-global + * make dependency induced by this file should not prove painful. + */ + +#include "jsapi.h" +#include "jsutil.h" + +#ifdef __cplusplus +#include "js/HashTable.h" +#include "js/Vector.h" +#endif + +/* + * Convenience constants. + */ +#define JS_BITS_PER_UINT32_LOG2 5 +#define JS_BITS_PER_UINT32 32 + +/* The alignment required of objects stored in GC arenas. */ +static const unsigned JS_GCTHING_ALIGN = 8; +static const unsigned JS_GCTHING_ZEROBITS = 3; + +/* Scalar typedefs. */ +typedef uint8_t jsbytecode; +typedef uint8_t jssrcnote; +typedef uintptr_t jsatomid; + +/* Struct typedefs. */ +typedef struct JSGCThing JSGCThing; +typedef struct JSGenerator JSGenerator; +typedef struct JSNativeEnumerator JSNativeEnumerator; +typedef struct JSTryNote JSTryNote; + +/* Friend "Advanced API" typedefs. */ +typedef struct JSAtomState JSAtomState; +typedef struct JSCodeSpec JSCodeSpec; +typedef struct JSPrinter JSPrinter; +typedef struct JSStackHeader JSStackHeader; +typedef struct JSSubString JSSubString; +typedef struct JSSpecializedNative JSSpecializedNative; + +/* + * Template declarations. + * + * jsprvtd.h can be included in both C and C++ translation units. For C++, it + * may possibly be wrapped in an extern "C" block which does not agree with + * templates. + */ +#ifdef __cplusplus + +extern "C++" { + +class JSDependentString; +class JSExtensibleString; +class JSExternalString; +class JSLinearString; +class JSRope; +class JSAtom; +class JSWrapper; + +namespace js { + +struct ArgumentsData; +struct Class; + +class RegExpGuard; +class RegExpObject; +class RegExpObjectBuilder; +class RegExpShared; +class RegExpStatics; +class MatchPairs; +class PropertyName; + +enum RegExpFlag +{ + IgnoreCaseFlag = 0x01, + GlobalFlag = 0x02, + MultilineFlag = 0x04, + StickyFlag = 0x08, + + NoFlags = 0x00, + AllFlags = 0x0f +}; + +class ExecuteArgsGuard; +class InvokeFrameGuard; +class InvokeArgsGuard; +class StringBuffer; + +class FrameRegs; +class StackFrame; +class StackSegment; +class StackSpace; +class ContextStack; +class ScriptFrameIter; + +class Proxy; +class JS_FRIEND_API(BaseProxyHandler); +class JS_FRIEND_API(Wrapper); +class JS_FRIEND_API(CrossCompartmentWrapper); + +class TempAllocPolicy; +class RuntimeAllocPolicy; + +class GlobalObject; + +template +class InlineMap; + +class LifoAlloc; + +class Shape; + +class Breakpoint; +class BreakpointSite; +class Debugger; +class WatchpointMap; + +/* + * Env is the type of what ES5 calls "lexical environments" (runtime + * activations of lexical scopes). This is currently just JSObject, and is + * implemented by Call, Block, With, and DeclEnv objects, among others--but + * environments and objects are really two different concepts. + */ +typedef JSObject Env; + +typedef JSNative Native; +typedef JSPropertyOp PropertyOp; +typedef JSStrictPropertyOp StrictPropertyOp; +typedef JSPropertyDescriptor PropertyDescriptor; + +namespace frontend { + +struct BytecodeEmitter; +struct Definition; +class FunctionBox; +class ObjectBox; +struct Token; +struct TokenPos; +struct TokenPtr; +class TokenStream; +struct Parser; +class ParseMapPool; +struct ParseNode; + +} /* namespace frontend */ + +namespace analyze { + +struct LifetimeVariable; +class LoopAnalysis; +class ScriptAnalysis; +class SlotValue; +class SSAValue; +class SSAUseChain; + +} /* namespace analyze */ + +namespace types { + +class TypeSet; +struct TypeCallsite; +struct TypeObject; +struct TypeCompartment; + +} /* namespace types */ + +typedef JS::Handle HandleShape; +typedef JS::Handle HandleTypeObject; +typedef JS::Handle HandleAtom; +typedef JS::Handle HandlePropertyName; + +typedef JS::MutableHandle MutableHandleShape; +typedef JS::MutableHandle MutableHandleAtom; + +typedef js::Rooted RootedShape; +typedef js::Rooted RootedTypeObject; +typedef js::Rooted RootedAtom; +typedef js::Rooted RootedPropertyName; + +enum XDRMode { + XDR_ENCODE, + XDR_DECODE +}; + +template +class XDRState; + +class FreeOp; + +} /* namespace js */ + +namespace JSC { + +class ExecutableAllocator; + +} /* namespace JSC */ + +namespace WTF { + +class BumpPointerAllocator; + +} /* namespace WTF */ + +} /* export "C++" */ + +#else + +typedef struct JSAtom JSAtom; + +#endif /* __cplusplus */ + +/* "Friend" types used by jscntxt.h and jsdbgapi.h. */ +typedef enum JSTrapStatus { + JSTRAP_ERROR, + JSTRAP_CONTINUE, + JSTRAP_RETURN, + JSTRAP_THROW, + JSTRAP_LIMIT +} JSTrapStatus; + +typedef JSTrapStatus +(* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, + jsval closure); + +typedef JSTrapStatus +(* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, + void *closure); + +typedef JSTrapStatus +(* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, + void *closure); + +typedef JSTrapStatus +(* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval, + void *closure); + +typedef JSBool +(* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old, + jsval *newp, void *closure); + +/* called just after script creation */ +typedef void +(* JSNewScriptHook)(JSContext *cx, + const char *filename, /* URL of script */ + unsigned lineno, /* first line */ + JSScript *script, + JSFunction *fun, + void *callerdata); + +/* called just before script destruction */ +typedef void +(* JSDestroyScriptHook)(JSFreeOp *fop, + JSScript *script, + void *callerdata); + +typedef void +(* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str, + size_t length, void **listenerTSData, void *closure); + +/* js::ObjectOps function pointer typedefs. */ + +/* + * A generic type for functions mapping an object to another object, or null + * if an error or exception was thrown on cx. + */ +typedef JSObject * +(* JSObjectOp)(JSContext *cx, JSHandleObject obj); + +/* Signature for class initialization ops. */ +typedef JSObject * +(* JSClassInitializerOp)(JSContext *cx, JSHandleObject obj); + +/* + * Hook that creates an iterator object for a given object. Returns the + * iterator object or null if an error or exception was thrown on cx. + */ +typedef JSObject * +(* JSIteratorOp)(JSContext *cx, JSHandleObject obj, JSBool keysonly); + + +#endif /* jsprvtd_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jspubtd.h b/scripting/javascript/spidermonkey-mac/include/jspubtd.h new file mode 100644 index 0000000000..bcbbd28c69 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jspubtd.h @@ -0,0 +1,383 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jspubtd_h___ +#define jspubtd_h___ + +/* + * JS public API typedefs. + */ + +#include "jsprototypes.h" +#include "jstypes.h" + +/* + * Allow headers to reference JS::Value without #including the whole jsapi.h. + * Unfortunately, typedefs (hence jsval) cannot be declared. + */ +#ifdef __cplusplus +namespace JS { class Value; } +#endif + +/* + * In release builds, jsid is defined to be an integral type. This + * prevents many bugs from being caught at compile time. E.g.: + * + * jsid id = ... + * if (id == JS_TRUE) // error + * ... + * + * size_t n = id; // error + * + * To catch more errors, jsid is given a struct type in C++ debug builds. + * Struct assignment and (in C++) operator== allow correct code to be mostly + * oblivious to the change. This feature can be explicitly disabled in debug + * builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES. + */ +#ifdef __cplusplus + +// Needed for cocos2d-js +#define JS_NO_JSVAL_JSID_STRUCT_TYPES + +# if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES) +# define JS_USE_JSID_STRUCT_TYPES +# endif + +# ifdef JS_USE_JSID_STRUCT_TYPES +struct jsid +{ + size_t asBits; + bool operator==(jsid rhs) const { return asBits == rhs.asBits; } + bool operator!=(jsid rhs) const { return asBits != rhs.asBits; } +}; +# define JSID_BITS(id) (id.asBits) +# else /* defined(JS_USE_JSID_STRUCT_TYPES) */ +typedef ptrdiff_t jsid; +# define JSID_BITS(id) (id) +# endif /* defined(JS_USE_JSID_STRUCT_TYPES) */ +#else /* defined(__cplusplus) */ +typedef ptrdiff_t jsid; +# define JSID_BITS(id) (id) +#endif + +#ifdef WIN32 +typedef wchar_t jschar; +#else +typedef uint16_t jschar; +#endif + +/* + * Run-time version enumeration. See jsversion.h for compile-time counterparts + * to these values that may be selected by the JS_VERSION macro, and tested by + * #if expressions. + */ +typedef enum JSVersion { + JSVERSION_ECMA_3 = 148, + JSVERSION_1_6 = 160, + JSVERSION_1_7 = 170, + JSVERSION_1_8 = 180, + JSVERSION_ECMA_5 = 185, + JSVERSION_DEFAULT = 0, + JSVERSION_UNKNOWN = -1, + JSVERSION_LATEST = JSVERSION_ECMA_5 +} JSVersion; + +/* Result of typeof operator enumeration. */ +typedef enum JSType { + JSTYPE_VOID, /* undefined */ + JSTYPE_OBJECT, /* object */ + JSTYPE_FUNCTION, /* function */ + JSTYPE_STRING, /* string */ + JSTYPE_NUMBER, /* number */ + JSTYPE_BOOLEAN, /* boolean */ + JSTYPE_NULL, /* null */ + JSTYPE_LIMIT +} JSType; + +/* Dense index into cached prototypes and class atoms for standard objects. */ +typedef enum JSProtoKey { +#define PROTOKEY_AND_INITIALIZER(name,code,init) JSProto_##name = code, + JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER) +#undef JS_PROTO + JSProto_LIMIT +} JSProtoKey; + +/* js_CheckAccess mode enumeration. */ +typedef enum JSAccessMode { + JSACC_PROTO = 0, /* XXXbe redundant w.r.t. id */ + + /* + * enum value #1 formerly called JSACC_PARENT, + * gap preserved for ABI compatibility. + */ + + /* + * enum value #2 formerly called JSACC_IMPORT, + * gap preserved for ABI compatibility. + */ + + JSACC_WATCH = 3, /* a watchpoint on object foo for id 'bar' */ + JSACC_READ = 4, /* a "get" of foo.bar */ + JSACC_WRITE = 8, /* a "set" of foo.bar = baz */ + JSACC_LIMIT +} JSAccessMode; + +#define JSACC_TYPEMASK (JSACC_WRITE - 1) + +/* + * This enum type is used to control the behavior of a JSObject property + * iterator function that has type JSNewEnumerate. + */ +typedef enum JSIterateOp { + /* Create new iterator state over enumerable properties. */ + JSENUMERATE_INIT, + + /* Create new iterator state over all properties. */ + JSENUMERATE_INIT_ALL, + + /* Iterate once. */ + JSENUMERATE_NEXT, + + /* Destroy iterator state. */ + JSENUMERATE_DESTROY +} JSIterateOp; + +/* See JSVAL_TRACE_KIND and JSTraceCallback in jsapi.h. */ +typedef enum { + JSTRACE_OBJECT, + JSTRACE_STRING, + JSTRACE_SCRIPT, + + /* + * Trace kinds internal to the engine. The embedding can only them if it + * implements JSTraceCallback. + */ + JSTRACE_IONCODE, + JSTRACE_SHAPE, + JSTRACE_BASE_SHAPE, + JSTRACE_TYPE_OBJECT, + JSTRACE_LAST = JSTRACE_TYPE_OBJECT +} JSGCTraceKind; + +/* Struct typedefs and class forward declarations. */ +typedef struct JSClass JSClass; +typedef struct JSCompartment JSCompartment; +typedef struct JSConstDoubleSpec JSConstDoubleSpec; +typedef struct JSContext JSContext; +typedef struct JSCrossCompartmentCall JSCrossCompartmentCall; +typedef struct JSErrorReport JSErrorReport; +typedef struct JSExceptionState JSExceptionState; +typedef struct JSFunctionSpec JSFunctionSpec; +typedef struct JSIdArray JSIdArray; +typedef struct JSLocaleCallbacks JSLocaleCallbacks; +typedef struct JSObjectMap JSObjectMap; +typedef struct JSPrincipals JSPrincipals; +typedef struct JSPropertyDescriptor JSPropertyDescriptor; +typedef struct JSPropertyName JSPropertyName; +typedef struct JSPropertySpec JSPropertySpec; +typedef struct JSRuntime JSRuntime; +typedef struct JSSecurityCallbacks JSSecurityCallbacks; +typedef struct JSStructuredCloneCallbacks JSStructuredCloneCallbacks; +typedef struct JSStructuredCloneReader JSStructuredCloneReader; +typedef struct JSStructuredCloneWriter JSStructuredCloneWriter; +typedef struct JSTracer JSTracer; + +#ifdef __cplusplus +class JSFlatString; +class JSFunction; +class JSObject; +class JSScript; +class JSStableString; // long story +class JSString; +#else +typedef struct JSFlatString JSFlatString; +typedef struct JSFunction JSFunction; +typedef struct JSObject JSObject; +typedef struct JSScript JSScript; +typedef struct JSString JSString; +#endif /* !__cplusplus */ + +#ifdef JS_THREADSAFE +typedef struct PRCallOnceType JSCallOnceType; +#else +typedef JSBool JSCallOnceType; +#endif +typedef JSBool (*JSInitCallback)(void); + +#ifdef __cplusplus + +namespace js { + +class Allocator; + +template +class Rooted; + +class SkipRoot; + +enum ThingRootKind +{ + THING_ROOT_OBJECT, + THING_ROOT_SHAPE, + THING_ROOT_BASE_SHAPE, + THING_ROOT_TYPE_OBJECT, + THING_ROOT_STRING, + THING_ROOT_SCRIPT, + THING_ROOT_ID, + THING_ROOT_PROPERTY_ID, + THING_ROOT_VALUE, + THING_ROOT_TYPE, + THING_ROOT_BINDINGS, + THING_ROOT_LIMIT +}; + +template +struct RootKind; + +/* + * Specifically mark the ThingRootKind of externally visible types, so that + * JSAPI users may use JSRooted... types without having the class definition + * available. + */ +template +struct SpecificRootKind +{ + static ThingRootKind rootKind() { return Kind; } +}; + +template <> struct RootKind : SpecificRootKind {}; +template <> struct RootKind : SpecificRootKind {}; +template <> struct RootKind : SpecificRootKind {}; +template <> struct RootKind : SpecificRootKind {}; +template <> struct RootKind : SpecificRootKind {}; +template <> struct RootKind : SpecificRootKind {}; + +struct ContextFriendFields { + JSRuntime *const runtime; + + /* The current compartment. */ + JSCompartment *compartment; + + explicit ContextFriendFields(JSRuntime *rt) + : runtime(rt), compartment(NULL) + { } + + static const ContextFriendFields *get(const JSContext *cx) { + return reinterpret_cast(cx); + } + + static ContextFriendFields *get(JSContext *cx) { + return reinterpret_cast(cx); + } + +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + /* + * Stack allocated GC roots for stack GC heap pointers, which may be + * overwritten if moved during a GC. + */ + Rooted *thingGCRooters[THING_ROOT_LIMIT]; +#endif + +#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) + /* + * Stack allocated list of stack locations which hold non-relocatable + * GC heap pointers (where the target is rooted somewhere else) or integer + * values which may be confused for GC heap pointers. These are used to + * suppress false positives which occur when a rooting analysis treats the + * location as holding a relocatable pointer, but have no other effect on + * GC behavior. + */ + SkipRoot *skipGCRooters; +#endif +}; + +struct RuntimeFriendFields { + /* + * If non-zero, we were been asked to call the operation callback as soon + * as possible. + */ + volatile int32_t interrupt; + + RuntimeFriendFields() + : interrupt(0) { } + + static const RuntimeFriendFields *get(const JSRuntime *rt) { + return reinterpret_cast(rt); + } +}; + +class PerThreadData; + +struct PerThreadDataFriendFields +{ + private: + // Note: this type only exists to permit us to derive the offset of + // the perThread data within the real JSRuntime* type in a portable + // way. + struct RuntimeDummy : RuntimeFriendFields + { + struct PerThreadDummy { + void *field1; + uintptr_t field2; +#ifdef DEBUG + uint64_t field3; +#endif + } mainThread; + }; + + public: + + PerThreadDataFriendFields(); + +#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) + /* + * Stack allocated GC roots for stack GC heap pointers, which may be + * overwritten if moved during a GC. + */ + Rooted *thingGCRooters[THING_ROOT_LIMIT]; +#endif + +#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) + /* + * Stack allocated list of stack locations which hold non-relocatable + * GC heap pointers (where the target is rooted somewhere else) or integer + * values which may be confused for GC heap pointers. These are used to + * suppress false positives which occur when a rooting analysis treats the + * location as holding a relocatable pointer, but have no other effect on + * GC behavior. + */ + SkipRoot *skipGCRooters; +#endif + + /* Limit pointer for checking native stack consumption. */ + uintptr_t nativeStackLimit; + + static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread); + + static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) { + return reinterpret_cast(pt); + } + + static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) { + // mainThread must always appear directly after |RuntimeFriendFields|. + // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp| + return reinterpret_cast( + reinterpret_cast(rt) + RuntimeMainThreadOffset); + } + + static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) { + // mainThread must always appear directly after |RuntimeFriendFields|. + // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp| + return reinterpret_cast( + reinterpret_cast(rt) + RuntimeMainThreadOffset); + } +}; + +} /* namespace js */ + +#endif /* __cplusplus */ + +#endif /* jspubtd_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jstypes.h b/scripting/javascript/spidermonkey-mac/include/jstypes.h new file mode 100644 index 0000000000..c83e7fed26 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jstypes.h @@ -0,0 +1,282 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* +** File: jstypes.h +** Description: Definitions of NSPR's basic types +** +** Prototypes and macros used to make up for deficiencies in ANSI environments +** that we have found. +** +** Since we do not wrap and all the other standard headers, authors +** of portable code will not know in general that they need these definitions. +** Instead of requiring these authors to find the dependent uses in their code +** and take the following steps only in those C files, we take steps once here +** for all C files. +**/ + +#ifndef jstypes_h___ +#define jstypes_h___ + +#include "mozilla/Attributes.h" +#include "mozilla/Util.h" + +#include "js-config.h" + +/*********************************************************************** +** MACROS: JS_EXTERN_API +** JS_EXPORT_API +** DESCRIPTION: +** These are only for externally visible routines and globals. For +** internal routines, just use "extern" for type checking and that +** will not export internal cross-file or forward-declared symbols. +** Define a macro for declaring procedures return types. We use this to +** deal with windoze specific type hackery for DLL definitions. Use +** JS_EXTERN_API when the prototype for the method is declared. Use +** JS_EXPORT_API for the implementation of the method. +** +** Example: +** in dowhim.h +** JS_EXTERN_API( void ) DoWhatIMean( void ); +** in dowhim.c +** JS_EXPORT_API( void ) DoWhatIMean( void ) { return; } +** +** +***********************************************************************/ + +#define JS_EXTERN_API(type) extern MOZ_EXPORT type +#define JS_EXPORT_API(type) MOZ_EXPORT type +#define JS_EXPORT_DATA(type) MOZ_EXPORT type +#define JS_IMPORT_API(type) MOZ_IMPORT_API type +#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type + +/* + * The linkage of JS API functions differs depending on whether the file is + * used within the JS library or not. Any source file within the JS + * interpreter should define EXPORT_JS_API whereas any client of the library + * should not. STATIC_JS_API is used to build JS as a static library. + */ +#if defined(STATIC_JS_API) +# define JS_PUBLIC_API(t) t +# define JS_PUBLIC_DATA(t) t +#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API) +# define JS_PUBLIC_API(t) MOZ_EXPORT t +# define JS_PUBLIC_DATA(t) MOZ_EXPORT t +#else +# define JS_PUBLIC_API(t) MOZ_IMPORT_API t +# define JS_PUBLIC_DATA(t) MOZ_IMPORT_DATA t +#endif + +#define JS_FRIEND_API(t) JS_PUBLIC_API(t) +#define JS_FRIEND_DATA(t) JS_PUBLIC_DATA(t) + +#if defined(_MSC_VER) && defined(_M_IX86) +#define JS_FASTCALL __fastcall +#elif defined(__GNUC__) && defined(__i386__) +#define JS_FASTCALL __attribute__((fastcall)) +#else +#define JS_FASTCALL +#define JS_NO_FASTCALL +#endif + +#ifndef JS_INLINE +#define JS_INLINE MOZ_INLINE +#endif + +#ifndef JS_ALWAYS_INLINE +#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE +#endif + +#ifndef JS_NEVER_INLINE +#define JS_NEVER_INLINE MOZ_NEVER_INLINE +#endif + +#ifndef JS_WARN_UNUSED_RESULT +# if defined __GNUC__ +# define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +# else +# define JS_WARN_UNUSED_RESULT +# endif +#endif + +/*********************************************************************** +** MACROS: JS_BEGIN_MACRO +** JS_END_MACRO +** DESCRIPTION: +** Macro body brackets so that macros with compound statement definitions +** behave syntactically more like functions when called. +***********************************************************************/ +#define JS_BEGIN_MACRO do { + +#if defined(_MSC_VER) && _MSC_VER >= 1400 +# define JS_END_MACRO \ + } __pragma(warning(push)) __pragma(warning(disable:4127)) \ + while (0) __pragma(warning(pop)) +#else +# define JS_END_MACRO } while (0) +#endif + +/*********************************************************************** +** MACROS: JS_BEGIN_EXTERN_C +** JS_END_EXTERN_C +** DESCRIPTION: +** Macro shorthands for conditional C++ extern block delimiters. +***********************************************************************/ +#define JS_BEGIN_EXTERN_C MOZ_BEGIN_EXTERN_C +#define JS_END_EXTERN_C MOZ_END_EXTERN_C + +/*********************************************************************** +** MACROS: JS_BIT +** JS_BITMASK +** DESCRIPTION: +** Bit masking macros. XXX n must be <= 31 to be portable +***********************************************************************/ +#define JS_BIT(n) ((uint32_t)1 << (n)) +#define JS_BITMASK(n) (JS_BIT(n) - 1) + +/*********************************************************************** +** MACROS: JS_HOWMANY +** JS_ROUNDUP +** JS_MIN +** JS_MAX +** DESCRIPTION: +** Commonly used macros for operations on compatible types. +***********************************************************************/ +#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y)) +#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y)) + +#include "jscpucfg.h" + +/* + * Define JS_64BIT iff we are building in an environment with 64-bit + * addresses. + */ +#ifdef _MSC_VER +# if defined(_M_X64) || defined(_M_AMD64) +# define JS_64BIT +# endif +#elif defined(__GNUC__) +/* Additional GCC defines are when running on Solaris, AIX, and HPUX */ +# if defined(__x86_64__) || defined(__sparcv9) || \ + defined(__64BIT__) || defined(__LP64__) +# define JS_64BIT +# endif +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */ +# if defined(__x86_64) || defined(__sparcv9) +# define JS_64BIT +# endif +#elif defined(__xlc__) || defined(__xlC__) /* IBM XL C/C++ */ +# if defined(__64BIT__) +# define JS_64BIT +# endif +#elif defined(__HP_cc) || defined(__HP_aCC) /* HP-UX cc/aCC */ +# if defined(__LP64__) +# define JS_64BIT +# endif +#else +# error "Implement me" +#endif + + +/************************************************************************ +** TYPES: JSBool +** DESCRIPTION: +** Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE +** for clarity of target type in assignments and actual arguments. Use +** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans +** just as you would C int-valued conditions. +************************************************************************/ +typedef int JSBool; +#define JS_TRUE (int)1 +#define JS_FALSE (int)0 + +/*********************************************************************** +** MACROS: JS_LIKELY +** JS_UNLIKELY +** DESCRIPTION: +** These macros allow you to give a hint to the compiler about branch +** probability so that it can better optimize. Use them like this: +** +** if (JS_LIKELY(v == 1)) { +** ... expected code path ... +** } +** +** if (JS_UNLIKELY(v == 0)) { +** ... non-expected code path ... +** } +** +***********************************************************************/ +#ifdef __GNUC__ + +# define JS_LIKELY(x) (__builtin_expect((x), 1)) +# define JS_UNLIKELY(x) (__builtin_expect((x), 0)) + +#else + +# define JS_LIKELY(x) (x) +# define JS_UNLIKELY(x) (x) + +#endif + +/*********************************************************************** +** MACROS: JS_ARRAY_LENGTH +** JS_ARRAY_END +** DESCRIPTION: +** Macros to get the number of elements and the pointer to one past the +** last element of a C array. Use them like this: +** +** jschar buf[10], *s; +** JSString *str; +** ... +** for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...; +** ... +** str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf)); +** ... +** +***********************************************************************/ + +#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0]) +#define JS_ARRAY_END(array) ((array) + JS_ARRAY_LENGTH(array)) + +#define JS_BITS_PER_BYTE 8 +#define JS_BITS_PER_BYTE_LOG2 3 + +#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD) +#define JS_BITS_PER_DOUBLE (JS_BITS_PER_BYTE * JS_BYTES_PER_DOUBLE) + +/*********************************************************************** +** MACROS: JS_FUNC_TO_DATA_PTR +** JS_DATA_TO_FUNC_PTR +** DESCRIPTION: +** Macros to convert between function and data pointers assuming that +** they have the same size. Use them like this: +** +** JSPropertyOp nativeGetter; +** JSObject *scriptedGetter; +** ... +** scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter); +** ... +** nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter); +** +***********************************************************************/ + +#ifdef __GNUC__ +# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (size_t) (fun)) +# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (size_t) (ptr)) +#else +/* Use an extra (void *) cast for MSVC. */ +# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun)) +# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr)) +#endif + +#ifdef __GNUC__ +# define JS_EXTENSION __extension__ +# define JS_EXTENSION_(s) __extension__ ({ s; }) +#else +# define JS_EXTENSION +# define JS_EXTENSION_(s) s +#endif + +#endif /* jstypes_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsutil.h b/scripting/javascript/spidermonkey-mac/include/jsutil.h new file mode 100644 index 0000000000..c5c19ffbf1 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsutil.h @@ -0,0 +1,471 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * PR assertion checker. + */ + +#ifndef jsutil_h___ +#define jsutil_h___ + +#include "mozilla/Attributes.h" +#include "mozilla/GuardObjects.h" + +#include "js/Utility.h" + +#ifdef USE_ZLIB +#include "zlib.h" +#endif + +/* Forward declarations. */ +struct JSContext; + +static JS_ALWAYS_INLINE void * +js_memcpy(void *dst_, const void *src_, size_t len) +{ + char *dst = (char *) dst_; + const char *src = (const char *) src_; + JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len); + JS_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len); + + return memcpy(dst, src, len); +} + +#ifdef __cplusplus +namespace js { + +template +struct AlignmentTestStruct +{ + char c; + T t; +}; + +/* This macro determines the alignment requirements of a type. */ +#define JS_ALIGNMENT_OF(t_) \ + (sizeof(js::AlignmentTestStruct) - sizeof(t_)) + +template +class AlignedPtrAndFlag +{ + uintptr_t bits; + + public: + AlignedPtrAndFlag(T *t, bool aFlag) { + JS_ASSERT((uintptr_t(t) & 1) == 0); + bits = uintptr_t(t) | uintptr_t(aFlag); + } + + T *ptr() const { + return (T *)(bits & ~uintptr_t(1)); + } + + bool flag() const { + return (bits & 1) != 0; + } + + void setPtr(T *t) { + JS_ASSERT((uintptr_t(t) & 1) == 0); + bits = uintptr_t(t) | uintptr_t(flag()); + } + + void setFlag() { + bits |= 1; + } + + void unsetFlag() { + bits &= ~uintptr_t(1); + } + + void set(T *t, bool aFlag) { + JS_ASSERT((uintptr_t(t) & 1) == 0); + bits = uintptr_t(t) | aFlag; + } +}; + +template +static inline void +Reverse(T *beg, T *end) +{ + while (beg != end) { + if (--end == beg) + return; + T tmp = *beg; + *beg = *end; + *end = tmp; + ++beg; + } +} + +template +static inline T * +Find(T *beg, T *end, const T &v) +{ + for (T *p = beg; p != end; ++p) { + if (*p == v) + return p; + } + return end; +} + +template +static inline typename Container::ElementType * +Find(Container &c, const typename Container::ElementType &v) +{ + return Find(c.begin(), c.end(), v); +} + +template +void +ForEach(InputIterT begin, InputIterT end, CallableT f) +{ + for (; begin != end; ++begin) + f(*begin); +} + +template +static inline T +Min(T t1, T t2) +{ + return t1 < t2 ? t1 : t2; +} + +template +static inline T +Max(T t1, T t2) +{ + return t1 > t2 ? t1 : t2; +} + +/* Allows a const variable to be initialized after its declaration. */ +template +static T& +InitConst(const T &t) +{ + return const_cast(t); +} + +template +JS_ALWAYS_INLINE T & +ImplicitCast(U &u) +{ + T &t = u; + return t; +} + +template +class AutoScopedAssign +{ + public: + AutoScopedAssign(T *addr, const T &value + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : addr_(addr), old(*addr_) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + *addr_ = value; + } + + ~AutoScopedAssign() { *addr_ = old; } + + private: + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER + T *addr_; + T old; +}; + +template +JS_ALWAYS_INLINE static void +PodZero(T *t) +{ + memset(t, 0, sizeof(T)); +} + +template +JS_ALWAYS_INLINE static void +PodZero(T *t, size_t nelem) +{ + /* + * This function is often called with 'nelem' small; we use an + * inline loop instead of calling 'memset' with a non-constant + * length. The compiler should inline the memset call with constant + * size, though. + */ + for (T *end = t + nelem; t != end; ++t) + memset(t, 0, sizeof(T)); +} + +/* + * Arrays implicitly convert to pointers to their first element, which is + * dangerous when combined with the above PodZero definitions. Adding an + * overload for arrays is ambiguous, so we need another identifier. The + * ambiguous overload is left to catch mistaken uses of PodZero; if you get a + * compile error involving PodZero and array types, use PodArrayZero instead. + */ +template static void PodZero(T (&)[N]); /* undefined */ +template static void PodZero(T (&)[N], size_t); /* undefined */ + +template +JS_ALWAYS_INLINE static void +PodArrayZero(T (&t)[N]) +{ + memset(t, 0, N * sizeof(T)); +} + +template +JS_ALWAYS_INLINE static void +PodAssign(T *dst, const T *src) +{ + js_memcpy((char *) dst, (const char *) src, sizeof(T)); +} + +template +JS_ALWAYS_INLINE static void +PodCopy(T *dst, const T *src, size_t nelem) +{ + /* Cannot find portable word-sized abs(). */ + JS_ASSERT_IF(dst >= src, size_t(dst - src) >= nelem); + JS_ASSERT_IF(src >= dst, size_t(src - dst) >= nelem); + + if (nelem < 128) { + /* + * Avoid using operator= in this loop, as it may have been + * intentionally deleted by the POD type. + */ + for (const T *srcend = src + nelem; src != srcend; ++src, ++dst) + PodAssign(dst, src); + } else { + memcpy(dst, src, nelem * sizeof(T)); + } +} + +template +JS_ALWAYS_INLINE static bool +PodEqual(T *one, T *two, size_t len) +{ + if (len < 128) { + T *p1end = one + len; + for (T *p1 = one, *p2 = two; p1 != p1end; ++p1, ++p2) { + if (*p1 != *p2) + return false; + } + return true; + } + + return !memcmp(one, two, len * sizeof(T)); +} + +template +static inline bool +IsPowerOfTwo(T t) +{ + return t && !(t & (t - 1)); +} + +template +static inline U +ComputeByteAlignment(T bytes, U alignment) +{ + JS_ASSERT(IsPowerOfTwo(alignment)); + return (alignment - (bytes % alignment)) % alignment; +} + +template +static inline T +AlignBytes(T bytes, U alignment) +{ + return bytes + ComputeByteAlignment(bytes, alignment); +} + +JS_ALWAYS_INLINE static size_t +UnsignedPtrDiff(const void *bigger, const void *smaller) +{ + return size_t(bigger) - size_t(smaller); +} + +/* + * Ordinarily, a function taking a JSContext* 'cx' parameter reports errors on + * the context. In some cases, functions optionally report and indicate this by + * taking a nullable 'maybecx' parameter. In some cases, though, a function + * always needs a 'cx', but optionally reports. This option is presented by the + * MaybeReportError. + */ +enum MaybeReportError { REPORT_ERROR = true, DONT_REPORT_ERROR = false }; + +/*****************************************************************************/ + +/* A bit array is an array of bits represented by an array of words (size_t). */ + +static inline unsigned +NumWordsForBitArrayOfLength(size_t length) +{ + return (length + (JS_BITS_PER_WORD - 1)) / JS_BITS_PER_WORD; +} + +static inline unsigned +BitArrayIndexToWordIndex(size_t length, size_t bitIndex) +{ + unsigned wordIndex = bitIndex / JS_BITS_PER_WORD; + JS_ASSERT(wordIndex < length); + return wordIndex; +} + +static inline size_t +BitArrayIndexToWordMask(size_t i) +{ + return size_t(1) << (i % JS_BITS_PER_WORD); +} + +static inline bool +IsBitArrayElementSet(size_t *array, size_t length, size_t i) +{ + return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i); +} + +static inline bool +IsAnyBitArrayElementSet(size_t *array, size_t length) +{ + unsigned numWords = NumWordsForBitArrayOfLength(length); + for (unsigned i = 0; i < numWords; ++i) { + if (array[i]) + return true; + } + return false; +} + +static inline void +SetBitArrayElement(size_t *array, size_t length, size_t i) +{ + array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i); +} + +static inline void +ClearBitArrayElement(size_t *array, size_t length, size_t i) +{ + array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i); +} + +static inline void +ClearAllBitArrayElements(size_t *array, size_t length) +{ + for (unsigned i = 0; i < length; ++i) + array[i] = 0; +} + +#ifdef USE_ZLIB +class Compressor +{ + /* Number of bytes we should hand to zlib each compressMore() call. */ + static const size_t CHUNKSIZE = 2048; + z_stream zs; + const unsigned char *inp; + size_t inplen; + size_t outbytes; + + public: + enum Status { + MOREOUTPUT, + DONE, + CONTINUE, + OOM + }; + + Compressor(const unsigned char *inp, size_t inplen); + ~Compressor(); + bool init(); + void setOutput(unsigned char *out, size_t outlen); + size_t outWritten() const { return outbytes; } + /* Compress some of the input. Return true if it should be called again. */ + Status compressMore(); +}; + +/* + * Decompress a string. The caller must know the length of the output and + * allocate |out| to a string of that length. + */ +bool DecompressString(const unsigned char *inp, size_t inplen, + unsigned char *out, size_t outlen); +#endif + +} /* namespace js */ +#endif /* __cplusplus */ + +/* Crash diagnostics */ +#ifdef DEBUG +# define JS_CRASH_DIAGNOSTICS 1 +#endif +#ifdef JS_CRASH_DIAGNOSTICS +# define JS_POISON(p, val, size) memset((p), (val), (size)) +#else +# define JS_POISON(p, val, size) ((void) 0) +#endif + +/* Basic stats */ +#ifdef DEBUG +# define JS_BASIC_STATS 1 +#endif +#ifdef JS_BASIC_STATS +# include +typedef struct JSBasicStats { + uint32_t num; + uint32_t max; + double sum; + double sqsum; + uint32_t logscale; /* logarithmic scale: 0 (linear), 2, 10 */ + uint32_t hist[11]; +} JSBasicStats; +# define JS_INIT_STATIC_BASIC_STATS {0,0,0,0,0,{0,0,0,0,0,0,0,0,0,0,0}} +# define JS_BASIC_STATS_INIT(bs) memset((bs), 0, sizeof(JSBasicStats)) +# define JS_BASIC_STATS_ACCUM(bs,val) \ + JS_BasicStatsAccum(bs, val) +# define JS_MeanAndStdDevBS(bs,sigma) \ + JS_MeanAndStdDev((bs)->num, (bs)->sum, (bs)->sqsum, sigma) +extern void +JS_BasicStatsAccum(JSBasicStats *bs, uint32_t val); +extern double +JS_MeanAndStdDev(uint32_t num, double sum, double sqsum, double *sigma); +extern void +JS_DumpBasicStats(JSBasicStats *bs, const char *title, FILE *fp); +extern void +JS_DumpHistogram(JSBasicStats *bs, FILE *fp); +#else +# define JS_BASIC_STATS_ACCUM(bs,val) +#endif + +/* A jsbitmap_t is a long integer that can be used for bitmaps. */ +typedef size_t jsbitmap; +#define JS_TEST_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] & \ + ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1)))) +#define JS_SET_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |= \ + ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1)))) +#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &= \ + ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1)))) + +/* Wrapper for various macros to stop warnings coming from their expansions. */ +#if defined(__clang__) +# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ + JS_BEGIN_MACRO \ + _Pragma("clang diagnostic push") \ + /* If these _Pragmas cause warnings for you, try disabling ccache. */ \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + { expr; } \ + _Pragma("clang diagnostic pop") \ + JS_END_MACRO +#elif (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ + JS_BEGIN_MACRO \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") \ + expr; \ + _Pragma("GCC diagnostic pop") \ + JS_END_MACRO +#else +# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ + JS_BEGIN_MACRO \ + expr; \ + JS_END_MACRO +#endif + +#endif /* jsutil_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsversion.h b/scripting/javascript/spidermonkey-mac/include/jsversion.h new file mode 100644 index 0000000000..50e2fa6beb --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jsversion.h @@ -0,0 +1,181 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jsversion_h___ +#define jsversion_h___ + +/* + * JS configuration macros. + */ +#ifndef JS_VERSION +#define JS_VERSION 185 +#endif + +/* + * Compile-time JS version configuration. The JS version numbers lie on the + * number line like so: + * + * 1.0 1.1 1.2 1.3 1.4 ECMAv3 1.5 1.6 1.7 1.8 ECMAv5 + * ^ ^ + * | | + * basis for ECMAv1 close to ECMAv2 + * + * where ECMAv3 stands for ECMA-262 Edition 3, and ECMAv5 stands for Edition 5. + * See the runtime version enum JSVersion in jspubtd.h. Code in the engine can + * therefore count on version <= JSVERSION_1_4 to mean "before the Third + * Edition of ECMA-262" and version > JSVERSION_1_4 to mean "at or after the + * Third Edition". + * + * In the (likely?) event that SpiderMonkey grows to implement JavaScript 2.0, + * the version number to use would be near 200, or greater. + * + * The JS_VERSION_ECMA_3 version is the minimal configuration conforming to + * the ECMA-262 Edition 3 specification. Use it for minimal embeddings, where + * you're sure you don't need any of the extensions disabled in this version. + * In order to facilitate testing, JS_HAS_OBJ_PROTO_PROP is defined as part of + * the JS_VERSION_ECMA_3_TEST version. + * + * To keep things sane in the modern age, where we need exceptions in order to + * implement, e.g., iterators and generators, we are dropping support for all + * versions <= 1.4. + */ +#define JS_VERSION_ECMA_3 148 +#define JS_VERSION_ECMA_3_TEST 149 + +#if JS_VERSION == JS_VERSION_ECMA_3 || \ + JS_VERSION == JS_VERSION_ECMA_3_TEST + +#define JS_HAS_STR_HTML_HELPERS 0 /* has str.anchor, str.bold, etc. */ +#if JS_VERSION == JS_VERSION_ECMA_3_TEST +#define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ +#else +#define JS_HAS_OBJ_PROTO_PROP 0 /* has o.__proto__ etc. */ +#endif +#define JS_HAS_OBJ_WATCHPOINT 0 /* has o.watch and o.unwatch */ +#define JS_HAS_TOSOURCE 0 /* has Object/Array toSource method */ +#define JS_HAS_CATCH_GUARD 0 /* has exception handling catch guard */ +#define JS_HAS_UNEVAL 0 /* has uneval() top-level function */ +#define JS_HAS_CONST 0 /* has JS2 const as alternative var */ +#define JS_HAS_FUN_EXPR_STMT 0 /* has function expression statement */ +#define JS_HAS_NO_SUCH_METHOD 0 /* has o.__noSuchMethod__ handler */ +#define JS_HAS_FOR_EACH_IN 0 /* has for each (lhs in iterable) */ +#define JS_HAS_GENERATORS 0 /* has yield in generator function */ +#define JS_HAS_BLOCK_SCOPE 0 /* has block scope via let/arraycomp */ +#define JS_HAS_DESTRUCTURING 0 /* has [a,b] = ... or {p:a,q:b} = ... */ +#define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */ +#define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */ + +#elif JS_VERSION < 150 + +#error "unsupported JS_VERSION" + +#elif JS_VERSION == 150 + +#define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ +#define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ +#define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ +#define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ +#define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ +#define JS_HAS_CONST 1 /* has JS2 const as alternative var */ +#define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ +#define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ +#define JS_HAS_FOR_EACH_IN 0 /* has for each (lhs in iterable) */ +#define JS_HAS_GENERATORS 0 /* has yield in generator function */ +#define JS_HAS_BLOCK_SCOPE 0 /* has block scope via let/arraycomp */ +#define JS_HAS_DESTRUCTURING 0 /* has [a,b] = ... or {p:a,q:b} = ... */ +#define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */ +#define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */ + +#elif JS_VERSION == 160 + +#define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ +#define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ +#define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ +#define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ +#define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ +#define JS_HAS_CONST 1 /* has JS2 const as alternative var */ +#define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ +#define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ +#define JS_HAS_FOR_EACH_IN 1 /* has for each (lhs in iterable) */ +#define JS_HAS_GENERATORS 0 /* has yield in generator function */ +#define JS_HAS_BLOCK_SCOPE 0 /* has block scope via let/arraycomp */ +#define JS_HAS_DESTRUCTURING 0 /* has [a,b] = ... or {p:a,q:b} = ... */ +#define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */ +#define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */ + +#elif JS_VERSION == 170 + +#define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ +#define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ +#define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ +#define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ +#define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ +#define JS_HAS_CONST 1 /* has JS2 const as alternative var */ +#define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ +#define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ +#define JS_HAS_FOR_EACH_IN 1 /* has for each (lhs in iterable) */ +#define JS_HAS_GENERATORS 1 /* has yield in generator function */ +#define JS_HAS_BLOCK_SCOPE 1 /* has block scope via let/arraycomp */ +#define JS_HAS_DESTRUCTURING 1 /* has [a,b] = ... or {p:a,q:b} = ... */ +#define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */ +#define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */ + +#elif 180 <= JS_VERSION && JS_VERSION <= 185 + +#define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */ +#define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */ +#define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */ +#define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */ +#define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */ +#define JS_HAS_UNEVAL 1 /* has uneval() top-level function */ +#define JS_HAS_CONST 1 /* has JS2 const as alternative var */ +#define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */ +#define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */ +#define JS_HAS_FOR_EACH_IN 1 /* has for each (lhs in iterable) */ +#define JS_HAS_GENERATORS 1 /* has yield in generator function */ +#define JS_HAS_BLOCK_SCOPE 1 /* has block scope via let/arraycomp */ +#define JS_HAS_DESTRUCTURING 2 /* has [a,b] = ... or {p:a,q:b} = ... */ +#define JS_HAS_GENERATOR_EXPRS 1 /* has (expr for (lhs in iterable)) */ +#define JS_HAS_EXPR_CLOSURES 1 /* has function (formals) listexpr */ + +#else + +#error "unknown JS_VERSION" + +#endif + +/* Support for JS_NewGlobalObject. */ +#define JS_HAS_NEW_GLOBAL_OBJECT 1 + +/* Support for JS_MakeSystemObject. */ +#define JS_HAS_MAKE_SYSTEM_OBJECT 1 + +/* Feature-test macro for evolving destructuring support. */ +#define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2) + +/* + * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support; + * support likely to be made opt-in at some future time. + */ +#define OLD_GETTER_SETTER_METHODS 1 + +/* A kill-switch for bug 586842. Embedders shouldn't touch this! */ +#define USE_NEW_OBJECT_REPRESENTATION 0 + +#if USE_NEW_OBJECT_REPRESENTATION +# define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0) +#else +# define NEW_OBJECT_REPRESENTATION_ONLY() \ + MOZ_NOT_REACHED("don't call this! to be used in the new object representation") +#endif + +/* ECMAScript Internationalization API isn't fully implemented yet. */ +#define ENABLE_INTL_API 0 + +#endif /* jsversion_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jswrapper.h b/scripting/javascript/spidermonkey-mac/include/jswrapper.h new file mode 100644 index 0000000000..e500e4ed36 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/jswrapper.h @@ -0,0 +1,329 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef jswrapper_h___ +#define jswrapper_h___ + +#include "mozilla/Attributes.h" + +#include "jsapi.h" +#include "jsproxy.h" + +namespace js { + +class DummyFrameGuard; + +/* + * A wrapper is a proxy with a target object to which it generally forwards + * operations, but may restrict access to certain operations or instrument + * the trap operations in various ways. A wrapper is distinct from a Direct Proxy + * Handler in the sense that it can be "unwrapped" in C++, exposing the underlying + * object (Direct Proxy Handlers have an underlying target object, but don't + * expect to expose this object via any kind of unwrapping operation). Callers + * should be careful to avoid unwrapping security wrappers in the wrong context. + */ +class JS_FRIEND_API(Wrapper) : public DirectProxyHandler +{ + unsigned mFlags; + bool mSafeToUnwrap; + + public: + enum Action { + GET, + SET, + CALL + }; + + enum Flags { + CROSS_COMPARTMENT = 1 << 0, + LAST_USED_FLAG = CROSS_COMPARTMENT + }; + + /* + * Wrappers can explicitly specify that they are unsafe to unwrap from a + * security perspective (as is the case for SecurityWrappers). If a wrapper + * is not safe to unwrap, operations requiring full access to the underlying + * object (via UnwrapObjectChecked) will throw. Otherwise, they will succeed. + */ + void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; } + bool isSafeToUnwrap() { return mSafeToUnwrap; } + + static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto, + JSObject *parent, Wrapper *handler); + + static JSObject *Renew(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *handler); + + static Wrapper *wrapperHandler(RawObject wrapper); + + static JSObject *wrappedObject(RawObject wrapper); + + unsigned flags() const { + return mFlags; + } + + /* Policy enforcement traps. + * + * enter() allows the policy to specify whether the caller may perform |act| + * on the underlying object's |id| property. In the case when |act| is CALL, + * |id| is generally JSID_VOID. + * + * The |act| parameter to enter() specifies the action being performed. + */ + virtual bool enter(JSContext *cx, JSObject *wrapper, jsid id, Action act, + bool *bp); + + explicit Wrapper(unsigned flags, bool hasPrototype = false); + + virtual ~Wrapper(); + + /* ES5 Harmony fundamental wrapper traps. */ + virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, + jsid id, PropertyDescriptor *desc, + unsigned flags) MOZ_OVERRIDE; + virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, + jsid id, PropertyDescriptor *desc, + unsigned flags) MOZ_OVERRIDE; + virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc) MOZ_OVERRIDE; + virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, + AutoIdVector &props) MOZ_OVERRIDE; + virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, + bool *bp) MOZ_OVERRIDE; + virtual bool enumerate(JSContext *cx, JSObject *wrapper, + AutoIdVector &props) MOZ_OVERRIDE; + + /* ES5 Harmony derived wrapper traps. */ + virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; + virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; + virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp) MOZ_OVERRIDE; + virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict, + Value *vp) MOZ_OVERRIDE; + virtual bool keys(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + virtual bool iterate(JSContext *cx, JSObject *wrapper, unsigned flags, Value *vp) MOZ_OVERRIDE; + + /* Spidermonkey extensions. */ + virtual bool call(JSContext *cx, JSObject *wrapper, unsigned argc, Value *vp) MOZ_OVERRIDE; + virtual bool construct(JSContext *cx, JSObject *wrapper, unsigned argc, Value *argv, Value *rval) MOZ_OVERRIDE; + virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, + CallArgs args) MOZ_OVERRIDE; + virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v, bool *bp) MOZ_OVERRIDE; + virtual JSString *obj_toString(JSContext *cx, JSObject *wrapper) MOZ_OVERRIDE; + virtual JSString *fun_toString(JSContext *cx, JSObject *wrapper, unsigned indent) MOZ_OVERRIDE; + virtual bool defaultValue(JSContext *cx, JSObject *wrapper_, JSType hint, + Value *vp) MOZ_OVERRIDE; + + static Wrapper singleton; + static Wrapper singletonWithPrototype; + + static void *getWrapperFamily(); +}; + +/* Base class for all cross compartment wrapper handlers. */ +class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper +{ + public: + CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false); + + virtual ~CrossCompartmentWrapper(); + + /* ES5 Harmony fundamental wrapper traps. */ + virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; + virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; + virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc) MOZ_OVERRIDE; + virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; + virtual bool enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + + /* ES5 Harmony derived wrapper traps. */ + virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; + virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; + virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp) MOZ_OVERRIDE; + virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict, + Value *vp) MOZ_OVERRIDE; + virtual bool keys(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + virtual bool iterate(JSContext *cx, JSObject *wrapper, unsigned flags, Value *vp) MOZ_OVERRIDE; + + /* Spidermonkey extensions. */ + virtual bool call(JSContext *cx, JSObject *wrapper, unsigned argc, Value *vp) MOZ_OVERRIDE; + virtual bool construct(JSContext *cx, JSObject *wrapper, unsigned argc, Value *argv, Value *rval) MOZ_OVERRIDE; + virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, + CallArgs args) MOZ_OVERRIDE; + virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v, bool *bp) MOZ_OVERRIDE; + virtual JSString *obj_toString(JSContext *cx, JSObject *wrapper) MOZ_OVERRIDE; + virtual JSString *fun_toString(JSContext *cx, JSObject *wrapper, unsigned indent) MOZ_OVERRIDE; + virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g) MOZ_OVERRIDE; + virtual bool defaultValue(JSContext *cx, JSObject *wrapper, JSType hint, Value *vp) MOZ_OVERRIDE; + virtual bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + + static CrossCompartmentWrapper singleton; + static CrossCompartmentWrapper singletonWithPrototype; +}; + +/* + * Base class for security wrappers. A security wrapper is potentially hiding + * all or part of some wrapped object thus SecurityWrapper defaults to denying + * access to the wrappee. This is the opposite of Wrapper which tries to be + * completely transparent. + * + * NB: Currently, only a few ProxyHandler operations are overridden to deny + * access, relying on derived SecurityWrapper to block access when necessary. + */ +template +class JS_FRIEND_API(SecurityWrapper) : public Base +{ + public: + SecurityWrapper(unsigned flags); + + virtual bool enter(JSContext *cx, JSObject *wrapper, jsid id, Wrapper::Action act, + bool *bp) MOZ_OVERRIDE; + virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, + CallArgs args) MOZ_OVERRIDE; + virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx) MOZ_OVERRIDE; + virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g) MOZ_OVERRIDE; + virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc) MOZ_OVERRIDE; + + /* + * Allow our subclasses to select the superclass behavior they want without + * needing to specify an exact superclass. + */ + typedef Base Permissive; + typedef SecurityWrapper Restrictive; +}; + +typedef SecurityWrapper SameCompartmentSecurityWrapper; +typedef SecurityWrapper CrossCompartmentSecurityWrapper; + +class JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler +{ + public: + static int sDeadObjectFamily; + + explicit DeadObjectProxy(); + + /* ES5 Harmony fundamental wrapper traps. */ + virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; + virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; + virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, + PropertyDescriptor *desc) MOZ_OVERRIDE; + virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; + virtual bool enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + + /* Spidermonkey extensions. */ + virtual bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp); + virtual bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval); + virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, + CallArgs args) MOZ_OVERRIDE; + virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp); + virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx); + virtual JSString *obj_toString(JSContext *cx, JSObject *proxy); + virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent); + virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g); + virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp); + virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, + uint32_t index, Value *vp, bool *present); + virtual bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + + static DeadObjectProxy singleton; +}; + +extern JSObject * +TransparentObjectWrapper(JSContext *cx, JSObject *existing, JSObject *obj, + JSObject *wrappedProto, JSObject *parent, + unsigned flags); + +// Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by +// jsfriendapi users. +extern JS_FRIEND_DATA(int) sWrapperFamily; + +inline bool +IsWrapper(RawObject obj) +{ + return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily; +} + +// Given a JSObject, returns that object stripped of wrappers. If +// stopAtOuter is true, then this returns the outer window if it was +// previously wrapped. Otherwise, this returns the first object for +// which JSObject::isWrapper returns false. +JS_FRIEND_API(JSObject *) +UnwrapObject(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = NULL); + +// Given a JSObject, returns that object stripped of wrappers. At each stage, +// the security wrapper has the opportunity to veto the unwrap. Since checked +// code should never be unwrapping outer window wrappers, we always stop at +// outer windows. +JS_FRIEND_API(JSObject *) +UnwrapObjectChecked(RawObject obj, bool stopAtOuter = true); + +// Unwrap only the outermost security wrapper, with the same semantics as +// above. This is the checked version of Wrapper::wrappedObject. +JS_FRIEND_API(JSObject *) +UnwrapOneChecked(RawObject obj, bool stopAtOuter = true); + +JS_FRIEND_API(bool) +IsCrossCompartmentWrapper(RawObject obj); + +bool +IsDeadProxyObject(RawObject obj); + +JSObject * +NewDeadProxyObject(JSContext *cx, JSObject *parent); + +void +NukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper); + +bool +RemapWrapper(JSContext *cx, JSObject *wobj, JSObject *newTarget); + +JS_FRIEND_API(bool) +RemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget, + JSObject *newTarget); + +// API to recompute all cross-compartment wrappers whose source and target +// match the given filters. +JS_FRIEND_API(bool) +RecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter, + const CompartmentFilter &targetFilter); + +/* + * This auto class should be used around any code, such as brain transplants, + * that may touch dead zones. Brain transplants can cause problems + * because they operate on all compartments, whether live or dead. A brain + * transplant can cause a formerly dead object to be "reanimated" by causing a + * read or write barrier to be invoked on it during the transplant. In this way, + * a zone becomes a zombie, kept alive by repeatedly consuming + * (transplanted) brains. + * + * To work around this issue, we observe when mark bits are set on objects in + * dead zones. If this happens during a brain transplant, we do a full, + * non-incremental GC at the end of the brain transplant. This will clean up any + * objects that were improperly marked. + */ +struct JS_FRIEND_API(AutoMaybeTouchDeadZones) +{ + // The version that takes an object just uses it for its runtime. + AutoMaybeTouchDeadZones(JSContext *cx); + AutoMaybeTouchDeadZones(JSObject *obj); + ~AutoMaybeTouchDeadZones(); + + private: + JSRuntime *runtime; + unsigned markCount; + bool inIncremental; + bool manipulatingDeadZones; +}; + +} /* namespace js */ + +#endif diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h new file mode 100644 index 0000000000..6b973627cb --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h @@ -0,0 +1,376 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Implementations of runtime and static assertion macros for C and C++. */ + +#ifndef mozilla_Assertions_h_ +#define mozilla_Assertions_h_ + +#include "mozilla/Attributes.h" +#include "mozilla/Compiler.h" + +#include +#include +#include +#ifdef WIN32 + /* + * TerminateProcess and GetCurrentProcess are defined in , which + * further depends on . We hardcode these few definitions manually + * because those headers clutter the global namespace with a significant + * number of undesired macros and symbols. + */ +# ifdef __cplusplus + extern "C" { +# endif + __declspec(dllimport) int __stdcall + TerminateProcess(void* hProcess, unsigned int uExitCode); + __declspec(dllimport) void* __stdcall GetCurrentProcess(void); +# ifdef __cplusplus + } +# endif +#else +# include +#endif +#ifdef ANDROID +# include +#endif + +/* + * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time*. This + * can be useful when you make certain assumptions about what must hold for + * optimal, or even correct, behavior. For example, you might assert that the + * size of a struct is a multiple of the target architecture's word size: + * + * struct S { ... }; + * MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0, + * "S should be a multiple of word size for efficiency"); + * + * This macro can be used in any location where both an extern declaration and a + * typedef could be used. + * + * Be aware of the gcc 4.2 concerns noted further down when writing patches that + * use this macro, particularly if a patch only bounces on OS X. + */ +#ifdef __cplusplus +# if defined(__clang__) +# ifndef __has_extension +# define __has_extension __has_feature /* compatibility, for older versions of clang */ +# endif +# if __has_extension(cxx_static_assert) +# define MOZ_STATIC_ASSERT(cond, reason) static_assert((cond), reason) +# endif +# elif defined(__GNUC__) +# if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) +# define MOZ_STATIC_ASSERT(cond, reason) static_assert((cond), reason) +# endif +# elif defined(_MSC_VER) +# if _MSC_VER >= 1600 /* MSVC 10 */ +# define MOZ_STATIC_ASSERT(cond, reason) static_assert((cond), reason) +# endif +# elif defined(__HP_aCC) +# if __HP_aCC >= 62500 && defined(_HP_CXX0x_SOURCE) +# define MOZ_STATIC_ASSERT(cond, reason) static_assert((cond), reason) +# endif +# endif +#endif +#ifndef MOZ_STATIC_ASSERT +# define MOZ_STATIC_ASSERT_GLUE1(x, y) x##y +# define MOZ_STATIC_ASSERT_GLUE(x, y) MOZ_STATIC_ASSERT_GLUE1(x, y) +# if defined(__SUNPRO_CC) + /* + * The Sun Studio C++ compiler is buggy when declaring, inside a function, + * another extern'd function with an array argument whose length contains a + * sizeof, triggering the error message "sizeof expression not accepted as + * size of array parameter". This bug (6688515, not public yet) would hit + * defining moz_static_assert as a function, so we always define an extern + * array for Sun Studio. + * + * We include the line number in the symbol name in a best-effort attempt + * to avoid conflicts (see below). + */ +# define MOZ_STATIC_ASSERT(cond, reason) \ + extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond) ? 1 : -1] +# elif defined(__COUNTER__) + /* + * If there was no preferred alternative, use a compiler-agnostic version. + * + * Note that the non-__COUNTER__ version has a bug in C++: it can't be used + * in both |extern "C"| and normal C++ in the same translation unit. (Alas + * |extern "C"| isn't allowed in a function.) The only affected compiler + * we really care about is gcc 4.2. For that compiler and others like it, + * we include the line number in the function name to do the best we can to + * avoid conflicts. These should be rare: a conflict would require use of + * MOZ_STATIC_ASSERT on the same line in separate files in the same + * translation unit, *and* the uses would have to be in code with + * different linkage, *and* the first observed use must be in C++-linkage + * code. + */ +# define MOZ_STATIC_ASSERT(cond, reason) \ + typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] +# else +# define MOZ_STATIC_ASSERT(cond, reason) \ + extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) +# endif +#endif + +#define MOZ_STATIC_ASSERT_IF(cond, expr, reason) MOZ_STATIC_ASSERT(!(cond) || (expr), reason) + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * MOZ_CRASH crashes the program, plain and simple, in a Breakpad-compatible + * way, in both debug and release builds. + * + * MOZ_CRASH is a good solution for "handling" failure cases when you're + * unwilling or unable to handle them more cleanly -- for OOM, for likely memory + * corruption, and so on. It's also a good solution if you need safe behavior + * in release builds as well as debug builds. But if the failure is one that + * should be debugged and fixed, MOZ_ASSERT is generally preferable. + */ +#if defined(_MSC_VER) + /* + * On MSVC use the __debugbreak compiler intrinsic, which produces an inline + * (not nested in a system function) breakpoint. This distinctively invokes + * Breakpad without requiring system library symbols on all stack-processing + * machines, as a nested breakpoint would require. We use TerminateProcess + * with the exit code aborting would generate because we don't want to invoke + * atexit handlers, destructors, library unload handlers, and so on when our + * process might be in a compromised state. We don't use abort() because + * it'd cause Windows to annoyingly pop up the process error dialog multiple + * times. See bug 345118 and bug 426163. + * + * (Technically these are Windows requirements, not MSVC requirements. But + * practically you need MSVC for debugging, and we only ship builds created + * by MSVC, so doing it this way reduces complexity.) + */ +# ifdef __cplusplus +# define MOZ_CRASH() \ + do { \ + __debugbreak(); \ + *((volatile int*) NULL) = 123; \ + ::TerminateProcess(::GetCurrentProcess(), 3); \ + } while (0) +# else +# define MOZ_CRASH() \ + do { \ + __debugbreak(); \ + *((volatile int*) NULL) = 123; \ + TerminateProcess(GetCurrentProcess(), 3); \ + } while (0) +# endif +#else +# ifdef __cplusplus +# define MOZ_CRASH() \ + do { \ + *((volatile int*) NULL) = 123; \ + ::abort(); \ + } while (0) +# else +# define MOZ_CRASH() \ + do { \ + *((volatile int*) NULL) = 123; \ + abort(); \ + } while (0) +# endif +#endif + +/* + * Prints |s| as an assertion failure (using file and ln as the location of the + * assertion) to the standard debug-output channel. + * + * Usually you should use MOZ_ASSERT instead of this method. This method is + * primarily for internal use in this header, and only secondarily for use in + * implementing release-build assertions. + */ +static MOZ_ALWAYS_INLINE void +MOZ_ReportAssertionFailure(const char* s, const char* file, int ln) +{ +#ifdef ANDROID + __android_log_print(ANDROID_LOG_FATAL, "MOZ_Assert", + "Assertion failure: %s, at %s:%d\n", s, file, ln); +#else + fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln); + fflush(stderr); +#endif +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/* + * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in + * debug builds. If it is, execution continues. Otherwise, an error message + * including the expression and the explanation-string (if provided) is printed, + * an attempt is made to invoke any existing debugger, and execution halts. + * MOZ_ASSERT is fatal: no recovery is possible. Do not assert a condition + * which can correctly be falsy. + * + * The optional explanation-string, if provided, must be a string literal + * explaining the assertion. It is intended for use with assertions whose + * correctness or rationale is non-obvious, and for assertions where the "real" + * condition being tested is best described prosaically. Don't provide an + * explanation if it's not actually helpful. + * + * // No explanation needed: pointer arguments often must not be NULL. + * MOZ_ASSERT(arg); + * + * // An explanation can be helpful to explain exactly how we know an + * // assertion is valid. + * MOZ_ASSERT(state == WAITING_FOR_RESPONSE, + * "given that and , we must have..."); + * + * // Or it might disambiguate multiple identical (save for their location) + * // assertions of the same expression. + * MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(), + * "we already set [[PrimitiveThis]] for this Boolean object"); + * MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(), + * "we already set [[PrimitiveThis]] for this String object"); + * + * MOZ_ASSERT has no effect in non-debug builds. It is designed to catch bugs + * *only* during debugging, not "in the field". + */ +#ifdef DEBUG + /* First the single-argument form. */ +# define MOZ_ASSERT_HELPER1(expr) \ + do { \ + if (!(expr)) { \ + MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \ + MOZ_CRASH(); \ + } \ + } while (0) + /* Now the two-argument form. */ +# define MOZ_ASSERT_HELPER2(expr, explain) \ + do { \ + if (!(expr)) { \ + MOZ_ReportAssertionFailure(#expr " (" explain ")", __FILE__, __LINE__); \ + MOZ_CRASH(); \ + } \ + } while (0) + /* And now, helper macrology up the wazoo. */ + /* + * Count the number of arguments passed to MOZ_ASSERT, very carefully + * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a + * single token in argument lists. See these URLs for details: + * + * http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement + * http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644 + */ +# define MOZ_COUNT_ASSERT_ARGS_IMPL2(_1, _2, count, ...) \ + count +# define MOZ_COUNT_ASSERT_ARGS_IMPL(args) \ + MOZ_COUNT_ASSERT_ARGS_IMPL2 args +# define MOZ_COUNT_ASSERT_ARGS(...) \ + MOZ_COUNT_ASSERT_ARGS_IMPL((__VA_ARGS__, 2, 1, 0)) + /* Pick the right helper macro to invoke. */ +# define MOZ_ASSERT_CHOOSE_HELPER2(count) MOZ_ASSERT_HELPER##count +# define MOZ_ASSERT_CHOOSE_HELPER1(count) MOZ_ASSERT_CHOOSE_HELPER2(count) +# define MOZ_ASSERT_CHOOSE_HELPER(count) MOZ_ASSERT_CHOOSE_HELPER1(count) + /* The actual macro. */ +# define MOZ_ASSERT_GLUE(x, y) x y +# define MOZ_ASSERT(...) \ + MOZ_ASSERT_GLUE(MOZ_ASSERT_CHOOSE_HELPER(MOZ_COUNT_ASSERT_ARGS(__VA_ARGS__)), \ + (__VA_ARGS__)) +#else +# define MOZ_ASSERT(...) do { } while(0) +#endif /* DEBUG */ + +/* + * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is + * true. + * + * MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num)); + * + * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds. It is + * designed to catch bugs during debugging, not "in the field". + */ +#ifdef DEBUG +# define MOZ_ASSERT_IF(cond, expr) \ + do { \ + if (cond) \ + MOZ_ASSERT(expr); \ + } while (0) +#else +# define MOZ_ASSERT_IF(cond, expr) do { } while (0) +#endif + +/* + * MOZ_NOT_REACHED_MARKER() expands to an expression which states that it is + * undefined behavior for execution to reach this point. No guarantees are made + * about what will happen if this is reached at runtime. Most code should + * probably use the higher level MOZ_NOT_REACHED, which uses this when + * appropriate. + */ +#if defined(__clang__) +# define MOZ_NOT_REACHED_MARKER() __builtin_unreachable() +#elif defined(__GNUC__) + /* + * __builtin_unreachable() was implemented in gcc 4.5. If we don't have + * that, call a noreturn function; abort() will do nicely. Qualify the call + * in C++ in case there's another abort() visible in local scope. + */ +# if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0) +# define MOZ_NOT_REACHED_MARKER() __builtin_unreachable() +# else +# ifdef __cplusplus +# define MOZ_NOT_REACHED_MARKER() ::abort() +# else +# define MOZ_NOT_REACHED_MARKER() abort() +# endif +# endif +#elif defined(_MSC_VER) +# define MOZ_NOT_REACHED_MARKER() __assume(0) +#else +# ifdef __cplusplus +# define MOZ_NOT_REACHED_MARKER() ::abort() +# else +# define MOZ_NOT_REACHED_MARKER() abort() +# endif +#endif + +/* + * MOZ_NOT_REACHED(reason) indicates that the given point can't be reached + * during execution: simply reaching that point in execution is a bug. It takes + * as an argument an error message indicating the reason why that point should + * not have been reachable. + * + * // ...in a language parser... + * void handle(BooleanLiteralNode node) + * { + * if (node.isTrue()) + * handleTrueLiteral(); + * else if (node.isFalse()) + * handleFalseLiteral(); + * else + * MOZ_NOT_REACHED("boolean literal that's not true or false?"); + * } + */ +#if defined(DEBUG) +# define MOZ_NOT_REACHED(reason) \ + do { \ + MOZ_ASSERT(false, reason); \ + MOZ_NOT_REACHED_MARKER(); \ + } while (0) +#else +# define MOZ_NOT_REACHED(reason) MOZ_NOT_REACHED_MARKER() +#endif + +/* + * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided + * expression, in debug builds and in release builds both. Then, in debug + * builds only, the value of the expression is asserted either true or false + * using MOZ_ASSERT. + */ +#ifdef DEBUG +# define MOZ_ALWAYS_TRUE(expr) MOZ_ASSERT((expr)) +# define MOZ_ALWAYS_FALSE(expr) MOZ_ASSERT(!(expr)) +#else +# define MOZ_ALWAYS_TRUE(expr) ((void)(expr)) +# define MOZ_ALWAYS_FALSE(expr) ((void)(expr)) +#endif + +#endif /* mozilla_Assertions_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h new file mode 100644 index 0000000000..941152fb05 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h @@ -0,0 +1,324 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Implementations of various class and method modifier attributes. */ + +#ifndef mozilla_Attributes_h_ +#define mozilla_Attributes_h_ + +#include "mozilla/Compiler.h" + +/* + * MOZ_INLINE is a macro which expands to tell the compiler that the method + * decorated with it should be inlined. This macro is usable from C and C++ + * code, even though C89 does not support the |inline| keyword. The compiler + * may ignore this directive if it chooses. + */ +#if defined(__cplusplus) +# define MOZ_INLINE inline +#elif defined(_MSC_VER) +# define MOZ_INLINE __inline +#elif defined(__GNUC__) +# define MOZ_INLINE __inline__ +#else +# define MOZ_INLINE inline +#endif + +/* + * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the + * method decorated with it must be inlined, even if the compiler thinks + * otherwise. This is only a (much) stronger version of the MOZ_INLINE hint: + * compilers are not guaranteed to respect it (although they're much more likely + * to do so). + */ +#if defined(_MSC_VER) +# define MOZ_ALWAYS_INLINE __forceinline +#elif defined(__GNUC__) +# define MOZ_ALWAYS_INLINE __attribute__((always_inline)) MOZ_INLINE +#else +# define MOZ_ALWAYS_INLINE MOZ_INLINE +#endif + +/* + * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality + * without warnings (functionality used by the macros below). These modes are + * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more + * standardly, by checking whether __cplusplus has a C++11 or greater value. + * Current versions of g++ do not correctly set __cplusplus, so we check both + * for forward compatibility. + */ +#if defined(__clang__) + /* + * Per Clang documentation, "Note that marketing version numbers should not + * be used to check for language features, as different vendors use different + * numbering schemes. Instead, use the feature checking macros." + */ +# ifndef __has_extension +# define __has_extension __has_feature /* compatibility, for older versions of clang */ +# endif +# if __has_extension(cxx_constexpr) +# define MOZ_HAVE_CXX11_CONSTEXPR +# endif +# if __has_extension(cxx_deleted_functions) +# define MOZ_HAVE_CXX11_DELETE +# endif +# if __has_extension(cxx_override_control) +# define MOZ_HAVE_CXX11_OVERRIDE +# define MOZ_HAVE_CXX11_FINAL final +# endif +# if __has_attribute(noinline) +# define MOZ_HAVE_NEVER_INLINE __attribute__((noinline)) +# endif +# if __has_attribute(noreturn) +# define MOZ_HAVE_NORETURN __attribute__((noreturn)) +# endif +#elif defined(__GNUC__) +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0) +# define MOZ_HAVE_CXX11_OVERRIDE +# define MOZ_HAVE_CXX11_FINAL final +# endif +# if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) +# define MOZ_HAVE_CXX11_CONSTEXPR +# endif +# define MOZ_HAVE_CXX11_DELETE +# else + /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */ +# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0) +# define MOZ_HAVE_CXX11_FINAL __final +# endif +# endif +# define MOZ_HAVE_NEVER_INLINE __attribute__((noinline)) +# define MOZ_HAVE_NORETURN __attribute__((noreturn)) +#elif defined(_MSC_VER) +# if _MSC_VER >= 1700 +# define MOZ_HAVE_CXX11_FINAL final +# else + /* MSVC <= 10 used to spell "final" as "sealed". */ +# define MOZ_HAVE_CXX11_FINAL sealed +# endif +# define MOZ_HAVE_CXX11_OVERRIDE +# define MOZ_HAVE_NEVER_INLINE __declspec(noinline) +# define MOZ_HAVE_NORETURN __declspec(noreturn) +#endif + +/* + * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a + * function at compile time. A constexpr function cannot examine any values + * except its arguments and can have no side effects except its return value. + */ +#ifdef MOZ_HAVE_CXX11_CONSTEXPR +# define MOZ_CONSTEXPR constexpr +#else +# define MOZ_CONSTEXPR /* no support */ +#endif + +/* + * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the + * method decorated with it must never be inlined, even if the compiler would + * otherwise choose to inline the method. Compilers aren't absolutely + * guaranteed to support this, but most do. + */ +#if defined(MOZ_HAVE_NEVER_INLINE) +# define MOZ_NEVER_INLINE MOZ_HAVE_NEVER_INLINE +#else +# define MOZ_NEVER_INLINE /* no support */ +#endif + +/* + * MOZ_NORETURN, specified at the start of a function declaration, indicates + * that the given function does not return. (The function definition does not + * need to be annotated.) + * + * MOZ_NORETURN void abort(const char* msg); + * + * This modifier permits the compiler to optimize code assuming a call to such a + * function will never return. It also enables the compiler to avoid spurious + * warnings about not initializing variables, or about any other seemingly-dodgy + * operations performed after the function returns. + * + * This modifier does not affect the corresponding function's linking behavior. + */ +#if defined(MOZ_HAVE_NORETURN) +# define MOZ_NORETURN MOZ_HAVE_NORETURN +#else +# define MOZ_NORETURN /* no support */ +#endif + +/* + * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time + * instrumentation shipped with Clang) to not instrument the annotated function. + * Furthermore, it will prevent the compiler from inlining the function because + * inlining currently breaks the blacklisting mechanism of AddressSanitizer. + */ +#if defined(MOZ_ASAN) +# define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis)) +# else +# define MOZ_ASAN_BLACKLIST +#endif + + +#ifdef __cplusplus + +/* + * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined- + * method declaration, attempts to delete that method from the corresponding + * class. An attempt to use the method will always produce an error *at compile + * time* (instead of sometimes as late as link time) when this macro can be + * implemented. For example, you can use MOZ_DELETE to produce classes with no + * implicit copy constructor or assignment operator: + * + * struct NonCopyable + * { + * private: + * NonCopyable(const NonCopyable& other) MOZ_DELETE; + * void operator=(const NonCopyable& other) MOZ_DELETE; + * }; + * + * If MOZ_DELETE can't be implemented for the current compiler, use of the + * annotated method will still cause an error, but the error might occur at link + * time in some cases rather than at compile time. + * + * MOZ_DELETE relies on C++11 functionality not universally implemented. As a + * backstop, method declarations using MOZ_DELETE should be private. + */ +#if defined(MOZ_HAVE_CXX11_DELETE) +# define MOZ_DELETE = delete +#else +# define MOZ_DELETE /* no support */ +#endif + +/* + * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class + * overrides a member function of a base class, rather than potentially being a + * new member function. MOZ_OVERRIDE should be placed immediately before the + * ';' terminating the member function's declaration, or before '= 0;' if the + * member function is pure. If the member function is defined in the class + * definition, it should appear before the opening brace of the function body. + * + * class Base + * { + * public: + * virtual void f() = 0; + * }; + * class Derived1 : public Base + * { + * public: + * virtual void f() MOZ_OVERRIDE; + * }; + * class Derived2 : public Base + * { + * public: + * virtual void f() MOZ_OVERRIDE = 0; + * }; + * class Derived3 : public Base + * { + * public: + * virtual void f() MOZ_OVERRIDE { } + * }; + * + * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that + * the function marked with it override a member function of a base class: it + * is a compile error if it does not. Otherwise MOZ_OVERRIDE does not affect + * semantics and merely documents the override relationship to the reader (but + * of course must still be used correctly to not break C++11 compilers). + */ +#if defined(MOZ_HAVE_CXX11_OVERRIDE) +# define MOZ_OVERRIDE override +#else +# define MOZ_OVERRIDE /* no support */ +#endif + +/* + * MOZ_FINAL indicates that some functionality cannot be overridden through + * inheritance. It can be used to annotate either classes/structs or virtual + * member functions. + * + * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after + * the name of the class, before the list of classes from which it derives (if + * any) and before its opening brace. MOZ_FINAL must not be used to annotate + * unnamed classes or structs. (With some compilers, and with C++11 proper, the + * underlying expansion is ambiguous with specifying a class name.) + * + * class Base MOZ_FINAL + * { + * public: + * Base(); + * ~Base(); + * virtual void f() { } + * }; + * // This will be an error in some compilers: + * class Derived : public Base + * { + * public: + * ~Derived() { } + * }; + * + * One particularly common reason to specify MOZ_FINAL upon a class is to tell + * the compiler that it's not dangerous for it to have a non-virtual destructor + * yet have one or more virtual functions, silencing the warning it might emit + * in this case. Suppose Base above weren't annotated with MOZ_FINAL. Because + * ~Base() is non-virtual, an attempt to delete a Derived* through a Base* + * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen. + * (Formally C++ says behavior is undefined, but compilers will likely just call + * ~Base() and not ~Derived().) Specifying MOZ_FINAL tells the compiler that + * it's safe for the destructor to be non-virtual. + * + * In compilers implementing final controls, it is an error to inherit from a + * class annotated with MOZ_FINAL. In other compilers it serves only as + * documentation. + * + * To annotate a virtual member function with MOZ_FINAL, place MOZ_FINAL + * immediately before the ';' terminating the member function's declaration, or + * before '= 0;' if the member function is pure. If the member function is + * defined in the class definition, it should appear before the opening brace of + * the function body. (This placement is identical to that for MOZ_OVERRIDE. + * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE' + * for consistency.) + * + * class Base + * { + * public: + * virtual void f() MOZ_FINAL; + * }; + * class Derived + * { + * public: + * // This will be an error in some compilers: + * virtual void f(); + * }; + * + * In compilers implementing final controls, it is an error for a derived class + * to override a method annotated with MOZ_FINAL. In other compilers it serves + * only as documentation. + */ +#if defined(MOZ_HAVE_CXX11_FINAL) +# define MOZ_FINAL MOZ_HAVE_CXX11_FINAL +#else +# define MOZ_FINAL /* no support */ +#endif + +/** + * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's + * return value is not used by the caller. + * + * Place this attribute at the very beginning of a function definition. For + * example, write + * + * MOZ_WARN_UNUSED_RESULT int foo(); + * + * or + * + * MOZ_WARN_UNUSED_RESULT int foo() { return 42; } + */ +#if defined(__GNUC__) || defined(__clang__) +# define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) +#else +# define MOZ_WARN_UNUSED_RESULT +#endif + +#endif /* __cplusplus */ + +#endif /* mozilla_Attributes_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/BloomFilter.h b/scripting/javascript/spidermonkey-mac/include/mozilla/BloomFilter.h new file mode 100644 index 0000000000..8680ef2907 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/BloomFilter.h @@ -0,0 +1,234 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * A counting Bloom filter implementation. This allows consumers to + * do fast probabilistic "is item X in set Y?" testing which will + * never answer "no" when the correct answer is "yes" (but might + * incorrectly answer "yes" when the correct answer is "no"). + */ + +#ifndef mozilla_BloomFilter_h_ +#define mozilla_BloomFilter_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/Likely.h" +#include "mozilla/StandardInteger.h" +#include "mozilla/Util.h" + +#include + +namespace mozilla { + +/* + * This class implements a counting Bloom filter as described at + * , with + * 8-bit counters. This allows quick probabilistic answers to the + * question "is object X in set Y?" where the contents of Y might not + * be time-invariant. The probabilistic nature of the test means that + * sometimes the answer will be "yes" when it should be "no". If the + * answer is "no", then X is guaranteed not to be in Y. + * + * The filter is parametrized on KeySize, which is the size of the key + * generated by each of hash functions used by the filter, in bits, + * and the type of object T being added and removed. T must implement + * a |uint32_t hash() const| method which returns a uint32_t hash key + * that will be used to generate the two separate hash functions for + * the Bloom filter. This hash key MUST be well-distributed for good + * results! KeySize is not allowed to be larger than 16. + * + * The filter uses exactly 2**KeySize bytes of memory. From now on we + * will refer to the memory used by the filter as M. + * + * The expected rate of incorrect "yes" answers depends on M and on + * the number N of objects in set Y. As long as N is small compared + * to M, the rate of such answers is expected to be approximately + * 4*(N/M)**2 for this filter. In practice, if Y has a few hundred + * elements then using a KeySize of 12 gives a reasonably low + * incorrect answer rate. A KeySize of 12 has the additional benefit + * of using exactly one page for the filter in typical hardware + * configurations. + */ + +template +class BloomFilter +{ + /* + * A counting Bloom filter with 8-bit counters. For now we assume + * that having two hash functions is enough, but we may revisit that + * decision later. + * + * The filter uses an array with 2**KeySize entries. + * + * Assuming a well-distributed hash function, a Bloom filter with + * array size M containing N elements and + * using k hash function has expected false positive rate exactly + * + * $ (1 - (1 - 1/M)^{kN})^k $ + * + * because each array slot has a + * + * $ (1 - 1/M)^{kN} $ + * + * chance of being 0, and the expected false positive rate is the + * probability that all of the k hash functions will hit a nonzero + * slot. + * + * For reasonable assumptions (M large, kN large, which should both + * hold if we're worried about false positives) about M and kN this + * becomes approximately + * + * $$ (1 - \exp(-kN/M))^k $$ + * + * For our special case of k == 2, that's $(1 - \exp(-2N/M))^2$, + * or in other words + * + * $$ N/M = -0.5 * \ln(1 - \sqrt(r)) $$ + * + * where r is the false positive rate. This can be used to compute + * the desired KeySize for a given load N and false positive rate r. + * + * If N/M is assumed small, then the false positive rate can + * further be approximated as 4*N^2/M^2. So increasing KeySize by + * 1, which doubles M, reduces the false positive rate by about a + * factor of 4, and a false positive rate of 1% corresponds to + * about M/N == 20. + * + * What this means in practice is that for a few hundred keys using a + * KeySize of 12 gives false positive rates on the order of 0.25-4%. + * + * Similarly, using a KeySize of 10 would lead to a 4% false + * positive rate for N == 100 and to quite bad false positive + * rates for larger N. + */ + public: + BloomFilter() { + MOZ_STATIC_ASSERT(KeySize <= keyShift, "KeySize too big"); + + // Should we have a custom operator new using calloc instead and + // require that we're allocated via the operator? + clear(); + } + + /* + * Clear the filter. This should be done before reusing it, because + * just removing all items doesn't clear counters that hit the upper + * bound. + */ + void clear(); + + /* + * Add an item to the filter. + */ + void add(const T* t); + + /* + * Remove an item from the filter. + */ + void remove(const T* t); + + /* + * Check whether the filter might contain an item. This can + * sometimes return true even if the item is not in the filter, + * but will never return false for items that are actually in the + * filter. + */ + bool mightContain(const T* t) const; + + /* + * Methods for add/remove/contain when we already have a hash computed + */ + void add(uint32_t hash); + void remove(uint32_t hash); + bool mightContain(uint32_t hash) const; + + private: + static const size_t arraySize = (1 << KeySize); + static const uint32_t keyMask = (1 << KeySize) - 1; + static const uint32_t keyShift = 16; + + static uint32_t hash1(uint32_t hash) { return hash & keyMask; } + static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; } + + uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; } + uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; } + const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; } + const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; } + + static bool full(const uint8_t& slot) { return slot == UINT8_MAX; } + + uint8_t counters[arraySize]; +}; + +template +inline void +BloomFilter::clear() +{ + memset(counters, 0, arraySize); +} + +template +inline void +BloomFilter::add(uint32_t hash) +{ + uint8_t& slot1 = firstSlot(hash); + if (MOZ_LIKELY(!full(slot1))) + ++slot1; + + uint8_t& slot2 = secondSlot(hash); + if (MOZ_LIKELY(!full(slot2))) + ++slot2; +} + +template +MOZ_ALWAYS_INLINE void +BloomFilter::add(const T* t) +{ + uint32_t hash = t->hash(); + return add(hash); +} + +template +inline void +BloomFilter::remove(uint32_t hash) +{ + // If the slots are full, we don't know whether we bumped them to be + // there when we added or not, so just leave them full. + uint8_t& slot1 = firstSlot(hash); + if (MOZ_LIKELY(!full(slot1))) + --slot1; + + uint8_t& slot2 = secondSlot(hash); + if (MOZ_LIKELY(!full(slot2))) + --slot2; +} + +template +MOZ_ALWAYS_INLINE void +BloomFilter::remove(const T* t) +{ + uint32_t hash = t->hash(); + remove(hash); +} + +template +MOZ_ALWAYS_INLINE bool +BloomFilter::mightContain(uint32_t hash) const +{ + // Check that all the slots for this hash contain something + return firstSlot(hash) && secondSlot(hash); +} + +template +MOZ_ALWAYS_INLINE bool +BloomFilter::mightContain(const T* t) const +{ + uint32_t hash = t->hash(); + return mightContain(hash); +} + +} // namespace mozilla + +#endif /* mozilla_BloomFilter_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Char16.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Char16.h new file mode 100644 index 0000000000..c6f9f87d44 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Char16.h @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Implements a UTF-16 character type. */ + +#ifndef mozilla_Char16_h_ +#define mozilla_Char16_h_ + +#include "mozilla/Assertions.h" + +/* + * C11 and C++11 introduce a char16_t type and support for UTF-16 string and + * character literals. C++11's char16_t is a distinct builtin type. C11's + * char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit + * code unit of a Unicode code point, not a "character". + * + * For now, Char16.h only supports C++ because we don't want mix different C + * and C++ definitions of char16_t in the same code base. + */ + +#ifdef _MSC_VER + /* + * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h + * typedefs char16_t as an unsigned short. We would like to alias char16_t + * to Windows's 16-bit wchar_t so we can declare UTF-16 literals as constant + * expressions (and pass char16_t pointers to Windows APIs). We #define our + * char16_t as a macro to override yval.h's typedef of the same name. + */ +# define MOZ_UTF16_HELPER(s) L##s +# include +# define char16_t wchar_t +#elif defined(__cplusplus) && \ + (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) + /* C++11 has a builtin char16_t type. */ +# define MOZ_UTF16_HELPER(s) u##s +#else +# error "Char16.h requires C++11 (or something like it) for UTF-16 support." +#endif + +/* + * Macro arguments used in concatenation or stringification won't be expanded. + * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to + * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper + * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro + * argument to expand. See "3.10.6 Separate Expansion of Macro Arguments" of the + * CPP manual for a more accurate and precise explanation. + */ +#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s) + +MOZ_STATIC_ASSERT(sizeof(char16_t) == 2, "Is char16_t type 16 bits?"); +MOZ_STATIC_ASSERT(sizeof(MOZ_UTF16('A')) == 2, "Is char literal 16 bits?"); +MOZ_STATIC_ASSERT(sizeof(MOZ_UTF16("")[0]) == 2, "Is string char 16 bits?"); + +#endif /* mozilla_Char16_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h b/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h new file mode 100644 index 0000000000..b56ac42b19 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h @@ -0,0 +1,809 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Provides checked integers, detecting integer overflow and divide-by-0. */ + +#ifndef mozilla_CheckedInt_h_ +#define mozilla_CheckedInt_h_ + +/* + * Build options. Comment out these #defines to disable the corresponding + * optional feature. Disabling features may be useful for code using + * CheckedInt outside of Mozilla (e.g. WebKit) + */ + +// Enable usage of MOZ_STATIC_ASSERT to check for unsupported types. +// If disabled, static asserts are replaced by regular assert(). +#define MOZ_CHECKEDINT_ENABLE_MOZ_ASSERTS + +/* + * End of build options + */ + + +#ifdef MOZ_CHECKEDINT_ENABLE_MOZ_ASSERTS +# include "mozilla/Assertions.h" +#else +# ifndef MOZ_STATIC_ASSERT +# include +# define MOZ_STATIC_ASSERT(cond, reason) assert((cond) && reason) +# define MOZ_ASSERT(cond, reason) assert((cond) && reason) +# endif +#endif + +#include "mozilla/StandardInteger.h" + +#include +#include + +namespace mozilla { + +namespace detail { + +/* + * Step 1: manually record supported types + * + * What's nontrivial here is that there are different families of integer + * types: basic integer types and stdint types. It is merrily undefined which + * types from one family may be just typedefs for a type from another family. + * + * For example, on GCC 4.6, aside from the basic integer types, the only other + * type that isn't just a typedef for some of them, is int8_t. + */ + +struct UnsupportedType {}; + +template +struct IsSupportedPass2 +{ + static const bool value = false; +}; + +template +struct IsSupported +{ + static const bool value = IsSupportedPass2::value; +}; + +template<> +struct IsSupported +{ static const bool value = true; }; + +template<> +struct IsSupported +{ static const bool value = true; }; + +template<> +struct IsSupported +{ static const bool value = true; }; + +template<> +struct IsSupported +{ static const bool value = true; }; + +template<> +struct IsSupported +{ static const bool value = true; }; + +template<> +struct IsSupported +{ static const bool value = true; }; + +template<> +struct IsSupported +{ static const bool value = true; }; + +template<> +struct IsSupported +{ static const bool value = true; }; + + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + + +/* + * Step 2: some integer-traits kind of stuff. + */ + +template +struct StdintTypeForSizeAndSignedness +{}; + +template<> +struct StdintTypeForSizeAndSignedness<1, true> +{ typedef int8_t Type; }; + +template<> +struct StdintTypeForSizeAndSignedness<1, false> +{ typedef uint8_t Type; }; + +template<> +struct StdintTypeForSizeAndSignedness<2, true> +{ typedef int16_t Type; }; + +template<> +struct StdintTypeForSizeAndSignedness<2, false> +{ typedef uint16_t Type; }; + +template<> +struct StdintTypeForSizeAndSignedness<4, true> +{ typedef int32_t Type; }; + +template<> +struct StdintTypeForSizeAndSignedness<4, false> +{ typedef uint32_t Type; }; + +template<> +struct StdintTypeForSizeAndSignedness<8, true> +{ typedef int64_t Type; }; + +template<> +struct StdintTypeForSizeAndSignedness<8, false> +{ typedef uint64_t Type; }; + +template +struct UnsignedType +{ + typedef typename StdintTypeForSizeAndSignedness::Type Type; +}; + +template +struct IsSigned +{ + static const bool value = IntegerType(-1) <= IntegerType(0); +}; + +template +struct TwiceBiggerType +{ + typedef typename StdintTypeForSizeAndSignedness< + sizeof(IntegerType) * 2, + IsSigned::value + >::Type Type; +}; + +template +struct TwiceBiggerType +{ + typedef UnsupportedType Type; +}; + +template +struct PositionOfSignBit +{ + static const size_t value = CHAR_BIT * sizeof(IntegerType) - 1; +}; + +template +struct MinValue +{ + private: + typedef typename UnsignedType::Type UnsignedIntegerType; + static const size_t PosOfSignBit = PositionOfSignBit::value; + + public: + // Bitwise ops may return a larger type, that's why we cast explicitly. + // In C++, left bit shifts on signed values is undefined by the standard + // unless the shifted value is representable. + // Notice that signed-to-unsigned conversions are always well-defined in + // the standard as the value congruent to 2**n, as expected. By contrast, + // unsigned-to-signed is only well-defined if the value is representable. + static const IntegerType value = + IsSigned::value + ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit) + : IntegerType(0); +}; + +template +struct MaxValue +{ + // Tricksy, but covered by the unit test. + // Relies heavily on the type of MinValue::value + // being IntegerType. + static const IntegerType value = ~MinValue::value; +}; + +/* + * Step 3: Implement the actual validity checks. + * + * Ideas taken from IntegerLib, code different. + */ + +template +inline bool +HasSignBit(T x) +{ + // In C++, right bit shifts on negative values is undefined by the standard. + // Notice that signed-to-unsigned conversions are always well-defined in the + // standard, as the value congruent modulo 2**n as expected. By contrast, + // unsigned-to-signed is only well-defined if the value is representable. + return bool(typename UnsignedType::Type(x) + >> PositionOfSignBit::value); +} + +// Bitwise ops may return a larger type, so it's good to use this inline +// helper guaranteeing that the result is really of type T. +template +inline T +BinaryComplement(T x) +{ + return ~x; +} + +template::value, + bool IsUSigned = IsSigned::value> +struct DoesRangeContainRange +{ +}; + +template +struct DoesRangeContainRange +{ + static const bool value = sizeof(T) >= sizeof(U); +}; + +template +struct DoesRangeContainRange +{ + static const bool value = sizeof(T) > sizeof(U); +}; + +template +struct DoesRangeContainRange +{ + static const bool value = false; +}; + +template::value, + bool IsUSigned = IsSigned::value, + bool DoesTRangeContainURange = DoesRangeContainRange::value> +struct IsInRangeImpl {}; + +template +struct IsInRangeImpl +{ + static bool run(U) + { + return true; + } +}; + +template +struct IsInRangeImpl +{ + static bool run(U x) + { + return x <= MaxValue::value && x >= MinValue::value; + } +}; + +template +struct IsInRangeImpl +{ + static bool run(U x) + { + return x <= MaxValue::value; + } +}; + +template +struct IsInRangeImpl +{ + static bool run(U x) + { + return sizeof(T) > sizeof(U) || x <= U(MaxValue::value); + } +}; + +template +struct IsInRangeImpl +{ + static bool run(U x) + { + return sizeof(T) >= sizeof(U) + ? x >= 0 + : x >= 0 && x <= U(MaxValue::value); + } +}; + +template +inline bool +IsInRange(U x) +{ + return IsInRangeImpl::run(x); +} + +template +inline bool +IsAddValid(T x, T y) +{ + // Addition is valid if the sign of x+y is equal to either that of x or that + // of y. Since the value of x+y is undefined if we have a signed type, we + // compute it using the unsigned type of the same size. + // Beware! These bitwise operations can return a larger integer type, + // if T was a small type like int8_t, so we explicitly cast to T. + + typename UnsignedType::Type ux = x; + typename UnsignedType::Type uy = y; + typename UnsignedType::Type result = ux + uy; + return IsSigned::value + ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y)))) + : BinaryComplement(x) >= y; +} + +template +inline bool +IsSubValid(T x, T y) +{ + // Subtraction is valid if either x and y have same sign, or x-y and x have + // same sign. Since the value of x-y is undefined if we have a signed type, + // we compute it using the unsigned type of the same size. + typename UnsignedType::Type ux = x; + typename UnsignedType::Type uy = y; + typename UnsignedType::Type result = ux - uy; + + return IsSigned::value + ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y)))) + : x >= y; +} + +template::value, + bool TwiceBiggerTypeIsSupported = + IsSupported::Type>::value> +struct IsMulValidImpl {}; + +template +struct IsMulValidImpl +{ + static bool run(T x, T y) + { + typedef typename TwiceBiggerType::Type TwiceBiggerType; + TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y); + return IsInRange(product); + } +}; + +template +struct IsMulValidImpl +{ + static bool run(T x, T y) + { + const T max = MaxValue::value; + const T min = MinValue::value; + + if (x == 0 || y == 0) + return true; + + if (x > 0) { + return y > 0 + ? x <= max / y + : y >= min / x; + } + + // If we reach this point, we know that x < 0. + return y > 0 + ? x >= min / y + : y >= max / x; + } +}; + +template +struct IsMulValidImpl +{ + static bool run(T x, T y) + { + return y == 0 || x <= MaxValue::value / y; + } +}; + +template +inline bool +IsMulValid(T x, T y) +{ + return IsMulValidImpl::run(x, y); +} + +template +inline bool +IsDivValid(T x, T y) +{ + // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max. + return y != 0 && + !(IsSigned::value && x == MinValue::value && y == T(-1)); +} + +// This is just to shut up msvc warnings about negating unsigned ints. +template::value> +struct OppositeIfSignedImpl +{ + static T run(T x) { return -x; } +}; +template +struct OppositeIfSignedImpl +{ + static T run(T x) { return x; } +}; +template +inline T +OppositeIfSigned(T x) +{ + return OppositeIfSignedImpl::run(x); +} + +} // namespace detail + + +/* + * Step 4: Now define the CheckedInt class. + */ + +/** + * @class CheckedInt + * @brief Integer wrapper class checking for integer overflow and other errors + * @param T the integer type to wrap. Can be any type among the following: + * - any basic integer type such as |int| + * - any stdint type such as |int8_t| + * + * This class implements guarded integer arithmetic. Do a computation, check + * that isValid() returns true, you then have a guarantee that no problem, such + * as integer overflow, happened during this computation, and you can call + * value() to get the plain integer value. + * + * The arithmetic operators in this class are guaranteed not to raise a signal + * (e.g. in case of a division by zero). + * + * For example, suppose that you want to implement a function that computes + * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by + * zero or integer overflow). You could code it as follows: + @code + bool computeXPlusYOverZ(int x, int y, int z, int *result) + { + CheckedInt checkedResult = (CheckedInt(x) + y) / z; + if (checkedResult.isValid()) { + *result = checkedResult.value(); + return true; + } else { + return false; + } + } + @endcode + * + * Implicit conversion from plain integers to checked integers is allowed. The + * plain integer is checked to be in range before being casted to the + * destination type. This means that the following lines all compile, and the + * resulting CheckedInts are correctly detected as valid or invalid: + * @code + // 1 is of type int, is found to be in range for uint8_t, x is valid + CheckedInt x(1); + // -1 is of type int, is found not to be in range for uint8_t, x is invalid + CheckedInt x(-1); + // -1 is of type int, is found to be in range for int8_t, x is valid + CheckedInt x(-1); + // 1000 is of type int16_t, is found not to be in range for int8_t, + // x is invalid + CheckedInt x(int16_t(1000)); + // 3123456789 is of type uint32_t, is found not to be in range for int32_t, + // x is invalid + CheckedInt x(uint32_t(3123456789)); + * @endcode + * Implicit conversion from + * checked integers to plain integers is not allowed. As shown in the + * above example, to get the value of a checked integer as a normal integer, + * call value(). + * + * Arithmetic operations between checked and plain integers is allowed; the + * result type is the type of the checked integer. + * + * Checked integers of different types cannot be used in the same arithmetic + * expression. + * + * There are convenience typedefs for all stdint types, of the following form + * (these are just 2 examples): + @code + typedef CheckedInt CheckedInt32; + typedef CheckedInt CheckedUint16; + @endcode + */ +template +class CheckedInt +{ + protected: + T mValue; + bool mIsValid; + + template + CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid) + { + MOZ_STATIC_ASSERT(detail::IsSupported::value, + "This type is not supported by CheckedInt"); + } + + public: + /** + * Constructs a checked integer with given @a value. The checked integer is + * initialized as valid or invalid depending on whether the @a value + * is in range. + * + * This constructor is not explicit. Instead, the type of its argument is a + * separate template parameter, ensuring that no conversion is performed + * before this constructor is actually called. As explained in the above + * documentation for class CheckedInt, this constructor checks that its + * argument is valid. + */ + template + CheckedInt(U value) + : mValue(T(value)), + mIsValid(detail::IsInRange(value)) + { + MOZ_STATIC_ASSERT(detail::IsSupported::value, + "This type is not supported by CheckedInt"); + } + + /** Constructs a valid checked integer with initial value 0 */ + CheckedInt() : mValue(0), mIsValid(true) + { + MOZ_STATIC_ASSERT(detail::IsSupported::value, + "This type is not supported by CheckedInt"); + } + + /** @returns the actual value */ + T value() const + { + MOZ_ASSERT(mIsValid, "Invalid checked integer (division by zero or integer overflow)"); + return mValue; + } + + /** + * @returns true if the checked integer is valid, i.e. is not the result + * of an invalid operation or of an operation involving an invalid checked + * integer + */ + bool isValid() const + { + return mIsValid; + } + + template + friend CheckedInt operator +(const CheckedInt& lhs, + const CheckedInt& rhs); + template + CheckedInt& operator +=(U rhs); + template + friend CheckedInt operator -(const CheckedInt& lhs, + const CheckedInt &rhs); + template + CheckedInt& operator -=(U rhs); + template + friend CheckedInt operator *(const CheckedInt& lhs, + const CheckedInt &rhs); + template + CheckedInt& operator *=(U rhs); + template + friend CheckedInt operator /(const CheckedInt& lhs, + const CheckedInt &rhs); + template + CheckedInt& operator /=(U rhs); + + CheckedInt operator -() const + { + // Circumvent msvc warning about - applied to unsigned int. + // if we're unsigned, the only valid case anyway is 0 + // in which case - is a no-op. + T result = detail::OppositeIfSigned(mValue); + /* Help the compiler perform RVO (return value optimization). */ + return CheckedInt(result, + mIsValid && detail::IsSubValid(T(0), + mValue)); + } + + /** + * @returns true if the left and right hand sides are valid + * and have the same value. + * + * Note that these semantics are the reason why we don't offer + * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b) + * but that would mean that whenever a or b is invalid, a!=b + * is always true, which would be very confusing. + * + * For similar reasons, operators <, >, <=, >= would be very tricky to + * specify, so we just avoid offering them. + * + * Notice that these == semantics are made more reasonable by these facts: + * 1. a==b implies equality at the raw data level + * (the converse is false, as a==b is never true among invalids) + * 2. This is similar to the behavior of IEEE floats, where a==b + * means that a and b have the same value *and* neither is NaN. + */ + bool operator ==(const CheckedInt& other) const + { + return mIsValid && other.mIsValid && mValue == other.mValue; + } + + /** prefix ++ */ + CheckedInt& operator++() + { + *this += 1; + return *this; + } + + /** postfix ++ */ + CheckedInt operator++(int) + { + CheckedInt tmp = *this; + *this += 1; + return tmp; + } + + /** prefix -- */ + CheckedInt& operator--() + { + *this -= 1; + return *this; + } + + /** postfix -- */ + CheckedInt operator--(int) + { + CheckedInt tmp = *this; + *this -= 1; + return tmp; + } + + private: + /** + * The !=, <, <=, >, >= operators are disabled: + * see the comment on operator==. + */ + template + bool operator !=(U other) const MOZ_DELETE; + template + bool operator <(U other) const MOZ_DELETE; + template + bool operator <=(U other) const MOZ_DELETE; + template + bool operator >(U other) const MOZ_DELETE; + template + bool operator >=(U other) const MOZ_DELETE; +}; + +#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP) \ +template \ +inline CheckedInt operator OP(const CheckedInt &lhs, \ + const CheckedInt &rhs) \ +{ \ + if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue)) \ + return CheckedInt(0, false); \ + \ + return CheckedInt(lhs.mValue OP rhs.mValue, \ + lhs.mIsValid && rhs.mIsValid); \ +} + +MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +) +MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -) +MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *) +MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /) + +#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR + +// Implement castToCheckedInt(x), making sure that +// - it allows x to be either a CheckedInt or any integer type +// that can be casted to T +// - if x is already a CheckedInt, we just return a reference to it, +// instead of copying it (optimization) + +namespace detail { + +template +struct CastToCheckedIntImpl +{ + typedef CheckedInt ReturnType; + static CheckedInt run(U u) { return u; } +}; + +template +struct CastToCheckedIntImpl > +{ + typedef const CheckedInt& ReturnType; + static const CheckedInt& run(const CheckedInt& u) { return u; } +}; + +} // namespace detail + +template +inline typename detail::CastToCheckedIntImpl::ReturnType +castToCheckedInt(U u) +{ + return detail::CastToCheckedIntImpl::run(u); +} + +#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP) \ +template \ +template \ +CheckedInt& CheckedInt::operator COMPOUND_OP(U rhs) \ +{ \ + *this = *this OP castToCheckedInt(rhs); \ + return *this; \ +} \ +template \ +inline CheckedInt operator OP(const CheckedInt &lhs, U rhs) \ +{ \ + return lhs OP castToCheckedInt(rhs); \ +} \ +template \ +inline CheckedInt operator OP(U lhs, const CheckedInt &rhs) \ +{ \ + return castToCheckedInt(lhs) OP rhs; \ +} + +MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=) +MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=) +MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=) +MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=) + +#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS + +template +inline bool +operator ==(const CheckedInt &lhs, U rhs) +{ + return lhs == castToCheckedInt(rhs); +} + +template +inline bool +operator ==(U lhs, const CheckedInt &rhs) +{ + return castToCheckedInt(lhs) == rhs; +} + +// Convenience typedefs. +typedef CheckedInt CheckedInt8; +typedef CheckedInt CheckedUint8; +typedef CheckedInt CheckedInt16; +typedef CheckedInt CheckedUint16; +typedef CheckedInt CheckedInt32; +typedef CheckedInt CheckedUint32; +typedef CheckedInt CheckedInt64; +typedef CheckedInt CheckedUint64; + +} // namespace mozilla + +#endif /* mozilla_CheckedInt_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Compiler.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Compiler.h new file mode 100644 index 0000000000..e4f26f42fa --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Compiler.h @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Various compiler checks. */ + +#ifndef mozilla_Compiler_h_ +#define mozilla_Compiler_h_ + +#if !defined(__clang__) && defined(__GNUC__) + /* + * This macro should simplify gcc version checking. For example, to check + * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`. + */ +# define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel) \ + ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \ + >= ((major) * 10000 + (minor) * 100 + (patchlevel))) +#if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0) +# error "mfbt (and Gecko) require at least gcc 4.4 to build." +#endif +#endif + +#endif /* mozilla_Compiler_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Constants.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Constants.h new file mode 100644 index 0000000000..904b30145a --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Constants.h @@ -0,0 +1,15 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* mfbt math constants. */ + +#ifndef mozilla_Constants_h_ +#define mozilla_Constants_h_ + +#ifndef M_PI +# define M_PI 3.14159265358979323846 +#endif + +#endif /* mozilla_Constants_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/DebugOnly.h b/scripting/javascript/spidermonkey-mac/include/mozilla/DebugOnly.h new file mode 100644 index 0000000000..1f78ed7989 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/DebugOnly.h @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Provides DebugOnly, a type for variables used only in debug builds (i.e. by + * assertions). + */ + +#ifndef mozilla_DebugOnly_h_ +#define mozilla_DebugOnly_h_ + +namespace mozilla { + +/** + * DebugOnly contains a value of type T, but only in debug builds. In release + * builds, it does not contain a value. This helper is intended to be used with + * MOZ_ASSERT()-style macros, allowing one to write: + * + * DebugOnly check = func(); + * MOZ_ASSERT(check); + * + * more concisely than declaring |check| conditional on #ifdef DEBUG, but also + * without allocating storage space for |check| in release builds. + * + * DebugOnly instances can only be coerced to T in debug builds. In release + * builds they don't have a value, so type coercion is not well defined. + */ +template +class DebugOnly +{ + public: +#ifdef DEBUG + T value; + + DebugOnly() { } + DebugOnly(const T& other) : value(other) { } + DebugOnly(const DebugOnly& other) : value(other.value) { } + DebugOnly& operator=(const T& rhs) { + value = rhs; + return *this; + } + void operator++(int) { + value++; + } + void operator--(int) { + value--; + } + + T* operator&() { return &value; } + + operator T&() { return value; } + operator const T&() const { return value; } + + T& operator->() { return value; } + +#else + DebugOnly() { } + DebugOnly(const T&) { } + DebugOnly(const DebugOnly&) { } + DebugOnly& operator=(const T&) { return *this; } + void operator++(int) { } + void operator--(int) { } +#endif + + /* + * DebugOnly must always have a destructor or else it will + * generate "unused variable" warnings, exactly what it's intended + * to avoid! + */ + ~DebugOnly() {} +}; + +} + +#endif /* mozilla_DebugOnly_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/EnumSet.h b/scripting/javascript/spidermonkey-mac/include/mozilla/EnumSet.h new file mode 100644 index 0000000000..b18b005669 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/EnumSet.h @@ -0,0 +1,175 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* A set abstraction for enumeration values. */ + +#ifndef mozilla_EnumSet_h +#define mozilla_EnumSet_h + +#include "mozilla/Assertions.h" +#include "mozilla/StandardInteger.h" + +namespace mozilla { + +/** + * EnumSet is a set of values defined by an enumeration. It is implemented + * using a 32 bit mask for each value so it will only work for enums with an int + * representation less than 32. It works both for enum and enum class types. + */ +template +class EnumSet +{ + public: + EnumSet() + : mBitField(0) + { } + + EnumSet(T aEnum) + : mBitField(aEnum) + { } + + EnumSet(T aEnum1, T aEnum2) + : mBitField(bitFor(aEnum1) | + bitFor(aEnum2)) + { } + + EnumSet(T aEnum1, T aEnum2, T aEnum3) + : mBitField(bitFor(aEnum1) | + bitFor(aEnum2) | + bitFor(aEnum3)) + { } + + EnumSet(T aEnum1, T aEnum2, T aEnum3, T aEnum4) + : mBitField(bitFor(aEnum1) | + bitFor(aEnum2) | + bitFor(aEnum3) | + bitFor(aEnum4)) + { } + + EnumSet(const EnumSet& aEnumSet) + : mBitField(aEnumSet.mBitField) + { } + + /** + * Add an element + */ + void operator+=(T aEnum) { + mBitField |= bitFor(aEnum); + } + + /** + * Add an element + */ + EnumSet operator+(T aEnum) const { + EnumSet result(*this); + result += aEnum; + return result; + } + + /** + * Union + */ + void operator+=(const EnumSet aEnumSet) { + mBitField |= aEnumSet.mBitField; + } + + /** + * Union + */ + EnumSet operator+(const EnumSet aEnumSet) const { + EnumSet result(*this); + result += aEnumSet; + return result; + } + + /** + * Remove an element + */ + void operator-=(T aEnum) { + mBitField &= ~(bitFor(aEnum)); + } + + /** + * Remove an element + */ + EnumSet operator-(T aEnum) const { + EnumSet result(*this); + result -= aEnum; + return result; + } + + /** + * Remove a set of elements + */ + void operator-=(const EnumSet aEnumSet) { + mBitField &= ~(aEnumSet.mBitField); + } + + /** + * Remove a set of elements + */ + EnumSet operator-(const EnumSet aEnumSet) const { + EnumSet result(*this); + result -= aEnumSet; + return result; + } + + /** + * Intersection + */ + void operator&=(const EnumSet aEnumSet) { + mBitField &= aEnumSet.mBitField; + } + + /** + * Intersection + */ + EnumSet operator&(const EnumSet aEnumSet) const { + EnumSet result(*this); + result &= aEnumSet; + return result; + } + + /** + * Equality + */ + + bool operator==(const EnumSet aEnumSet) const { + return mBitField == aEnumSet.mBitField; + } + + /** + * Test is an element is contained in the set + */ + bool contains(T aEnum) const { + return mBitField & bitFor(aEnum); + } + + /** + * Return the number of elements in the set + */ + + uint8_t size() { + uint8_t count = 0; + for (uint32_t bitField = mBitField; bitField; bitField >>= 1) { + if (bitField & 1) + count++; + } + return count; + } + + private: + static uint32_t bitFor(T aEnum) { + uint32_t bitNumber(aEnum); + MOZ_ASSERT(bitNumber < 32); + return 1U << bitNumber; + } + + uint32_t mBitField; +}; + +} // namespace mozilla + +#endif // mozilla_EnumSet_h_ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/FloatingPoint.h b/scripting/javascript/spidermonkey-mac/include/mozilla/FloatingPoint.h new file mode 100644 index 0000000000..cb1394e1a4 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/FloatingPoint.h @@ -0,0 +1,244 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Various predicates and operations on IEEE-754 floating point types. */ + +#ifndef mozilla_FloatingPoint_h_ +#define mozilla_FloatingPoint_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" +#include "mozilla/StandardInteger.h" + +/* + * It's reasonable to ask why we have this header at all. Don't isnan, + * copysign, the built-in comparison operators, and the like solve these + * problems? Unfortunately, they don't. We've found that various compilers + * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile + * the standard methods in various situations, so we can't use them. Some of + * these compilers even have problems compiling seemingly reasonable bitwise + * algorithms! But with some care we've found algorithms that seem to not + * trigger those compiler bugs. + * + * For the aforementioned reasons, be very wary of making changes to any of + * these algorithms. If you must make changes, keep a careful eye out for + * compiler bustage, particularly PGO-specific bustage. + * + * Some users require that this file be C-compatible. Unfortunately, this means + * no mozilla namespace to contain everything, no detail namespace clarifying + * MozDoublePun to be an internal data structure, and so on. + */ + +/* + * These implementations all assume |double| is a 64-bit double format number + * type, compatible with the IEEE-754 standard. C/C++ don't require this to be + * the case. But we required this in implementations of these algorithms that + * preceded this header, so we shouldn't break anything if we continue doing so. + */ +MOZ_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t), "double must be 64 bits"); + +/* + * Constant expressions in C can't refer to consts, unfortunately, so #define + * these rather than use |const uint64_t|. + */ +#define MOZ_DOUBLE_SIGN_BIT 0x8000000000000000ULL +#define MOZ_DOUBLE_EXPONENT_BITS 0x7ff0000000000000ULL +#define MOZ_DOUBLE_SIGNIFICAND_BITS 0x000fffffffffffffULL + +#define MOZ_DOUBLE_EXPONENT_BIAS 1023 +#define MOZ_DOUBLE_EXPONENT_SHIFT 52 + +MOZ_STATIC_ASSERT((MOZ_DOUBLE_SIGN_BIT & MOZ_DOUBLE_EXPONENT_BITS) == 0, + "sign bit doesn't overlap exponent bits"); +MOZ_STATIC_ASSERT((MOZ_DOUBLE_SIGN_BIT & MOZ_DOUBLE_SIGNIFICAND_BITS) == 0, + "sign bit doesn't overlap significand bits"); +MOZ_STATIC_ASSERT((MOZ_DOUBLE_EXPONENT_BITS & MOZ_DOUBLE_SIGNIFICAND_BITS) == 0, + "exponent bits don't overlap significand bits"); + +MOZ_STATIC_ASSERT((MOZ_DOUBLE_SIGN_BIT | MOZ_DOUBLE_EXPONENT_BITS | MOZ_DOUBLE_SIGNIFICAND_BITS) + == ~(uint64_t)0, + "all bits accounted for"); + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This union is NOT a public data structure, and it is not to be used outside + * this file! + */ +union MozDoublePun { + /* + * Every way to pun the bits of a double introduces an additional layer of + * complexity, across a multitude of platforms, architectures, and ABIs. + * Use *only* uint64_t to reduce complexity. Don't add new punning here + * without discussion! + */ + uint64_t u; + double d; +}; + +/** Determines whether a double is NaN. */ +static MOZ_ALWAYS_INLINE int +MOZ_DOUBLE_IS_NaN(double d) +{ + union MozDoublePun pun; + pun.d = d; + + /* + * A double is NaN if all exponent bits are 1 and the significand contains at + * least one non-zero bit. + */ + return (pun.u & MOZ_DOUBLE_EXPONENT_BITS) == MOZ_DOUBLE_EXPONENT_BITS && + (pun.u & MOZ_DOUBLE_SIGNIFICAND_BITS) != 0; +} + +/** Determines whether a double is +Infinity or -Infinity. */ +static MOZ_ALWAYS_INLINE int +MOZ_DOUBLE_IS_INFINITE(double d) +{ + union MozDoublePun pun; + pun.d = d; + + /* Infinities have all exponent bits set to 1 and an all-0 significand. */ + return (pun.u & ~MOZ_DOUBLE_SIGN_BIT) == MOZ_DOUBLE_EXPONENT_BITS; +} + +/** Determines whether a double is not NaN or infinite. */ +static MOZ_ALWAYS_INLINE int +MOZ_DOUBLE_IS_FINITE(double d) +{ + union MozDoublePun pun; + pun.d = d; + + /* + * NaN and Infinities are the only non-finite doubles, and both have all + * exponent bits set to 1. + */ + return (pun.u & MOZ_DOUBLE_EXPONENT_BITS) != MOZ_DOUBLE_EXPONENT_BITS; +} + +/** + * Determines whether a double is negative. It is an error to call this method + * on a double which is NaN. + */ +static MOZ_ALWAYS_INLINE int +MOZ_DOUBLE_IS_NEGATIVE(double d) +{ + union MozDoublePun pun; + pun.d = d; + + MOZ_ASSERT(!MOZ_DOUBLE_IS_NaN(d), "NaN does not have a sign"); + + /* The sign bit is set if the double is negative. */ + return (pun.u & MOZ_DOUBLE_SIGN_BIT) != 0; +} + +/** Determines whether a double represents -0. */ +static MOZ_ALWAYS_INLINE int +MOZ_DOUBLE_IS_NEGATIVE_ZERO(double d) +{ + union MozDoublePun pun; + pun.d = d; + + /* Only the sign bit is set if the double is -0. */ + return pun.u == MOZ_DOUBLE_SIGN_BIT; +} + +/** Returns the exponent portion of the double. */ +static MOZ_ALWAYS_INLINE int_fast16_t +MOZ_DOUBLE_EXPONENT(double d) +{ + union MozDoublePun pun; + pun.d = d; + + /* + * The exponent component of a double is an unsigned number, biased from its + * actual value. Subtract the bias to retrieve the actual exponent. + */ + return (int_fast16_t)((pun.u & MOZ_DOUBLE_EXPONENT_BITS) >> MOZ_DOUBLE_EXPONENT_SHIFT) - + MOZ_DOUBLE_EXPONENT_BIAS; +} + +/** Returns +Infinity. */ +static MOZ_ALWAYS_INLINE double +MOZ_DOUBLE_POSITIVE_INFINITY() +{ + union MozDoublePun pun; + + /* + * Positive infinity has all exponent bits set, sign bit set to 0, and no + * significand. + */ + pun.u = MOZ_DOUBLE_EXPONENT_BITS; + return pun.d; +} + +/** Returns -Infinity. */ +static MOZ_ALWAYS_INLINE double +MOZ_DOUBLE_NEGATIVE_INFINITY() +{ + union MozDoublePun pun; + + /* + * Negative infinity has all exponent bits set, sign bit set to 1, and no + * significand. + */ + pun.u = MOZ_DOUBLE_SIGN_BIT | MOZ_DOUBLE_EXPONENT_BITS; + return pun.d; +} + +/** Constructs a NaN value with the specified sign bit and significand bits. */ +static MOZ_ALWAYS_INLINE double +MOZ_DOUBLE_SPECIFIC_NaN(int signbit, uint64_t significand) +{ + union MozDoublePun pun; + + MOZ_ASSERT(signbit == 0 || signbit == 1); + MOZ_ASSERT((significand & ~MOZ_DOUBLE_SIGNIFICAND_BITS) == 0); + MOZ_ASSERT(significand & MOZ_DOUBLE_SIGNIFICAND_BITS); + + pun.u = (signbit ? MOZ_DOUBLE_SIGN_BIT : 0) | + MOZ_DOUBLE_EXPONENT_BITS | + significand; + MOZ_ASSERT(MOZ_DOUBLE_IS_NaN(pun.d)); + return pun.d; +} + +/** + * Computes a NaN value. Do not use this method if you depend upon a particular + * NaN value being returned. + */ +static MOZ_ALWAYS_INLINE double +MOZ_DOUBLE_NaN() +{ + return MOZ_DOUBLE_SPECIFIC_NaN(0, 0xfffffffffffffULL); +} + +/** Computes the smallest non-zero positive double value. */ +static MOZ_ALWAYS_INLINE double +MOZ_DOUBLE_MIN_VALUE() +{ + union MozDoublePun pun; + pun.u = 1; + return pun.d; +} + +static MOZ_ALWAYS_INLINE int +MOZ_DOUBLE_IS_INT32(double d, int32_t* i) +{ + /* + * XXX Casting a double that doesn't truncate to int32_t, to int32_t, induces + * undefined behavior. We should definitely fix this (bug 744965), but as + * apparently it "works" in practice, it's not a pressing concern now. + */ + return !MOZ_DOUBLE_IS_NEGATIVE_ZERO(d) && d == (*i = (int32_t)d); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* mozilla_FloatingPoint_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/GuardObjects.h b/scripting/javascript/spidermonkey-mac/include/mozilla/GuardObjects.h new file mode 100644 index 0000000000..6c2058938c --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/GuardObjects.h @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Implementation of macros to ensure correct use of RAII Auto* objects. */ + +#ifndef mozilla_GuardObjects_h +#define mozilla_GuardObjects_h + +#include "mozilla/Assertions.h" +#include "mozilla/Types.h" + +#ifdef __cplusplus + +#ifdef DEBUG + +namespace mozilla { +namespace detail { + +/* + * The following classes are designed to cause assertions to detect + * inadvertent use of guard objects as temporaries. In other words, + * when we have a guard object whose only purpose is its constructor and + * destructor (and is never otherwise referenced), the intended use + * might be: + * + * AutoRestore savePainting(mIsPainting); + * + * but is is easy to accidentally write: + * + * AutoRestore(mIsPainting); + * + * which compiles just fine, but runs the destructor well before the + * intended time. + * + * They work by adding (#ifdef DEBUG) an additional parameter to the + * guard object's constructor, with a default value, so that users of + * the guard object's API do not need to do anything. The default value + * of this parameter is a temporary object. C++ (ISO/IEC 14882:1998), + * section 12.2 [class.temporary], clauses 4 and 5 seem to assume a + * guarantee that temporaries are destroyed in the reverse of their + * construction order, but I actually can't find a statement that that + * is true in the general case (beyond the two specific cases mentioned + * there). However, it seems to be true. + * + * These classes are intended to be used only via the macros immediately + * below them: + * + * MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member + * variable, and should be put where a declaration of a private + * member variable would be placed. + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the + * parameters to each constructor of the guard object; it declares + * (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM + * variant for constructors that take no other parameters.) + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in + * the implementation of such constructors when they are not inline. + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in + * the implementation of such constructors to pass the parameter to + * a base class that also uses these macros + * MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each + * constructor. It uses the parameter declared by + * MOZ_GUARD_OBJECT_NOTIFIER_PARAM. + * + * For more details, and examples of using these macros, see + * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla + */ +class MOZ_EXPORT GuardObjectNotifier +{ + private: + bool* statementDone; + + public: + GuardObjectNotifier() : statementDone(NULL) { } + + ~GuardObjectNotifier() { + *statementDone = true; + } + + void setStatementDone(bool* statementIsDone) { + statementDone = statementIsDone; + } +}; + +class MOZ_EXPORT GuardObjectNotificationReceiver +{ + private: + bool statementDone; + + public: + GuardObjectNotificationReceiver() : statementDone(false) { } + + ~GuardObjectNotificationReceiver() { + /* + * Assert that the guard object was not used as a temporary. (Note that + * this assert might also fire if init is not called because the guard + * object's implementation is not using the above macros correctly.) + */ + MOZ_ASSERT(statementDone); + } + + void init(const GuardObjectNotifier& constNotifier) { + /* + * constNotifier is passed as a const reference so that we can pass a + * temporary, but we really intend it as non-const. + */ + GuardObjectNotifier& notifier = const_cast(constNotifier); + notifier.setStatementDone(&statementDone); + } +}; + +} /* namespace detail */ +} /* namespace mozilla */ + +#endif /* DEBUG */ + +#ifdef DEBUG +# define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \ + mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary; +# define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \ + , const mozilla::detail::GuardObjectNotifier& _notifier = \ + mozilla::detail::GuardObjectNotifier() +# define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \ + const mozilla::detail::GuardObjectNotifier& _notifier = \ + mozilla::detail::GuardObjectNotifier() +# define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \ + , const mozilla::detail::GuardObjectNotifier& _notifier +# define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \ + const mozilla::detail::GuardObjectNotifier& _notifier +# define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \ + , _notifier +# define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \ + _notifier +# define MOZ_GUARD_OBJECT_NOTIFIER_INIT \ + do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0) +#else +# define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +# define MOZ_GUARD_OBJECT_NOTIFIER_PARAM +# define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM +# define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL +# define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL +# define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT +# define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT +# define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0) +#endif + +#endif /* __cplusplus */ + +#endif /* mozilla_GuardObjects_h */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/HashFunctions.h b/scripting/javascript/spidermonkey-mac/include/mozilla/HashFunctions.h new file mode 100644 index 0000000000..96242b629a --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/HashFunctions.h @@ -0,0 +1,359 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Utilities for hashing. */ + +/* + * This file exports functions for hashing data down to a 32-bit value, + * including: + * + * - HashString Hash a char* or uint16_t/wchar_t* of known or unknown + * length. + * + * - HashBytes Hash a byte array of known length. + * + * - HashGeneric Hash one or more values. Currently, we support uint32_t, + * types which can be implicitly cast to uint32_t, data + * pointers, and function pointers. + * + * - AddToHash Add one or more values to the given hash. This supports the + * same list of types as HashGeneric. + * + * + * You can chain these functions together to hash complex objects. For example: + * + * class ComplexObject + * { + * char* str; + * uint32_t uint1, uint2; + * void (*callbackFn)(); + * + * public: + * uint32_t hash() { + * uint32_t hash = HashString(str); + * hash = AddToHash(hash, uint1, uint2); + * return AddToHash(hash, callbackFn); + * } + * }; + * + * If you want to hash an nsAString or nsACString, use the HashString functions + * in nsHashKey.h. + */ + +#ifndef mozilla_HashFunctions_h_ +#define mozilla_HashFunctions_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" +#include "mozilla/StandardInteger.h" +#include "mozilla/Types.h" + +#ifdef __cplusplus +namespace mozilla { + +/** + * The golden ratio as a 32-bit fixed-point value. + */ +static const uint32_t GoldenRatioU32 = 0x9E3779B9U; + +inline uint32_t +RotateBitsLeft32(uint32_t value, uint8_t bits) +{ + MOZ_ASSERT(bits < 32); + return (value << bits) | (value >> (32 - bits)); +} + +namespace detail { + +inline uint32_t +AddU32ToHash(uint32_t hash, uint32_t value) +{ + /* + * This is the meat of all our hash routines. This hash function is not + * particularly sophisticated, but it seems to work well for our mostly + * plain-text inputs. Implementation notes follow. + * + * Our use of the golden ratio here is arbitrary; we could pick almost any + * number which: + * + * * is odd (because otherwise, all our hash values will be even) + * + * * has a reasonably-even mix of 1's and 0's (consider the extreme case + * where we multiply by 0x3 or 0xeffffff -- this will not produce good + * mixing across all bits of the hash). + * + * The rotation length of 5 is also arbitrary, although an odd number is again + * preferable so our hash explores the whole universe of possible rotations. + * + * Finally, we multiply by the golden ratio *after* xor'ing, not before. + * Otherwise, if |hash| is 0 (as it often is for the beginning of a message), + * the expression + * + * (GoldenRatioU32 * RotateBitsLeft(hash, 5)) |xor| value + * + * evaluates to |value|. + * + * (Number-theoretic aside: Because any odd number |m| is relatively prime to + * our modulus (2^32), the list + * + * [x * m (mod 2^32) for 0 <= x < 2^32] + * + * has no duplicate elements. This means that multiplying by |m| does not + * cause us to skip any possible hash values. + * + * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the + * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely + * multiply our hash value by |m| a few times without negating the + * multiplicative effect. Our golden ratio constant has order 2^29, which is + * more than enough for our purposes.) + */ + return GoldenRatioU32 * (RotateBitsLeft32(hash, 5) ^ value); +} + +/** + * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter. + */ +template +inline uint32_t +AddUintptrToHash(uint32_t hash, uintptr_t value); + +template<> +inline uint32_t +AddUintptrToHash<4>(uint32_t hash, uintptr_t value) +{ + return AddU32ToHash(hash, static_cast(value)); +} + +template<> +inline uint32_t +AddUintptrToHash<8>(uint32_t hash, uintptr_t value) +{ + /* + * The static cast to uint64_t below is necessary because this function + * sometimes gets compiled on 32-bit platforms (yes, even though it's a + * template and we never call this particular override in a 32-bit build). If + * we do value >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t + * right 32 bits, and the compiler throws an error. + */ + uint32_t v1 = static_cast(value); + uint32_t v2 = static_cast(static_cast(value) >> 32); + return AddU32ToHash(AddU32ToHash(hash, v1), v2); +} + +} /* namespace detail */ + +/** + * AddToHash takes a hash and some values and returns a new hash based on the + * inputs. + * + * Currently, we support hashing uint32_t's, values which we can implicitly + * convert to uint32_t, data pointers, and function pointers. + */ +template +MOZ_WARN_UNUSED_RESULT +inline uint32_t +AddToHash(uint32_t hash, A a) +{ + /* + * Try to convert |A| to uint32_t implicitly. If this works, great. If not, + * we'll error out. + */ + return detail::AddU32ToHash(hash, a); +} + +template +MOZ_WARN_UNUSED_RESULT +inline uint32_t +AddToHash(uint32_t hash, A* a) +{ + /* + * You might think this function should just take a void*. But then we'd only + * catch data pointers and couldn't handle function pointers. + */ + + MOZ_STATIC_ASSERT(sizeof(a) == sizeof(uintptr_t), + "Strange pointer!"); + + return detail::AddUintptrToHash(hash, uintptr_t(a)); +} + +template<> +MOZ_WARN_UNUSED_RESULT +inline uint32_t +AddToHash(uint32_t hash, uintptr_t a) +{ + return detail::AddUintptrToHash(hash, a); +} + +template +MOZ_WARN_UNUSED_RESULT +uint32_t +AddToHash(uint32_t hash, A a, B b) +{ + return AddToHash(AddToHash(hash, a), b); +} + +template +MOZ_WARN_UNUSED_RESULT +uint32_t +AddToHash(uint32_t hash, A a, B b, C c) +{ + return AddToHash(AddToHash(hash, a, b), c); +} + +template +MOZ_WARN_UNUSED_RESULT +uint32_t +AddToHash(uint32_t hash, A a, B b, C c, D d) +{ + return AddToHash(AddToHash(hash, a, b, c), d); +} + +template +MOZ_WARN_UNUSED_RESULT +uint32_t +AddToHash(uint32_t hash, A a, B b, C c, D d, E e) +{ + return AddToHash(AddToHash(hash, a, b, c, d), e); +} + +/** + * The HashGeneric class of functions let you hash one or more values. + * + * If you want to hash together two values x and y, calling HashGeneric(x, y) is + * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes + * that x has already been hashed. + */ +template +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashGeneric(A a) +{ + return AddToHash(0, a); +} + +template +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashGeneric(A a, B b) +{ + return AddToHash(0, a, b); +} + +template +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashGeneric(A a, B b, C c) +{ + return AddToHash(0, a, b, c); +} + +template +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashGeneric(A a, B b, C c, D d) +{ + return AddToHash(0, a, b, c, d); +} + +template +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashGeneric(A a, B b, C c, D d, E e) +{ + return AddToHash(0, a, b, c, d, e); +} + +namespace detail { + +template +uint32_t +HashUntilZero(const T* str) +{ + uint32_t hash = 0; + for (T c; (c = *str); str++) + hash = AddToHash(hash, c); + return hash; +} + +template +uint32_t +HashKnownLength(const T* str, size_t length) +{ + uint32_t hash = 0; + for (size_t i = 0; i < length; i++) + hash = AddToHash(hash, str[i]); + return hash; +} + +} /* namespace detail */ + +/** + * The HashString overloads below do just what you'd expect. + * + * If you have the string's length, you might as well call the overload which + * includes the length. It may be marginally faster. + */ +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const char* str) +{ + return detail::HashUntilZero(str); +} + +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const char* str, size_t length) +{ + return detail::HashKnownLength(str, length); +} + +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const uint16_t* str) +{ + return detail::HashUntilZero(str); +} + +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const uint16_t* str, size_t length) +{ + return detail::HashKnownLength(str, length); +} + +/* + * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's + * the same width! + */ +#ifdef WIN32 +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const wchar_t* str) +{ + return detail::HashUntilZero(str); +} + +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const wchar_t* str, size_t length) +{ + return detail::HashKnownLength(str, length); +} +#endif + +/** + * Hash some number of bytes. + * + * This hash walks word-by-word, rather than byte-by-byte, so you won't get the + * same result out of HashBytes as you would out of HashString. + */ +MOZ_WARN_UNUSED_RESULT +extern MFBT_API uint32_t +HashBytes(const void* bytes, size_t length); + +} /* namespace mozilla */ +#endif /* __cplusplus */ +#endif /* mozilla_HashFunctions_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Likely.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Likely.h new file mode 100644 index 0000000000..6412b4943b --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Likely.h @@ -0,0 +1,22 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a + * boolean predicate should be branch-predicted. + */ + +#ifndef mozilla_Likely_h_ +#define mozilla_Likely_h_ + +#if defined(__clang__) || defined(__GNUC__) +# define MOZ_LIKELY(x) (__builtin_expect(!!(x), 1)) +# define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0)) +#else +# define MOZ_LIKELY(x) (!!(x)) +# define MOZ_UNLIKELY(x) (!!(x)) +#endif + +#endif /* mozilla_Likely_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/LinkedList.h b/scripting/javascript/spidermonkey-mac/include/mozilla/LinkedList.h new file mode 100644 index 0000000000..5cfd60e4ac --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/LinkedList.h @@ -0,0 +1,429 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* A type-safe doubly-linked list class. */ + +/* + * The classes LinkedList and LinkedListElement together form a + * convenient, type-safe doubly-linked list implementation. + * + * The class T which will be inserted into the linked list must inherit from + * LinkedListElement. A given object may be in only one linked list at a + * time. + * + * A LinkedListElement automatically removes itself from the list upon + * destruction, and a LinkedList will fatally assert in debug builds if it's + * non-empty when it's destructed. + * + * For example, you might use LinkedList in a simple observer list class as + * follows. + * + * class Observer : public LinkedListElement + * { + * public: + * void observe(char* topic) { ... } + * }; + * + * class ObserverContainer + * { + * private: + * LinkedList list; + * + * public: + * void addObserver(Observer* observer) { + * // Will assert if |observer| is part of another list. + * list.insertBack(observer); + * } + * + * void removeObserver(Observer* observer) { + * // Will assert if |observer| is not part of some list. + * observer.remove(); + * // Or, will assert if |observer| is not part of |list| specifically. + * // observer.removeFrom(list); + * } + * + * void notifyObservers(char* topic) { + * for (Observer* o = list.getFirst(); o != NULL; o = o->getNext()) + * o->Observe(topic); + * } + * }; + * + */ + +#ifndef mozilla_LinkedList_h_ +#define mozilla_LinkedList_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" + +#ifdef __cplusplus + +namespace mozilla { + +template +class LinkedList; + +template +class LinkedListElement +{ + /* + * It's convenient that we return NULL when getNext() or getPrevious() hits + * the end of the list, but doing so costs an extra word of storage in each + * linked list node (to keep track of whether |this| is the sentinel node) + * and a branch on this value in getNext/getPrevious. + * + * We could get rid of the extra word of storage by shoving the "is + * sentinel" bit into one of the pointers, although this would, of course, + * have performance implications of its own. + * + * But the goal here isn't to win an award for the fastest or slimmest + * linked list; rather, we want a *convenient* linked list. So we won't + * waste time guessing which micro-optimization strategy is best. + * + * + * Speaking of unnecessary work, it's worth addressing here why we wrote + * mozilla::LinkedList in the first place, instead of using stl::list. + * + * The key difference between mozilla::LinkedList and stl::list is that + * mozilla::LinkedList stores the prev/next pointers in the object itself, + * while stl::list stores the prev/next pointers in a list element which + * itself points to the object being stored. + * + * mozilla::LinkedList's approach makes it harder to store an object in more + * than one list. But the upside is that you can call next() / prev() / + * remove() directly on the object. With stl::list, you'd need to store a + * pointer to its iterator in the object in order to accomplish this. Not + * only would this waste space, but you'd have to remember to update that + * pointer every time you added or removed the object from a list. + * + * In-place, constant-time removal is a killer feature of doubly-linked + * lists, and supporting this painlessly was a key design criterion. + */ + + private: + LinkedListElement* next; + LinkedListElement* prev; + const bool isSentinel; + + LinkedListElement* thisDuringConstruction() { return this; } + + public: + LinkedListElement() + : next(thisDuringConstruction()), + prev(thisDuringConstruction()), + isSentinel(false) + { } + + ~LinkedListElement() { + if (!isSentinel && isInList()) + remove(); + } + + /* + * Get the next element in the list, or NULL if this is the last element in + * the list. + */ + T* getNext() { + return next->asT(); + } + const T* getNext() const { + return next->asT(); + } + + /* + * Get the previous element in the list, or NULL if this is the first element + * in the list. + */ + T* getPrevious() { + return prev->asT(); + } + const T* getPrevious() const { + return prev->asT(); + } + + /* + * Insert elem after this element in the list. |this| must be part of a + * linked list when you call setNext(); otherwise, this method will assert. + */ + void setNext(T* elem) { + MOZ_ASSERT(isInList()); + setNextUnsafe(elem); + } + + /* + * Insert elem before this element in the list. |this| must be part of a + * linked list when you call setPrevious(); otherwise, this method will + * assert. + */ + void setPrevious(T* elem) { + MOZ_ASSERT(isInList()); + setPreviousUnsafe(elem); + } + + /* + * Remove this element from the list which contains it. If this element is + * not currently part of a linked list, this method asserts. + */ + void remove() { + MOZ_ASSERT(isInList()); + + prev->next = next; + next->prev = prev; + next = this; + prev = this; + } + + /* + * Identical to remove(), but also asserts in debug builds that this element + * is in list. + */ + void removeFrom(const LinkedList& list) { + list.assertContains(asT()); + remove(); + } + + /* + * Return true if |this| part is of a linked list, and false otherwise. + */ + bool isInList() const { + MOZ_ASSERT((next == this) == (prev == this)); + return next != this; + } + + private: + friend class LinkedList; + + enum NodeKind { + NODE_KIND_NORMAL, + NODE_KIND_SENTINEL + }; + + LinkedListElement(NodeKind nodeKind) + : next(thisDuringConstruction()), + prev(thisDuringConstruction()), + isSentinel(nodeKind == NODE_KIND_SENTINEL) + { } + + /* + * Return |this| cast to T* if we're a normal node, or return NULL if we're + * a sentinel node. + */ + T* asT() { + if (isSentinel) + return NULL; + + return static_cast(this); + } + const T* asT() const { + if (isSentinel) + return NULL; + + return static_cast(this); + } + + /* + * Insert elem after this element, but don't check that this element is in + * the list. This is called by LinkedList::insertFront(). + */ + void setNextUnsafe(T* elem) { + LinkedListElement *listElem = static_cast(elem); + MOZ_ASSERT(!listElem->isInList()); + + listElem->next = this->next; + listElem->prev = this; + this->next->prev = listElem; + this->next = listElem; + } + + /* + * Insert elem before this element, but don't check that this element is in + * the list. This is called by LinkedList::insertBack(). + */ + void setPreviousUnsafe(T* elem) { + LinkedListElement* listElem = static_cast*>(elem); + MOZ_ASSERT(!listElem->isInList()); + + listElem->next = this; + listElem->prev = this->prev; + this->prev->next = listElem; + this->prev = listElem; + } + + private: + LinkedListElement& operator=(const LinkedList& other) MOZ_DELETE; + LinkedListElement(const LinkedList& other) MOZ_DELETE; +}; + +template +class LinkedList +{ + private: + LinkedListElement sentinel; + + public: + LinkedList() : sentinel(LinkedListElement::NODE_KIND_SENTINEL) { } + + ~LinkedList() { + MOZ_ASSERT(isEmpty()); + } + + /* + * Add elem to the front of the list. + */ + void insertFront(T* elem) { + /* Bypass setNext()'s this->isInList() assertion. */ + sentinel.setNextUnsafe(elem); + } + + /* + * Add elem to the back of the list. + */ + void insertBack(T* elem) { + sentinel.setPreviousUnsafe(elem); + } + + /* + * Get the first element of the list, or NULL if the list is empty. + */ + T* getFirst() { + return sentinel.getNext(); + } + const T* getFirst() const { + return sentinel.getNext(); + } + + /* + * Get the last element of the list, or NULL if the list is empty. + */ + T* getLast() { + return sentinel.getPrevious(); + } + const T* getLast() const { + return sentinel.getPrevious(); + } + + /* + * Get and remove the first element of the list. If the list is empty, + * return NULL. + */ + T* popFirst() { + T* ret = sentinel.getNext(); + if (ret) + static_cast*>(ret)->remove(); + return ret; + } + + /* + * Get and remove the last element of the list. If the list is empty, + * return NULL. + */ + T* popLast() { + T* ret = sentinel.getPrevious(); + if (ret) + static_cast*>(ret)->remove(); + return ret; + } + + /* + * Return true if the list is empty, or false otherwise. + */ + bool isEmpty() const { + return !sentinel.isInList(); + } + + /* + * Remove all the elements from the list. + * + * This runs in time linear to the list's length, because we have to mark + * each element as not in the list. + */ + void clear() { + while (popFirst()) + continue; + } + + /* + * In a debug build, make sure that the list is sane (no cycles, consistent + * next/prev pointers, only one sentinel). Has no effect in release builds. + */ + void debugAssertIsSane() const { +#ifdef DEBUG + const LinkedListElement* slow; + const LinkedListElement* fast1; + const LinkedListElement* fast2; + + /* + * Check for cycles in the forward singly-linked list using the + * tortoise/hare algorithm. + */ + for (slow = sentinel.next, + fast1 = sentinel.next->next, + fast2 = sentinel.next->next->next; + slow != sentinel && fast1 != sentinel && fast2 != sentinel; + slow = slow->next, fast1 = fast2->next, fast2 = fast1->next) + { + MOZ_ASSERT(slow != fast1); + MOZ_ASSERT(slow != fast2); + } + + /* Check for cycles in the backward singly-linked list. */ + for (slow = sentinel.prev, + fast1 = sentinel.prev->prev, + fast2 = sentinel.prev->prev->prev; + slow != sentinel && fast1 != sentinel && fast2 != sentinel; + slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev) + { + MOZ_ASSERT(slow != fast1); + MOZ_ASSERT(slow != fast2); + } + + /* + * Check that |sentinel| is the only node in the list with + * isSentinel == true. + */ + for (const LinkedListElement* elem = sentinel.next; + elem != sentinel; + elem = elem->next) + { + MOZ_ASSERT(!elem->isSentinel); + } + + /* Check that the next/prev pointers match up. */ + const LinkedListElement* prev = sentinel; + const LinkedListElement* cur = sentinel.next; + do { + MOZ_ASSERT(cur->prev == prev); + MOZ_ASSERT(prev->next == cur); + + prev = cur; + cur = cur->next; + } while (cur != sentinel); +#endif /* ifdef DEBUG */ + } + + private: + friend class LinkedListElement; + + void assertContains(const T* t) const { +#ifdef DEBUG + for (const T* elem = getFirst(); + elem; + elem = elem->getNext()) + { + if (elem == t) + return; + } + MOZ_NOT_REACHED("element wasn't found in this list!"); +#endif + } + + LinkedList& operator=(const LinkedList& other) MOZ_DELETE; + LinkedList(const LinkedList& other) MOZ_DELETE; +}; + +} /* namespace mozilla */ + +#endif /* ifdef __cplusplus */ +#endif /* ifdef mozilla_LinkedList_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/MSStdInt.h b/scripting/javascript/spidermonkey-mac/include/mozilla/MSStdInt.h new file mode 100644 index 0000000000..0447f2f11b --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/MSStdInt.h @@ -0,0 +1,247 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2008 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we should wrap include with 'extern "C++" {}' +// or compiler give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#ifdef __cplusplus +extern "C" { +#endif +# include +#ifdef __cplusplus +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +#define INTMAX_C INT64_C +#define UINTMAX_C UINT64_C + +#endif // __STDC_CONSTANT_MACROS ] + + +#endif // _MSC_STDINT_H_ ] diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h b/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h new file mode 100644 index 0000000000..b545fa544b --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* mfbt maths algorithms. */ + +#ifndef mozilla_MathAlgorithms_h_ +#define mozilla_MathAlgorithms_h_ + +#include "mozilla/Assertions.h" + +namespace mozilla { + +// Greatest Common Divisor +template +MOZ_ALWAYS_INLINE IntegerType +EuclidGCD(IntegerType a, IntegerType b) +{ + // Euclid's algorithm; O(N) in the worst case. (There are better + // ways, but we don't need them for the current use of this algo.) + MOZ_ASSERT(a > 0); + MOZ_ASSERT(b > 0); + + while (a != b) { + if (a > b) { + a = a - b; + } else { + b = b - a; + } + } + + return a; +} + +// Least Common Multiple +template +MOZ_ALWAYS_INLINE IntegerType +EuclidLCM(IntegerType a, IntegerType b) +{ + // Divide first to reduce overflow risk. + return (a / EuclidGCD(a, b)) * b; +} + +} /* namespace mozilla */ + +#endif /* mozilla_MathAlgorithms_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/MemoryChecking.h b/scripting/javascript/spidermonkey-mac/include/mozilla/MemoryChecking.h new file mode 100644 index 0000000000..3287e57ba1 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/MemoryChecking.h @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Provides a common interface to the ASan (AddressSanitizer) and Valgrind + * functions used to mark memory in certain ways. In detail, the following + * three macros are provided: + * + * MOZ_MAKE_MEM_NOACCESS - Mark memory as unsafe to access (e.g. freed) + * MOZ_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined + * MOZ_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined + * + * With Valgrind in use, these directly map to the three respective Valgrind + * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory, + * while the UNDEFINED/DEFINED macros unpoison memory. + * + * With no memory checker available, all macros expand to the empty statement. + */ + +#ifndef mozilla_MemoryChecking_h_ +#define mozilla_MemoryChecking_h_ + +#if defined(MOZ_VALGRIND) +#include "valgrind/memcheck.h" +#endif + +#if defined(MOZ_ASAN) || defined(MOZ_VALGRIND) +#define MOZ_HAVE_MEM_CHECKS 1 +#endif + +#if defined(MOZ_ASAN) +#include + +extern "C" { + /* These definitions are usually provided through the + * sanitizer/asan_interface.h header installed by ASan. + */ + void __asan_poison_memory_region(void const volatile *addr, size_t size) + __attribute__((visibility("default"))); + void __asan_unpoison_memory_region(void const volatile *addr, size_t size) + __attribute__((visibility("default"))); + +#define MOZ_MAKE_MEM_NOACCESS(addr, size) \ + __asan_poison_memory_region((addr), (size)) + +#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \ + __asan_unpoison_memory_region((addr), (size)) + +#define MOZ_MAKE_MEM_DEFINED(addr, size) \ + __asan_unpoison_memory_region((addr), (size)) +} +#elif defined(MOZ_VALGRIND) +#define MOZ_MAKE_MEM_NOACCESS(addr, size) \ + VALGRIND_MAKE_MEM_NOACCESS((addr), (size)) + +#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \ + VALGRIND_MAKE_MEM_UNDEFINED((addr), (size)) + +#define MOZ_MAKE_MEM_DEFINED(addr, size) \ + VALGRIND_MAKE_MEM_DEFINED((addr), (size)) +#else + +#define MOZ_MAKE_MEM_NOACCESS(addr, size) do {} while(0) +#define MOZ_MAKE_MEM_UNDEFINED(addr, size) do {} while(0) +#define MOZ_MAKE_MEM_DEFINED(addr, size) do {} while(0) + +#endif + +#endif /* mozilla_MemoryChecking_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/NullPtr.h b/scripting/javascript/spidermonkey-mac/include/mozilla/NullPtr.h new file mode 100644 index 0000000000..7dcb03d734 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/NullPtr.h @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Implements a workaround for compilers which do not support the C++11 nullptr + * constant. + */ + +#ifndef mozilla_NullPtr_h_ +#define mozilla_NullPtr_h_ + +#include "mozilla/Compiler.h" + +#if defined(__clang__) +# ifndef __has_extension +# define __has_extension __has_feature +# endif +# if __has_extension(cxx_nullptr) +# define MOZ_HAVE_CXX11_NULLPTR +# endif +#elif defined(__GNUC__) +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) +# define MOZ_HAVE_CXX11_NULLPTR +# endif +# endif +#elif _MSC_VER >= 1600 +# define MOZ_HAVE_CXX11_NULLPTR +#endif + +/** + * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal + * with the correct size to match the size of a pointer on a given platform. + */ + +#ifndef MOZ_HAVE_CXX11_NULLPTR +# if defined(__GNUC__) +# define nullptr __null +# elif defined(_WIN64) +# define nullptr 0LL +# else +# define nullptr 0L +# endif +#endif + +#endif /* mozilla_NullPtr_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Range.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Range.h new file mode 100644 index 0000000000..e14594d09d --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Range.h @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=78: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_Range_h_ +#define mozilla_Range_h_ + +#include "mozilla/NullPtr.h" +#include "mozilla/RangedPtr.h" + +#include + +namespace mozilla { + +// Range is a tuple containing a pointer and a length. +template +class Range +{ + RangedPtr mStart; + RangedPtr mEnd; + + typedef void (Range::* ConvertibleToBool)(); + void nonNull() {} + + public: + Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {} + Range(T* p, size_t len) + : mStart(p, p, p + len), + mEnd(p + len, p, p + len) + {} + + RangedPtr start() const { return mStart; } + RangedPtr end() const { return mEnd; } + size_t length() const { return mEnd - mStart; } + + T& operator[](size_t offset) { + return mStart[offset]; + } + + operator ConvertibleToBool() const { return mStart ? &Range::nonNull : 0; } +}; + +} // namespace mozilla + +#endif // mozilla_Range_h_ + diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/RangedPtr.h b/scripting/javascript/spidermonkey-mac/include/mozilla/RangedPtr.h new file mode 100644 index 0000000000..7ce19d071f --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/RangedPtr.h @@ -0,0 +1,254 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Implements a smart pointer asserted to remain within a range specified at + * construction. + */ + +#ifndef mozilla_RangedPtr_h_ +#define mozilla_RangedPtr_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" +#include "mozilla/Util.h" + +namespace mozilla { + +/* + * RangedPtr is a smart pointer restricted to an address range specified at + * creation. The pointer (and any smart pointers derived from it) must remain + * within the range [start, end] (inclusive of end to facilitate use as + * sentinels). Dereferencing or indexing into the pointer (or pointers derived + * from it) must remain within the range [start, end). All the standard pointer + * operators are defined on it; in debug builds these operations assert that the + * range specified at construction is respected. + * + * In theory passing a smart pointer instance as an argument can be slightly + * slower than passing a T* (due to ABI requirements for passing structs versus + * passing pointers), if the method being called isn't inlined. If you are in + * extremely performance-critical code, you may want to be careful using this + * smart pointer as an argument type. + * + * RangedPtr intentionally does not implicitly convert to T*. Use get() to + * explicitly convert to T*. Keep in mind that the raw pointer of course won't + * implement bounds checking in debug builds. + */ +template +class RangedPtr +{ + T* ptr; + +#ifdef DEBUG + T* const rangeStart; + T* const rangeEnd; +#endif + + typedef void (RangedPtr::* ConvertibleToBool)(); + void nonNull() {} + + void checkSanity() { + MOZ_ASSERT(rangeStart <= ptr); + MOZ_ASSERT(ptr <= rangeEnd); + } + + /* Creates a new pointer for |p|, restricted to this pointer's range. */ + RangedPtr create(T *p) const { +#ifdef DEBUG + return RangedPtr(p, rangeStart, rangeEnd); +#else + return RangedPtr(p, NULL, size_t(0)); +#endif + } + + uintptr_t asUintptr() const { return uintptr_t(ptr); } + + public: + RangedPtr(T* p, T* start, T* end) + : ptr(p) +#ifdef DEBUG + , rangeStart(start), rangeEnd(end) +#endif + { + MOZ_ASSERT(rangeStart <= rangeEnd); + checkSanity(); + } + RangedPtr(T* p, T* start, size_t length) + : ptr(p) +#ifdef DEBUG + , rangeStart(start), rangeEnd(start + length) +#endif + { + MOZ_ASSERT(length <= size_t(-1) / sizeof(T)); + MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart)); + checkSanity(); + } + + /* Equivalent to RangedPtr(p, p, length). */ + RangedPtr(T* p, size_t length) + : ptr(p) +#ifdef DEBUG + , rangeStart(p), rangeEnd(p + length) +#endif + { + MOZ_ASSERT(length <= size_t(-1) / sizeof(T)); + MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart)); + checkSanity(); + } + + /* Equivalent to RangedPtr(arr, arr, N). */ + template + RangedPtr(T (&arr)[N]) + : ptr(arr) +#ifdef DEBUG + , rangeStart(arr), rangeEnd(arr + N) +#endif + { + checkSanity(); + } + + T* get() const { + return ptr; + } + + operator ConvertibleToBool() const { return ptr ? &RangedPtr::nonNull : 0; } + + /* + * You can only assign one RangedPtr into another if the two pointers have + * the same valid range: + * + * char arr1[] = "hi"; + * char arr2[] = "bye"; + * RangedPtr p1(arr1, 2); + * p1 = RangedPtr(arr1 + 1, arr1, arr1 + 2); // works + * p1 = RangedPtr(arr2, 3); // asserts + */ + RangedPtr& operator=(const RangedPtr& other) { + MOZ_ASSERT(rangeStart == other.rangeStart); + MOZ_ASSERT(rangeEnd == other.rangeEnd); + ptr = other.ptr; + checkSanity(); + return *this; + } + + RangedPtr operator+(size_t inc) { + MOZ_ASSERT(inc <= size_t(-1) / sizeof(T)); + MOZ_ASSERT(asUintptr() + inc * sizeof(T) >= asUintptr()); + return create(ptr + inc); + } + + RangedPtr operator-(size_t dec) { + MOZ_ASSERT(dec <= size_t(-1) / sizeof(T)); + MOZ_ASSERT(asUintptr() - dec * sizeof(T) <= asUintptr()); + return create(ptr - dec); + } + + /* + * You can assign a raw pointer into a RangedPtr if the raw pointer is + * within the range specified at creation. + */ + template + RangedPtr& operator=(U* p) { + *this = create(p); + return *this; + } + + template + RangedPtr& operator=(const RangedPtr& p) { + MOZ_ASSERT(rangeStart <= p.ptr); + MOZ_ASSERT(p.ptr <= rangeEnd); + ptr = p.ptr; + checkSanity(); + return *this; + } + + RangedPtr& operator++() { + return (*this += 1); + } + + RangedPtr operator++(int) { + RangedPtr rcp = *this; + ++*this; + return rcp; + } + + RangedPtr& operator--() { + return (*this -= 1); + } + + RangedPtr operator--(int) { + RangedPtr rcp = *this; + --*this; + return rcp; + } + + RangedPtr& operator+=(size_t inc) { + *this = *this + inc; + return *this; + } + + RangedPtr& operator-=(size_t dec) { + *this = *this - dec; + return *this; + } + + T& operator[](int index) const { + MOZ_ASSERT(size_t(index > 0 ? index : -index) <= size_t(-1) / sizeof(T)); + return *create(ptr + index); + } + + T& operator*() const { + return *ptr; + } + + template + bool operator==(const RangedPtr& other) const { + return ptr == other.ptr; + } + template + bool operator!=(const RangedPtr& other) const { + return !(*this == other); + } + + template + bool operator==(const U* u) const { + return ptr == u; + } + template + bool operator!=(const U* u) const { + return !(*this == u); + } + + template + bool operator<(const RangedPtr& other) const { + return ptr < other.ptr; + } + template + bool operator<=(const RangedPtr& other) const { + return ptr <= other.ptr; + } + + template + bool operator>(const RangedPtr& other) const { + return ptr > other.ptr; + } + template + bool operator>=(const RangedPtr& other) const { + return ptr >= other.ptr; + } + + size_t operator-(const RangedPtr& other) const { + MOZ_ASSERT(ptr >= other.ptr); + return PointerRangeSize(other.ptr, ptr); + } + + private: + RangedPtr() MOZ_DELETE; + T* operator&() MOZ_DELETE; +}; + +} /* namespace mozilla */ + +#endif /* mozilla_RangedPtr_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/RefPtr.h b/scripting/javascript/spidermonkey-mac/include/mozilla/RefPtr.h new file mode 100644 index 0000000000..a298706e71 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/RefPtr.h @@ -0,0 +1,413 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Helpers for defining and using refcounted objects. */ + +#ifndef mozilla_RefPtr_h_ +#define mozilla_RefPtr_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" + +namespace mozilla { + +template class RefCounted; +template class RefPtr; +template class TemporaryRef; +template class OutParamRef; +template OutParamRef byRef(RefPtr&); + +/** + * RefCounted is a sort of a "mixin" for a class T. RefCounted + * manages, well, refcounting for T, and because RefCounted is + * parameterized on T, RefCounted can call T's destructor directly. + * This means T doesn't need to have a virtual dtor and so doesn't + * need a vtable. + * + * RefCounted is created with refcount == 0. Newly-allocated + * RefCounted must immediately be assigned to a RefPtr to make the + * refcount > 0. It's an error to allocate and free a bare + * RefCounted, i.e. outside of the RefPtr machinery. Attempts to + * do so will abort DEBUG builds. + * + * Live RefCounted have refcount > 0. The lifetime (refcounts) of + * live RefCounted are controlled by RefPtr and + * RefPtr. Upon a transition from refcounted==1 + * to 0, the RefCounted "dies" and is destroyed. The "destroyed" + * state is represented in DEBUG builds by refcount==0xffffdead. This + * state distinguishes use-before-ref (refcount==0) from + * use-after-destroy (refcount==0xffffdead). + */ +#ifdef DEBUG +namespace detail { +static const int DEAD = 0xffffdead; +} +#endif + +template +class RefCounted +{ + friend class RefPtr; + + protected: + RefCounted() : refCnt(0) { } + ~RefCounted() { MOZ_ASSERT(refCnt == detail::DEAD); } + + public: + // Compatibility with nsRefPtr. + void AddRef() { + MOZ_ASSERT(refCnt >= 0); + ++refCnt; + } + + void Release() { + MOZ_ASSERT(refCnt > 0); + if (0 == --refCnt) { +#ifdef DEBUG + refCnt = detail::DEAD; +#endif + delete static_cast(this); + } + } + + // Compatibility with wtf::RefPtr. + void ref() { AddRef(); } + void deref() { Release(); } + int refCount() const { return refCnt; } + bool hasOneRef() const { + MOZ_ASSERT(refCnt > 0); + return refCnt == 1; + } + + private: + int refCnt; +}; + +/** + * RefPtr points to a refcounted thing that has AddRef and Release + * methods to increase/decrease the refcount, respectively. After a + * RefPtr is assigned a T*, the T* can be used through the RefPtr + * as if it were a T*. + * + * A RefPtr can forget its underlying T*, which results in the T* + * being wrapped in a temporary object until the T* is either + * re-adopted from or released by the temporary. + */ +template +class RefPtr +{ + // To allow them to use unref() + friend class TemporaryRef; + friend class OutParamRef; + + struct DontRef {}; + + public: + RefPtr() : ptr(0) { } + RefPtr(const RefPtr& o) : ptr(ref(o.ptr)) {} + RefPtr(const TemporaryRef& o) : ptr(o.drop()) {} + RefPtr(T* t) : ptr(ref(t)) {} + + template + RefPtr(const RefPtr& o) : ptr(ref(o.get())) {} + + ~RefPtr() { unref(ptr); } + + RefPtr& operator=(const RefPtr& o) { + assign(ref(o.ptr)); + return *this; + } + RefPtr& operator=(const TemporaryRef& o) { + assign(o.drop()); + return *this; + } + RefPtr& operator=(T* t) { + assign(ref(t)); + return *this; + } + + template + RefPtr& operator=(const RefPtr& o) { + assign(ref(o.get())); + return *this; + } + + TemporaryRef forget() { + T* tmp = ptr; + ptr = 0; + return TemporaryRef(tmp, DontRef()); + } + + T* get() const { return ptr; } + operator T*() const { return ptr; } + T* operator->() const { return ptr; } + T& operator*() const { return *ptr; } + template + operator TemporaryRef() { return TemporaryRef(ptr); } + + private: + void assign(T* t) { + unref(ptr); + ptr = t; + } + + T* ptr; + + static MOZ_ALWAYS_INLINE T* ref(T* t) { + if (t) + t->AddRef(); + return t; + } + + static MOZ_ALWAYS_INLINE void unref(T* t) { + if (t) + t->Release(); + } +}; + +/** + * TemporaryRef represents an object that holds a temporary + * reference to a T. TemporaryRef objects can't be manually ref'd or + * unref'd (being temporaries, not lvalues), so can only relinquish + * references to other objects, or unref on destruction. + */ +template +class TemporaryRef +{ + // To allow it to construct TemporaryRef from a bare T* + friend class RefPtr; + + typedef typename RefPtr::DontRef DontRef; + + public: + TemporaryRef(T* t) : ptr(RefPtr::ref(t)) {} + TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {} + + template + TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {} + + ~TemporaryRef() { RefPtr::unref(ptr); } + + T* drop() const { + T* tmp = ptr; + ptr = 0; + return tmp; + } + + private: + TemporaryRef(T* t, const DontRef&) : ptr(t) {} + + mutable T* ptr; + + TemporaryRef() MOZ_DELETE; + void operator=(const TemporaryRef&) MOZ_DELETE; +}; + +/** + * OutParamRef is a wrapper that tracks a refcounted pointer passed as + * an outparam argument to a function. OutParamRef implements COM T** + * outparam semantics: this requires the callee to AddRef() the T* + * returned through the T** outparam on behalf of the caller. This + * means the caller (through OutParamRef) must Release() the old + * object contained in the tracked RefPtr. It's OK if the callee + * returns the same T* passed to it through the T** outparam, as long + * as the callee obeys the COM discipline. + * + * Prefer returning TemporaryRef from functions over creating T** + * outparams and passing OutParamRef to T**. Prefer RefPtr* + * outparams over T** outparams. + */ +template +class OutParamRef +{ + friend OutParamRef byRef(RefPtr&); + + public: + ~OutParamRef() { + RefPtr::unref(refPtr.ptr); + refPtr.ptr = tmp; + } + + operator T**() { return &tmp; } + + private: + OutParamRef(RefPtr& p) : refPtr(p), tmp(p.get()) {} + + RefPtr& refPtr; + T* tmp; + + OutParamRef() MOZ_DELETE; + OutParamRef& operator=(const OutParamRef&) MOZ_DELETE; +}; + +/** + * byRef cooperates with OutParamRef to implement COM outparam semantics. + */ +template +OutParamRef +byRef(RefPtr& ptr) +{ + return OutParamRef(ptr); +} + +} // namespace mozilla + +#endif // mozilla_RefPtr_h_ + + +#if 0 + +// Command line that builds these tests +// +// cp RefPtr.h test.cc && g++ -g -Wall -pedantic -DDEBUG -o test test.cc && ./test + +using namespace mozilla; + +struct Foo : public RefCounted +{ + Foo() : dead(false) { } + ~Foo() { + MOZ_ASSERT(!dead); + dead = true; + numDestroyed++; + } + + bool dead; + static int numDestroyed; +}; +int Foo::numDestroyed; + +struct Bar : public Foo { }; + +TemporaryRef +NewFoo() +{ + return RefPtr(new Foo()); +} + +TemporaryRef +NewBar() +{ + return new Bar(); +} + +void +GetNewFoo(Foo** f) +{ + *f = new Bar(); + // Kids, don't try this at home + (*f)->AddRef(); +} + +void +GetPassedFoo(Foo** f) +{ + // Kids, don't try this at home + (*f)->AddRef(); +} + +void +GetNewFoo(RefPtr* f) +{ + *f = new Bar(); +} + +void +GetPassedFoo(RefPtr* f) +{} + +TemporaryRef +GetNullFoo() +{ + return 0; +} + +int +main(int argc, char** argv) +{ + // This should blow up +// Foo* f = new Foo(); delete f; + + MOZ_ASSERT(0 == Foo::numDestroyed); + { + RefPtr f = new Foo(); + MOZ_ASSERT(f->refCount() == 1); + } + MOZ_ASSERT(1 == Foo::numDestroyed); + + { + RefPtr f1 = NewFoo(); + RefPtr f2(NewFoo()); + MOZ_ASSERT(1 == Foo::numDestroyed); + } + MOZ_ASSERT(3 == Foo::numDestroyed); + + { + RefPtr b = NewBar(); + MOZ_ASSERT(3 == Foo::numDestroyed); + } + MOZ_ASSERT(4 == Foo::numDestroyed); + + { + RefPtr f1; + { + f1 = new Foo(); + RefPtr f2(f1); + RefPtr f3 = f2; + MOZ_ASSERT(4 == Foo::numDestroyed); + } + MOZ_ASSERT(4 == Foo::numDestroyed); + } + MOZ_ASSERT(5 == Foo::numDestroyed); + + { + RefPtr f = new Foo(); + f.forget(); + MOZ_ASSERT(6 == Foo::numDestroyed); + } + + { + RefPtr f = new Foo(); + GetNewFoo(byRef(f)); + MOZ_ASSERT(7 == Foo::numDestroyed); + } + MOZ_ASSERT(8 == Foo::numDestroyed); + + { + RefPtr f = new Foo(); + GetPassedFoo(byRef(f)); + MOZ_ASSERT(8 == Foo::numDestroyed); + } + MOZ_ASSERT(9 == Foo::numDestroyed); + + { + RefPtr f = new Foo(); + GetNewFoo(&f); + MOZ_ASSERT(10 == Foo::numDestroyed); + } + MOZ_ASSERT(11 == Foo::numDestroyed); + + { + RefPtr f = new Foo(); + GetPassedFoo(&f); + MOZ_ASSERT(11 == Foo::numDestroyed); + } + MOZ_ASSERT(12 == Foo::numDestroyed); + + { + RefPtr f1 = new Bar(); + } + MOZ_ASSERT(13 == Foo::numDestroyed); + + { + RefPtr f = GetNullFoo(); + MOZ_ASSERT(13 == Foo::numDestroyed); + } + MOZ_ASSERT(13 == Foo::numDestroyed); + + return 0; +} + +#endif diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/SHA1.h b/scripting/javascript/spidermonkey-mac/include/mozilla/SHA1.h new file mode 100644 index 0000000000..a6604e699f --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/SHA1.h @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Simple class for computing SHA1. */ + +#ifndef mozilla_SHA1_h_ +#define mozilla_SHA1_h_ + +#include "mozilla/StandardInteger.h" +#include "mozilla/Types.h" + +#include + +namespace mozilla { + +/** + * This class computes the SHA1 hash of a byte sequence, or of the concatenation + * of multiple sequences. For example, computing the SHA1 of two sequences of + * bytes could be done as follows: + * + * void SHA1(const uint8_t* buf1, uint32_t size1, + * const uint8_t* buf2, uint32_t size2, + * SHA1Sum::Hash& hash) + * { + * SHA1Sum s; + * s.update(buf1, size1); + * s.update(buf2, size2); + * s.finish(hash); + * } + * + * The finish method may only be called once and cannot be followed by calls + * to update. + */ +class SHA1Sum +{ + union { + uint32_t w[16]; /* input buffer */ + uint8_t b[64]; + } u; + uint64_t size; /* count of hashed bytes. */ + unsigned H[22]; /* 5 state variables, 16 tmp values, 1 extra */ + bool mDone; + + public: + MFBT_API SHA1Sum(); + + static const size_t HashSize = 20; + typedef uint8_t Hash[HashSize]; + + /* Add len bytes of dataIn to the data sequence being hashed. */ + MFBT_API void update(const void* dataIn, uint32_t len); + + /* Compute the final hash of all data into hashOut. */ + MFBT_API void finish(SHA1Sum::Hash& hashOut); +}; + +} /* namespace mozilla */ + +#endif /* mozilla_SHA1_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Scoped.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Scoped.h new file mode 100644 index 0000000000..677a1a3797 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Scoped.h @@ -0,0 +1,271 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* A number of structures to simplify scope-based RAII management. */ + +#ifndef mozilla_Scoped_h_ +#define mozilla_Scoped_h_ + +/* + * Resource Acquisition Is Initialization is a programming idiom used + * to write robust code that is able to deallocate resources properly, + * even in presence of execution errors or exceptions that need to be + * propagated. The Scoped* classes defined in this header perform the + * deallocation of the resource they hold once program execution + * reaches the end of the scope for which they have been defined. + * + * This header provides the following RAII classes: + * + * - |ScopedFreePtr| - a container for a pointer, that automatically calls + * |free()| at the end of the scope; + * - |ScopedDeletePtr| - a container for a pointer, that automatically calls + * |delete| at the end of the scope; + * - |ScopedDeleteArray| - a container for a pointer to an array, that + * automatically calls |delete[]| at the end of the scope. + * + * The general scenario for each of the RAII classes is the following: + * + * ScopedClass foo(create_value()); + * // ... In this scope, |foo| is defined. Use |foo.get()| or |foo.rwget()| + * to access the value. + * // ... In case of |return| or |throw|, |foo| is deallocated automatically. + * // ... If |foo| needs to be returned or stored, use |foo.forget()| + * + * Note that the RAII classes defined in this header do _not_ perform any form + * of reference-counting or garbage-collection. These classes have exactly two + * behaviors: + * + * - if |forget()| has not been called, the resource is always deallocated at + * the end of the scope; + * - if |forget()| has been called, any control on the resource is unbound + * and the resource is not deallocated by the class. + * + * Extension: + * + * In addition, this header provides class |Scoped| and macros |SCOPED_TEMPLATE| + * and |MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE| to simplify the definition + * of RAII classes for other scenarios. These macros have been used to + * automatically close file descriptors/file handles when reaching the end of + * the scope, graphics contexts, etc. + */ + +#include "mozilla/Attributes.h" +#include "mozilla/GuardObjects.h" + +namespace mozilla { + +/* + * Scoped is a helper to create RAII wrappers + * Type argument |Traits| is expected to have the following structure: + * + * struct Traits { + * // Define the type of the value stored in the wrapper + * typedef value_type type; + * // Returns the value corresponding to the uninitialized or freed state + * const static type empty(); + * // Release resources corresponding to the wrapped value + * // This function is responsible for not releasing an |empty| value + * const static void release(type); + * } + */ +template +class Scoped +{ + public: + typedef typename Traits::type Resource; + + explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) + : value(Traits::empty()) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + explicit Scoped(const Resource& v + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) + : value(v) + { + MOZ_GUARD_OBJECT_NOTIFIER_INIT; + } + ~Scoped() { + Traits::release(value); + } + + // Constant getter + operator const Resource&() const { return value; } + const Resource& operator->() const { return value; } + const Resource& get() const { return value; } + // Non-constant getter. + Resource& rwget() { return value; } + + /* + * Forget the resource. + * + * Once |forget| has been called, the |Scoped| is neutralized, i.e. it will + * have no effect at destruction (unless it is reset to another resource by + * |operator=|). + * + * @return The original resource. + */ + Resource forget() { + Resource tmp = value; + value = Traits::empty(); + return tmp; + } + + /* + * Perform immediate clean-up of this |Scoped|. + * + * If this |Scoped| is currently empty, this method has no effect. + */ + void dispose() { + Traits::release(value); + value = Traits::empty(); + } + + bool operator==(const Resource& other) const { + return value == other; + } + + /* + * Replace the resource with another resource. + * + * Calling |operator=| has the side-effect of triggering clean-up. If you do + * not want to trigger clean-up, you should first invoke |forget|. + * + * @return this + */ + Scoped& operator=(const Resource& other) { + return reset(other); + } + Scoped& reset(const Resource& other) { + Traits::release(value); + value = other; + return *this; + } + + private: + explicit Scoped(const Scoped& value) MOZ_DELETE; + Scoped& operator=(const Scoped& value) MOZ_DELETE; + + private: + Resource value; + MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER +}; + +/* + * SCOPED_TEMPLATE defines a templated class derived from Scoped + * This allows to implement templates such as ScopedFreePtr. + * + * @param name The name of the class to define. + * @param Traits A struct implementing clean-up. See the implementations + * for more details. + */ +#define SCOPED_TEMPLATE(name, Traits) \ +template \ +struct name : public mozilla::Scoped > \ +{ \ + typedef mozilla::Scoped > Super; \ + typedef typename Super::Resource Resource; \ + name& operator=(Resource ptr) { \ + Super::operator=(ptr); \ + return *this; \ + } \ + explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) \ + : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT) \ + {} \ + explicit name(Resource ptr \ + MOZ_GUARD_OBJECT_NOTIFIER_PARAM) \ + : Super(ptr MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT) \ + {} \ + private: \ + explicit name(name& source) MOZ_DELETE; \ + name& operator=(name& source) MOZ_DELETE; \ +}; + +/* + * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d. + * + * struct S { ... }; + * ScopedFreePtr foo = malloc(sizeof(S)); + * ScopedFreePtr bar = strdup(str); + */ +template +struct ScopedFreePtrTraits +{ + typedef T* type; + static T* empty() { return NULL; } + static void release(T* ptr) { free(ptr); } +}; +SCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits) + +/* + * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted. + * + * struct S { ... }; + * ScopedDeletePtr foo = new S(); + */ +template +struct ScopedDeletePtrTraits : public ScopedFreePtrTraits +{ + static void release(T* ptr) { delete ptr; } +}; +SCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits) + +/* + * ScopedDeleteArray is a RAII wrapper for pointers that need to be delete[]ed. + * + * struct S { ... }; + * ScopedDeleteArray foo = new S[42]; + */ +template +struct ScopedDeleteArrayTraits : public ScopedFreePtrTraits +{ + static void release(T* ptr) { delete [] ptr; } +}; +SCOPED_TEMPLATE(ScopedDeleteArray, ScopedDeleteArrayTraits) + +/* + * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped + * pointers for types with custom deleters; just overload + * TypeSpecificDelete(T*) in the same namespace as T to call the deleter for + * type T. + * + * @param name The name of the class to define. + * @param Type A struct implementing clean-up. See the implementations + * for more details. + * *param Deleter The function that is used to delete/destroy/free a + * non-null value of Type*. + * + * Example: + * + * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \ + * PR_Close) + * ... + * { + * ScopedPRFileDesc file(PR_OpenFile(...)); + * ... + * } // file is closed with PR_Close here + */ +#define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \ +template <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \ +typedef ::mozilla::TypeSpecificScopedPointer name; + +template void TypeSpecificDelete(T * value); + +template +struct TypeSpecificScopedPointerTraits +{ + typedef T* type; + const static type empty() { return NULL; } + const static void release(type value) + { + if (value) + TypeSpecificDelete(value); + } +}; + +SCOPED_TEMPLATE(TypeSpecificScopedPointer, TypeSpecificScopedPointerTraits) + +} /* namespace mozilla */ + +#endif // mozilla_Scoped_h_ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/SplayTree.h b/scripting/javascript/spidermonkey-mac/include/mozilla/SplayTree.h new file mode 100644 index 0000000000..f9a10d36dd --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/SplayTree.h @@ -0,0 +1,285 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * A sorted tree with optimal access times, where recently-accessed elements + * are faster to access again. + */ + +#ifndef mozilla_SplayTree_h_ +#define mozilla_SplayTree_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/NullPtr.h" + +namespace mozilla { + +template +class SplayTree; + +template +class SplayTreeNode +{ + public: + template + friend class SplayTree; + + SplayTreeNode() + : left(nullptr), right(nullptr), parent(nullptr) + {} + + private: + T* left; + T* right; + T* parent; +}; + + +/** + * Class which represents a splay tree. + * Splay trees are balanced binary search trees for which search, insert and + * remove are all amortized O(log n), but where accessing a node makes it + * faster to access that node in the future. + * + * T indicates the type of tree elements, Comparator must have a static + * compare(const T&, const T&) method ordering the elements. The compare + * method must be free from side effects. + */ +template +class SplayTree +{ + T* root; + T* freeList; + + public: + SplayTree() + : root(nullptr), freeList(nullptr) + {} + + bool empty() const { + return !root; + } + + bool contains(const T& v) + { + if (empty()) + return false; + + T* last = lookup(v); + splay(last); + checkCoherency(root, nullptr); + return Comparator::compare(v, *last) == 0; + } + + bool insert(T* v) + { + MOZ_ASSERT(!contains(*v), "Duplicate elements are not allowed."); + + if (!root) { + root = v; + return true; + } + T* last = lookup(*v); + int cmp = Comparator::compare(*v, *last); + + T** parentPointer = (cmp < 0) ? &last->left : &last->right; + MOZ_ASSERT(!*parentPointer); + *parentPointer = v; + v->parent = last; + + splay(v); + checkCoherency(root, nullptr); + return true; + } + + T* remove(const T& v) + { + T* last = lookup(v); + MOZ_ASSERT(last, "This tree must contain the element being removed."); + MOZ_ASSERT(Comparator::compare(v, *last) == 0); + + // Splay the tree so that the item to remove is the root. + splay(last); + MOZ_ASSERT(last == root); + + // Find another node which can be swapped in for the root: either the + // rightmost child of the root's left, or the leftmost child of the + // root's right. + T* swap; + T* swapChild; + if (root->left) { + swap = root->left; + while (swap->right) + swap = swap->right; + swapChild = swap->left; + } else if (root->right) { + swap = root->right; + while (swap->left) + swap = swap->left; + swapChild = swap->right; + } else { + T* result = root; + root = nullptr; + return result; + } + + // The selected node has at most one child, in swapChild. Detach it + // from the subtree by replacing it with that child. + if (swap == swap->parent->left) + swap->parent->left = swapChild; + else + swap->parent->right = swapChild; + if (swapChild) + swapChild->parent = swap->parent; + + // Make the selected node the new root. + root = swap; + root->parent = nullptr; + root->left = last->left; + root->right = last->right; + if (root->left) { + root->left->parent = root; + } + if (root->right) { + root->right->parent = root; + } + + checkCoherency(root, nullptr); + return last; + } + + T* removeMin() + { + MOZ_ASSERT(root, "No min to remove!"); + + T* min = root; + while (min->left) + min = min->left; + return remove(*min); + } + + private: + /** + * Returns the node in this comparing equal to |v|, or a node just greater or + * just less than |v| if there is no such node. + */ + T* lookup(const T& v) + { + MOZ_ASSERT(!empty()); + + T* node = root; + T* parent; + do { + parent = node; + int c = Comparator::compare(v, *node); + if (c == 0) + return node; + else if (c < 0) + node = node->left; + else + node = node->right; + } while (node); + return parent; + } + + /** + * Rotate the tree until |node| is at the root of the tree. Performing + * the rotations in this fashion preserves the amortized balancing of + * the tree. + */ + void splay(T* node) + { + MOZ_ASSERT(node); + + while (node != root) { + T* parent = node->parent; + if (parent == root) { + // Zig rotation. + rotate(node); + MOZ_ASSERT(node == root); + return; + } + T* grandparent = parent->parent; + if ((parent->left == node) == (grandparent->left == parent)) { + // Zig-zig rotation. + rotate(parent); + rotate(node); + } else { + // Zig-zag rotation. + rotate(node); + rotate(node); + } + } + } + + void rotate(T* node) + { + // Rearrange nodes so that node becomes the parent of its current + // parent, while preserving the sortedness of the tree. + T* parent = node->parent; + if (parent->left == node) { + // x y + // y c ==> a x + // a b b c + parent->left = node->right; + if (node->right) + node->right->parent = parent; + node->right = parent; + } else { + MOZ_ASSERT(parent->right == node); + // x y + // a y ==> x c + // b c a b + parent->right = node->left; + if (node->left) + node->left->parent = parent; + node->left = parent; + } + node->parent = parent->parent; + parent->parent = node; + if (T* grandparent = node->parent) { + if (grandparent->left == parent) + grandparent->left = node; + else + grandparent->right = node; + } else { + root = node; + } + } + + T* checkCoherency(T* node, T* minimum) + { +#ifdef DEBUG + MOZ_ASSERT_IF(root, !root->parent); + if (!node) { + MOZ_ASSERT(!root); + return nullptr; + } + MOZ_ASSERT_IF(!node->parent, node == root); + MOZ_ASSERT_IF(minimum, Comparator::compare(*minimum, *node) < 0); + if (node->left) { + MOZ_ASSERT(node->left->parent == node); + T* leftMaximum = checkCoherency(node->left, minimum); + MOZ_ASSERT(Comparator::compare(*leftMaximum, *node) < 0); + } + if (node->right) { + MOZ_ASSERT(node->right->parent == node); + return checkCoherency(node->right, node); + } + return node; +#else + return nullptr; +#endif + } + + SplayTree(const SplayTree&) MOZ_DELETE; + void operator=(const SplayTree&) MOZ_DELETE; +}; + +} /* namespace mozilla */ + +#endif /* mozilla_SplayTree_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/StandardInteger.h b/scripting/javascript/spidermonkey-mac/include/mozilla/StandardInteger.h new file mode 100644 index 0000000000..8e4c8578f1 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/StandardInteger.h @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Implements the C99 interface for C and C++ code. */ + +#ifndef mozilla_StandardInteger_h_ +#define mozilla_StandardInteger_h_ + +/* + * The C99 standard header exposes typedefs for common fixed-width + * integer types. It would be feasible to simply #include , but + * MSVC++ versions prior to 2010 don't provide . We could solve this + * by reimplementing for MSVC++ 2008 and earlier. But then we reach + * a second problem: our custom might conflict with a + * defined by an embedder already looking to work around the MSVC++ + * absence. + * + * We address these issues in this manner: + * + * 1. If the preprocessor macro MOZ_CUSTOM_STDINT_H is defined to a path to a + * custom implementation, we will #include it. Embedders using + * a custom must define this macro to an implementation that + * will work with their embedding. + * 2. Otherwise, if we are compiling with a an MSVC++ version without + * , #include our custom reimplementation. + * 3. Otherwise, #include the standard provided by the compiler. + * + * Note that we can't call this file "stdint.h" or something case-insensitively + * equal to "stdint.h" because then MSVC (and other compilers on + * case-insensitive file systems) will include this file, rather than the system + * stdint.h, when we ask for below. + */ +#if defined(MOZ_CUSTOM_STDINT_H) +# include MOZ_CUSTOM_STDINT_H +#elif defined(_MSC_VER) && _MSC_VER < 1600 +# include "mozilla/MSStdInt.h" +#else +# include +#endif + +#endif /* mozilla_StandardInteger_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/ThreadLocal.h b/scripting/javascript/spidermonkey-mac/include/mozilla/ThreadLocal.h new file mode 100644 index 0000000000..2b4eb30207 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/ThreadLocal.h @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Cross-platform lightweight thread local data wrappers. */ + +#ifndef mozilla_ThreadLocal_h_ +#define mozilla_ThreadLocal_h_ + +#if defined(XP_WIN) +// This file will get included in any file that wants to add a profiler mark. +// In order to not bring together we could include windef.h and +// winbase.h which are sufficient to get the prototypes for the Tls* functions. +// # include +// # include +// Unfortunately, even including these headers causes us to add a bunch of ugly +// stuff to our namespace e.g #define CreateEvent CreateEventW +extern "C" { +__declspec(dllimport) void* __stdcall TlsGetValue(unsigned long); +__declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void*); +__declspec(dllimport) unsigned long __stdcall TlsAlloc(); +} +#else +# include +# include +#endif + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" + +namespace mozilla { + +// sig_safe_t denotes an atomic type which can be read or stored in a single +// instruction. This means that data of this type is safe to be manipulated +// from a signal handler, or other similar asynchronous execution contexts. +#if defined(XP_WIN) +typedef unsigned long sig_safe_t; +#else +typedef sig_atomic_t sig_safe_t; +#endif + +/* + * Thread Local Storage helpers. + * + * Usage: + * + * Only static-storage-duration (e.g. global variables, or static class members) + * objects of this class should be instantiated. This class relies on + * zero-initialization, which is implicit for static-storage-duration objects. + * It doesn't have a custom default constructor, to avoid static initializers. + * + * API usage: + * + * // Create a TLS item + * mozilla::ThreadLocal tlsKey; + * if (!tlsKey.init()) { + * // deal with the error + * } + * + * // Set the TLS value + * tlsKey.set(123); + * + * // Get the TLS value + * int value = tlsKey.get(); + */ +template +class ThreadLocal +{ +#if defined(XP_WIN) + typedef unsigned long key_t; +#else + typedef pthread_key_t key_t; +#endif + + union Helper { + void* ptr; + T value; + }; + + public: + MOZ_WARN_UNUSED_RESULT inline bool init(); + + inline T get() const; + + inline void set(const T value); + + bool initialized() const { + return inited; + } + + private: + key_t key; + bool inited; +}; + +template +inline bool +ThreadLocal::init() +{ + MOZ_STATIC_ASSERT(sizeof(T) <= sizeof(void*), + "mozilla::ThreadLocal can't be used for types larger than " + "a pointer"); + MOZ_ASSERT(!initialized()); +#ifdef XP_WIN + key = TlsAlloc(); + inited = key != 0xFFFFFFFFUL; // TLS_OUT_OF_INDEXES +#else + inited = !pthread_key_create(&key, NULL); +#endif + return inited; +} + +template +inline T +ThreadLocal::get() const +{ + MOZ_ASSERT(initialized()); + Helper h; +#ifdef XP_WIN + h.ptr = TlsGetValue(key); +#else + h.ptr = pthread_getspecific(key); +#endif + return h.value; +} + +template +inline void +ThreadLocal::set(const T value) +{ + MOZ_ASSERT(initialized()); + Helper h; + h.value = value; + bool succeeded; +#ifdef XP_WIN + succeeded = TlsSetValue(key, h.ptr); +#else + succeeded = !pthread_setspecific(key, h.ptr); +#endif + if (!succeeded) + MOZ_CRASH(); +} + +} // namespace mozilla + +#endif // mozilla_ThreadLocal_h_ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h b/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h new file mode 100644 index 0000000000..1422d44648 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h @@ -0,0 +1,253 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Template-based metaprogramming and type-testing facilities. */ + +#ifndef mozilla_TypeTraits_h_ +#define mozilla_TypeTraits_h_ + +/* + * These traits are approximate copies of the traits and semantics from C++11's + * header. Don't add traits not in that header! When all + * platforms provide that header, we can convert all users and remove this one. + */ + +#include + +namespace mozilla { + +namespace detail { + +/** + * The trickery used to implement IsBaseOf here makes it possible to use it for + * the cases of private and multiple inheritance. This code was inspired by the + * sample code here: + * + * http://stackoverflow.com/questions/2910979/how-is-base-of-works + */ +template +class IsBaseOfHelper +{ + public: + operator Base*() const; + operator Derived*(); +}; + +} /* namespace detail */ + +/* + * IsBaseOf allows to know whether a given class is derived from another. + * + * Consider the following class definitions: + * + * class A {}; + * class B : public A {}; + * class C {}; + * + * mozilla::IsBaseOf::value is true; + * mozilla::IsBaseOf::value is false; + */ +template +class IsBaseOf +{ + private: + template + static char test(Derived*, T); + static int test(Base*, int); + + public: + static const bool value = + sizeof(test(detail::IsBaseOfHelper(), int())) == sizeof(char); +}; + +template +class IsBaseOf +{ + private: + template + static char test(Derived*, T); + static int test(Base*, int); + + public: + static const bool value = + sizeof(test(detail::IsBaseOfHelper(), int())) == sizeof(char); +}; + +template +class IsBaseOf +{ + public: + static const bool value = false; +}; + +template +class IsBaseOf +{ + public: + static const bool value = true; +}; + +template +class IsBaseOf +{ + public: + static const bool value = true; +}; + +/* + * IsConvertible determines whether a value of type From will implicitly convert + * to a value of type To. For example: + * + * struct A {}; + * struct B : public A {}; + * struct C {}; + * + * mozilla::IsConvertible::value is true; + * mozilla::IsConvertible::value is true; + * mozilla::IsConvertible::value is true; + * mozilla::IsConvertible::value is true; + * mozilla::IsConvertible::value is false; + * mozilla::IsConvertible::value is false; + * mozilla::IsConvertible::value is false; + * mozilla::IsConvertible::value is false. + * + * For obscure reasons, you can't use IsConvertible when the types being tested + * are related through private inheritance, and you'll get a compile error if + * you try. Just don't do it! + */ +template +struct IsConvertible +{ + private: + static From create(); + + template + static char test(To to); + + template + static int test(...); + + public: + static const bool value = + sizeof(test(create())) == sizeof(char); +}; + +/* + * Conditional selects a class between two, depending on a given boolean value. + * + * mozilla::Conditional::Type is A; + * mozilla::Conditional::Type is B; + */ +template +struct Conditional +{ + typedef A Type; +}; + +template +struct Conditional +{ + typedef B Type; +}; + +/* + * EnableIf is a struct containing a typedef of T if and only if B is true. + * + * mozilla::EnableIf::Type is int; + * mozilla::EnableIf::Type is a compile-time error. + * + * Use this template to implement SFINAE-style (Substitution Failure Is not An + * Error) requirements. For example, you might use it to impose a restriction + * on a template parameter: + * + * template + * class PodVector // vector optimized to store POD (memcpy-able) types + * { + * EnableIf, T>::Type* vector; + * size_t length; + * ... + * }; + */ +template +struct EnableIf +{}; + +template +struct EnableIf +{ + typedef T Type; +}; + +/** + * IsSame tests whether two types are the same type. + * + * mozilla::IsSame::value is true; + * mozilla::IsSame::value is true; + * mozilla::IsSame::value is false; + * mozilla::IsSame::value is true; + * mozilla::IsSame::value is false; + * mozilla::IsSame::value is true. + */ +template +struct IsSame +{ + static const bool value = false; +}; + +template +struct IsSame +{ + static const bool value = true; +}; + +/* + * Traits class for identifying POD types. Until C++0x, there is no automatic + * way to detect PODs, so for the moment it is done manually. + */ +template +struct IsPod +{ + static const bool value = false; +}; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template<> struct IsPod { static const bool value = true; }; +template struct IsPod { static const bool value = true; }; + +/** + * IsPointer determines whether a type is a pointer type (but not a pointer-to- + * member type). + * + * mozilla::IsPointer::value is true; + * mozilla::IsPointer::value is true; + * mozilla::IsPointer::value is true; + * mozilla::IsPointer::value is false; + * mozilla::IsPointer::value is false. + */ +template +struct IsPointer +{ + static const bool value = false; +}; +template +struct IsPointer +{ + static const bool value = true; +}; + +} /* namespace mozilla */ + +#endif /* mozilla_TypeTraits_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/TypedEnum.h b/scripting/javascript/spidermonkey-mac/include/mozilla/TypedEnum.h new file mode 100644 index 0000000000..889960a32d --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/TypedEnum.h @@ -0,0 +1,213 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Macros to emulate C++11 typed enums and enum classes. */ + +#ifndef mozilla_TypedEnum_h_ +#define mozilla_TypedEnum_h_ + +#include "mozilla/Attributes.h" + +#if defined(__cplusplus) + +#if defined(__clang__) + /* + * Per Clang documentation, "Note that marketing version numbers should not + * be used to check for language features, as different vendors use different + * numbering schemes. Instead, use the feature checking macros." + */ +# ifndef __has_extension +# define __has_extension __has_feature /* compatibility, for older versions of clang */ +# endif +# if __has_extension(cxx_strong_enums) +# define MOZ_HAVE_CXX11_ENUM_TYPE +# define MOZ_HAVE_CXX11_STRONG_ENUMS +# endif +#elif defined(__GNUC__) +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# if MOZ_GCC_VERSION_AT_LEAST(4, 5, 1) +# define MOZ_HAVE_CXX11_ENUM_TYPE +# define MOZ_HAVE_CXX11_STRONG_ENUMS +# endif +# endif +#elif defined(_MSC_VER) +# if _MSC_VER >= 1400 +# define MOZ_HAVE_CXX11_ENUM_TYPE +# endif +# if _MSC_VER >= 1700 +# define MOZ_HAVE_CXX11_STRONG_ENUMS +# endif +#endif + +/** + * MOZ_ENUM_TYPE specifies the underlying numeric type for an enum. It's + * specified by placing MOZ_ENUM_TYPE(type) immediately after the enum name in + * its declaration, and before the opening curly brace, like + * + * enum MyEnum MOZ_ENUM_TYPE(uint16_t) + * { + * A, + * B = 7, + * C + * }; + * + * In supporting compilers, the macro will expand to ": uint16_t". The + * compiler will allocate exactly two bytes for MyEnum and will require all + * enumerators to have values between 0 and 65535. (Thus specifying "B = + * 100000" instead of "B = 7" would fail to compile.) In old compilers the + * macro expands to the empty string, and the underlying type is generally + * undefined. + */ +#ifdef MOZ_HAVE_CXX11_ENUM_TYPE +# define MOZ_ENUM_TYPE(type) : type +#else +# define MOZ_ENUM_TYPE(type) /* no support */ +#endif + +/** + * MOZ_BEGIN_ENUM_CLASS and MOZ_END_ENUM_CLASS provide access to the + * strongly-typed enumeration feature of C++11 ("enum class"). If supported + * by the compiler, an enum defined using these macros will not be implicitly + * converted to any other type, and its enumerators will be scoped using the + * enumeration name. Place MOZ_BEGIN_ENUM_CLASS(EnumName, type) in place of + * "enum EnumName {", and MOZ_END_ENUM_CLASS(EnumName) in place of the closing + * "};". For example, + * + * MOZ_BEGIN_ENUM_CLASS(Enum, int32_t) + * A, + * B = 6 + * MOZ_END_ENUM_CLASS(Enum) + * + * This will make "Enum::A" and "Enum::B" appear in the global scope, but "A" + * and "B" will not. In compilers that support C++11 strongly-typed + * enumerations, implicit conversions of Enum values to numeric types will + * fail. In other compilers, Enum itself will actually be defined as a class, + * and some implicit conversions will fail while others will succeed. + * + * The type argument specifies the underlying type for the enum where + * supported, as with MOZ_ENUM_TYPE(). For simplicity, it is currently + * mandatory. As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do + * not support it. + * + * Note that the workaround implemented here is not compatible with enums + * nested inside a class. + */ +#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS) + /* + * All compilers that support strong enums also support an explicit + * underlying type, so no extra check is needed. + */ +# define MOZ_BEGIN_ENUM_CLASS(Name, type) enum class Name : type { +# define MOZ_END_ENUM_CLASS(Name) }; +#else + /** + * We need Name to both name a type, and scope the provided enumerator + * names. Namespaces and classes both provide scoping, but namespaces + * aren't types, so we need to use a class that wraps the enum values. We + * have an implicit conversion from the inner enum type to the class, so + * statements like + * + * Enum x = Enum::A; + * + * will still work. We need to define an implicit conversion from the class + * to the inner enum as well, so that (for instance) switch statements will + * work. This means that the class can be implicitly converted to a numeric + * value as well via the enum type, since C++ allows an implicit + * user-defined conversion followed by a standard conversion to still be + * implicit. + * + * We have an explicit constructor from int defined, so that casts like + * (Enum)7 will still work. We also have a zero-argument constructor with + * no arguments, so declaration without initialization (like "Enum foo;") + * will work. + * + * Additionally, we'll delete as many operators as possible for the inner + * enum type, so statements like this will still fail: + * + * f(5 + Enum::B); // deleted operator+ + * + * But we can't prevent things like this, because C++ doesn't allow + * overriding conversions or assignment operators for enums: + * + * int x = Enum::A; + * int f() + * { + * return Enum::A; + * } + */ +# define MOZ_BEGIN_ENUM_CLASS(Name, type) \ + class Name \ + { \ + public: \ + enum Enum MOZ_ENUM_TYPE(type) \ + { +# define MOZ_END_ENUM_CLASS(Name) \ + }; \ + Name() {} \ + Name(Enum aEnum) : mEnum(aEnum) {} \ + explicit Name(int num) : mEnum((Enum)num) {} \ + operator Enum() const { return mEnum; } \ + private: \ + Enum mEnum; \ + }; \ + inline int operator+(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator+(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator-(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator-(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator*(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator*(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator/(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator/(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator%(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator%(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator+(const Name::Enum&) MOZ_DELETE; \ + inline int operator-(const Name::Enum&) MOZ_DELETE; \ + inline int& operator++(Name::Enum&) MOZ_DELETE; \ + inline int operator++(Name::Enum&, int) MOZ_DELETE; \ + inline int& operator--(Name::Enum&) MOZ_DELETE; \ + inline int operator--(Name::Enum&, int) MOZ_DELETE; \ + inline bool operator==(const int&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator==(const Name::Enum&, const int&) MOZ_DELETE; \ + inline bool operator!=(const int&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator!=(const Name::Enum&, const int&) MOZ_DELETE; \ + inline bool operator>(const int&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator>(const Name::Enum&, const int&) MOZ_DELETE; \ + inline bool operator<(const int&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator<(const Name::Enum&, const int&) MOZ_DELETE; \ + inline bool operator>=(const int&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator>=(const Name::Enum&, const int&) MOZ_DELETE; \ + inline bool operator<=(const int&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator<=(const Name::Enum&, const int&) MOZ_DELETE; \ + inline bool operator!(const Name::Enum&) MOZ_DELETE; \ + inline bool operator&&(const bool&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator&&(const Name::Enum&, const bool&) MOZ_DELETE; \ + inline bool operator||(const bool&, const Name::Enum&) MOZ_DELETE; \ + inline bool operator||(const Name::Enum&, const bool&) MOZ_DELETE; \ + inline int operator~(const Name::Enum&) MOZ_DELETE; \ + inline int operator&(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator&(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator|(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator|(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator^(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator^(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator<<(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator<<(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int operator>>(const int&, const Name::Enum&) MOZ_DELETE; \ + inline int operator>>(const Name::Enum&, const int&) MOZ_DELETE; \ + inline int& operator+=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator-=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator*=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator/=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator%=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator&=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator|=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator^=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator<<=(int&, const Name::Enum&) MOZ_DELETE; \ + inline int& operator>>=(int&, const Name::Enum&) MOZ_DELETE; +#endif + +#endif /* __cplusplus */ + +#endif /* mozilla_TypedEnum_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Types.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Types.h new file mode 100644 index 0000000000..56e5cb82fb --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Types.h @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* mfbt foundational types and macros. */ + +#ifndef mozilla_Types_h_ +#define mozilla_Types_h_ + +/* + * This header must be valid C and C++, includable by code embedding either + * SpiderMonkey or Gecko. + */ + +/* + * Expose all the integer types defined in C99's (and the integer + * limit and constant macros, if compiling C code or if compiling C++ code and + * the right __STDC_*_MACRO has been defined for each). These are all usable + * throughout mfbt code, and throughout Mozilla code more generally. + */ +#include "mozilla/StandardInteger.h" + +/* Also expose size_t. */ +#include + +/* Implement compiler and linker macros needed for APIs. */ + +/* + * MOZ_EXPORT is used to declare and define a symbol or type which is externally + * visible to users of the current library. It encapsulates various decorations + * needed to properly export the method's symbol. + * + * api.h: + * extern MOZ_EXPORT int MeaningOfLife(void); + * extern MOZ_EXPORT int LuggageCombination; + * + * api.c: + * int MeaningOfLife(void) { return 42; } + * int LuggageCombination = 12345; + * + * If you are merely sharing a method across files, just use plain |extern|. + * These macros are designed for use by library interfaces -- not for normal + * methods or data used cross-file. + */ +#if defined(WIN32) || defined(XP_OS2) +# define MOZ_EXPORT __declspec(dllexport) +#else /* Unix */ +# ifdef HAVE_VISIBILITY_ATTRIBUTE +# define MOZ_EXPORT __attribute__((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define MOZ_EXPORT __global +# else +# define MOZ_EXPORT /* nothing */ +# endif +#endif + + +/* + * Whereas implementers use MOZ_EXPORT to declare and define library symbols, + * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them. Most often the + * implementer of the library will expose an API macro which expands to either + * the export or import version of the macro, depending upon the compilation + * mode. + */ +#ifdef _WIN32 +# if defined(__MWERKS__) +# define MOZ_IMPORT_API /* nothing */ +# else +# define MOZ_IMPORT_API __declspec(dllimport) +# endif +#elif defined(XP_OS2) +# define MOZ_IMPORT_API __declspec(dllimport) +#else +# define MOZ_IMPORT_API MOZ_EXPORT +#endif + +#if defined(_WIN32) && !defined(__MWERKS__) +# define MOZ_IMPORT_DATA __declspec(dllimport) +#elif defined(XP_OS2) +# define MOZ_IMPORT_DATA __declspec(dllimport) +#else +# define MOZ_IMPORT_DATA MOZ_EXPORT +#endif + +/* + * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose + * export mfbt declarations when building mfbt, and they expose import mfbt + * declarations when using mfbt. + */ +#if defined(IMPL_MFBT) +# define MFBT_API MOZ_EXPORT +# define MFBT_DATA MOZ_EXPORT +#else + /* + * On linux mozglue is linked in the program and we link libxul.so with + * -z,defs. Normally that causes the linker to reject undefined references in + * libxul.so, but as a loophole it allows undefined references to weak + * symbols. We add the weak attribute to the import version of the MFBT API + * macros to exploit this. + */ +# if defined(MOZ_GLUE_IN_PROGRAM) +# define MFBT_API __attribute__((weak)) MOZ_IMPORT_API +# define MFBT_DATA __attribute__((weak)) MOZ_IMPORT_DATA +# else +# define MFBT_API MOZ_IMPORT_API +# define MFBT_DATA MOZ_IMPORT_DATA +# endif +#endif + +/* + * C symbols in C++ code must be declared immediately within |extern "C"| + * blocks. However, in C code, they need not be declared specially. This + * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C + * macros, so that the user need not know whether he is being used in C or C++ + * code. + * + * MOZ_BEGIN_EXTERN_C + * + * extern MOZ_EXPORT int MostRandomNumber(void); + * ...other declarations... + * + * MOZ_END_EXTERN_C + * + * This said, it is preferable to just use |extern "C"| in C++ header files for + * its greater clarity. + */ +#ifdef __cplusplus +# define MOZ_BEGIN_EXTERN_C extern "C" { +# define MOZ_END_EXTERN_C } +#else +# define MOZ_BEGIN_EXTERN_C +# define MOZ_END_EXTERN_C +#endif + +#endif /* mozilla_Types_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Util.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Util.h new file mode 100644 index 0000000000..097c5478eb --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Util.h @@ -0,0 +1,283 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Miscellaneous uncategorized functionality. Please add new functionality to + * new headers, or to other appropriate existing headers, not here. + */ + +#ifndef mozilla_Util_h_ +#define mozilla_Util_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" +#include "mozilla/Types.h" + +#ifdef __cplusplus + +namespace mozilla { + +/* + * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many + * bytes of alignment a given type needs. + */ +template +class AlignmentFinder +{ + struct Aligner + { + char c; + T t; + }; + + public: + static const size_t alignment = sizeof(Aligner) - sizeof(T); +}; + +#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder::alignment + +/* + * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types. + * + * For instance, + * + * MOZ_ALIGNED_DECL(char arr[2], 8); + * + * will declare a two-character array |arr| aligned to 8 bytes. + */ + +#if defined(__GNUC__) +# define MOZ_ALIGNED_DECL(_type, _align) \ + _type __attribute__((aligned(_align))) +#elif defined(_MSC_VER) +# define MOZ_ALIGNED_DECL(_type, _align) \ + __declspec(align(_align)) _type +#else +# warning "We don't know how to align variables on this compiler." +# define MOZ_ALIGNED_DECL(_type, _align) _type +#endif + +/* + * AlignedElem is a structure whose alignment is guaranteed to be at least N + * bytes. + * + * We support 1, 2, 4, 8, and 16-bit alignment. + */ +template +struct AlignedElem; + +/* + * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where + * foo is a template parameter. + */ + +template<> +struct AlignedElem<1> +{ + MOZ_ALIGNED_DECL(uint8_t elem, 1); +}; + +template<> +struct AlignedElem<2> +{ + MOZ_ALIGNED_DECL(uint8_t elem, 2); +}; + +template<> +struct AlignedElem<4> +{ + MOZ_ALIGNED_DECL(uint8_t elem, 4); +}; + +template<> +struct AlignedElem<8> +{ + MOZ_ALIGNED_DECL(uint8_t elem, 8); +}; + +template<> +struct AlignedElem<16> +{ + MOZ_ALIGNED_DECL(uint8_t elem, 16); +}; + +/* + * This utility pales in comparison to Boost's aligned_storage. The utility + * simply assumes that uint64_t is enough alignment for anyone. This may need + * to be extended one day... + * + * As an important side effect, pulling the storage into this template is + * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving + * false negatives when we cast from the char buffer to whatever type we've + * constructed using the bytes. + */ +template +struct AlignedStorage +{ + union U { + char bytes[nbytes]; + uint64_t _; + } u; + + const void* addr() const { return u.bytes; } + void* addr() { return u.bytes; } +}; + +template +struct AlignedStorage2 +{ + union U { + char bytes[sizeof(T)]; + uint64_t _; + } u; + + const T* addr() const { return reinterpret_cast(u.bytes); } + T* addr() { return static_cast(static_cast(u.bytes)); } +}; + +/* + * Small utility for lazily constructing objects without using dynamic storage. + * When a Maybe is constructed, it is |empty()|, i.e., no value of T has + * been constructed and no T destructor will be called when the Maybe is + * destroyed. Upon calling |construct|, a T object will be constructed with the + * given arguments and that object will be destroyed when the owning Maybe + * is destroyed. + * + * N.B. GCC seems to miss some optimizations with Maybe and may generate extra + * branches/loads/stores. Use with caution on hot paths. + */ +template +class Maybe +{ + AlignedStorage2 storage; + bool constructed; + + T& asT() { return *storage.addr(); } + + public: + Maybe() { constructed = false; } + ~Maybe() { if (constructed) asT().~T(); } + + bool empty() const { return !constructed; } + + void construct() { + MOZ_ASSERT(!constructed); + ::new (storage.addr()) T(); + constructed = true; + } + + template + void construct(const T1& t1) { + MOZ_ASSERT(!constructed); + ::new (storage.addr()) T(t1); + constructed = true; + } + + template + void construct(const T1& t1, const T2& t2) { + MOZ_ASSERT(!constructed); + ::new (storage.addr()) T(t1, t2); + constructed = true; + } + + template + void construct(const T1& t1, const T2& t2, const T3& t3) { + MOZ_ASSERT(!constructed); + ::new (storage.addr()) T(t1, t2, t3); + constructed = true; + } + + template + void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4) { + MOZ_ASSERT(!constructed); + ::new (storage.addr()) T(t1, t2, t3, t4); + constructed = true; + } + + T* addr() { + MOZ_ASSERT(constructed); + return &asT(); + } + + T& ref() { + MOZ_ASSERT(constructed); + return asT(); + } + + const T& ref() const { + MOZ_ASSERT(constructed); + return const_cast(this)->asT(); + } + + void destroy() { + ref().~T(); + constructed = false; + } + + void destroyIfConstructed() { + if (!empty()) + destroy(); + } + + private: + Maybe(const Maybe& other) MOZ_DELETE; + const Maybe& operator=(const Maybe& other) MOZ_DELETE; +}; + +/* + * Safely subtract two pointers when it is known that end >= begin. This avoids + * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB + * set, the unsigned subtraction followed by right shift will produce -1, or + * size_t(-1), instead of the real difference. + */ +template +MOZ_ALWAYS_INLINE size_t +PointerRangeSize(T* begin, T* end) +{ + MOZ_ASSERT(end >= begin); + return (size_t(end) - size_t(begin)) / sizeof(T); +} + +/* + * Compute the length of an array with constant length. (Use of this method + * with a non-array pointer will not compile.) + * + * Beware of the implicit trailing '\0' when using this with string constants. + */ +template +MOZ_CONSTEXPR size_t +ArrayLength(T (&arr)[N]) +{ + return N; +} + +/* + * Compute the address one past the last element of a constant-length array. + * + * Beware of the implicit trailing '\0' when using this with string constants. + */ +template +MOZ_CONSTEXPR T* +ArrayEnd(T (&arr)[N]) +{ + return arr + ArrayLength(arr); +} + +} /* namespace mozilla */ + +#endif /* __cplusplus */ + +/* + * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files + * that can't use C++ template functions and for MOZ_STATIC_ASSERT() calls that + * can't call ArrayLength() when it is not a C++11 constexpr function. + */ +#ifdef MOZ_HAVE_CXX11_CONSTEXPR +# define MOZ_ARRAY_LENGTH(array) mozilla::ArrayLength(array) +#else +# define MOZ_ARRAY_LENGTH(array) (sizeof(array)/sizeof((array)[0])) +#endif + +#endif /* mozilla_Util_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/WeakPtr.h b/scripting/javascript/spidermonkey-mac/include/mozilla/WeakPtr.h new file mode 100644 index 0000000000..b8437f5bcf --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/WeakPtr.h @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Weak pointer functionality, implemented as a mixin for use with any class. */ + +/** + * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting + * its lifetime. It works by creating a single shared reference counted object + * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo' + * clear the pointer in the WeakReference without having to know about all of + * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime + * of 'Foo'. + * + * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional + * dereference, and an additional heap allocated pointer sized object shared + * between all of the WeakPtrs. + * + * Example of usage: + * + * // To have a class C support weak pointers, inherit from SupportsWeakPtr. + * class C : public SupportsWeakPtr + * { + * public: + * int num; + * void act(); + * }; + * + * C* ptr = new C(); + * + * // Get weak pointers to ptr. The first time asWeakPtr is called + * // a reference counted WeakReference object is created that + * // can live beyond the lifetime of 'ptr'. The WeakReference + * // object will be notified of 'ptr's destruction. + * WeakPtr weak = ptr->asWeakPtr(); + * WeakPtr other = ptr->asWeakPtr(); + * + * // Test a weak pointer for validity before using it. + * if (weak) { + * weak->num = 17; + * weak->act(); + * } + * + * // Destroying the underlying object clears weak pointers to it. + * delete ptr; + * + * MOZ_ASSERT(!weak, "Deleting |ptr| clears weak pointers to it."); + * MOZ_ASSERT(!other, "Deleting |ptr| clears all weak pointers to it."); + * + * WeakPtr is typesafe and may be used with any class. It is not required that + * the class be reference-counted or allocated in any particular way. + * + * The API was loosely inspired by Chromium's weak_ptr.h: + * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h + */ + +#ifndef mozilla_WeakPtr_h_ +#define mozilla_WeakPtr_h_ + +#include "mozilla/Assertions.h" +#include "mozilla/NullPtr.h" +#include "mozilla/RefPtr.h" +#include "mozilla/TypeTraits.h" + +namespace mozilla { + +template class WeakPtr; + +template +class SupportsWeakPtr +{ + public: + WeakPtr asWeakPtr() { + if (!weakRef) + weakRef = new WeakReference(static_cast(this)); + return WeakPtr(weakRef); + } + + protected: + ~SupportsWeakPtr() { + MOZ_STATIC_ASSERT((IsBaseOf, T>::value), "T must derive from SupportsWeakPtr"); + if (weakRef) + weakRef->detach(); + } + + private: + friend class WeakPtr; + + // This can live beyond the lifetime of the class derived from SupportsWeakPtr. + class WeakReference : public RefCounted + { + public: + explicit WeakReference(T* p) : ptr(p) {} + T* get() const { + return ptr; + } + + private: + friend class WeakPtr; + friend class SupportsWeakPtr; + void detach() { + ptr = nullptr; + } + T* ptr; + }; + + RefPtr weakRef; +}; + +template +class WeakPtr +{ + public: + WeakPtr(const WeakPtr& o) : ref(o.ref) {} + // Ensure that ref is dereferenceable in the uninitialized state + WeakPtr() : ref(new typename SupportsWeakPtr::WeakReference(nullptr)) {} + + operator T*() const { + return ref->get(); + } + T& operator*() const { + return *ref->get(); + } + + T* operator->() const { + return ref->get(); + } + + T* get() const { + return ref->get(); + } + + private: + friend class SupportsWeakPtr; + + explicit WeakPtr(const RefPtr::WeakReference> &o) : ref(o) {} + + RefPtr::WeakReference> ref; +}; + +} // namespace mozilla + +#endif /* ifdef mozilla_WeakPtr_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id b/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id new file mode 100644 index 0000000000..a00daec551 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id @@ -0,0 +1 @@ +dddc2eb85889b606c2bcbdb93bc8a63e0d8edf8a \ No newline at end of file From 398c6593f07a8df02ded67c8d305b1fb8f553760 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 26 Jun 2013 23:45:08 -0700 Subject: [PATCH 02/43] JS Tests: Almost working on Mac --- .../contents.xcworkspacedata | 3 + .../libwebsockets/mac/include/libwebsockets.h | 993 ++++++++++++++++++ .../mac/lib/libwebsockets.a.REMOVED.git-id | 1 + .../project.pbxproj.REMOVED.git-id | 2 +- .../TestJavascript/proj.mac/AppController.h | 42 + .../TestJavascript/proj.mac/AppController.mm | 93 ++ .../TestJavascript/proj.mac/Icon.icns | Bin 0 -> 77152 bytes .../TestJavascript.xcodeproj/project.pbxproj | 817 ++++++++++++++ .../xcshareddata/TestJavascript.xccheckout | 63 ++ .../TestJavascript/proj.mac/Test_Prefix.pch | 7 + .../proj.mac/en.lproj/InfoPlist.strings | 2 + .../proj.mac/en.lproj/MainMenu.xib | 812 ++++++++++++++ .../Javascript/TestJavascript/proj.mac/main.m | 30 + 13 files changed, 2864 insertions(+), 1 deletion(-) create mode 100644 external/libwebsockets/mac/include/libwebsockets.h create mode 100644 external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id create mode 100644 samples/Javascript/TestJavascript/proj.mac/AppController.h create mode 100644 samples/Javascript/TestJavascript/proj.mac/AppController.mm create mode 100644 samples/Javascript/TestJavascript/proj.mac/Icon.icns create mode 100644 samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj create mode 100644 samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout create mode 100644 samples/Javascript/TestJavascript/proj.mac/Test_Prefix.pch create mode 100644 samples/Javascript/TestJavascript/proj.mac/en.lproj/InfoPlist.strings create mode 100644 samples/Javascript/TestJavascript/proj.mac/en.lproj/MainMenu.xib create mode 100644 samples/Javascript/TestJavascript/proj.mac/main.m diff --git a/cocos2d-mac.xcworkspace/contents.xcworkspacedata b/cocos2d-mac.xcworkspace/contents.xcworkspacedata index 99e1e01c8b..6f413213c3 100644 --- a/cocos2d-mac.xcworkspace/contents.xcworkspacedata +++ b/cocos2d-mac.xcworkspace/contents.xcworkspacedata @@ -7,6 +7,9 @@ + + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation: + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifndef __LIBWEBSOCKET_H__ +#define __LIBWEBSOCKET_H__ + +#ifdef __cplusplus +extern "C" { +#include +#endif + +#ifdef WIN32 + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#include +#include +#include "../win32port/win32helpers/websock-w32.h" + +#include "../win32port/win32helpers/gettimeofday.h" + +#define strcasecmp stricmp +#define getdtablesize() 30000 + +typedef int ssize_t; + +#define LWS_VISIBLE + +#ifdef LWS_DLL +#ifdef LWS_INTERNAL +#define LWS_EXTERN extern __declspec(dllexport) +#else +#define LWS_EXTERN extern __declspec(dllimport) +#endif +#else +#define LWS_EXTERN +#endif + +#else // NOT WIN32 +#include +#include + +#if defined(__GNUC__) +#define LWS_VISIBLE __attribute__((visibility("default"))) +#else +#define LWS_VISIBLE +#endif + +#endif + +#include + +#ifndef LWS_EXTERN +#define LWS_EXTERN extern +#endif + +#define CONTEXT_PORT_NO_LISTEN 0 +#define MAX_MUX_RECURSION 2 + +enum lws_log_levels { + LLL_ERR = 1 << 0, + LLL_WARN = 1 << 1, + LLL_NOTICE = 1 << 2, + LLL_INFO = 1 << 3, + LLL_DEBUG = 1 << 4, + LLL_PARSER = 1 << 5, + LLL_HEADER = 1 << 6, + LLL_EXT = 1 << 7, + LLL_CLIENT = 1 << 8, + LLL_LATENCY = 1 << 9, + + LLL_COUNT = 10 /* set to count of valid flags */ +}; + +LWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...); + +/* notice, warn and log are always compiled in */ +#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) +#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__) +#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__) +/* + * weaker logging can be deselected at configure time using --disable-debug + * that gets rid of the overhead of checking while keeping _warn and _err + * active + */ +#ifdef _DEBUG + +#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__) +#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__) +#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__) +#define lwsl_header(...) _lws_log(LLL_HEADER, __VA_ARGS__) +#define lwsl_ext(...) _lws_log(LLL_EXT, __VA_ARGS__) +#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__) +#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__) +LWS_VISIBLE LWS_EXTERN void lwsl_hexdump(void *buf, size_t len); + +#else /* no debug */ + +#define lwsl_info(...) +#define lwsl_debug(...) +#define lwsl_parser(...) +#define lwsl_header(...) +#define lwsl_ext(...) +#define lwsl_client(...) +#define lwsl_latency(...) +#define lwsl_hexdump(a, b) + +#endif + +enum libwebsocket_context_options { + LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2, + LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4, +}; + +enum libwebsocket_callback_reasons { + LWS_CALLBACK_ESTABLISHED, + LWS_CALLBACK_CLIENT_CONNECTION_ERROR, + LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH, + LWS_CALLBACK_CLIENT_ESTABLISHED, + LWS_CALLBACK_CLOSED, + LWS_CALLBACK_RECEIVE, + LWS_CALLBACK_CLIENT_RECEIVE, + LWS_CALLBACK_CLIENT_RECEIVE_PONG, + LWS_CALLBACK_CLIENT_WRITEABLE, + LWS_CALLBACK_SERVER_WRITEABLE, + LWS_CALLBACK_HTTP, + LWS_CALLBACK_HTTP_FILE_COMPLETION, + LWS_CALLBACK_HTTP_WRITEABLE, + LWS_CALLBACK_FILTER_NETWORK_CONNECTION, + LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION, + LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS, + LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS, + LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION, + LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER, + LWS_CALLBACK_CONFIRM_EXTENSION_OKAY, + LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED, + LWS_CALLBACK_PROTOCOL_INIT, + LWS_CALLBACK_PROTOCOL_DESTROY, + /* external poll() management support */ + LWS_CALLBACK_ADD_POLL_FD, + LWS_CALLBACK_DEL_POLL_FD, + LWS_CALLBACK_SET_MODE_POLL_FD, + LWS_CALLBACK_CLEAR_MODE_POLL_FD, +}; + +#ifndef LWS_NO_EXTENSIONS +enum libwebsocket_extension_callback_reasons { + LWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT, + LWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT, + LWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT, + LWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT, + LWS_EXT_CALLBACK_CONSTRUCT, + LWS_EXT_CALLBACK_CLIENT_CONSTRUCT, + LWS_EXT_CALLBACK_CHECK_OK_TO_REALLY_CLOSE, + LWS_EXT_CALLBACK_CHECK_OK_TO_PROPOSE_EXTENSION, + LWS_EXT_CALLBACK_DESTROY, + LWS_EXT_CALLBACK_DESTROY_ANY_WSI_CLOSING, + LWS_EXT_CALLBACK_ANY_WSI_ESTABLISHED, + LWS_EXT_CALLBACK_PACKET_RX_PREPARSE, + LWS_EXT_CALLBACK_PACKET_TX_PRESEND, + LWS_EXT_CALLBACK_PACKET_TX_DO_SEND, + LWS_EXT_CALLBACK_HANDSHAKE_REPLY_TX, + LWS_EXT_CALLBACK_FLUSH_PENDING_TX, + LWS_EXT_CALLBACK_EXTENDED_PAYLOAD_RX, + LWS_EXT_CALLBACK_CAN_PROXY_CLIENT_CONNECTION, + LWS_EXT_CALLBACK_1HZ, + LWS_EXT_CALLBACK_REQUEST_ON_WRITEABLE, + LWS_EXT_CALLBACK_IS_WRITEABLE, + LWS_EXT_CALLBACK_PAYLOAD_TX, + LWS_EXT_CALLBACK_PAYLOAD_RX, +}; +#endif + +enum libwebsocket_write_protocol { + LWS_WRITE_TEXT, + LWS_WRITE_BINARY, + LWS_WRITE_CONTINUATION, + LWS_WRITE_HTTP, + + /* special 04+ opcodes */ + + LWS_WRITE_CLOSE, + LWS_WRITE_PING, + LWS_WRITE_PONG, + + /* flags */ + + LWS_WRITE_NO_FIN = 0x40, + /* + * client packet payload goes out on wire unmunged + * only useful for security tests since normal servers cannot + * decode the content if used + */ + LWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80 +}; + +/* + * you need these to look at headers that have been parsed if using the + * LWS_CALLBACK_FILTER_CONNECTION callback. If a header from the enum + * list below is absent, .token = NULL and token_len = 0. Otherwise .token + * points to .token_len chars containing that header content. + */ + +struct lws_tokens { + char *token; + int token_len; +}; + +enum lws_token_indexes { + WSI_TOKEN_GET_URI, + WSI_TOKEN_HOST, + WSI_TOKEN_CONNECTION, + WSI_TOKEN_KEY1, + WSI_TOKEN_KEY2, + WSI_TOKEN_PROTOCOL, + WSI_TOKEN_UPGRADE, + WSI_TOKEN_ORIGIN, + WSI_TOKEN_DRAFT, + WSI_TOKEN_CHALLENGE, + + /* new for 04 */ + WSI_TOKEN_KEY, + WSI_TOKEN_VERSION, + WSI_TOKEN_SWORIGIN, + + /* new for 05 */ + WSI_TOKEN_EXTENSIONS, + + /* client receives these */ + WSI_TOKEN_ACCEPT, + WSI_TOKEN_NONCE, + WSI_TOKEN_HTTP, + WSI_TOKEN_MUXURL, + + /* use token storage to stash these */ + + _WSI_TOKEN_CLIENT_SENT_PROTOCOLS, + _WSI_TOKEN_CLIENT_PEER_ADDRESS, + _WSI_TOKEN_CLIENT_URI, + _WSI_TOKEN_CLIENT_HOST, + _WSI_TOKEN_CLIENT_ORIGIN, + + /* always last real token index*/ + WSI_TOKEN_COUNT, + /* parser state additions */ + WSI_TOKEN_NAME_PART, + WSI_TOKEN_SKIPPING, + WSI_TOKEN_SKIPPING_SAW_CR, + WSI_PARSING_COMPLETE, + WSI_INIT_TOKEN_MUXURL, +}; + +/* + * From RFC 6455 + 1000 + + 1000 indicates a normal closure, meaning that the purpose for + which the connection was established has been fulfilled. + + 1001 + + 1001 indicates that an endpoint is "going away", such as a server + going down or a browser having navigated away from a page. + + 1002 + + 1002 indicates that an endpoint is terminating the connection due + to a protocol error. + + 1003 + + 1003 indicates that an endpoint is terminating the connection + because it has received a type of data it cannot accept (e.g., an + endpoint that understands only text data MAY send this if it + receives a binary message). + + 1004 + + Reserved. The specific meaning might be defined in the future. + + 1005 + + 1005 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. It is designated for use in + applications expecting a status code to indicate that no status + code was actually present. + + 1006 + + 1006 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. It is designated for use in + applications expecting a status code to indicate that the + connection was closed abnormally, e.g., without sending or + receiving a Close control frame. + + 1007 + + 1007 indicates that an endpoint is terminating the connection + because it has received data within a message that was not + consistent with the type of the message (e.g., non-UTF-8 [RFC3629] + data within a text message). + + 1008 + + 1008 indicates that an endpoint is terminating the connection + because it has received a message that violates its policy. This + is a generic status code that can be returned when there is no + other more suitable status code (e.g., 1003 or 1009) or if there + is a need to hide specific details about the policy. + + 1009 + + 1009 indicates that an endpoint is terminating the connection + because it has received a message that is too big for it to + process. + + 1010 + + 1010 indicates that an endpoint (client) is terminating the + connection because it has expected the server to negotiate one or + more extension, but the server didn't return them in the response + message of the WebSocket handshake. The list of extensions that + are needed SHOULD appear in the /reason/ part of the Close frame. + Note that this status code is not used by the server, because it + can fail the WebSocket handshake instead. + + 1011 + + 1011 indicates that a server is terminating the connection because + it encountered an unexpected condition that prevented it from + fulfilling the request. + + 1015 + + 1015 is a reserved value and MUST NOT be set as a status code in a + Close control frame by an endpoint. It is designated for use in + applications expecting a status code to indicate that the + connection was closed due to a failure to perform a TLS handshake + (e.g., the server certificate can't be verified). +*/ + +enum lws_close_status { + LWS_CLOSE_STATUS_NOSTATUS = 0, + LWS_CLOSE_STATUS_NORMAL = 1000, + LWS_CLOSE_STATUS_GOINGAWAY = 1001, + LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002, + LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003, + LWS_CLOSE_STATUS_RESERVED = 1004, + LWS_CLOSE_STATUS_NO_STATUS = 1005, + LWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006, + LWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007, + LWS_CLOSE_STATUS_POLICY_VIOLATION = 1008, + LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009, + LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010, + LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011, + LWS_CLOSE_STATUS_TLS_FAILURE = 1015, +}; + +struct libwebsocket; +struct libwebsocket_context; +/* needed even with extensions disabled for create context */ +struct libwebsocket_extension; + +/** + * callback_function() - User server actions + * @context: Websockets context + * @wsi: Opaque websocket instance pointer + * @reason: The reason for the call + * @user: Pointer to per-session user data allocated by library + * @in: Pointer used for some callback reasons + * @len: Length set for some callback reasons + * + * This callback is the way the user controls what is served. All the + * protocol detail is hidden and handled by the library. + * + * For each connection / session there is user data allocated that is + * pointed to by "user". You set the size of this user data area when + * the library is initialized with libwebsocket_create_server. + * + * You get an opportunity to initialize user data when called back with + * LWS_CALLBACK_ESTABLISHED reason. + * + * LWS_CALLBACK_ESTABLISHED: after the server completes a handshake with + * an incoming client + * + * LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has + * been unable to complete a handshake with the remote server + * + * LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: this is the last chance for the + * client user code to examine the http headers + * and decide to reject the connection. If the + * content in the headers is interesting to the + * client (url, etc) it needs to copy it out at + * this point since it will be destroyed before + * the CLIENT_ESTABLISHED call + * + * LWS_CALLBACK_CLIENT_ESTABLISHED: after your client connection completed + * a handshake with the remote server + * + * LWS_CALLBACK_CLOSED: when the websocket session ends + * + * LWS_CALLBACK_RECEIVE: data has appeared for this server endpoint from a + * remote client, it can be found at *in and is + * len bytes long + * + * LWS_CALLBACK_CLIENT_RECEIVE_PONG: if you elected to see PONG packets, + * they appear with this callback reason. PONG + * packets only exist in 04+ protocol + * + * LWS_CALLBACK_CLIENT_RECEIVE: data has appeared from the server for the + * client connection, it can be found at *in and + * is len bytes long + * + * LWS_CALLBACK_HTTP: an http request has come from a client that is not + * asking to upgrade the connection to a websocket + * one. This is a chance to serve http content, + * for example, to send a script to the client + * which will then open the websockets connection. + * @in points to the URI path requested and + * libwebsockets_serve_http_file() makes it very + * simple to send back a file to the client. + * Normally after sending the file you are done + * with the http connection, since the rest of the + * activity will come by websockets from the script + * that was delivered by http, so you will want to + * return 1; to close and free up the connection. + * That's important because it uses a slot in the + * total number of client connections allowed set + * by MAX_CLIENTS. + * + * LWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol + * link now. + * + * LWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down + * http link has completed. + * + * LWS_CALLBACK_CLIENT_WRITEABLE: + * LWS_CALLBACK_SERVER_WRITEABLE: If you call + * libwebsocket_callback_on_writable() on a connection, you will + * get one of these callbacks coming when the connection socket + * is able to accept another write packet without blocking. + * If it already was able to take another packet without blocking, + * you'll get this callback at the next call to the service loop + * function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE + * and servers get LWS_CALLBACK_SERVER_WRITEABLE. + * + * LWS_CALLBACK_FILTER_NETWORK_CONNECTION: called when a client connects to + * the server at network level; the connection is accepted but then + * passed to this callback to decide whether to hang up immediately + * or not, based on the client IP. @in contains the connection + * socket's descriptor. Return non-zero to terminate + * the connection before sending or receiving anything. + * Because this happens immediately after the network connection + * from the client, there's no websocket protocol selected yet so + * this callback is issued only to protocol 0. + * + * LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: called when the handshake has + * been received and parsed from the client, but the response is + * not sent yet. Return non-zero to disallow the connection. + * @user is a pointer to an array of struct lws_tokens, you can + * use the header enums lws_token_indexes from libwebsockets.h + * to check for and read the supported header presence and + * content before deciding to allow the handshake to proceed or + * to kill the connection. + * + * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configured for + * including OpenSSL support, this callback allows your user code + * to perform extra SSL_CTX_load_verify_locations() or similar + * calls to direct OpenSSL where to find certificates the client + * can use to confirm the remote server identity. @user is the + * OpenSSL SSL_CTX* + * + * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS: if configured for + * including OpenSSL support, this callback allows your user code + * to load extra certifcates into the server which allow it to + * verify the validity of certificates returned by clients. @user + * is the server's OpenSSL SSL_CTX* + * + * LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: if the + * libwebsockets context was created with the option + * LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this + * callback is generated during OpenSSL verification of the cert + * sent from the client. It is sent to protocol[0] callback as + * no protocol has been negotiated on the connection yet. + * Notice that the libwebsockets context and wsi are both NULL + * during this callback. See + * http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html + * to understand more detail about the OpenSSL callback that + * generates this libwebsockets callback and the meanings of the + * arguments passed. In this callback, @user is the x509_ctx, + * @in is the ssl pointer and @len is preverify_ok + * Notice that this callback maintains libwebsocket return + * conventions, return 0 to mean the cert is OK or 1 to fail it. + * This also means that if you don't handle this callback then + * the default callback action of returning 0 allows the client + * certificates. + * + * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: this callback happens + * when a client handshake is being compiled. @user is NULL, + * @in is a char **, it's pointing to a char * which holds the + * next location in the header buffer where you can add + * headers, and @len is the remaining space in the header buffer, + * which is typically some hundreds of bytes. So, to add a canned + * cookie, your handler code might look similar to: + * + * char **p = (char **)in; + * + * if (len < 100) + * return 1; + * + * *p += sprintf(*p, "Cookie: a=b\x0d\x0a"); + * + * return 0; + * + * Notice if you add anything, you just have to take care about + * the CRLF on the line you added. Obviously this callback is + * optional, if you don't handle it everything is fine. + * + * Notice the callback is coming to protocols[0] all the time, + * because there is no specific protocol handshook yet. + * + * LWS_CALLBACK_CONFIRM_EXTENSION_OKAY: When the server handshake code + * sees that it does support a requested extension, before + * accepting the extension by additing to the list sent back to + * the client it gives this callback just to check that it's okay + * to use that extension. It calls back to the requested protocol + * and with @in being the extension name, @len is 0 and @user is + * valid. Note though at this time the ESTABLISHED callback hasn't + * happened yet so if you initialize @user content there, @user + * content during this callback might not be useful for anything. + * Notice this callback comes to protocols[0]. + * + * LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED: When a client + * connection is being prepared to start a handshake to a server, + * each supported extension is checked with protocols[0] callback + * with this reason, giving the user code a chance to suppress the + * claim to support that extension by returning non-zero. If + * unhandled, by default 0 will be returned and the extension + * support included in the header to the server. Notice this + * callback comes to protocols[0]. + * + * LWS_CALLBACK_PROTOCOL_INIT: One-time call per protocol so it can + * do initial setup / allocations etc + * + * LWS_CALLBACK_PROTOCOL_DESTROY: One-time call per protocol indicating + * this protocol won't get used at all after this callback, the + * context is getting destroyed. Take the opportunity to + * deallocate everything that was allocated by the protocol. + * + * The next four reasons are optional and only need taking care of if you + * will be integrating libwebsockets sockets into an external polling + * array. + * + * LWS_CALLBACK_ADD_POLL_FD: libwebsocket deals with its poll() loop + * internally, but in the case you are integrating with another + * server you will need to have libwebsocket sockets share a + * polling array with the other server. This and the other + * POLL_FD related callbacks let you put your specialized + * poll array interface code in the callback for protocol 0, the + * first protocol you support, usually the HTTP protocol in the + * serving case. This callback happens when a socket needs to be + * added to the polling loop: @in contains the fd, and + * @len is the events bitmap (like, POLLIN). If you are using the + * internal polling loop (the "service" callback), you can just + * ignore these callbacks. + * + * LWS_CALLBACK_DEL_POLL_FD: This callback happens when a socket descriptor + * needs to be removed from an external polling array. @in is + * the socket desricptor. If you are using the internal polling + * loop, you can just ignore it. + * + * LWS_CALLBACK_SET_MODE_POLL_FD: This callback happens when libwebsockets + * wants to modify the events for the socket descriptor in @in. + * The handler should OR @len on to the events member of the pollfd + * struct for this socket descriptor. If you are using the + * internal polling loop, you can just ignore it. + * + * LWS_CALLBACK_CLEAR_MODE_POLL_FD: This callback occurs when libwebsockets + * wants to modify the events for the socket descriptor in @in. + * The handler should AND ~@len on to the events member of the + * pollfd struct for this socket descriptor. If you are using the + * internal polling loop, you can just ignore it. + */ +LWS_VISIBLE LWS_EXTERN int callback(struct libwebsocket_context *context, + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, void *user, + void *in, size_t len); + +typedef int (callback_function)(struct libwebsocket_context *context, + struct libwebsocket *wsi, + enum libwebsocket_callback_reasons reason, void *user, + void *in, size_t len); + +#ifndef LWS_NO_EXTENSIONS +/** + * extension_callback_function() - Hooks to allow extensions to operate + * @context: Websockets context + * @ext: This extension + * @wsi: Opaque websocket instance pointer + * @reason: The reason for the call + * @user: Pointer to per-session user data allocated by library + * @in: Pointer used for some callback reasons + * @len: Length set for some callback reasons + * + * Each extension that is active on a particular connection receives + * callbacks during the connection lifetime to allow the extension to + * operate on websocket data and manage itself. + * + * Libwebsockets takes care of allocating and freeing "user" memory for + * each active extension on each connection. That is what is pointed to + * by the @user parameter. + * + * LWS_EXT_CALLBACK_CONSTRUCT: called when the server has decided to + * select this extension from the list provided by the client, + * just before the server will send back the handshake accepting + * the connection with this extension active. This gives the + * extension a chance to initialize its connection context found + * in @user. + * + * LWS_EXT_CALLBACK_CLIENT_CONSTRUCT: same as LWS_EXT_CALLBACK_CONSTRUCT + * but called when client is instantiating this extension. Some + * extensions will work the same on client and server side and then + * you can just merge handlers for both CONSTRUCTS. + * + * LWS_EXT_CALLBACK_DESTROY: called when the connection the extension was + * being used on is about to be closed and deallocated. It's the + * last chance for the extension to deallocate anything it has + * allocated in the user data (pointed to by @user) before the + * user data is deleted. This same callback is used whether you + * are in client or server instantiation context. + * + * LWS_EXT_CALLBACK_PACKET_RX_PREPARSE: when this extension was active on + * a connection, and a packet of data arrived at the connection, + * it is passed to this callback to give the extension a chance to + * change the data, eg, decompress it. @user is pointing to the + * extension's private connection context data, @in is pointing + * to an lws_tokens struct, it consists of a char * pointer called + * token, and an int called token_len. At entry, these are + * set to point to the received buffer and set to the content + * length. If the extension will grow the content, it should use + * a new buffer allocated in its private user context data and + * set the pointed-to lws_tokens members to point to its buffer. + * + * LWS_EXT_CALLBACK_PACKET_TX_PRESEND: this works the same way as + * LWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the + * extension a chance to change websocket data just before it will + * be sent out. Using the same lws_token pointer scheme in @in, + * the extension can change the buffer and the length to be + * transmitted how it likes. Again if it wants to grow the + * buffer safely, it should copy the data into its own buffer and + * set the lws_tokens token pointer to it. + */ +LWS_VISIBLE LWS_EXTERN int extension_callback(struct libwebsocket_context *context, + struct libwebsocket_extension *ext, + struct libwebsocket *wsi, + enum libwebsocket_extension_callback_reasons reason, + void *user, void *in, size_t len); + +typedef int (extension_callback_function)(struct libwebsocket_context *context, + struct libwebsocket_extension *ext, + struct libwebsocket *wsi, + enum libwebsocket_extension_callback_reasons reason, + void *user, void *in, size_t len); +#endif + +/** + * struct libwebsocket_protocols - List of protocols and handlers server + * supports. + * @name: Protocol name that must match the one given in the client + * Javascript new WebSocket(url, 'protocol') name + * @callback: The service callback used for this protocol. It allows the + * service action for an entire protocol to be encapsulated in + * the protocol-specific callback + * @per_session_data_size: Each new connection using this protocol gets + * this much memory allocated on connection establishment and + * freed on connection takedown. A pointer to this per-connection + * allocation is passed into the callback in the 'user' parameter + * @rx_buffer_size: if you want atomic frames delivered to the callback, you + * should set this to the size of the biggest legal frame that + * you support. If the frame size is exceeded, there is no + * error, but the buffer will spill to the user callback when + * full, which you can detect by using + * libwebsockets_remaining_packet_payload(). Notice that you + * just talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING + * and post-padding are automatically also allocated on top. + * @owning_server: the server init call fills in this opaque pointer when + * registering this protocol with the server. + * @protocol_index: which protocol we are starting from zero + * + * This structure represents one protocol supported by the server. An + * array of these structures is passed to libwebsocket_create_server() + * allows as many protocols as you like to be handled by one server. + */ + +struct libwebsocket_protocols { + const char *name; + callback_function *callback; + size_t per_session_data_size; + size_t rx_buffer_size; + + /* + * below are filled in on server init and can be left uninitialized, + * no need for user to use them directly either + */ + + struct libwebsocket_context *owning_server; + int protocol_index; +}; + +#ifndef LWS_NO_EXTENSIONS +/** + * struct libwebsocket_extension - An extension we know how to cope with + * + * @name: Formal extension name, eg, "deflate-stream" + * @callback: Service callback + * @per_session_data_size: Libwebsockets will auto-malloc this much + * memory for the use of the extension, a pointer + * to it comes in the @user callback parameter + * @per_context_private_data: Optional storage for this extension that + * is per-context, so it can track stuff across + * all sessions, etc, if it wants + */ + +struct libwebsocket_extension { + const char *name; + extension_callback_function *callback; + size_t per_session_data_size; + void *per_context_private_data; +}; +#endif + +/** + * struct lws_context_creation_info: parameters to create context with + * + * @port: Port to listen on... you can use 0 to suppress listening on + * any port, that's what you want if you are not running a + * websocket server at all but just using it as a client + * @iface: NULL to bind the listen socket to all interfaces, or the + * interface name, eg, "eth2" + * @protocols: Array of structures listing supported protocols and a protocol- + * specific callback for each one. The list is ended with an + * entry that has a NULL callback pointer. + * It's not const because we write the owning_server member + * @extensions: NULL or array of libwebsocket_extension structs listing the + * extensions this context supports. If you configured with + * --without-extensions, you should give NULL here. + * @ssl_cert_filepath: If libwebsockets was compiled to use ssl, and you want + * to listen using SSL, set to the filepath to fetch the + * server cert from, otherwise NULL for unencrypted + * @ssl_private_key_filepath: filepath to private key if wanting SSL mode, + * else ignored + * @ssl_ca_filepath: CA certificate filepath or NULL + * @ssl_cipher_list: List of valid ciphers to use (eg, + * "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" + * or you can leave it as NULL to get "DEFAULT" + * @gid: group id to change to after setting listen socket, or -1. + * @uid: user id to change to after setting listen socket, or -1. + * @options: 0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK + * @user: optional user pointer that can be recovered via the context + * pointer using libwebsocket_context_user + * @ka_time: 0 for no keepalive, otherwise apply this keepalive timeout to + * all libwebsocket sockets, client or server + * @ka_probes: if ka_time was nonzero, after the timeout expires how many + * times to try to get a response from the peer before giving up + * and killing the connection + * @ka_interval: if ka_time was nonzero, how long to wait before each ka_probes + * attempt + */ + +struct lws_context_creation_info { + int port; + const char *iface; + struct libwebsocket_protocols *protocols; + struct libwebsocket_extension *extensions; + const char *ssl_cert_filepath; + const char *ssl_private_key_filepath; + const char *ssl_ca_filepath; + const char *ssl_cipher_list; + int gid; + int uid; + unsigned int options; + void *user; + int ka_time; + int ka_probes; + int ka_interval; + +}; + +LWS_VISIBLE LWS_EXTERN +void lws_set_log_level(int level, + void (*log_emit_function)(int level, const char *line)); + +LWS_VISIBLE LWS_EXTERN void +lwsl_emit_syslog(int level, const char *line); + +LWS_VISIBLE LWS_EXTERN struct libwebsocket_context * +libwebsocket_create_context(struct lws_context_creation_info *info); + +LWS_VISIBLE LWS_EXTERN void +libwebsocket_context_destroy(struct libwebsocket_context *context); + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_service(struct libwebsocket_context *context, int timeout_ms); + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_service_fd(struct libwebsocket_context *context, + struct pollfd *pollfd); + +LWS_VISIBLE LWS_EXTERN void * +libwebsocket_context_user(struct libwebsocket_context *context); + +/* + * IMPORTANT NOTICE! + * + * When sending with websocket protocol (LWS_WRITE_TEXT or LWS_WRITE_BINARY) + * the send buffer has to have LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE + * buf, and LWS_SEND_BUFFER_POST_PADDING bytes valid AFTER (buf + len). + * + * This allows us to add protocol info before and after the data, and send as + * one packet on the network without payload copying, for maximum efficiency. + * + * So for example you need this kind of code to use libwebsocket_write with a + * 128-byte payload + * + * char buf[LWS_SEND_BUFFER_PRE_PADDING + 128 + LWS_SEND_BUFFER_POST_PADDING]; + * + * // fill your part of the buffer... for example here it's all zeros + * memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, 128); + * + * libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], 128, + * LWS_WRITE_TEXT); + * + * When sending LWS_WRITE_HTTP, there is no protocol addition and you can just + * use the whole buffer without taking care of the above. + */ + +/* + * this is the frame nonce plus two header plus 8 length + * there's an additional two for mux extension per mux nesting level + * 2 byte prepend on close will already fit because control frames cannot use + * the big length style + */ + +#define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION)) +#define LWS_SEND_BUFFER_POST_PADDING 4 + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len, + enum libwebsocket_write_protocol protocol); + +LWS_VISIBLE LWS_EXTERN int +libwebsockets_serve_http_file(struct libwebsocket_context *context, + struct libwebsocket *wsi, const char *file, + const char *content_type); +LWS_VISIBLE LWS_EXTERN int +libwebsockets_serve_http_file_fragment(struct libwebsocket_context *context, + struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN const struct libwebsocket_protocols * +libwebsockets_get_protocol(struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_callback_on_writable(struct libwebsocket_context *context, + struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_callback_on_writable_all_protocol( + const struct libwebsocket_protocols *protocol); + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_get_socket_fd(struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_is_final_fragment(struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN unsigned char +libwebsocket_get_reserved_bits(struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable); + +LWS_VISIBLE LWS_EXTERN void +libwebsocket_rx_flow_allow_all_protocol( + const struct libwebsocket_protocols *protocol); + +LWS_VISIBLE LWS_EXTERN size_t +libwebsockets_remaining_packet_payload(struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN struct libwebsocket * +libwebsocket_client_connect(struct libwebsocket_context *clients, + const char *address, + int port, + int ssl_connection, + const char *path, + const char *host, + const char *origin, + const char *protocol, + int ietf_version_or_minus_one); + +LWS_VISIBLE LWS_EXTERN struct libwebsocket * +libwebsocket_client_connect_extended(struct libwebsocket_context *clients, + const char *address, + int port, + int ssl_connection, + const char *path, + const char *host, + const char *origin, + const char *protocol, + int ietf_version_or_minus_one, + void *userdata); + +LWS_VISIBLE LWS_EXTERN const char * +libwebsocket_canonical_hostname(struct libwebsocket_context *context); + + +LWS_VISIBLE LWS_EXTERN void +libwebsockets_get_peer_addresses(struct libwebsocket_context *context, + struct libwebsocket *wsi, int fd, char *name, int name_len, + char *rip, int rip_len); + +LWS_VISIBLE LWS_EXTERN int +libwebsockets_get_random(struct libwebsocket_context *context, + void *buf, int len); + +LWS_VISIBLE LWS_EXTERN int +lws_daemonize(const char *_lock_path); + +LWS_VISIBLE LWS_EXTERN int +lws_send_pipe_choked(struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN int +lws_frame_is_binary(struct libwebsocket *wsi); + +LWS_VISIBLE LWS_EXTERN unsigned char * +libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md); + +LWS_VISIBLE LWS_EXTERN int +lws_b64_encode_string(const char *in, int in_len, char *out, int out_size); + +LWS_VISIBLE LWS_EXTERN int +lws_b64_decode_string(const char *in, char *out, int out_size); + +LWS_VISIBLE LWS_EXTERN const char * +lws_get_library_version(void); + +/* access to headers... only valid while headers valid */ + +LWS_VISIBLE LWS_EXTERN int +lws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h); + +LWS_VISIBLE LWS_EXTERN int +lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, + enum lws_token_indexes h); + +/* + * Note: this is not normally needed as a user api. It's provided in case it is + * useful when integrating with other app poll loop service code. + */ + +LWS_VISIBLE LWS_EXTERN int +libwebsocket_read(struct libwebsocket_context *context, + struct libwebsocket *wsi, + unsigned char *buf, size_t len); + +#ifndef LWS_NO_EXTENSIONS +LWS_VISIBLE LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions(); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id b/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id new file mode 100644 index 0000000000..07244313a9 --- /dev/null +++ b/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id @@ -0,0 +1 @@ +7c6e7415c9d9fd3c6a002191f7d2c486aacf5204 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index 076eec3ddf..bb28a0782b 100644 --- a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -9ae9939f85833280aac46f6be8bddf05b869bab8 \ No newline at end of file +d81b281e5f46de12ac714ea968ad8c352c70af3e \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/AppController.h b/samples/Javascript/TestJavascript/proj.mac/AppController.h new file mode 100644 index 0000000000..96c717304b --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/AppController.h @@ -0,0 +1,42 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#pragma once + +#import "cocos2d.h" +#import "EAGLView.h" + +@interface AppController : NSObject + { + NSWindow *window; + CCEAGLView *glView; + } + + @property (nonatomic, assign) IBOutlet NSWindow* window; + @property (nonatomic, assign) IBOutlet CCEAGLView* glView; + + -(IBAction) toggleFullScreen:(id)sender; + -(IBAction) exitFullScreen:(id)sender; + +@end diff --git a/samples/Javascript/TestJavascript/proj.mac/AppController.mm b/samples/Javascript/TestJavascript/proj.mac/AppController.mm new file mode 100644 index 0000000000..0d30617caa --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/AppController.mm @@ -0,0 +1,93 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "AppController.h" +#import "AppDelegate.h" + +@implementation AppController + + static AppDelegate s_sharedApplication; + + @synthesize window, glView; + + -(void) applicationDidFinishLaunching:(NSNotification *)aNotification + { + // create the window + // note that using NSResizableWindowMask causes the window to be a little + // smaller and therefore ipad graphics are not loaded + NSRect rect = NSMakeRect(200, 200, 480, 320); + window = [[NSWindow alloc] initWithContentRect:rect + styleMask:( NSClosableWindowMask | NSTitledWindowMask ) + backing:NSBackingStoreBuffered + defer:YES]; + + NSOpenGLPixelFormatAttribute attributes[] = { + NSOpenGLPFADoubleBuffer, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAStencilSize, 8, + 0 + }; + + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease]; + + // allocate our GL view + // (isn't there already a shared CCEAGLView?) + glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; + + // set window parameters + [window becomeFirstResponder]; + [window setContentView:glView]; + [window setTitle:@"TestCpp"]; + [window makeKeyAndOrderFront:self]; + [window setAcceptsMouseMovedEvents:NO]; + + cocos2d::Application::sharedApplication()->run(); + } + + -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication + { + return YES; + } + + -(void) dealloc + { + cocos2d::Director::sharedDirector()->end(); + [super dealloc]; + } + +#pragma mark - +#pragma mark IB Actions + + -(IBAction) toggleFullScreen:(id)sender + { + CCEAGLView* pView = [CCEAGLView sharedEGLView]; + [pView setFullScreen:!pView.isFullScreen]; + } + + -(IBAction) exitFullScreen:(id)sender + { + [[CCEAGLView sharedEGLView] setFullScreen:NO]; + } + +@end diff --git a/samples/Javascript/TestJavascript/proj.mac/Icon.icns b/samples/Javascript/TestJavascript/proj.mac/Icon.icns new file mode 100644 index 0000000000000000000000000000000000000000..285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c GIT binary patch literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?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zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX literal 0 HcmV?d00001 diff --git a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..ead3eecf60 --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj @@ -0,0 +1,817 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 15A3D5631682F20C002FB0C5 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4621682F14C002FB0C5 /* main.js */; }; + 15A3D5651682F20C002FB0C5 /* tests_resources-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */; }; + 15A3D5681682F20C002FB0C5 /* tests-main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4741682F14C002FB0C5 /* tests-main.js */; }; + 1A4C3F1317784B6000EDFB3B /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */; }; + 1A4C3F1417784B6000EDFB3B /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */; }; + 1A4C3F1517784B6000EDFB3B /* libCocosDenshion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */; }; + 1A4C3F1617784B6000EDFB3B /* libextensions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1117784B6000EDFB3B /* libextensions.a */; }; + 1A4C3F1717784B6000EDFB3B /* libjsbindings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1217784B6000EDFB3B /* libjsbindings.a */; }; + 1A6B05C517782A2400FFE52B /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6B05C417782A2400FFE52B /* libsqlite3.dylib */; }; + 1A6B05C717782B0500FFE52B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6B05C617782B0500FFE52B /* libz.dylib */; }; + 1A6E468A177812D20055514D /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4672177812AF0055514D /* jsb.js */; }; + 1A6E468B177812D20055514D /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4673177812AF0055514D /* jsb_chipmunk.js */; }; + 1A6E468C177812D20055514D /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4674177812AF0055514D /* jsb_chipmunk_constants.js */; }; + 1A6E468D177812D20055514D /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4675177812AF0055514D /* jsb_cocos2d.js */; }; + 1A6E468E177812D20055514D /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4676177812AF0055514D /* jsb_cocos2d_constants.js */; }; + 1A6E468F177812D20055514D /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4677177812AF0055514D /* jsb_cocos2d_extension.js */; }; + 1A6E4690177812D20055514D /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4678177812AF0055514D /* jsb_cocosbuilder.js */; }; + 1A6E4691177812D20055514D /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4679177812AF0055514D /* jsb_debugger.js */; }; + 1A6E4692177812D20055514D /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467A177812AF0055514D /* jsb_opengl.js */; }; + 1A6E4693177812D20055514D /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467B177812AF0055514D /* jsb_opengl_constants.js */; }; + 1A6E4694177812D20055514D /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467C177812AF0055514D /* jsb_sys.js */; }; + 1A6E4695177812D20055514D /* main.debug.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467D177812AF0055514D /* main.debug.js */; }; + 1A80332A1728DECD00240CC3 /* EffectsAdvancedTest in Resources */ = {isa = PBXBuildFile; fileRef = 1A8033291728DECD00240CC3 /* EffectsAdvancedTest */; }; + 1A80332C1728F1FB00240CC3 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1A80332B1728F1FB00240CC3 /* res */; }; + 1AA51A9F16F708FA000FDF05 /* ActionManagerTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7816F708FA000FDF05 /* ActionManagerTest */; }; + 1AA51AA016F708FA000FDF05 /* ActionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7916F708FA000FDF05 /* ActionsTest */; }; + 1AA51AA116F708FA000FDF05 /* BaseTestLayer in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7A16F708FA000FDF05 /* BaseTestLayer */; }; + 1AA51AA216F708FA000FDF05 /* Box2dTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7B16F708FA000FDF05 /* Box2dTest */; }; + 1AA51AA316F708FA000FDF05 /* ChipmunkTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7C16F708FA000FDF05 /* ChipmunkTest */; }; + 1AA51AA416F708FA000FDF05 /* ClickAndMoveTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */; }; + 1AA51AA516F708FA000FDF05 /* CocosDenshionTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */; }; + 1AA51AA616F708FA000FDF05 /* CocosNodeTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7F16F708FA000FDF05 /* CocosNodeTest */; }; + 1AA51AA716F708FA000FDF05 /* CurrentLanguageTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */; }; + 1AA51AA816F708FA000FDF05 /* DrawPrimitivesTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8116F708FA000FDF05 /* DrawPrimitivesTest */; }; + 1AA51AA916F708FA000FDF05 /* EaseActionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8216F708FA000FDF05 /* EaseActionsTest */; }; + 1AA51AAA16F708FA000FDF05 /* EffectsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8316F708FA000FDF05 /* EffectsTest */; }; + 1AA51AAB16F708FA000FDF05 /* EventTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8416F708FA000FDF05 /* EventTest */; }; + 1AA51AAC16F708FA000FDF05 /* ExtensionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8516F708FA000FDF05 /* ExtensionsTest */; }; + 1AA51AAD16F708FA000FDF05 /* FileUtils in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8616F708FA000FDF05 /* FileUtils */; }; + 1AA51AAE16F708FA000FDF05 /* FontTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8716F708FA000FDF05 /* FontTest */; }; + 1AA51AAF16F708FA000FDF05 /* IntervalTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8816F708FA000FDF05 /* IntervalTest */; }; + 1AA51AB016F708FA000FDF05 /* LabelTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8916F708FA000FDF05 /* LabelTest */; }; + 1AA51AB116F708FA000FDF05 /* LayerTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8A16F708FA000FDF05 /* LayerTest */; }; + 1AA51AB216F708FA000FDF05 /* MenuTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8B16F708FA000FDF05 /* MenuTest */; }; + 1AA51AB316F708FA000FDF05 /* OpenGLTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8C16F708FA000FDF05 /* OpenGLTest */; }; + 1AA51AB416F708FA000FDF05 /* ParallaxTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8D16F708FA000FDF05 /* ParallaxTest */; }; + 1AA51AB516F708FA000FDF05 /* ParticleTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8E16F708FA000FDF05 /* ParticleTest */; }; + 1AA51AB616F708FA000FDF05 /* PerformanceTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8F16F708FA000FDF05 /* PerformanceTest */; }; + 1AA51AB716F708FA000FDF05 /* Presentation in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9016F708FA000FDF05 /* Presentation */; }; + 1AA51AB816F708FA000FDF05 /* ProgressActionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9116F708FA000FDF05 /* ProgressActionsTest */; }; + 1AA51AB916F708FA000FDF05 /* RenderTextureTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9216F708FA000FDF05 /* RenderTextureTest */; }; + 1AA51ABB16F708FA000FDF05 /* RotateWorldTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9416F708FA000FDF05 /* RotateWorldTest */; }; + 1AA51ABC16F708FA000FDF05 /* SceneTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9516F708FA000FDF05 /* SceneTest */; }; + 1AA51ABD16F708FA000FDF05 /* SchedulerTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9616F708FA000FDF05 /* SchedulerTest */; }; + 1AA51ABE16F708FA000FDF05 /* SpriteTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9716F708FA000FDF05 /* SpriteTest */; }; + 1AA51ABF16F708FA000FDF05 /* SysTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9816F708FA000FDF05 /* SysTest */; }; + 1AA51AC016F708FA000FDF05 /* TextInputTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9916F708FA000FDF05 /* TextInputTest */; }; + 1AA51AC116F708FA000FDF05 /* TextureCacheTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9A16F708FA000FDF05 /* TextureCacheTest */; }; + 1AA51AC216F708FA000FDF05 /* TileMapTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9B16F708FA000FDF05 /* TileMapTest */; }; + 1AA51AC316F708FA000FDF05 /* TouchesTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9C16F708FA000FDF05 /* TouchesTest */; }; + 1AA51AC416F708FA000FDF05 /* TransitionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9D16F708FA000FDF05 /* TransitionsTest */; }; + 1AA51AC516F708FA000FDF05 /* UnitTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9E16F708FA000FDF05 /* UnitTest */; }; + A05FCAC8177C123600BE600E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAC7177C123600BE600E /* OpenGL.framework */; }; + A05FCAC9177C123F00BE600E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAC7177C123600BE600E /* OpenGL.framework */; }; + A05FCACC177C125300BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCACB177C125300BE600E /* Cocoa.framework */; }; + A05FCACD177C125800BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCACB177C125300BE600E /* Cocoa.framework */; }; + A05FCAD6177C129100BE600E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A05FCACF177C129100BE600E /* InfoPlist.strings */; }; + A05FCAD7177C129100BE600E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A05FCACF177C129100BE600E /* InfoPlist.strings */; }; + A05FCAD8177C129100BE600E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD1177C129100BE600E /* MainMenu.xib */; }; + A05FCAD9177C129100BE600E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD1177C129100BE600E /* MainMenu.xib */; }; + A05FCADA177C129100BE600E /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD3177C129100BE600E /* Icon.icns */; }; + A05FCADB177C129100BE600E /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD3177C129100BE600E /* Icon.icns */; }; + A05FCADC177C129100BE600E /* Test_Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD4177C129100BE600E /* Test_Info.plist */; }; + A05FCADD177C129100BE600E /* Test_Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD4177C129100BE600E /* Test_Info.plist */; }; + A05FCAE1177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; + A05FCAE2177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; + A218F7DC1743D97E00F65883 /* XHRTest in Resources */ = {isa = PBXBuildFile; fileRef = A218F7DB1743D97E00F65883 /* XHRTest */; }; + A22656EF1743DCBB00598A2C /* ClippingNodeTest in Resources */ = {isa = PBXBuildFile; fileRef = A22656EE1743DCBB00598A2C /* ClippingNodeTest */; }; + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; + D401B61116FB637400F2529D /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; + D401B67D16FB637400F2529D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; + D401B67F16FB637400F2529D /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; + D401B68016FB637400F2529D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; + D401B68116FB637400F2529D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; + D401B68316FB637400F2529D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; + D401B68416FB637400F2529D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; + D401B6D716FBF49A00F2529D /* game.js in Resources */ = {isa = PBXBuildFile; fileRef = D401B6D516FBF48000F2529D /* game.js */; }; + D401B6E016FC072B00F2529D /* tests-boot-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = D401B6DE16FC071100F2529D /* tests-boot-jsb.js */; }; + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 15A3D4621682F14C002FB0C5 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../../Shared/tests/main.js; sourceTree = ""; }; + 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests_resources-jsb.js"; path = "../../Shared/tests/tests_resources-jsb.js"; sourceTree = ""; }; + 15A3D4741682F14C002FB0C5 /* tests-main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests-main.js"; path = "../../Shared/tests/tests-main.js"; sourceTree = ""; }; + 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libchipmunk.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libcocos2dx.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libCocosDenshion.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A4C3F1117784B6000EDFB3B /* libextensions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libextensions.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A4C3F1217784B6000EDFB3B /* libjsbindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libjsbindings.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1A6B05C417782A2400FFE52B /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; + 1A6B05C617782B0500FFE52B /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + 1A6E4672177812AF0055514D /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb.js; sourceTree = ""; }; + 1A6E4673177812AF0055514D /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk.js; sourceTree = ""; }; + 1A6E4674177812AF0055514D /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk_constants.js; sourceTree = ""; }; + 1A6E4675177812AF0055514D /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d.js; sourceTree = ""; }; + 1A6E4676177812AF0055514D /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_constants.js; sourceTree = ""; }; + 1A6E4677177812AF0055514D /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_extension.js; sourceTree = ""; }; + 1A6E4678177812AF0055514D /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocosbuilder.js; sourceTree = ""; }; + 1A6E4679177812AF0055514D /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_debugger.js; sourceTree = ""; }; + 1A6E467A177812AF0055514D /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl.js; sourceTree = ""; }; + 1A6E467B177812AF0055514D /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl_constants.js; sourceTree = ""; }; + 1A6E467C177812AF0055514D /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_sys.js; sourceTree = ""; }; + 1A6E467D177812AF0055514D /* main.debug.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.debug.js; sourceTree = ""; }; + 1A8033291728DECD00240CC3 /* EffectsAdvancedTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EffectsAdvancedTest; path = ../../Shared/tests/EffectsAdvancedTest; sourceTree = ""; }; + 1A80332B1728F1FB00240CC3 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../../Shared/tests/res; sourceTree = ""; }; + 1AA51A7816F708FA000FDF05 /* ActionManagerTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ActionManagerTest; path = ../../Shared/tests/ActionManagerTest; sourceTree = ""; }; + 1AA51A7916F708FA000FDF05 /* ActionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ActionsTest; path = ../../Shared/tests/ActionsTest; sourceTree = ""; }; + 1AA51A7A16F708FA000FDF05 /* BaseTestLayer */ = {isa = PBXFileReference; lastKnownFileType = folder; name = BaseTestLayer; path = ../../Shared/tests/BaseTestLayer; sourceTree = ""; }; + 1AA51A7B16F708FA000FDF05 /* Box2dTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Box2dTest; path = ../../Shared/tests/Box2dTest; sourceTree = ""; }; + 1AA51A7C16F708FA000FDF05 /* ChipmunkTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ChipmunkTest; path = ../../Shared/tests/ChipmunkTest; sourceTree = ""; }; + 1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ClickAndMoveTest; path = ../../Shared/tests/ClickAndMoveTest; sourceTree = ""; }; + 1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CocosDenshionTest; path = ../../Shared/tests/CocosDenshionTest; sourceTree = ""; }; + 1AA51A7F16F708FA000FDF05 /* CocosNodeTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CocosNodeTest; path = ../../Shared/tests/CocosNodeTest; sourceTree = ""; }; + 1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CurrentLanguageTest; path = ../../Shared/tests/CurrentLanguageTest; sourceTree = ""; }; + 1AA51A8116F708FA000FDF05 /* DrawPrimitivesTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = DrawPrimitivesTest; path = ../../Shared/tests/DrawPrimitivesTest; sourceTree = ""; }; + 1AA51A8216F708FA000FDF05 /* EaseActionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EaseActionsTest; path = ../../Shared/tests/EaseActionsTest; sourceTree = ""; }; + 1AA51A8316F708FA000FDF05 /* EffectsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EffectsTest; path = ../../Shared/tests/EffectsTest; sourceTree = ""; }; + 1AA51A8416F708FA000FDF05 /* EventTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EventTest; path = ../../Shared/tests/EventTest; sourceTree = ""; }; + 1AA51A8516F708FA000FDF05 /* ExtensionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ExtensionsTest; path = ../../Shared/tests/ExtensionsTest; sourceTree = ""; }; + 1AA51A8616F708FA000FDF05 /* FileUtils */ = {isa = PBXFileReference; lastKnownFileType = folder; name = FileUtils; path = ../../Shared/tests/FileUtils; sourceTree = ""; }; + 1AA51A8716F708FA000FDF05 /* FontTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = FontTest; path = ../../Shared/tests/FontTest; sourceTree = ""; }; + 1AA51A8816F708FA000FDF05 /* IntervalTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = IntervalTest; path = ../../Shared/tests/IntervalTest; sourceTree = ""; }; + 1AA51A8916F708FA000FDF05 /* LabelTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = LabelTest; path = ../../Shared/tests/LabelTest; sourceTree = ""; }; + 1AA51A8A16F708FA000FDF05 /* LayerTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = LayerTest; path = ../../Shared/tests/LayerTest; sourceTree = ""; }; + 1AA51A8B16F708FA000FDF05 /* MenuTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = MenuTest; path = ../../Shared/tests/MenuTest; sourceTree = ""; }; + 1AA51A8C16F708FA000FDF05 /* OpenGLTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = OpenGLTest; path = ../../Shared/tests/OpenGLTest; sourceTree = ""; }; + 1AA51A8D16F708FA000FDF05 /* ParallaxTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ParallaxTest; path = ../../Shared/tests/ParallaxTest; sourceTree = ""; }; + 1AA51A8E16F708FA000FDF05 /* ParticleTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ParticleTest; path = ../../Shared/tests/ParticleTest; sourceTree = ""; }; + 1AA51A8F16F708FA000FDF05 /* PerformanceTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = PerformanceTest; path = ../../Shared/tests/PerformanceTest; sourceTree = ""; }; + 1AA51A9016F708FA000FDF05 /* Presentation */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Presentation; path = ../../Shared/tests/Presentation; sourceTree = ""; }; + 1AA51A9116F708FA000FDF05 /* ProgressActionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ProgressActionsTest; path = ../../Shared/tests/ProgressActionsTest; sourceTree = ""; }; + 1AA51A9216F708FA000FDF05 /* RenderTextureTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = RenderTextureTest; path = ../../Shared/tests/RenderTextureTest; sourceTree = ""; }; + 1AA51A9416F708FA000FDF05 /* RotateWorldTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = RotateWorldTest; path = ../../Shared/tests/RotateWorldTest; sourceTree = ""; }; + 1AA51A9516F708FA000FDF05 /* SceneTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SceneTest; path = ../../Shared/tests/SceneTest; sourceTree = ""; }; + 1AA51A9616F708FA000FDF05 /* SchedulerTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SchedulerTest; path = ../../Shared/tests/SchedulerTest; sourceTree = ""; }; + 1AA51A9716F708FA000FDF05 /* SpriteTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SpriteTest; path = ../../Shared/tests/SpriteTest; sourceTree = ""; }; + 1AA51A9816F708FA000FDF05 /* SysTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SysTest; path = ../../Shared/tests/SysTest; sourceTree = ""; }; + 1AA51A9916F708FA000FDF05 /* TextInputTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TextInputTest; path = ../../Shared/tests/TextInputTest; sourceTree = ""; }; + 1AA51A9A16F708FA000FDF05 /* TextureCacheTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TextureCacheTest; path = ../../Shared/tests/TextureCacheTest; sourceTree = ""; }; + 1AA51A9B16F708FA000FDF05 /* TileMapTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TileMapTest; path = ../../Shared/tests/TileMapTest; sourceTree = ""; }; + 1AA51A9C16F708FA000FDF05 /* TouchesTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TouchesTest; path = ../../Shared/tests/TouchesTest; sourceTree = ""; }; + 1AA51A9D16F708FA000FDF05 /* TransitionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TransitionsTest; path = ../../Shared/tests/TransitionsTest; sourceTree = ""; }; + 1AA51A9E16F708FA000FDF05 /* UnitTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = UnitTest; path = ../../Shared/tests/UnitTest; sourceTree = ""; }; + A05FCAC7177C123600BE600E /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + A05FCACB177C125300BE600E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + A05FCAD0177C129100BE600E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; + A05FCAD2177C129100BE600E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = ""; }; + A05FCAD3177C129100BE600E /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; + A05FCAD4177C129100BE600E /* Test_Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Test_Info.plist; sourceTree = ""; }; + A05FCAD5177C129100BE600E /* Test_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test_Prefix.pch; sourceTree = ""; }; + A05FCADF177C12B500BE600E /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; + A05FCAE0177C12B500BE600E /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; + A218F7DB1743D97E00F65883 /* XHRTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = XHRTest; path = ../../Shared/tests/XHRTest; sourceTree = ""; }; + A22656EE1743DCBB00598A2C /* ClippingNodeTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ClippingNodeTest; path = ../../Shared/tests/ClippingNodeTest; sourceTree = ""; }; + A922753D1517C094001B78AA /* TestJavascript.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestJavascript.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A92275411517C094001B78AA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + A92275451517C094001B78AA /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + A92275471517C094001B78AA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + A92275491517C094001B78AA /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + A922754D1517C094001B78AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + A922754F1517C094001B78AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + D401B5FD16FB199B00F2529D /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-57.png"; sourceTree = ""; }; + D401B5FF16FB19A000F2529D /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-114.png"; sourceTree = ""; }; + D401B60116FB19A600F2529D /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = ""; }; + D401B60316FB19A900F2529D /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-144.png"; sourceTree = ""; }; + D401B6C816FB637400F2529D /* TestJavascriptObfuscated.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestJavascriptObfuscated.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D401B6D516FBF48000F2529D /* game.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = game.js; path = ../game.js; sourceTree = ""; }; + D401B6DE16FC071100F2529D /* tests-boot-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests-boot-jsb.js"; path = "../../Shared/tests/tests-boot-jsb.js"; sourceTree = ""; }; + D446FDA216102D7D000ADA7B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + D446FDA416102D82000ADA7B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + D446FDA616102D86000ADA7B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + D4545215156E28EF00887EB5 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = ""; }; + D4545216156E28EF00887EB5 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A922753A1517C094001B78AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1A4C3F1317784B6000EDFB3B /* libchipmunk.a in Frameworks */, + 1A4C3F1417784B6000EDFB3B /* libcocos2dx.a in Frameworks */, + 1A4C3F1517784B6000EDFB3B /* libCocosDenshion.a in Frameworks */, + 1A4C3F1617784B6000EDFB3B /* libextensions.a in Frameworks */, + 1A4C3F1717784B6000EDFB3B /* libjsbindings.a in Frameworks */, + 1A6B05C717782B0500FFE52B /* libz.dylib in Frameworks */, + 1A6B05C517782A2400FFE52B /* libsqlite3.dylib in Frameworks */, + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */, + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */, + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */, + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, + A05FCAC9177C123F00BE600E /* OpenGL.framework in Frameworks */, + A05FCACD177C125800BE600E /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D401B67816FB637400F2529D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A05FCACC177C125300BE600E /* Cocoa.framework in Frameworks */, + A05FCAC8177C123600BE600E /* OpenGL.framework in Frameworks */, + D401B67D16FB637400F2529D /* QuartzCore.framework in Frameworks */, + D401B67F16FB637400F2529D /* OpenAL.framework in Frameworks */, + D401B68016FB637400F2529D /* AudioToolbox.framework in Frameworks */, + D401B68116FB637400F2529D /* AVFoundation.framework in Frameworks */, + D401B68316FB637400F2529D /* Foundation.framework in Frameworks */, + D401B68416FB637400F2529D /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 15628F5B15F0F5C2000CF24B /* Resources */ = { + isa = PBXGroup; + children = ( + 1A6E4671177812AF0055514D /* js */, + 1A80332B1728F1FB00240CC3 /* res */, + D446FDA616102D86000ADA7B /* Default-568h@2x.png */, + D446FDA216102D7D000ADA7B /* Default.png */, + D446FDA416102D82000ADA7B /* Default@2x.png */, + D401B60316FB19A900F2529D /* Icon-144.png */, + D401B60116FB19A600F2529D /* Icon-72.png */, + D401B5FF16FB19A000F2529D /* Icon-114.png */, + D401B5FD16FB199B00F2529D /* Icon-57.png */, + ); + name = Resources; + sourceTree = ""; + }; + 1A6E4671177812AF0055514D /* js */ = { + isa = PBXGroup; + children = ( + 1A6E4672177812AF0055514D /* jsb.js */, + 1A6E4673177812AF0055514D /* jsb_chipmunk.js */, + 1A6E4674177812AF0055514D /* jsb_chipmunk_constants.js */, + 1A6E4675177812AF0055514D /* jsb_cocos2d.js */, + 1A6E4676177812AF0055514D /* jsb_cocos2d_constants.js */, + 1A6E4677177812AF0055514D /* jsb_cocos2d_extension.js */, + 1A6E4678177812AF0055514D /* jsb_cocosbuilder.js */, + 1A6E4679177812AF0055514D /* jsb_debugger.js */, + 1A6E467A177812AF0055514D /* jsb_opengl.js */, + 1A6E467B177812AF0055514D /* jsb_opengl_constants.js */, + 1A6E467C177812AF0055514D /* jsb_sys.js */, + 1A6E467D177812AF0055514D /* main.debug.js */, + ); + name = js; + path = ../../../../scripting/javascript/bindings/js; + sourceTree = ""; + }; + A05FCACE177C129100BE600E /* en.lproj */ = { + isa = PBXGroup; + children = ( + A05FCACF177C129100BE600E /* InfoPlist.strings */, + A05FCAD1177C129100BE600E /* MainMenu.xib */, + ); + path = en.lproj; + sourceTree = ""; + }; + A05FCADE177C129A00BE600E /* mac */ = { + isa = PBXGroup; + children = ( + A05FCADF177C12B500BE600E /* AppController.h */, + A05FCAE0177C12B500BE600E /* AppController.mm */, + A05FCACE177C129100BE600E /* en.lproj */, + A05FCAD3177C129100BE600E /* Icon.icns */, + A05FCAD4177C129100BE600E /* Test_Info.plist */, + A05FCAD5177C129100BE600E /* Test_Prefix.pch */, + ); + name = mac; + sourceTree = ""; + }; + A92275321517C094001B78AA = { + isa = PBXGroup; + children = ( + D4545214156E28EF00887EB5 /* Classes */, + A05FCADE177C129A00BE600E /* mac */, + A92275401517C094001B78AA /* Frameworks */, + D401B60716FB632B00F2529D /* js_src_obfuscated */, + D401B5FC16FB169100F2529D /* js_src_raw */, + A922753E1517C094001B78AA /* Products */, + 15628F5B15F0F5C2000CF24B /* Resources */, + ); + sourceTree = ""; + }; + A922753E1517C094001B78AA /* Products */ = { + isa = PBXGroup; + children = ( + A922753D1517C094001B78AA /* TestJavascript.app */, + D401B6C816FB637400F2529D /* TestJavascriptObfuscated.app */, + ); + name = Products; + sourceTree = ""; + }; + A92275401517C094001B78AA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */, + 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */, + 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */, + 1A4C3F1117784B6000EDFB3B /* libextensions.a */, + 1A4C3F1217784B6000EDFB3B /* libjsbindings.a */, + 1A6B05C617782B0500FFE52B /* libz.dylib */, + 1A6B05C417782A2400FFE52B /* libsqlite3.dylib */, + A05FCACB177C125300BE600E /* Cocoa.framework */, + A05FCAC7177C123600BE600E /* OpenGL.framework */, + A92275411517C094001B78AA /* QuartzCore.framework */, + A92275451517C094001B78AA /* OpenAL.framework */, + A92275471517C094001B78AA /* AudioToolbox.framework */, + A92275491517C094001B78AA /* AVFoundation.framework */, + A922754D1517C094001B78AA /* Foundation.framework */, + A922754F1517C094001B78AA /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + D401B5FC16FB169100F2529D /* js_src_raw */ = { + isa = PBXGroup; + children = ( + A22656EE1743DCBB00598A2C /* ClippingNodeTest */, + A218F7DB1743D97E00F65883 /* XHRTest */, + 1AA51A7816F708FA000FDF05 /* ActionManagerTest */, + 1AA51A7916F708FA000FDF05 /* ActionsTest */, + 1AA51A7A16F708FA000FDF05 /* BaseTestLayer */, + 1AA51A7B16F708FA000FDF05 /* Box2dTest */, + 1AA51A7C16F708FA000FDF05 /* ChipmunkTest */, + 1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */, + 1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */, + 1AA51A7F16F708FA000FDF05 /* CocosNodeTest */, + 1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */, + 1AA51A8116F708FA000FDF05 /* DrawPrimitivesTest */, + 1AA51A8216F708FA000FDF05 /* EaseActionsTest */, + 1A8033291728DECD00240CC3 /* EffectsAdvancedTest */, + 1AA51A8316F708FA000FDF05 /* EffectsTest */, + 1AA51A8416F708FA000FDF05 /* EventTest */, + 1AA51A8516F708FA000FDF05 /* ExtensionsTest */, + 1AA51A8616F708FA000FDF05 /* FileUtils */, + 1AA51A8716F708FA000FDF05 /* FontTest */, + 1AA51A8816F708FA000FDF05 /* IntervalTest */, + 1AA51A8916F708FA000FDF05 /* LabelTest */, + 1AA51A8A16F708FA000FDF05 /* LayerTest */, + 1AA51A8B16F708FA000FDF05 /* MenuTest */, + 1AA51A8C16F708FA000FDF05 /* OpenGLTest */, + 1AA51A8D16F708FA000FDF05 /* ParallaxTest */, + 1AA51A8E16F708FA000FDF05 /* ParticleTest */, + 1AA51A8F16F708FA000FDF05 /* PerformanceTest */, + 1AA51A9016F708FA000FDF05 /* Presentation */, + 1AA51A9116F708FA000FDF05 /* ProgressActionsTest */, + 1AA51A9216F708FA000FDF05 /* RenderTextureTest */, + 1AA51A9416F708FA000FDF05 /* RotateWorldTest */, + 1AA51A9516F708FA000FDF05 /* SceneTest */, + 1AA51A9616F708FA000FDF05 /* SchedulerTest */, + 1AA51A9716F708FA000FDF05 /* SpriteTest */, + 1AA51A9816F708FA000FDF05 /* SysTest */, + 1AA51A9916F708FA000FDF05 /* TextInputTest */, + 1AA51A9A16F708FA000FDF05 /* TextureCacheTest */, + 1AA51A9B16F708FA000FDF05 /* TileMapTest */, + 1AA51A9C16F708FA000FDF05 /* TouchesTest */, + 1AA51A9D16F708FA000FDF05 /* TransitionsTest */, + 1AA51A9E16F708FA000FDF05 /* UnitTest */, + 15A3D4621682F14C002FB0C5 /* main.js */, + D401B6DE16FC071100F2529D /* tests-boot-jsb.js */, + 15A3D4741682F14C002FB0C5 /* tests-main.js */, + 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */, + ); + name = js_src_raw; + sourceTree = ""; + }; + D401B60716FB632B00F2529D /* js_src_obfuscated */ = { + isa = PBXGroup; + children = ( + D401B6D516FBF48000F2529D /* game.js */, + ); + name = js_src_obfuscated; + sourceTree = ""; + }; + D4545214156E28EF00887EB5 /* Classes */ = { + isa = PBXGroup; + children = ( + D4545215156E28EF00887EB5 /* AppDelegate.cpp */, + D4545216156E28EF00887EB5 /* AppDelegate.h */, + ); + name = Classes; + path = ../Classes; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A922753C1517C094001B78AA /* TestJavascript */ = { + isa = PBXNativeTarget; + buildConfigurationList = A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "TestJavascript" */; + buildPhases = ( + A92275391517C094001B78AA /* Sources */, + A922753A1517C094001B78AA /* Frameworks */, + A922753B1517C094001B78AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestJavascript; + productName = TestJavascript; + productReference = A922753D1517C094001B78AA /* TestJavascript.app */; + productType = "com.apple.product-type.application"; + }; + D401B60A16FB637400F2529D /* TestJavascriptObfuscated */ = { + isa = PBXNativeTarget; + buildConfigurationList = D401B6C516FB637400F2529D /* Build configuration list for PBXNativeTarget "TestJavascriptObfuscated" */; + buildPhases = ( + D401B60D16FB637400F2529D /* Sources */, + D401B67816FB637400F2529D /* Frameworks */, + D401B6E116FC076200F2529D /* ShellScript */, + D401B68516FB637400F2529D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestJavascriptObfuscated; + productName = TestJavascript; + productReference = D401B6C816FB637400F2529D /* TestJavascriptObfuscated.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A92275341517C094001B78AA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; + buildConfigurationList = A92275371517C094001B78AA /* Build configuration list for PBXProject "TestJavascript" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = A92275321517C094001B78AA; + productRefGroup = A922753E1517C094001B78AA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + A922753C1517C094001B78AA /* TestJavascript */, + D401B60A16FB637400F2529D /* TestJavascriptObfuscated */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + A922753B1517C094001B78AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1A6E468A177812D20055514D /* jsb.js in Resources */, + 1A6E468B177812D20055514D /* jsb_chipmunk.js in Resources */, + 1A6E468C177812D20055514D /* jsb_chipmunk_constants.js in Resources */, + 1A6E468D177812D20055514D /* jsb_cocos2d.js in Resources */, + 1A6E468E177812D20055514D /* jsb_cocos2d_constants.js in Resources */, + 1A6E468F177812D20055514D /* jsb_cocos2d_extension.js in Resources */, + 1A6E4690177812D20055514D /* jsb_cocosbuilder.js in Resources */, + 1A6E4691177812D20055514D /* jsb_debugger.js in Resources */, + 1A6E4692177812D20055514D /* jsb_opengl.js in Resources */, + 1A6E4693177812D20055514D /* jsb_opengl_constants.js in Resources */, + 1A6E4694177812D20055514D /* jsb_sys.js in Resources */, + 1A6E4695177812D20055514D /* main.debug.js in Resources */, + D401B6E016FC072B00F2529D /* tests-boot-jsb.js in Resources */, + 15A3D5631682F20C002FB0C5 /* main.js in Resources */, + 15A3D5651682F20C002FB0C5 /* tests_resources-jsb.js in Resources */, + 15A3D5681682F20C002FB0C5 /* tests-main.js in Resources */, + 1AA51A9F16F708FA000FDF05 /* ActionManagerTest in Resources */, + 1AA51AA016F708FA000FDF05 /* ActionsTest in Resources */, + 1AA51AA116F708FA000FDF05 /* BaseTestLayer in Resources */, + 1AA51AA216F708FA000FDF05 /* Box2dTest in Resources */, + 1AA51AA316F708FA000FDF05 /* ChipmunkTest in Resources */, + 1AA51AA416F708FA000FDF05 /* ClickAndMoveTest in Resources */, + 1AA51AA516F708FA000FDF05 /* CocosDenshionTest in Resources */, + 1AA51AA616F708FA000FDF05 /* CocosNodeTest in Resources */, + 1AA51AA716F708FA000FDF05 /* CurrentLanguageTest in Resources */, + 1AA51AA816F708FA000FDF05 /* DrawPrimitivesTest in Resources */, + 1AA51AA916F708FA000FDF05 /* EaseActionsTest in Resources */, + 1AA51AAA16F708FA000FDF05 /* EffectsTest in Resources */, + 1AA51AAB16F708FA000FDF05 /* EventTest in Resources */, + 1AA51AAC16F708FA000FDF05 /* ExtensionsTest in Resources */, + 1AA51AAD16F708FA000FDF05 /* FileUtils in Resources */, + 1AA51AAE16F708FA000FDF05 /* FontTest in Resources */, + 1AA51AAF16F708FA000FDF05 /* IntervalTest in Resources */, + 1AA51AB016F708FA000FDF05 /* LabelTest in Resources */, + 1AA51AB116F708FA000FDF05 /* LayerTest in Resources */, + 1AA51AB216F708FA000FDF05 /* MenuTest in Resources */, + 1AA51AB316F708FA000FDF05 /* OpenGLTest in Resources */, + 1AA51AB416F708FA000FDF05 /* ParallaxTest in Resources */, + 1AA51AB516F708FA000FDF05 /* ParticleTest in Resources */, + 1AA51AB616F708FA000FDF05 /* PerformanceTest in Resources */, + 1AA51AB716F708FA000FDF05 /* Presentation in Resources */, + 1AA51AB816F708FA000FDF05 /* ProgressActionsTest in Resources */, + 1AA51AB916F708FA000FDF05 /* RenderTextureTest in Resources */, + 1AA51ABB16F708FA000FDF05 /* RotateWorldTest in Resources */, + 1AA51ABC16F708FA000FDF05 /* SceneTest in Resources */, + 1AA51ABD16F708FA000FDF05 /* SchedulerTest in Resources */, + 1AA51ABE16F708FA000FDF05 /* SpriteTest in Resources */, + 1AA51ABF16F708FA000FDF05 /* SysTest in Resources */, + 1AA51AC016F708FA000FDF05 /* TextInputTest in Resources */, + 1AA51AC116F708FA000FDF05 /* TextureCacheTest in Resources */, + 1AA51AC216F708FA000FDF05 /* TileMapTest in Resources */, + 1AA51AC316F708FA000FDF05 /* TouchesTest in Resources */, + 1AA51AC416F708FA000FDF05 /* TransitionsTest in Resources */, + 1AA51AC516F708FA000FDF05 /* UnitTest in Resources */, + 1A80332A1728DECD00240CC3 /* EffectsAdvancedTest in Resources */, + 1A80332C1728F1FB00240CC3 /* res in Resources */, + A218F7DC1743D97E00F65883 /* XHRTest in Resources */, + A22656EF1743DCBB00598A2C /* ClippingNodeTest in Resources */, + A05FCAD6177C129100BE600E /* InfoPlist.strings in Resources */, + A05FCAD8177C129100BE600E /* MainMenu.xib in Resources */, + A05FCADA177C129100BE600E /* Icon.icns in Resources */, + A05FCADC177C129100BE600E /* Test_Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D401B68516FB637400F2529D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D401B6D716FBF49A00F2529D /* game.js in Resources */, + A05FCAD7177C129100BE600E /* InfoPlist.strings in Resources */, + A05FCAD9177C129100BE600E /* MainMenu.xib in Resources */, + A05FCADB177C129100BE600E /* Icon.icns in Resources */, + A05FCADD177C129100BE600E /* Test_Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + D401B6E116FC076200F2529D /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "pushd $SRCROOT/../\nrm game.js\nant -buildfile obfuscate.xml\npopd\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A92275391517C094001B78AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */, + A05FCAE1177C12B500BE600E /* AppController.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D401B60D16FB637400F2529D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D401B61116FB637400F2529D /* AppDelegate.cpp in Sources */, + A05FCAE2177C12B500BE600E /* AppController.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + A05FCACF177C129100BE600E /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + A05FCAD0177C129100BE600E /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + A05FCAD1177C129100BE600E /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + A05FCAD2177C129100BE600E /* en */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + A92276FE1517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "COCOS2D_DEBUG=1", + COCOS2D_JAVASCRIPT, + USE_FILE32API, + CC_ENABLE_CHIPMUNK_INTEGRATION, + CC_TARGET_OS_MAC, + DEBUG, + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../../../cocos2dx", + "$(SRCROOT)/../../../../cocos2dx/include", + "$(SRCROOT)/../../../../cocos2dx/platform/mac", + "$(SRCROOT)/../../../../cocos2dx/kazmath/include", + "${SRCROOT}/../../../../cocos2dx/platform/third_party/mac", + "$(SRCROOT)/../../../../CocosDenshion/include", + "$(SRCROOT)/../../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/include", + "$(SRCROOT)/../../../../scripting/javascript/bindings", + "$(SRCROOT)/../../../../extensions", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/lib\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac/libraries\"", + "\"$(SRCROOT)/../../../../external/libwebsockets/mac/lib\"", + ); + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + A92276FF1517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = ( + COCOS2D_JAVASCRIPT, + USE_FILE32API, + CC_ENABLE_CHIPMUNK_INTEGRATION, + CC_TARGET_OS_MAC, + NDEBUG, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../../../cocos2dx", + "$(SRCROOT)/../../../../cocos2dx/include", + "$(SRCROOT)/../../../../cocos2dx/platform/mac", + "$(SRCROOT)/../../../../cocos2dx/kazmath/include", + "${SRCROOT}/../../../../cocos2dx/platform/third_party/mac", + "$(SRCROOT)/../../../../CocosDenshion/include", + "$(SRCROOT)/../../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/include", + "$(SRCROOT)/../../../../scripting/javascript/bindings", + "$(SRCROOT)/../../../../extensions", + ); + LIBRARY_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/lib\"", + "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac/libraries\"", + "\"$(SRCROOT)/../../../../external/libwebsockets/mac/lib\"", + ); + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = macosx; + }; + name = Release; + }; + A92277011517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 1; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Test_Prefix.pch; + GCC_VERSION = ""; + INFOPLIST_FILE = "$(SRCROOT)/Test_Info.plist"; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = TestJavascript; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + A92277021517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Test_Prefix.pch; + GCC_VERSION = ""; + INFOPLIST_FILE = "$(SRCROOT)/Test_Info.plist"; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = TestJavascript; + VALIDATE_PRODUCT = YES; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + D401B6C616FB637400F2529D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 1; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Test_Prefix.pch; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + INFOPLIST_FILE = "$(SRCROOT)/Info-obfuscated.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + OTHER_LDFLAGS = ( + "-lxml2", + "-lz", + "-ljs_static", + ); + PRODUCT_NAME = TestJavascriptObfuscated; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + D401B6C716FB637400F2529D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Test_Prefix.pch; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + INFOPLIST_FILE = "$(SRCROOT)/Info-obfuscated.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + OTHER_LDFLAGS = ( + "-lxml2", + "-lz", + "-ljs_static", + ); + PRODUCT_NAME = TestJavascriptObfuscated; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A92275371517C094001B78AA /* Build configuration list for PBXProject "TestJavascript" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92276FE1517C097001B78AA /* Debug */, + A92276FF1517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "TestJavascript" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92277011517C097001B78AA /* Debug */, + A92277021517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D401B6C516FB637400F2529D /* Build configuration list for PBXNativeTarget "TestJavascriptObfuscated" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D401B6C616FB637400F2529D /* Debug */, + D401B6C716FB637400F2529D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A92275341517C094001B78AA /* Project object */; +} diff --git a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout new file mode 100644 index 0000000000..58f6193c12 --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout @@ -0,0 +1,63 @@ + + + + + IDESourceControlProjectIdentifier + 0B98B4D8-828E-460D-817C-495BE3652AD5 + IDESourceControlProjectName + TestJavascript + IDESourceControlProjectOriginsDictionary + + 5B0F35E6-1A4B-4F3D-A082-C30150726270 + git://github.com/folecr/cocos2dx-autogen-bindings.git + D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A + https://github.com/minggo/cocos2d-x.git + E0C8B176-3A21-43EF-A355-D004DE1F4825 + https://github.com/minggo/cocos2d-js-tests.git + + IDESourceControlProjectPath + samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 5B0F35E6-1A4B-4F3D-A082-C30150726270 + ../../../../../../scripting/javascript/bindings/generated + D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A + ../../../../../.. + E0C8B176-3A21-43EF-A355-D004DE1F4825 + ../../../../Shared + + IDESourceControlProjectURL + https://github.com/minggo/cocos2d-x.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A + IDESourceControlWCCName + cocos2d-x + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + E0C8B176-3A21-43EF-A355-D004DE1F4825 + IDESourceControlWCCName + Shared + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 5B0F35E6-1A4B-4F3D-A082-C30150726270 + IDESourceControlWCCName + generated + + + + diff --git a/samples/Javascript/TestJavascript/proj.mac/Test_Prefix.pch b/samples/Javascript/TestJavascript/proj.mac/Test_Prefix.pch new file mode 100644 index 0000000000..46c36a7e99 --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/Test_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/samples/Javascript/TestJavascript/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/TestJavascript/proj.mac/en.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/Javascript/TestJavascript/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/TestJavascript/proj.mac/en.lproj/MainMenu.xib new file mode 100644 index 0000000000..3dacdedbd0 --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/en.lproj/MainMenu.xib @@ -0,0 +1,812 @@ + + + + 1060 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSMenuItem + NSCustomObject + NSMenu + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + TestCpp + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + TestCpp + + YES + + + About TestCpp + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide TestCpp + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit TestCpp + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Fullscreen + f + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + TestCpp Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + AppController + + + NSFontManager + + + + + YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + showHelp: + + + + 493 + + + + toggleFullScreen: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + 420 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 536 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 129.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency + 134.IBPluginDependency + 136.IBPluginDependency + 143.IBPluginDependency + 144.IBPluginDependency + 145.IBPluginDependency + 149.IBPluginDependency + 150.IBPluginDependency + 19.IBPluginDependency + 23.IBPluginDependency + 236.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 29.IBPluginDependency + 295.IBPluginDependency + 296.IBPluginDependency + 420.IBPluginDependency + 490.IBPluginDependency + 491.IBPluginDependency + 492.IBPluginDependency + 494.IBPluginDependency + 5.IBPluginDependency + 536.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 92.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 541 + + + + YES + + AppController + NSObject + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + id + id + + + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + + exitFullScreen: + id + + + toggleFullScreen: + id + + + + + YES + + YES + glView + window + + + YES + EAGLView + NSWindow + + + + YES + + YES + glView + window + + + YES + + glView + EAGLView + + + window + NSWindow + + + + + IBProjectSource + ./Classes/AppController.h + + + + EAGLView + NSOpenGLView + + IBProjectSource + ./Classes/EAGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/samples/Javascript/TestJavascript/proj.mac/main.m b/samples/Javascript/TestJavascript/proj.mac/main.m new file mode 100644 index 0000000000..97d9b73282 --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/main.m @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} From ccd9cb486ce26707b3979188107c99d0f115f116 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 27 Jun 2013 00:58:46 -0700 Subject: [PATCH 03/43] JS Tests compiles and links in Mac ...but it doesn't work yet due to a bug with the touch events :-( --- .../extensions.xcodeproj/project.pbxproj | 38 +++++++++---------- .../mac/lib/libwebsockets.a.REMOVED.git-id | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- .../TestJavascript.xcodeproj/project.pbxproj | 18 +++++++-- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/extensions/proj.mac/extensions.xcodeproj/project.pbxproj b/extensions/proj.mac/extensions.xcodeproj/project.pbxproj index 3ec88e06a2..d49984c136 100644 --- a/extensions/proj.mac/extensions.xcodeproj/project.pbxproj +++ b/extensions/proj.mac/extensions.xcodeproj/project.pbxproj @@ -112,6 +112,8 @@ 1A0C0D4F1777F9CD00838530 /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE31777F9CD00838530 /* Slot.cpp */; }; 1A0C0D501777F9CD00838530 /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE51777F9CD00838530 /* SlotData.cpp */; }; 1A0C0D511777F9CD00838530 /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */; }; + A05FCAE8177C1A1400BE600E /* libwebsockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAE7177C1A1400BE600E /* libwebsockets.a */; }; + A05FCAEA177C1F8E00BE600E /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAE9177C1F8E00BE600E /* libcurl.dylib */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -361,9 +363,9 @@ 1A0C0CE71777F9CD00838530 /* spine-cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "spine-cocos2dx.cpp"; sourceTree = ""; }; 1A0C0CE81777F9CD00838530 /* spine-cocos2dx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "spine-cocos2dx.h"; sourceTree = ""; }; 1A0C0CE91777F9CD00838530 /* spine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spine.h; sourceTree = ""; }; - 1A0C0D551777FAAD00838530 /* libwebsockets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libwebsockets.h; sourceTree = ""; }; - 1A0C0D571777FAAD00838530 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebsockets.a; sourceTree = ""; }; - 1A0C0D591777FB1300838530 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; + A05FCAE5177C1A1400BE600E /* libwebsockets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libwebsockets.h; sourceTree = ""; }; + A05FCAE7177C1A1400BE600E /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebsockets.a; sourceTree = ""; }; + A05FCAE9177C1F8E00BE600E /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -371,7 +373,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A05FCAEA177C1F8E00BE600E /* libcurl.dylib in Frameworks */, 1A0C0A7E1777F79700838530 /* Foundation.framework in Frameworks */, + A05FCAE8177C1A1400BE600E /* libwebsockets.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -409,8 +413,8 @@ 1A0C0A7C1777F79700838530 /* Frameworks */ = { isa = PBXGroup; children = ( - 1A0C0D591777FB1300838530 /* libcurl.a */, - 1A0C0D521777FAAD00838530 /* libwebsockets */, + A05FCAE9177C1F8E00BE600E /* libcurl.dylib */, + A05FCAE3177C1A1400BE600E /* libwebsockets */, 1A0C0A7D1777F79700838530 /* Foundation.framework */, ); name = Frameworks; @@ -805,36 +809,28 @@ path = ../spine; sourceTree = ""; }; - 1A0C0D521777FAAD00838530 /* libwebsockets */ = { + A05FCAE3177C1A1400BE600E /* libwebsockets */ = { isa = PBXGroup; children = ( - 1A0C0D531777FAAD00838530 /* ios */, + A05FCAE4177C1A1400BE600E /* include */, + A05FCAE6177C1A1400BE600E /* lib */, ); name = libwebsockets; - path = ../../external/libwebsockets; + path = ../../external/libwebsockets/mac; sourceTree = ""; }; - 1A0C0D531777FAAD00838530 /* ios */ = { + A05FCAE4177C1A1400BE600E /* include */ = { isa = PBXGroup; children = ( - 1A0C0D541777FAAD00838530 /* include */, - 1A0C0D561777FAAD00838530 /* lib */, - ); - path = ios; - sourceTree = ""; - }; - 1A0C0D541777FAAD00838530 /* include */ = { - isa = PBXGroup; - children = ( - 1A0C0D551777FAAD00838530 /* libwebsockets.h */, + A05FCAE5177C1A1400BE600E /* libwebsockets.h */, ); path = include; sourceTree = ""; }; - 1A0C0D561777FAAD00838530 /* lib */ = { + A05FCAE6177C1A1400BE600E /* lib */ = { isa = PBXGroup; children = ( - 1A0C0D571777FAAD00838530 /* libwebsockets.a */, + A05FCAE7177C1A1400BE600E /* libwebsockets.a */, ); path = lib; sourceTree = ""; diff --git a/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id b/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id index 07244313a9..bdf504bf24 100644 --- a/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id +++ b/external/libwebsockets/mac/lib/libwebsockets.a.REMOVED.git-id @@ -1 +1 @@ -7c6e7415c9d9fd3c6a002191f7d2c486aacf5204 \ No newline at end of file +5d0743ce07a9c865d4367d8e3db161148676f2c8 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index bb28a0782b..eb3adc8ac0 100644 --- a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -d81b281e5f46de12ac714ea968ad8c352c70af3e \ No newline at end of file +a1c526dca23c3ded2ceec95cfd144e0e99c49b79 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj index ead3eecf60..fa3acfeaab 100644 --- a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj +++ b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj @@ -83,12 +83,15 @@ A05FCADD177C129100BE600E /* Test_Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD4177C129100BE600E /* Test_Info.plist */; }; A05FCAE1177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; A05FCAE2177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; + A05FCAEC177C1FBB00BE600E /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAEB177C1FBB00BE600E /* libcurl.dylib */; }; + A05FCAEE177C208D00BE600E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAED177C208D00BE600E /* main.m */; }; + A05FCAEF177C208D00BE600E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAED177C208D00BE600E /* main.m */; }; + A05FCAF1177C273700BE600E /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAF0177C273700BE600E /* ApplicationServices.framework */; }; A218F7DC1743D97E00F65883 /* XHRTest in Resources */ = {isa = PBXBuildFile; fileRef = A218F7DB1743D97E00F65883 /* XHRTest */; }; A22656EF1743DCBB00598A2C /* ClippingNodeTest in Resources */ = {isa = PBXBuildFile; fileRef = A22656EE1743DCBB00598A2C /* ClippingNodeTest */; }; A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; A92275461517C094001B78AA /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; - A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; A922754E1517C094001B78AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; D401B61116FB637400F2529D /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; @@ -175,6 +178,9 @@ A05FCAD5177C129100BE600E /* Test_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test_Prefix.pch; sourceTree = ""; }; A05FCADF177C12B500BE600E /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; A05FCAE0177C12B500BE600E /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; + A05FCAEB177C1FBB00BE600E /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; + A05FCAED177C208D00BE600E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + A05FCAF0177C273700BE600E /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; }; A218F7DB1743D97E00F65883 /* XHRTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = XHRTest; path = ../../Shared/tests/XHRTest; sourceTree = ""; }; A22656EE1743DCBB00598A2C /* ClippingNodeTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ClippingNodeTest; path = ../../Shared/tests/ClippingNodeTest; sourceTree = ""; }; A922753D1517C094001B78AA /* TestJavascript.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestJavascript.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -203,6 +209,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A05FCAEC177C1FBB00BE600E /* libcurl.dylib in Frameworks */, 1A4C3F1317784B6000EDFB3B /* libchipmunk.a in Frameworks */, 1A4C3F1417784B6000EDFB3B /* libcocos2dx.a in Frameworks */, 1A4C3F1517784B6000EDFB3B /* libCocosDenshion.a in Frameworks */, @@ -210,10 +217,10 @@ 1A4C3F1717784B6000EDFB3B /* libjsbindings.a in Frameworks */, 1A6B05C717782B0500FFE52B /* libz.dylib in Frameworks */, 1A6B05C517782A2400FFE52B /* libsqlite3.dylib in Frameworks */, - A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, A92275461517C094001B78AA /* OpenAL.framework in Frameworks */, + A05FCAF1177C273700BE600E /* ApplicationServices.framework in Frameworks */, + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */, - A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */, A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, A05FCAC9177C123F00BE600E /* OpenGL.framework in Frameworks */, @@ -287,6 +294,7 @@ A05FCADE177C129A00BE600E /* mac */ = { isa = PBXGroup; children = ( + A05FCAED177C208D00BE600E /* main.m */, A05FCADF177C12B500BE600E /* AppController.h */, A05FCAE0177C12B500BE600E /* AppController.mm */, A05FCACE177C129100BE600E /* en.lproj */, @@ -322,6 +330,7 @@ A92275401517C094001B78AA /* Frameworks */ = { isa = PBXGroup; children = ( + A05FCAEB177C1FBB00BE600E /* libcurl.dylib */, 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */, 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */, 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */, @@ -329,6 +338,7 @@ 1A4C3F1217784B6000EDFB3B /* libjsbindings.a */, 1A6B05C617782B0500FFE52B /* libz.dylib */, 1A6B05C417782A2400FFE52B /* libsqlite3.dylib */, + A05FCAF0177C273700BE600E /* ApplicationServices.framework */, A05FCACB177C125300BE600E /* Cocoa.framework */, A05FCAC7177C123600BE600E /* OpenGL.framework */, A92275411517C094001B78AA /* QuartzCore.framework */, @@ -582,6 +592,7 @@ files = ( D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */, A05FCAE1177C12B500BE600E /* AppController.mm in Sources */, + A05FCAEE177C208D00BE600E /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -591,6 +602,7 @@ files = ( D401B61116FB637400F2529D /* AppDelegate.cpp in Sources */, A05FCAE2177C12B500BE600E /* AppController.mm in Sources */, + A05FCAEF177C208D00BE600E /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From b1be161e5d1f1e51d9a069b1cbf7e2354fd7ddc2 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 27 Jun 2013 17:34:53 -0700 Subject: [PATCH 04/43] updates to SpiderMonkey v22 --- .../spidermonkey-mac/include/ds/BitArray.h | 58 --- .../spidermonkey-mac/include/js.msg | 23 +- .../spidermonkey-mac/include/js/CallArgs.h | 348 +++++++++++++++ .../include/js/CharacterEncoding.h | 12 + .../spidermonkey-mac/include/js/GCAPI.h | 10 +- .../spidermonkey-mac/include/js/HashTable.h | 86 +++- .../spidermonkey-mac/include/js/HeapAPI.h | 16 +- .../include/js/MemoryMetrics.h | 310 +++++++------ .../include/{gc/Root.h => js/RootingAPI.h} | 419 ++++-------------- .../spidermonkey-mac/include/js/TemplateLib.h | 12 +- .../spidermonkey-mac/include/js/Utility.h | 14 +- .../spidermonkey-mac/include/js/Value.h | 320 ++++++------- .../spidermonkey-mac/include/js/Vector.h | 78 +++- .../include/jsapi.h.REMOVED.git-id | 2 +- .../spidermonkey-mac/include/jsdbgapi.h | 11 - .../spidermonkey-mac/include/jsfriendapi.h | 57 ++- .../spidermonkey-mac/include/jsproxy.h | 296 +++++++++---- .../spidermonkey-mac/include/jsprvtd.h | 24 +- .../spidermonkey-mac/include/jspubtd.h | 29 +- .../spidermonkey-mac/include/jswrapper.h | 155 +++---- .../include/mozilla/Assertions.h | 14 +- .../include/mozilla/Attributes.h | 58 +++ .../include/mozilla/CheckedInt.h | 81 ++-- .../include/mozilla/MathAlgorithms.h | 100 +++++ .../include/mozilla/TypeTraits.h | 305 +++++++------ .../lib/libjs_static.a.REMOVED.git-id | 2 +- 26 files changed, 1650 insertions(+), 1190 deletions(-) delete mode 100644 scripting/javascript/spidermonkey-mac/include/ds/BitArray.h create mode 100644 scripting/javascript/spidermonkey-mac/include/js/CallArgs.h rename scripting/javascript/spidermonkey-mac/include/{gc/Root.h => js/RootingAPI.h} (65%) diff --git a/scripting/javascript/spidermonkey-mac/include/ds/BitArray.h b/scripting/javascript/spidermonkey-mac/include/ds/BitArray.h deleted file mode 100644 index 1be12fc881..0000000000 --- a/scripting/javascript/spidermonkey-mac/include/ds/BitArray.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BitArray_h__ -#define BitArray_h__ - -#include "jstypes.h" - -#include "js/TemplateLib.h" - -namespace js { - -template -class BitArray { - private: - uintptr_t map[nbits / JS_BITS_PER_WORD + (nbits % JS_BITS_PER_WORD == 0 ? 0 : 1)]; - - public: - void clear(bool value) { - if (value) - memset(map, 0xFF, sizeof(map)); - else - memset(map, 0, sizeof(map)); - } - - inline bool get(size_t offset) const { - uintptr_t index, mask; - getMarkWordAndMask(offset, &index, &mask); - return map[index] & mask; - } - - inline void set(size_t offset) { - uintptr_t index, mask; - getMarkWordAndMask(offset, &index, &mask); - map[index] |= mask; - } - - inline void unset(size_t offset) { - uintptr_t index, mask; - getMarkWordAndMask(offset, &index, &mask); - map[index] &= ~mask; - } - - private: - inline void getMarkWordAndMask(size_t offset, - uintptr_t *indexp, uintptr_t *maskp) const { - *indexp = offset >> tl::FloorLog2::result; - *maskp = uintptr_t(1) << (offset & (JS_BITS_PER_WORD - 1)); - } -}; - -} /* namespace js */ - -#endif diff --git a/scripting/javascript/spidermonkey-mac/include/js.msg b/scripting/javascript/spidermonkey-mac/include/js.msg index ba58f4d00e..1f727dce0b 100644 --- a/scripting/javascript/spidermonkey-mac/include/js.msg +++ b/scripting/javascript/spidermonkey-mac/include/js.msg @@ -79,8 +79,8 @@ MSG_DEF(JSMSG_TOO_DEEP, 25, 1, JSEXN_INTERNALERR, "{0} nested too MSG_DEF(JSMSG_OVER_RECURSED, 26, 0, JSEXN_INTERNALERR, "too much recursion") MSG_DEF(JSMSG_IN_NOT_OBJECT, 27, 1, JSEXN_TYPEERR, "invalid 'in' operand {0}") MSG_DEF(JSMSG_BAD_NEW_RESULT, 28, 1, JSEXN_TYPEERR, "invalid new expression result {0}") -MSG_DEF(JSMSG_UNUSED29, 29, 0, JSEXN_NONE, "") -MSG_DEF(JSMSG_UNUSED30, 30, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_OBJECT_ACCESS_DENIED, 29, 0, JSEXN_ERR, "Permission denied to access object") +MSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED, 30, 1, JSEXN_ERR, "Permission denied to access property '{0}'") MSG_DEF(JSMSG_BAD_INSTANCEOF_RHS, 31, 1, JSEXN_TYPEERR, "invalid 'instanceof' operand {0}") MSG_DEF(JSMSG_BAD_BYTECODE, 32, 1, JSEXN_INTERNALERR, "unimplemented JavaScript bytecode {0}") MSG_DEF(JSMSG_BAD_RADIX, 33, 0, JSEXN_RANGEERR, "radix must be an integer at least 2 and no greater than 36") @@ -235,7 +235,7 @@ MSG_DEF(JSMSG_UNUSED181, 181, 0, JSEXN_NONE, "") MSG_DEF(JSMSG_BAD_GENERATOR_SEND, 182, 1, JSEXN_TYPEERR, "attempt to send {0} to newborn generator") MSG_DEF(JSMSG_UNUSED183, 183, 0, JSEXN_NONE, "") MSG_DEF(JSMSG_UNUSED184, 184, 0, JSEXN_NONE, "") -MSG_DEF(JSMSG_UNUSED185, 185, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE, 185, 0, JSEXN_TYPEERR, "proxy can't report an extensible object as non-extensible") MSG_DEF(JSMSG_UNUSED186, 186, 0, JSEXN_NONE, "") MSG_DEF(JSMSG_UNUSED187, 187, 0, JSEXN_NONE, "") MSG_DEF(JSMSG_INCOMPATIBLE_METHOD, 188, 3, JSEXN_TYPEERR, "{0} {1} called on incompatible {2}") @@ -247,7 +247,7 @@ MSG_DEF(JSMSG_BAD_FOR_EACH_LOOP, 193, 0, JSEXN_SYNTAXERR, "invalid for each MSG_DEF(JSMSG_UNUSED194, 194, 0, JSEXN_NONE, "") MSG_DEF(JSMSG_UNUSED195, 195, 0, JSEXN_NONE, "") MSG_DEF(JSMSG_UNUSED196, 196, 0, JSEXN_NONE, "") -MSG_DEF(JSMSG_UNUSED197, 197, 0, JSEXN_NONE, "") +MSG_DEF(JSMSG_INTERNAL_INTL_ERROR, 197, 0, JSEXN_ERR, "internal error while computing Intl data") MSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR, 198, 0, JSEXN_ERR, "internal error getting the default locale") MSG_DEF(JSMSG_TOO_MANY_LOCALS, 199, 0, JSEXN_SYNTAXERR, "too many local variables") MSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG, 200, 0, JSEXN_INTERNALERR, "array initialiser too large") @@ -354,9 +354,9 @@ MSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, "paramet MSG_DEF(JSMSG_YIELD_IN_DEFAULT, 301, 0, JSEXN_SYNTAXERR, "yield in default expression") MSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED, 302, 1, JSEXN_REFERENCEERR, "no intrinsic function {0}") MSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP, 303, 1, JSEXN_ERR, "{0} is being assigned a source map, yet already has one") -MSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG, 304, 1, JSEXN_TYPEERR, "invalid ParallelArray{0} argument") +MSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG, 304, 1, JSEXN_RANGEERR, "invalid ParallelArray{0} argument") MSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, "argument must be divisible by outermost dimension") -MSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, "cannot reduce empty ParallelArray object") +MSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, "cannot reduce ParallelArray object whose outermost dimension is empty") MSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, "cannot flatten 1-dimensional ParallelArray object") MSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, "no conflict resolution function provided") MSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, "index in scatter vector out of bounds") @@ -388,3 +388,14 @@ MSG_DEF(JSMSG_INVALID_CURRENCY_CODE, 334, 1, JSEXN_RANGEERR, "invalid currency MSG_DEF(JSMSG_UNDEFINED_CURRENCY, 335, 0, JSEXN_TYPEERR, "undefined currency in NumberFormat() with currency style") MSG_DEF(JSMSG_INVALID_TIME_ZONE, 336, 1, JSEXN_RANGEERR, "invalid time zone in DateTimeFormat(): {0}") MSG_DEF(JSMSG_DATE_NOT_FINITE, 337, 0, JSEXN_RANGEERR, "date value is not finite in DateTimeFormat.format()") +MSG_DEF(JSMSG_MODULE_STATEMENT, 338, 0, JSEXN_SYNTAXERR, "module declarations may only appear at the top level of a program or module body") +MSG_DEF(JSMSG_CURLY_BEFORE_MODULE, 339, 0, JSEXN_SYNTAXERR, "missing { before module body") +MSG_DEF(JSMSG_CURLY_AFTER_MODULE, 340, 0, JSEXN_SYNTAXERR, "missing } after module body") +MSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 341, 0, JSEXN_SYNTAXERR, "'use asm' directive only works on function code") +MSG_DEF(JSMSG_USE_ASM_TYPE_FAIL, 342, 1, JSEXN_TYPEERR, "asm.js type error: {0}") +MSG_DEF(JSMSG_USE_ASM_LINK_FAIL, 343, 1, JSEXN_TYPEERR, "asm.js link error: {0}") +MSG_DEF(JSMSG_USE_ASM_TYPE_OK, 344, 0, JSEXN_ERR, "Successfully compiled asm.js code") +MSG_DEF(JSMSG_BAD_ARROW_ARGS, 345, 0, JSEXN_SYNTAXERR, "invalid arrow-function arguments (parentheses around the arrow-function may help)") +MSG_DEF(JSMSG_YIELD_IN_ARROW, 346, 0, JSEXN_SYNTAXERR, "arrow function may not contain yield") +MSG_DEF(JSMSG_WRONG_VALUE, 347, 2, JSEXN_ERR, "expected {0} but found {1}") +MSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, "target for index {0} is not an integer") diff --git a/scripting/javascript/spidermonkey-mac/include/js/CallArgs.h b/scripting/javascript/spidermonkey-mac/include/js/CallArgs.h new file mode 100644 index 0000000000..b84070bbe8 --- /dev/null +++ b/scripting/javascript/spidermonkey-mac/include/js/CallArgs.h @@ -0,0 +1,348 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* + * Helper classes encapsulating access to the callee, |this| value, arguments, + * and argument count for a function call. + * + * The intent of JS::CallArgs and JS::CallReceiver is that they be used to + * encapsulate access to the un-abstracted |unsigned argc, Value *vp| arguments + * to a function. It's possible (albeit deprecated) to manually index into + * |vp| to access the callee, |this|, and arguments of a function, and to set + * its return value. It's also possible to use the supported API of JS_CALLEE, + * JS_THIS, JS_ARGV, JS_RVAL and JS_SET_RVAL to the same ends. But neither API + * has the error-handling or moving-GC correctness of CallArgs or CallReceiver. + * New code should use CallArgs and CallReceiver instead whenever possible. + * + * The eventual plan is to change JSNative to take |const CallArgs&| directly, + * for automatic assertion of correct use and to make calling functions more + * efficient. Embedders should start internally switching away from using + * |argc| and |vp| directly, except to create a |CallArgs|. Then, when an + * eventual release making that change occurs, porting efforts will require + * changing methods' signatures but won't require invasive changes to the + * methods' implementations, potentially under time pressure. + */ + +#ifndef js_CallArgs_h___ +#define js_CallArgs_h___ + +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" + +#include "jstypes.h" + +#include "js/RootingAPI.h" +#include "js/Value.h" + +struct JSContext; +class JSObject; + +/* Typedef for native functions called by the JS VM. */ +typedef JSBool +(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp); + +namespace JS { + +/* + * JS::CallReceiver encapsulates access to the callee, |this|, and eventual + * return value for a function call. The principal way to create a + * CallReceiver is using JS::CallReceiverFromVp: + * + * static JSBool + * FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp) + * { + * JS::CallReceiver rec = JS::CallReceiverFromVp(vp); + * + * // Access to the callee must occur before accessing/setting + * // the return value. + * JSObject &callee = rec.callee(); + * rec.rval().set(JS::ObjectValue(callee)); + * + * // callee() and calleev() will now assert. + * + * // It's always fine to access thisv(). + * HandleValue thisv = rec.thisv(); + * rec.thisv().set(thisv); + * + * // As the return value was last set to |this|, returns |this|. + * return true; + * } + * + * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't + * part of the CallReceiver interface. We will likely add them at some point. + * Until then, you should probably continue using |vp| directly for these two + * cases. + * + * CallReceiver is exposed publicly and used internally. Not all parts of its + * public interface are meant to be used by embedders! See inline comments to + * for details. + */ +class CallReceiver +{ + protected: +#ifdef DEBUG + mutable bool usedRval_; + void setUsedRval() const { usedRval_ = true; } + void clearUsedRval() const { usedRval_ = false; } +#else + void setUsedRval() const {} + void clearUsedRval() const {} +#endif + + Value *argv_; + + friend CallReceiver CallReceiverFromVp(Value *vp); + friend CallReceiver CallReceiverFromArgv(Value *argv); + + public: + /* + * Returns the function being called, as an object. Must not be called + * after rval() has been used! + */ + JSObject &callee() const { + MOZ_ASSERT(!usedRval_); + return argv_[-2].toObject(); + } + + /* + * Returns the function being called, as a value. Must not be called after + * rval() has been used! + */ + HandleValue calleev() const { + MOZ_ASSERT(!usedRval_); + return HandleValue::fromMarkedLocation(&argv_[-2]); + } + + /* + * Returns the |this| value passed to the function. This method must not + * be called when the function is being called as a constructor via |new|. + * The value may or may not be an object: it is the individual function's + * responsibility to box the value if needed. + */ + HandleValue thisv() const { + // Some internal code uses thisv() in constructing cases, so don't do + // this yet. + // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING)); + return HandleValue::fromMarkedLocation(&argv_[-1]); + } + + /* + * Returns the currently-set return value. The initial contents of this + * value are unspecified. Once this method has been called, callee() and + * calleev() can no longer be used. (If you're compiling against a debug + * build of SpiderMonkey, these methods will assert to aid debugging.) + * + * If the method you're implementing succeeds by returning true, you *must* + * set this. (SpiderMonkey doesn't currently assert this, but it will do + * so eventually.) You don't need to use or change this if your method + * fails. + */ + MutableHandleValue rval() const { + setUsedRval(); + return MutableHandleValue::fromMarkedLocation(&argv_[-2]); + } + + public: + // These methods are only intended for internal use. Embedders shouldn't + // use them! + + Value *base() const { return argv_ - 2; } + + Value *spAfterCall() const { + setUsedRval(); + return argv_ - 1; + } + + public: + // These methods are publicly exposed, but they are *not* to be used when + // implementing a JSNative method and encapsulating access to |vp| within + // it. You probably don't want to use these! + + void setCallee(Value aCalleev) const { + clearUsedRval(); + argv_[-2] = aCalleev; + } + + void setThis(Value aThisv) const { + argv_[-1] = aThisv; + } + + MutableHandleValue mutableThisv() const { + return MutableHandleValue::fromMarkedLocation(&argv_[-1]); + } +}; + +MOZ_ALWAYS_INLINE CallReceiver +CallReceiverFromArgv(Value *argv) +{ + CallReceiver receiver; + receiver.clearUsedRval(); + receiver.argv_ = argv; + return receiver; +} + +MOZ_ALWAYS_INLINE CallReceiver +CallReceiverFromVp(Value *vp) +{ + return CallReceiverFromArgv(vp + 2); +} + +/* + * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to + * the function call's arguments. The principal way to create a CallArgs is + * like so, using JS::CallArgsFromVp: + * + * static JSBool + * FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp) + * { + * JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + * + * // Guard against no arguments or a non-numeric arg0. + * if (args.length() == 0 || !args[0].isNumber()) { + * args.rval().setInt32(0); + * return true; + * } + * + * args.rval().set(JS::NumberValue(args.length() * args[0].toNumber())); + * return true; + * } + * + * CallArgs is exposed publicly and used internally. Not all parts of its + * public interface are meant to be used by embedders! See inline comments to + * for details. + */ +class CallArgs : public CallReceiver +{ + protected: + unsigned argc_; + + friend CallArgs CallArgsFromVp(unsigned argc, Value *vp); + friend CallArgs CallArgsFromSp(unsigned argc, Value *sp); + + static CallArgs create(unsigned argc, Value *argv) { + CallArgs args; + args.clearUsedRval(); + args.argv_ = argv; + args.argc_ = argc; + return args; + } + + public: + /* Returns the number of arguments. */ + unsigned length() const { return argc_; } + + /* Returns the i-th zero-indexed argument. */ + Value &operator[](unsigned i) const { + MOZ_ASSERT(i < argc_); + return argv_[i]; + } + + /* Returns a mutable handle for the i-th zero-indexed argument. */ + MutableHandleValue handleAt(unsigned i) { + MOZ_ASSERT(i < argc_); + return MutableHandleValue::fromMarkedLocation(&argv_[i]); + } + + /* Returns a Handle for the i-th zero-indexed argument. */ + HandleValue handleAt(unsigned i) const { + MOZ_ASSERT(i < argc_); + return HandleValue::fromMarkedLocation(&argv_[i]); + } + + /* + * Returns the i-th zero-indexed argument, or |undefined| if there's no + * such argument. + */ + Value get(unsigned i) const { + return i < length() ? argv_[i] : UndefinedValue(); + } + + /* + * Returns true if the i-th zero-indexed argument is present and is not + * |undefined|. + */ + bool hasDefined(unsigned i) const { + return i < argc_ && !argv_[i].isUndefined(); + } + + public: + // These methods are publicly exposed, but we're less sure of the interface + // here than we'd like (because they're hackish and drop assertions). Try + // to avoid using these if you can. + + Value *array() const { return argv_; } + Value *end() const { return argv_ + argc_; } +}; + +MOZ_ALWAYS_INLINE CallArgs +CallArgsFromVp(unsigned argc, Value *vp) +{ + return CallArgs::create(argc, vp + 2); +} + +// This method is only intended for internal use in SpiderMonkey. We may +// eventually move it to an internal header. Embedders should use +// JS::CallArgsFromVp! +MOZ_ALWAYS_INLINE CallArgs +CallArgsFromSp(unsigned argc, Value *sp) +{ + return CallArgs::create(argc, sp - argc); +} + +} // namespace JS + +/* + * Compute |this| for the |vp| inside a JSNative, either boxing primitives or + * replacing with the global object as necessary. + * + * This method will go away at some point: instead use |args.thisv()|. If the + * value is an object, no further work is required. If that value is |null| or + * |undefined|, use |JS_GetGlobalForObject| to compute the global object. If + * the value is some other primitive, use |JS_ValueToObject| to box it. + */ +extern JS_PUBLIC_API(JS::Value) +JS_ComputeThis(JSContext *cx, JS::Value *vp); + +/* + * Macros to hide interpreter stack layout details from a JSNative using its + * JS::Value *vp parameter. DO NOT USE THESE! Instead use JS::CallArgs and + * friends, above. These macros will be removed when we change JSNative to + * take a const JS::CallArgs&. + */ + +#define JS_CALLEE(cx,vp) ((vp)[0]) +#define JS_THIS_OBJECT(cx,vp) (JSVAL_TO_OBJECT(JS_THIS(cx,vp))) +#define JS_ARGV(cx,vp) ((vp) + 2) +#define JS_RVAL(cx,vp) (*(vp)) +#define JS_SET_RVAL(cx,vp,v) (*(vp) = (v)) + +/* + * Note: if this method returns null, an error has occurred and must be + * propagated or caught. + */ +MOZ_ALWAYS_INLINE JS::Value +JS_THIS(JSContext *cx, JS::Value *vp) +{ + return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1]; +} + +/* + * |this| is passed to functions in ES5 without change. Functions themselves + * do any post-processing they desire to box |this|, compute the global object, + * &c. This macro retrieves a function's unboxed |this| value. + * + * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT, + * or vice versa. Either use the provided this value with this macro, or + * compute the boxed |this| value using those. JS_THIS_VALUE must not be used + * if the function is being called as a constructor. + * + * But: DO NOT USE THIS! Instead use JS::CallArgs::thisv(), above. + * + */ +#define JS_THIS_VALUE(cx,vp) ((vp)[1]) + +#endif /* js_CallArgs_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h b/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h index 2d336e4908..36d8670a08 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h +++ b/scripting/javascript/spidermonkey-mac/include/js/CharacterEncoding.h @@ -74,6 +74,14 @@ class UTF8CharsZ : public mozilla::RangedPtr { JS_ASSERT(aBytes[aLength] == '\0'); } + + UTF8CharsZ(unsigned char *aBytes, size_t aLength) + : Base(aBytes, aLength) + { + JS_ASSERT(aBytes[aLength] == '\0'); + } + + char *c_str() { return reinterpret_cast(get()); } }; /* @@ -137,8 +145,12 @@ class TwoByteCharsZ : public mozilla::RangedPtr extern Latin1CharsZ LossyTwoByteCharsToNewLatin1CharsZ(JSContext *cx, TwoByteChars tbchars); +extern UTF8CharsZ +TwoByteCharsToNewUTF8CharsZ(JSContext *cx, TwoByteChars tbchars); + } // namespace JS inline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); } +inline void JS_free(JS::UTF8CharsZ &ptr) { js_free((void*)ptr.get()); } #endif // js_CharacterEncoding_h___ diff --git a/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h b/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h index db09eaef50..6f4649eb30 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h +++ b/scripting/javascript/spidermonkey-mac/include/js/GCAPI.h @@ -43,7 +43,8 @@ namespace JS { D(INTER_SLICE_GC) \ D(REFRESH_FRAME) \ D(FULL_GC_TIMER) \ - D(SHUTDOWN_CC) + D(SHUTDOWN_CC) \ + D(FINISH_LARGE_EVALUTE) namespace gcreason { @@ -152,6 +153,9 @@ IsIncrementalGCInProgress(JSRuntime *rt); extern JS_FRIEND_API(void) DisableIncrementalGC(JSRuntime *rt); +extern JS_FRIEND_API(void) +DisableGenerationalGC(JSRuntime *rt); + extern JS_FRIEND_API(bool) IsIncrementalBarrierNeeded(JSRuntime *rt); @@ -200,6 +204,10 @@ class ObjectPtr IncrementalObjectBarrier(value); } + bool isAboutToBeFinalized() { + return JS_IsAboutToBeFinalized(&value); + } + ObjectPtr &operator=(JSObject *obj) { IncrementalObjectBarrier(value); value = obj; diff --git a/scripting/javascript/spidermonkey-mac/include/js/HashTable.h b/scripting/javascript/spidermonkey-mac/include/js/HashTable.h index 1db926ffd1..7a29437ed8 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/HashTable.h +++ b/scripting/javascript/spidermonkey-mac/include/js/HashTable.h @@ -8,6 +8,7 @@ #ifndef js_HashTable_h__ #define js_HashTable_h__ +#include "mozilla/Assertions.h" #include "mozilla/Attributes.h" #include "mozilla/DebugOnly.h" #include "mozilla/TypeTraits.h" @@ -67,7 +68,15 @@ class HashMap // HashMap construction is fallible (due to OOM); thus the user must call // init after constructing a HashMap and check the return value. - HashMap(AllocPolicy a = AllocPolicy()) : impl(a) {} + HashMap(AllocPolicy a = AllocPolicy()) + : impl(a) + { + MOZ_STATIC_ASSERT(tl::IsRelocatableHeapType::result, + "Key type must be relocatable"); + MOZ_STATIC_ASSERT(tl::IsRelocatableHeapType::result, + "Value type must be relocatable"); + } + bool init(uint32_t len = 16) { return impl.init(len); } bool initialized() const { return impl.initialized(); } @@ -85,6 +94,10 @@ class HashMap typedef typename Impl::Ptr Ptr; Ptr lookup(const Lookup &l) const { return impl.lookup(l); } + // Like lookup, but does not assert if two threads call lookup at the same + // time. Only use this method when none of the threads will modify the map. + Ptr readonlyThreadsafeLookup(const Lookup &l) const { return impl.readonlyThreadsafeLookup(l); } + // Assuming |p.found()|, remove |*p|. void remove(Ptr p) { impl.remove(p); } @@ -250,9 +263,6 @@ class HashMap HashMap &operator=(const HashMap &hm) MOZ_DELETE; friend class Impl::Enum; - - typedef typename tl::StaticAssert::result>::result keyAssert; - typedef typename tl::StaticAssert::result>::result valAssert; }; /*****************************************************************************/ @@ -293,7 +303,11 @@ class HashSet // HashSet construction is fallible (due to OOM); thus the user must call // init after constructing a HashSet and check the return value. - HashSet(AllocPolicy a = AllocPolicy()) : impl(a) {} + HashSet(AllocPolicy a = AllocPolicy()) : impl(a) + { + MOZ_STATIC_ASSERT(tl::IsRelocatableHeapType::result, + "Set element type must be relocatable"); + } bool init(uint32_t len = 16) { return impl.init(len); } bool initialized() const { return impl.initialized(); } @@ -444,8 +458,6 @@ class HashSet HashSet &operator=(const HashSet &hs) MOZ_DELETE; friend class Impl::Enum; - - typedef typename tl::StaticAssert::result>::result _; }; /*****************************************************************************/ @@ -482,7 +494,7 @@ struct PointerHasher { typedef Key Lookup; static HashNumber hash(const Lookup &l) { - JS_ASSERT(!js::IsPoisonedPtr(l)); + JS_ASSERT(!JS::IsPoisonedPtr(l)); size_t word = reinterpret_cast(l) >> zeroBits; JS_STATIC_ASSERT(sizeof(HashNumber) == 4); #if JS_BYTES_PER_WORD == 4 @@ -493,8 +505,8 @@ struct PointerHasher #endif } static bool match(const Key &k, const Lookup &l) { - JS_ASSERT(!js::IsPoisonedPtr(k)); - JS_ASSERT(!js::IsPoisonedPtr(l)); + JS_ASSERT(!JS::IsPoisonedPtr(k)); + JS_ASSERT(!JS::IsPoisonedPtr(l)); return k == l; } }; @@ -523,6 +535,28 @@ template struct DefaultHasher : PointerHasher::result> {}; +// For doubles, we can xor the two uint32s. +template <> +struct DefaultHasher +{ + typedef double Lookup; + static HashNumber hash(double d) { + JS_STATIC_ASSERT(sizeof(HashNumber) == 4); + union { + struct { + uint32_t lo; + uint32_t hi; + } s; + double d; + } u; + u.d = d; + return u.s.lo ^ u.s.hi; + } + static bool match(double lhs, double rhs) { + return lhs == rhs; + } +}; + /*****************************************************************************/ // Both HashMap and HashSet are implemented by a single HashTable that is even @@ -554,17 +588,13 @@ class HashMapEntry namespace mozilla { -template -struct IsPod > -{ - static const bool value = IsPod::value; -}; +template +struct IsPod > : IsPod {}; -template +template struct IsPod > -{ - static const bool value = IsPod::value && IsPod::value; -}; + : IntegralConstant::value && IsPod::value> +{}; } // namespace mozilla @@ -789,8 +819,10 @@ class HashTable : private AllocPolicy // Potentially rehashes the table. ~Enum() { - if (rekeyed) + if (rekeyed) { + table.gen++; table.checkOverRemoved(); + } if (removed) table.compactIfUnderloaded(); @@ -1163,9 +1195,8 @@ class HashTable : private AllocPolicy void checkOverRemoved() { if (overloaded()) { - METER(stats.rehashes++); - rehashTable(); - JS_ASSERT(!overloaded()); + if (checkOverloaded() == RehashFailed) + rehashTableInPlace(); } } @@ -1215,8 +1246,9 @@ class HashTable : private AllocPolicy // the element is already inserted or still waiting to be inserted. Since // already-inserted elements win any conflicts, we get the same table as we // would have gotten through random insertion order. - void rehashTable() + void rehashTableInPlace() { + METER(stats.rehashes++); removedCount = 0; for (size_t i = 0; i < capacity(); ++i) table[i].unsetCollision(); @@ -1343,6 +1375,12 @@ class HashTable : private AllocPolicy return Ptr(lookup(l, keyHash, 0)); } + Ptr readonlyThreadsafeLookup(const Lookup &l) const + { + HashNumber keyHash = prepareHash(l); + return Ptr(lookup(l, keyHash, 0)); + } + AddPtr lookupForAdd(const Lookup &l) const { ReentrancyGuard g(*this); diff --git a/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h b/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h index c634d5fd3e..2f61e9d2ee 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h +++ b/scripting/javascript/spidermonkey-mac/include/js/HeapAPI.h @@ -56,7 +56,7 @@ static const uint32_t GRAY = 1; } /* namespace js */ namespace JS { -typedef JSCompartment Zone; +struct Zone; } /* namespace JS */ namespace JS { @@ -110,17 +110,11 @@ GetGCThingArena(void *thing) } } /* namespace gc */ + } /* namespace js */ namespace JS { -static JS_ALWAYS_INLINE JSCompartment * -GetGCThingCompartment(void *thing) -{ - JS_ASSERT(thing); - return js::gc::GetGCThingArena(thing)->zone; -} - static JS_ALWAYS_INLINE Zone * GetGCThingZone(void *thing) { @@ -128,12 +122,6 @@ GetGCThingZone(void *thing) return js::gc::GetGCThingArena(thing)->zone; } -static JS_ALWAYS_INLINE JSCompartment * -GetObjectCompartment(JSObject *obj) -{ - return GetGCThingCompartment(obj); -} - static JS_ALWAYS_INLINE Zone * GetObjectZone(JSObject *obj) { diff --git a/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h b/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h index f0e77941e8..71b8cd37ba 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h +++ b/scripting/javascript/spidermonkey-mac/include/js/MemoryMetrics.h @@ -37,9 +37,12 @@ JS_FRIEND_API(size_t) MemoryReportingSundriesThreshold(); namespace JS { // Data for tracking memory usage of things hanging off objects. -struct ObjectsExtraSizes { +struct ObjectsExtraSizes +{ size_t slots; - size_t elements; + size_t elementsNonAsmJS; + size_t elementsAsmJSHeap; + size_t elementsAsmJSNonHeap; size_t argumentsData; size_t regExpStatics; size_t propertyIteratorData; @@ -51,7 +54,9 @@ struct ObjectsExtraSizes { void add(ObjectsExtraSizes &sizes) { this->slots += sizes.slots; - this->elements += sizes.elements; + this->elementsNonAsmJS += sizes.elementsNonAsmJS; + this->elementsAsmJSHeap += sizes.elementsAsmJSHeap; + this->elementsAsmJSNonHeap += sizes.elementsAsmJSNonHeap; this->argumentsData += sizes.argumentsData; this->regExpStatics += sizes.regExpStatics; this->propertyIteratorData += sizes.propertyIteratorData; @@ -66,12 +71,10 @@ struct TypeInferenceSizes size_t typeScripts; size_t typeResults; size_t analysisPool; - size_t typePool; size_t pendingArrays; size_t allocationSiteTables; size_t arrayTypeTables; size_t objectTypeTables; - size_t typeObjects; TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); } @@ -79,31 +82,37 @@ struct TypeInferenceSizes this->typeScripts += sizes.typeScripts; this->typeResults += sizes.typeResults; this->analysisPool += sizes.analysisPool; - this->typePool += sizes.typePool; this->pendingArrays += sizes.pendingArrays; this->allocationSiteTables += sizes.allocationSiteTables; this->arrayTypeTables += sizes.arrayTypeTables; this->objectTypeTables += sizes.objectTypeTables; - this->typeObjects += sizes.typeObjects; } }; +// Data for tracking JIT-code memory usage. +struct CodeSizes +{ + size_t jaeger; + size_t ion; + size_t asmJS; + size_t baseline; + size_t regexp; + size_t other; + size_t unused; + + CodeSizes() { memset(this, 0, sizeof(CodeSizes)); } +}; + // Holds data about a huge string (one which uses more HugeStringInfo::MinSize // bytes of memory), so we can report it individually. struct HugeStringInfo { - HugeStringInfo() - : length(0) - , size(0) - { - memset(&buffer, 0, sizeof(buffer)); - } + HugeStringInfo() : length(0), size(0) { memset(&buffer, 0, sizeof(buffer)); } // A string needs to take up this many bytes of storage before we consider // it to be "huge". - static size_t MinSize() - { - return js::MemoryReportingSundriesThreshold(); + static size_t MinSize() { + return js::MemoryReportingSundriesThreshold(); } // A string's size in memory is not necessarily equal to twice its length @@ -127,92 +136,149 @@ struct RuntimeSizes size_t contexts; size_t dtoa; size_t temporary; - size_t jaegerCode; - size_t ionCode; - size_t regexpCode; - size_t unusedCode; size_t regexpData; size_t stack; size_t gcMarker; size_t mathCache; - size_t scriptFilenames; size_t scriptData; size_t scriptSources; + + CodeSizes code; +}; + +struct ZoneStats +{ + ZoneStats() + : extra1(0), + gcHeapArenaAdmin(0), + gcHeapUnusedGcThings(0), + gcHeapStringsNormal(0), + gcHeapStringsShort(0), + gcHeapTypeObjects(0), + gcHeapIonCodes(0), + stringCharsNonHuge(0), + typeObjects(0), + typePool(0), + hugeStrings() + {} + + ZoneStats(const ZoneStats &other) + : extra1(other.extra1), + gcHeapArenaAdmin(other.gcHeapArenaAdmin), + gcHeapUnusedGcThings(other.gcHeapUnusedGcThings), + gcHeapStringsNormal(other.gcHeapStringsNormal), + gcHeapStringsShort(other.gcHeapStringsShort), + gcHeapTypeObjects(other.gcHeapTypeObjects), + gcHeapIonCodes(other.gcHeapIonCodes), + stringCharsNonHuge(other.stringCharsNonHuge), + typeObjects(other.typeObjects), + typePool(other.typePool), + hugeStrings() + { + hugeStrings.append(other.hugeStrings); + } + + // Add other's numbers to this object's numbers. + void add(ZoneStats &other) { + #define ADD(x) this->x += other.x + + ADD(gcHeapArenaAdmin); + ADD(gcHeapUnusedGcThings); + + ADD(gcHeapStringsNormal); + ADD(gcHeapStringsShort); + ADD(gcHeapTypeObjects); + ADD(gcHeapIonCodes); + + ADD(stringCharsNonHuge); + ADD(typeObjects); + ADD(typePool); + + #undef ADD + + hugeStrings.append(other.hugeStrings); + } + + // This field can be used by embedders. + void *extra1; + + size_t gcHeapArenaAdmin; + size_t gcHeapUnusedGcThings; + + size_t gcHeapStringsNormal; + size_t gcHeapStringsShort; + + size_t gcHeapTypeObjects; + size_t gcHeapIonCodes; + + size_t stringCharsNonHuge; + size_t typeObjects; + size_t typePool; + + js::Vector hugeStrings; + + // The size of all the live things in the GC heap that don't belong to any + // compartment. + size_t GCHeapThingsSize(); }; struct CompartmentStats { CompartmentStats() - : extra1(0) - , extra2(0) - , gcHeapArenaAdmin(0) - , gcHeapUnusedGcThings(0) - , gcHeapObjectsOrdinary(0) - , gcHeapObjectsFunction(0) - , gcHeapObjectsDenseArray(0) - , gcHeapObjectsSlowArray(0) - , gcHeapObjectsCrossCompartmentWrapper(0) - , gcHeapStringsNormal(0) - , gcHeapStringsShort(0) - , gcHeapShapesTreeGlobalParented(0) - , gcHeapShapesTreeNonGlobalParented(0) - , gcHeapShapesDict(0) - , gcHeapShapesBase(0) - , gcHeapScripts(0) - , gcHeapTypeObjects(0) - , gcHeapIonCodes(0) - , objectsExtra() - , stringCharsNonHuge(0) - , shapesExtraTreeTables(0) - , shapesExtraDictTables(0) - , shapesExtraTreeShapeKids(0) - , shapesCompartmentTables(0) - , scriptData(0) - , jaegerData(0) - , ionData(0) - , compartmentObject(0) - , crossCompartmentWrappersTable(0) - , regexpCompartment(0) - , debuggeesSet(0) - , typeInference() - , hugeStrings() + : extra1(0), + extra2(0), + gcHeapObjectsOrdinary(0), + gcHeapObjectsFunction(0), + gcHeapObjectsDenseArray(0), + gcHeapObjectsSlowArray(0), + gcHeapObjectsCrossCompartmentWrapper(0), + gcHeapShapesTreeGlobalParented(0), + gcHeapShapesTreeNonGlobalParented(0), + gcHeapShapesDict(0), + gcHeapShapesBase(0), + gcHeapScripts(0), + objectsExtra(), + shapesExtraTreeTables(0), + shapesExtraDictTables(0), + shapesExtraTreeShapeKids(0), + shapesCompartmentTables(0), + scriptData(0), + jaegerData(0), + ionData(0), + compartmentObject(0), + crossCompartmentWrappersTable(0), + regexpCompartment(0), + debuggeesSet(0), + typeInference() {} CompartmentStats(const CompartmentStats &other) - : extra1(other.extra1) - , extra2(other.extra2) - , gcHeapArenaAdmin(other.gcHeapArenaAdmin) - , gcHeapUnusedGcThings(other.gcHeapUnusedGcThings) - , gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary) - , gcHeapObjectsFunction(other.gcHeapObjectsFunction) - , gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray) - , gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray) - , gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper) - , gcHeapStringsNormal(other.gcHeapStringsNormal) - , gcHeapStringsShort(other.gcHeapStringsShort) - , gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented) - , gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented) - , gcHeapShapesDict(other.gcHeapShapesDict) - , gcHeapShapesBase(other.gcHeapShapesBase) - , gcHeapScripts(other.gcHeapScripts) - , gcHeapTypeObjects(other.gcHeapTypeObjects) - , gcHeapIonCodes(other.gcHeapIonCodes) - , objectsExtra(other.objectsExtra) - , stringCharsNonHuge(other.stringCharsNonHuge) - , shapesExtraTreeTables(other.shapesExtraTreeTables) - , shapesExtraDictTables(other.shapesExtraDictTables) - , shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids) - , shapesCompartmentTables(other.shapesCompartmentTables) - , scriptData(other.scriptData) - , jaegerData(other.jaegerData) - , ionData(other.ionData) - , compartmentObject(other.compartmentObject) - , crossCompartmentWrappersTable(other.crossCompartmentWrappersTable) - , regexpCompartment(other.regexpCompartment) - , debuggeesSet(other.debuggeesSet) - , typeInference(other.typeInference) + : extra1(other.extra1), + extra2(other.extra2), + gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary), + gcHeapObjectsFunction(other.gcHeapObjectsFunction), + gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray), + gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray), + gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper), + gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented), + gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented), + gcHeapShapesDict(other.gcHeapShapesDict), + gcHeapShapesBase(other.gcHeapShapesBase), + gcHeapScripts(other.gcHeapScripts), + objectsExtra(other.objectsExtra), + shapesExtraTreeTables(other.shapesExtraTreeTables), + shapesExtraDictTables(other.shapesExtraDictTables), + shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids), + shapesCompartmentTables(other.shapesCompartmentTables), + scriptData(other.scriptData), + jaegerData(other.jaegerData), + ionData(other.ionData), + compartmentObject(other.compartmentObject), + crossCompartmentWrappersTable(other.crossCompartmentWrappersTable), + regexpCompartment(other.regexpCompartment), + debuggeesSet(other.debuggeesSet), + typeInference(other.typeInference) { - hugeStrings.append(other.hugeStrings); } // These fields can be used by embedders. @@ -221,26 +287,18 @@ struct CompartmentStats // If you add a new number, remember to update the constructors, add(), and // maybe gcHeapThingsSize()! - size_t gcHeapArenaAdmin; - size_t gcHeapUnusedGcThings; - size_t gcHeapObjectsOrdinary; size_t gcHeapObjectsFunction; size_t gcHeapObjectsDenseArray; size_t gcHeapObjectsSlowArray; size_t gcHeapObjectsCrossCompartmentWrapper; - size_t gcHeapStringsNormal; - size_t gcHeapStringsShort; size_t gcHeapShapesTreeGlobalParented; size_t gcHeapShapesTreeNonGlobalParented; size_t gcHeapShapesDict; size_t gcHeapShapesBase; size_t gcHeapScripts; - size_t gcHeapTypeObjects; - size_t gcHeapIonCodes; ObjectsExtraSizes objectsExtra; - size_t stringCharsNonHuge; size_t shapesExtraTreeTables; size_t shapesExtraDictTables; size_t shapesExtraTreeShapeKids; @@ -254,33 +312,23 @@ struct CompartmentStats size_t debuggeesSet; TypeInferenceSizes typeInference; - js::Vector hugeStrings; // Add cStats's numbers to this object's numbers. - void add(CompartmentStats &cStats) - { + void add(CompartmentStats &cStats) { #define ADD(x) this->x += cStats.x - ADD(gcHeapArenaAdmin); - ADD(gcHeapUnusedGcThings); - ADD(gcHeapObjectsOrdinary); ADD(gcHeapObjectsFunction); ADD(gcHeapObjectsDenseArray); ADD(gcHeapObjectsSlowArray); ADD(gcHeapObjectsCrossCompartmentWrapper); - ADD(gcHeapStringsNormal); - ADD(gcHeapStringsShort); ADD(gcHeapShapesTreeGlobalParented); ADD(gcHeapShapesTreeNonGlobalParented); ADD(gcHeapShapesDict); ADD(gcHeapShapesBase); ADD(gcHeapScripts); - ADD(gcHeapTypeObjects); - ADD(gcHeapIonCodes); objectsExtra.add(cStats.objectsExtra); - ADD(stringCharsNonHuge); ADD(shapesExtraTreeTables); ADD(shapesExtraDictTables); ADD(shapesExtraTreeShapeKids); @@ -296,28 +344,29 @@ struct CompartmentStats #undef ADD typeInference.add(cStats.typeInference); - hugeStrings.append(cStats.hugeStrings); } // The size of all the live things in the GC heap. - size_t gcHeapThingsSize(); + size_t GCHeapThingsSize(); }; struct RuntimeStats { RuntimeStats(JSMallocSizeOfFun mallocSizeOf) - : runtime() - , gcHeapChunkTotal(0) - , gcHeapDecommittedArenas(0) - , gcHeapUnusedChunks(0) - , gcHeapUnusedArenas(0) - , gcHeapUnusedGcThings(0) - , gcHeapChunkAdmin(0) - , gcHeapGcThings(0) - , totals() - , compartmentStatsVector() - , currCompartmentStats(NULL) - , mallocSizeOf_(mallocSizeOf) + : runtime(), + gcHeapChunkTotal(0), + gcHeapDecommittedArenas(0), + gcHeapUnusedChunks(0), + gcHeapUnusedArenas(0), + gcHeapUnusedGcThings(0), + gcHeapChunkAdmin(0), + gcHeapGcThings(0), + cTotals(), + zTotals(), + compartmentStatsVector(), + zoneStatsVector(), + currZoneStats(NULL), + mallocSizeOf_(mallocSizeOf) {} RuntimeSizes runtime; @@ -352,21 +401,23 @@ struct RuntimeStats size_t gcHeapGcThings; // The sum of all compartment's measurements. - CompartmentStats totals; - + CompartmentStats cTotals; + ZoneStats zTotals; + js::Vector compartmentStatsVector; - CompartmentStats *currCompartmentStats; + js::Vector zoneStatsVector; + + ZoneStats *currZoneStats; JSMallocSizeOfFun mallocSizeOf_; virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0; + virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0; }; -#ifdef JS_THREADSAFE - class ObjectPrivateVisitor { -public: + public: // Within CollectRuntimeStats, this method is called for each JS object // that has an nsISupports pointer. virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0; @@ -387,13 +438,14 @@ CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor * extern JS_PUBLIC_API(int64_t) GetExplicitNonHeapForRuntime(JSRuntime *rt, JSMallocSizeOfFun mallocSizeOf); -#endif // JS_THREADSAFE +extern JS_PUBLIC_API(size_t) +SystemCompartmentCount(JSRuntime *rt); extern JS_PUBLIC_API(size_t) -SystemCompartmentCount(const JSRuntime *rt); +UserCompartmentCount(JSRuntime *rt); extern JS_PUBLIC_API(size_t) -UserCompartmentCount(const JSRuntime *rt); +PeakSizeOfTemporary(const JSRuntime *rt); } // namespace JS diff --git a/scripting/javascript/spidermonkey-mac/include/gc/Root.h b/scripting/javascript/spidermonkey-mac/include/js/RootingAPI.h similarity index 65% rename from scripting/javascript/spidermonkey-mac/include/gc/Root.h rename to scripting/javascript/spidermonkey-mac/include/js/RootingAPI.h index 53a72ea49b..0f1e6b459c 100644 --- a/scripting/javascript/spidermonkey-mac/include/gc/Root.h +++ b/scripting/javascript/spidermonkey-mac/include/js/RootingAPI.h @@ -40,8 +40,7 @@ * * If |DoSomething()| cannot trigger a GC, and the same holds for all other * calls made between |obj|'s definitions and its last uses, then no rooting - * is required. The |Unrooted| class below is used to ensure that this - * property is true and remains true in the future. + * is required. * * SpiderMonkey can trigger a GC at almost any time and in ways that are not * always clear. For example, the following innocuous-looking actions can @@ -84,30 +83,6 @@ * - Pass Handle through your hot call stack to avoid re-rooting costs at * every invocation. * - * If this is not enough, the following family of two classes and two - * functions can provide partially type-safe and mostly runtime-safe access to - * GC things. - * - * - AutoAssertNoGC is a scoped guard that will trigger an assertion if a GC, - * or an appropriately marked method that might GC, is entered when it is in - * scope. By convention the name given to instances of this guard is |nogc|. - * - * - AssertCanGC() will assert if an AutoAssertNoGC is in scope either locally - * or anywhere in the call stack. - * - * - UnrootedT is a typedef for a pointer to thing of type T. In DEBUG builds - * it gets replaced by a class that additionally acts as an AutoAssertNoGC - * guard. Since there is only minimal compile-time protection against - * mis-use, UnrootedT should only be used in places where there is adequate - * coverage of AutoAssertNoGC and AssertCanGC guards to ensure that mis-use - * is caught at runtime. - * - * - DropUnrooted(UnrootedT &v) will poison |v| and end its AutoAssertNoGC - * scope. This can be used to force |v| out of scope before its C++ scope - * would end naturally. The usage of braces C++ syntactical scopes |{...}| - * is strongly perferred to this, but sometimes will not work because of - * awkwardly overlapping lifetimes. - * * There also exists a set of RawT typedefs for modules without rooting * concerns, such as the GC. Do not use these as they provide no rooting * protection whatsoever. @@ -115,12 +90,8 @@ * The following diagram explains the list of supported, implicit type * conversions between classes of this family: * - * RawT ----> UnrootedT - * | ^ - * | | - * | v - * +--------> Rooted <---> Handle - * ^ ^ + * RawT -----> Rooted ----> Handle + * | ^ * | | * | | * +---> MutableHandle @@ -135,9 +106,6 @@ namespace js { class Module; -template class Rooted; -template class Unrooted; - template struct RootMethods {}; @@ -150,20 +118,34 @@ class HandleBase {}; template class MutableHandleBase {}; +/* + * js::NullPtr acts like a NULL pointer in contexts that require a Handle. + * + * Handle provides an implicit constructor for js::NullPtr so that, given: + * foo(Handle h); + * callers can simply write: + * foo(js::NullPtr()); + * which avoids creating a Rooted just to pass NULL. + * + * This is the SpiderMonkey internal variant. js::NullPtr should be used in + * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API + * symbols. + */ +struct NullPtr +{ + static void * const constNullValue; +}; + } /* namespace js */ namespace JS { -class AutoAssertNoGC; +template class Rooted; template class Handle; template class MutableHandle; -JS_FRIEND_API(void) EnterAssertNoGCScope(); -JS_FRIEND_API(void) LeaveAssertNoGCScope(); - -/* These are exposing internal state of the GC for inlining purposes. */ -JS_FRIEND_API(bool) InNoGCScope(); +/* This is exposing internal state of the GC for inlining purposes. */ JS_FRIEND_API(bool) isGCEnabled(); #if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) @@ -172,13 +154,15 @@ CheckStackRoots(JSContext *cx); #endif /* - * Handle provides an implicit constructor for NullPtr so that, given: + * JS::NullPtr acts like a NULL pointer in contexts that require a Handle. + * + * Handle provides an implicit constructor for JS::NullPtr so that, given: * foo(Handle h); * callers can simply write: - * foo(NullPtr()); + * foo(JS::NullPtr()); * which avoids creating a Rooted just to pass NULL. */ -struct NullPtr +struct JS_PUBLIC_API(NullPtr) { static void * const constNullValue; }; @@ -206,9 +190,17 @@ class Handle : public js::HandleBase } /* Create a handle for a NULL pointer. */ - Handle(NullPtr) { - typedef typename js::tl::StaticAssert::value>::result _; - ptr = reinterpret_cast(&NullPtr::constNullValue); + Handle(js::NullPtr) { + MOZ_STATIC_ASSERT(mozilla::IsPointer::value, + "js::NullPtr overload not valid for non-pointer types"); + ptr = reinterpret_cast(&js::NullPtr::constNullValue); + } + + /* Create a handle for a NULL pointer. */ + Handle(JS::NullPtr) { + MOZ_STATIC_ASSERT(mozilla::IsPointer::value, + "JS::NullPtr overload not valid for non-pointer types"); + ptr = reinterpret_cast(&JS::NullPtr::constNullValue); } Handle(MutableHandle handle) { @@ -234,7 +226,7 @@ class Handle : public js::HandleBase */ template inline - Handle(js::Rooted &root, + Handle(Rooted &root, typename mozilla::EnableIf::value, int>::Type dummy = 0); /* Construct a read only handle from a mutable handle. */ @@ -281,7 +273,7 @@ template class MutableHandle : public js::MutableHandleBase { public: - inline MutableHandle(js::Rooted *root); + inline MutableHandle(Rooted *root); void set(T v) { JS_ASSERT(!js::RootMethods::poisoned(v)); @@ -365,7 +357,7 @@ class InternalHandle * Create an InternalHandle to a field within a Rooted<>. */ template - InternalHandle(const Rooted &root, T *field) + InternalHandle(const JS::Rooted &root, T *field) : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get())) {} @@ -389,190 +381,25 @@ class InternalHandle * fromMarkedLocation(). */ InternalHandle(T *field) - : holder(reinterpret_cast(&JS::NullPtr::constNullValue)), + : holder(reinterpret_cast(&js::NullPtr::constNullValue)), offset(uintptr_t(field)) {} }; -#ifdef DEBUG /* - * |Unrooted| acts as an AutoAssertNoGC after it is initialized. It otherwise - * acts like as a normal pointer of type T. + * This macro simplifies forward declaration of a class and its matching raw-pointer. */ -template -class Unrooted -{ - public: - Unrooted() : ptr_(UninitializedTag()) {} - - /* - * |Unrooted| can be initialized from a convertible |Rooted| or - * |Handle|. This is so that we can call AutoAssertNoGC methods that - * take |Unrooted| parameters with a convertible rooted argument - * without explicit unpacking. - * - * Note: Even though this allows implicit conversion to |Unrooted| - * type, this is safe because Unrooted acts as an AutoAssertNoGC scope. - */ - template - inline Unrooted(const Rooted &root, - typename mozilla::EnableIf::value, int>::Type dummy = 0); - - template - Unrooted(const JS::Handle &root, - typename mozilla::EnableIf::value, int>::Type dummy = 0) - : ptr_(root.get()) - { - JS_ASSERT(ptr_ != UninitializedTag()); - JS::EnterAssertNoGCScope(); - } - - /* - * |Unrooted| can initialize by copying from a convertible type - * |Unrooted|. This enables usage such as: - * - * Unrooted base = js_NewBaseShape(cx); - * Unrooted ubase = static_cast(ubase); - */ - template - Unrooted(const Unrooted &other) - /* Note: |static_cast| acquires other.ptr_ in DEBUG builds. */ - : ptr_(static_cast(static_cast(other))) - { - if (ptr_ != UninitializedTag()) - JS::EnterAssertNoGCScope(); - } - - Unrooted(const Unrooted &other) : ptr_(other.ptr_) { - if (ptr_ != UninitializedTag()) - JS::EnterAssertNoGCScope(); - } - - Unrooted(const T &p) : ptr_(p) { - JS_ASSERT(ptr_ != UninitializedTag()); - JS::EnterAssertNoGCScope(); - } - - Unrooted(const JS::NullPtr &) : ptr_(NULL) { - JS::EnterAssertNoGCScope(); - } - - ~Unrooted() { - if (ptr_ != UninitializedTag()) - JS::LeaveAssertNoGCScope(); - } - - void drop() { - if (ptr_ != UninitializedTag()) - JS::LeaveAssertNoGCScope(); - ptr_ = UninitializedTag(); - } - - /* See notes for Unrooted::Unrooted(const T &) */ - Unrooted &operator=(T other) { - JS_ASSERT(other != UninitializedTag()); - if (ptr_ == UninitializedTag()) - JS::EnterAssertNoGCScope(); - ptr_ = other; - return *this; - } - Unrooted &operator=(Unrooted other) { - JS_ASSERT(other.ptr_ != UninitializedTag()); - if (ptr_ == UninitializedTag()) - JS::EnterAssertNoGCScope(); - ptr_ = other.ptr_; - return *this; - } - - operator T() const { return (ptr_ == UninitializedTag()) ? NULL : ptr_; } - T *operator&() { return &ptr_; } - const T operator->() const { JS_ASSERT(ptr_ != UninitializedTag()); return ptr_; } - bool operator==(const T &other) { return ptr_ == other; } - bool operator!=(const T &other) { return ptr_ != other; } - - private: - /* - * The after-initialization constraint is to handle the case: - * - * Unrooted foo = js_NewFoo(cx); - * - * In this case, C++ may run the default constructor, then call MaybeGC, - * and finally call the assignment operator. We cannot handle this case by - * simply checking if the pointer is NULL, since that would disable the - * NoGCScope on assignment. Instead we tag the pointer when we should - * disable the LeaveNoGCScope. - */ - static inline T UninitializedTag() { return reinterpret_cast(2); }; - - T ptr_; -}; - -/* - * This macro simplifies declaration of the required matching raw-pointer for - * optimized builds and Unrooted template for debug builds. - */ -# define ForwardDeclare(type) \ - class type; \ - typedef Unrooted Unrooted##type; \ +# define ForwardDeclare(type) \ + class type; \ typedef type * Raw##type -# define ForwardDeclareJS(type) \ - class JS##type; \ - namespace js { \ - typedef js::Unrooted Unrooted##type; \ - typedef JS##type * Raw##type; \ - } \ +# define ForwardDeclareJS(type) \ + class JS##type; \ + namespace js { \ + typedef JS##type * Raw##type; \ + } \ class JS##type -template -T DropUnrooted(Unrooted &unrooted) -{ - T rv = unrooted; - unrooted.drop(); - return rv; -} - -template -T DropUnrooted(T &unrooted) -{ - T rv = unrooted; - JS::PoisonPtr(&unrooted); - return rv; -} - -template <> -inline RawId DropUnrooted(RawId &id) { return id; } - -#else /* NDEBUG */ - -/* In opt builds |UnrootedFoo| is a real |Foo*|. */ -# define ForwardDeclare(type) \ - class type; \ - typedef type * Unrooted##type; \ - typedef type * Raw##type - -# define ForwardDeclareJS(type) \ - class JS##type; \ - namespace js { \ - typedef JS##type * Unrooted##type; \ - typedef JS##type * Raw##type; \ - } \ - class JS##type - -template -class Unrooted -{ - private: - Unrooted() MOZ_DELETE; - Unrooted(const Unrooted &) MOZ_DELETE; - ~Unrooted() MOZ_DELETE; -}; - -template -T DropUnrooted(T &unrooted) { return unrooted; } - -#endif /* DEBUG */ - /* * By default, pointers should use the inheritance hierarchy to find their * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that @@ -589,9 +416,13 @@ struct RootMethods { static T *initial() { return NULL; } static ThingRootKind kind() { return RootKind::rootKind(); } - static bool poisoned(T *v) { return IsPoisonedPtr(v); } + static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); } }; +} /* namespace js */ + +namespace JS { + /* * Local variable of type T whose value is always rooted. This is typically * used for local variables, or for non-rooted values being passed to a @@ -601,18 +432,18 @@ struct RootMethods * specialization, define a RootedBase specialization containing them. */ template -class Rooted : public RootedBase +class Rooted : public js::RootedBase { void init(JSContext *cxArg) { #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) - ContextFriendFields *cx = ContextFriendFields::get(cxArg); + js::ContextFriendFields *cx = js::ContextFriendFields::get(cxArg); commonInit(cx->thingGCRooters); #endif } - void init(PerThreadData *ptArg) { + void init(js::PerThreadData *ptArg) { #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) - PerThreadDataFriendFields *pt = PerThreadDataFriendFields::get(ptArg); + js::PerThreadDataFriendFields *pt = js::PerThreadDataFriendFields::get(ptArg); commonInit(pt->thingGCRooters); #endif } @@ -620,7 +451,7 @@ class Rooted : public RootedBase public: Rooted(JSContext *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) - : ptr(RootMethods::initial()) + : ptr(js::RootMethods::initial()) { MOZ_GUARD_OBJECT_NOTIFIER_INIT; init(cx); @@ -634,24 +465,15 @@ class Rooted : public RootedBase init(cx); } - template - Rooted(JSContext *cx, const Unrooted &initial + Rooted(js::PerThreadData *pt MOZ_GUARD_OBJECT_NOTIFIER_PARAM) - : ptr(static_cast(initial)) - { - MOZ_GUARD_OBJECT_NOTIFIER_INIT; - init(cx); - } - - Rooted(PerThreadData *pt - MOZ_GUARD_OBJECT_NOTIFIER_PARAM) - : ptr(RootMethods::initial()) + : ptr(js::RootMethods::initial()) { MOZ_GUARD_OBJECT_NOTIFIER_INIT; init(pt); } - Rooted(PerThreadData *pt, T initial + Rooted(js::PerThreadData *pt, T initial MOZ_GUARD_OBJECT_NOTIFIER_PARAM) : ptr(initial) { @@ -659,18 +481,9 @@ class Rooted : public RootedBase init(pt); } - template - Rooted(PerThreadData *pt, const Unrooted &initial - MOZ_GUARD_OBJECT_NOTIFIER_PARAM) - : ptr(static_cast(initial)) - { - MOZ_GUARD_OBJECT_NOTIFIER_INIT; - init(pt); - } - ~Rooted() { #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) - JS_ASSERT(*stack == this); + JS_ASSERT(*stack == reinterpret_cast*>(this)); *stack = prev; #endif } @@ -687,7 +500,7 @@ class Rooted : public RootedBase const T &get() const { return ptr; } T &operator=(T value) { - JS_ASSERT(!RootMethods::poisoned(value)); + JS_ASSERT(!js::RootMethods::poisoned(value)); ptr = value; return ptr; } @@ -703,20 +516,20 @@ class Rooted : public RootedBase private: void commonInit(Rooted **thingGCRooters) { #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) - ThingRootKind kind = RootMethods::kind(); - this->stack = reinterpret_cast**>(&thingGCRooters[kind]); + js::ThingRootKind kind = js::RootMethods::kind(); + this->stack = &thingGCRooters[kind]; this->prev = *stack; - *stack = this; + *stack = reinterpret_cast*>(this); - JS_ASSERT(!RootMethods::poisoned(ptr)); + JS_ASSERT(!js::RootMethods::poisoned(ptr)); #endif } #if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) - Rooted **stack, *prev; + Rooted **stack, *prev; #endif -#if defined(JSGC_ROOT_ANALYSIS) +#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) /* Has the rooting analysis ever scanned this Rooted's stack location? */ friend void JS::CheckStackRoots(JSContext*); bool scanned; @@ -739,18 +552,6 @@ template <> class Rooted; #endif -#ifdef DEBUG -template template -inline -Unrooted::Unrooted(const Rooted &root, - typename mozilla::EnableIf::value, int>::Type dummy) - : ptr_(root.get()) -{ - JS_ASSERT(ptr_ != UninitializedTag()); - JS::EnterAssertNoGCScope(); -} -#endif /* DEBUG */ - typedef Rooted RootedObject; typedef Rooted RootedModule; typedef Rooted RootedFunction; @@ -759,6 +560,10 @@ typedef Rooted RootedString; typedef Rooted RootedId; typedef Rooted RootedValue; +} /* namespace JS */ + +namespace js { + /* * Mark a stack location as a root for the rooting analysis, without actually * rooting it in release builds. This should only be used for stack locations @@ -852,14 +657,6 @@ class FakeRooted : public RootedBase MOZ_GUARD_OBJECT_NOTIFIER_INIT; } - template - FakeRooted(JSContext *cx, const Unrooted &initial - MOZ_GUARD_OBJECT_NOTIFIER_PARAM) - : ptr(static_cast(initial)) - { - MOZ_GUARD_OBJECT_NOTIFIER_INIT; - } - operator T() const { return ptr; } T operator->() const { return ptr; } T *address() { return &ptr; } @@ -938,15 +735,15 @@ class MaybeRooted template class MaybeRooted { public: - typedef Handle HandleType; - typedef Rooted RootType; - typedef MutableHandle MutableHandleType; + typedef JS::Handle HandleType; + typedef JS::Rooted RootType; + typedef JS::MutableHandle MutableHandleType; - static inline Handle toHandle(HandleType v) { + static inline JS::Handle toHandle(HandleType v) { return v; } - static inline MutableHandle toMutableHandle(MutableHandleType v) { + static inline JS::MutableHandle toMutableHandle(MutableHandleType v) { return v; } }; @@ -958,14 +755,14 @@ template class MaybeRooted typedef FakeRooted RootType; typedef FakeMutableHandle MutableHandleType; - static inline Handle toHandle(HandleType v) { + static inline JS::Handle toHandle(HandleType v) { JS_NOT_REACHED("Bad conversion"); - return Handle::fromMarkedLocation(NULL); + return JS::Handle::fromMarkedLocation(NULL); } - static inline MutableHandle toMutableHandle(MutableHandleType v) { + static inline JS::MutableHandle toMutableHandle(MutableHandleType v) { JS_NOT_REACHED("Bad conversion"); - return MutableHandle::fromMarkedLocation(NULL); + return JS::MutableHandle::fromMarkedLocation(NULL); } }; @@ -975,7 +772,7 @@ namespace JS { template template inline -Handle::Handle(js::Rooted &root, +Handle::Handle(Rooted &root, typename mozilla::EnableIf::value, int>::Type dummy) { ptr = reinterpret_cast(root.address()); @@ -991,46 +788,11 @@ Handle::Handle(MutableHandle &root, template inline -MutableHandle::MutableHandle(js::Rooted *root) +MutableHandle::MutableHandle(Rooted *root) { ptr = root->address(); } -/* - * The scoped guard object AutoAssertNoGC forces the GC to assert if a GC is - * attempted while the guard object is live. If you have a GC-unsafe operation - * to perform, use this guard object to protect your operation. - */ -class AutoAssertNoGC -{ - MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER - -public: - AutoAssertNoGC(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) { - MOZ_GUARD_OBJECT_NOTIFIER_INIT; -#ifdef DEBUG - EnterAssertNoGCScope(); -#endif - } - - ~AutoAssertNoGC() { -#ifdef DEBUG - LeaveAssertNoGCScope(); -#endif - } -}; - -/* - * AssertCanGC will assert if it is called inside of an AutoAssertNoGC region. - */ -JS_ALWAYS_INLINE void -AssertCanGC() -{ - JS_ASSERT_IF(isGCEnabled(), !InNoGCScope()); -} - -JS_FRIEND_API(bool) NeedRelaxedRootChecks(); - } /* namespace JS */ namespace js { @@ -1039,13 +801,10 @@ namespace js { * Hook for dynamic root analysis. Checks the native stack and poisons * references to GC things which have not been rooted. */ -inline void MaybeCheckStackRoots(JSContext *cx, bool relax = true) +inline void MaybeCheckStackRoots(JSContext *cx) { - JS::AssertCanGC(); #if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) - if (relax && NeedRelaxedRootChecks()) - return; - CheckStackRoots(cx); + JS::CheckStackRoots(cx); #endif } diff --git a/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h b/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h index 6d35f74ec6..254c7fe752 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h +++ b/scripting/javascript/spidermonkey-mac/include/js/TemplateLib.h @@ -64,17 +64,17 @@ template struct BitSize { static const size_t result = sizeof(T) * JS_BITS_PER_BYTE; }; -/* Allow Assertions by only including the 'result' typedef if 'true'. */ -template struct StaticAssert {}; -template <> struct StaticAssert { typedef int result; }; - /* * Produce an N-bit mask, where N <= BitSize::result. Handle the * language-undefined edge case when N = BitSize::result. */ template struct NBitMask { - typedef typename StaticAssert::result>::result _; - static const size_t result = (size_t(1) << N) - 1; + // Assert the precondition. On success this evaluates to 0. Otherwise it + // triggers divide-by-zero at compile time: a guaranteed compile error in + // C++11, and usually one in C++98. Add this value to |result| to assure + // its computation. + static const size_t checkPrecondition = 0 / size_t(N < BitSize::result); + static const size_t result = (size_t(1) << N) - 1 + checkPrecondition; }; template <> struct NBitMask::result> { static const size_t result = size_t(-1); diff --git a/scripting/javascript/spidermonkey-mac/include/js/Utility.h b/scripting/javascript/spidermonkey-mac/include/js/Utility.h index 0020be6b46..deceff2488 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/Utility.h +++ b/scripting/javascript/spidermonkey-mac/include/js/Utility.h @@ -31,12 +31,7 @@ namespace JS {} namespace mozilla {} /* The private JS engine namespace. */ -namespace js { - -/* The private namespace is a superset of the public/shared namespaces. */ -using namespace JS; - -} /* namespace js */ +namespace js {} /* * Pattern used to overwrite freed memory. If you are accessing an object with @@ -563,6 +558,13 @@ struct ScopedDeletePtrTraits : public ScopedFreePtrTraits }; SCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits) +template +struct ScopedReleasePtrTraits : public ScopedFreePtrTraits +{ + static void release(T *ptr) { if (ptr) ptr->release(); } +}; +SCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits) + } /* namespace js */ namespace js { diff --git a/scripting/javascript/spidermonkey-mac/include/js/Value.h b/scripting/javascript/spidermonkey-mac/include/js/Value.h index f01f8dff7b..a9a7bfd400 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/Value.h +++ b/scripting/javascript/spidermonkey-mac/include/js/Value.h @@ -16,8 +16,8 @@ #include /* for std::numeric_limits */ -#include "gc/Root.h" #include "js/Anchor.h" +#include "js/RootingAPI.h" #include "js/Utility.h" namespace JS { class Value; } @@ -342,7 +342,7 @@ JS_STATIC_ASSERT(sizeof(jsval_layout) == 8); * Thus, all comparisons should explicitly cast operands to uint32_t. */ -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout BUILD_JSVAL(JSValueTag tag, uint32_t payload) { jsval_layout l; @@ -350,13 +350,13 @@ BUILD_JSVAL(JSValueTag tag, uint32_t payload) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_DOUBLE_IMPL(jsval_layout l) { return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout DOUBLE_TO_JSVAL_IMPL(double d) { jsval_layout l; @@ -365,19 +365,19 @@ DOUBLE_TO_JSVAL_IMPL(double d) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_INT32_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_INT32; } -static MOZ_ALWAYS_INLINE int32_t +static inline int32_t JSVAL_TO_INT32_IMPL(jsval_layout l) { return l.s.payload.i32; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout INT32_TO_JSVAL_IMPL(int32_t i) { jsval_layout l; @@ -386,7 +386,7 @@ INT32_TO_JSVAL_IMPL(int32_t i) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_NUMBER_IMPL(jsval_layout l) { JSValueTag tag = l.s.tag; @@ -394,19 +394,19 @@ JSVAL_IS_NUMBER_IMPL(jsval_layout l) return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_UNDEFINED_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_UNDEFINED; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_STRING_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_STRING; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout STRING_TO_JSVAL_IMPL(JSString *str) { jsval_layout l; @@ -416,25 +416,25 @@ STRING_TO_JSVAL_IMPL(JSString *str) return l; } -static MOZ_ALWAYS_INLINE JSString * +static inline JSString * JSVAL_TO_STRING_IMPL(jsval_layout l) { return l.s.payload.str; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_BOOLEAN_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_BOOLEAN; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_TO_BOOLEAN_IMPL(jsval_layout l) { return l.s.payload.boo; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout BOOLEAN_TO_JSVAL_IMPL(JSBool b) { jsval_layout l; @@ -444,38 +444,38 @@ BOOLEAN_TO_JSVAL_IMPL(JSBool b) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_MAGIC_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_MAGIC; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_OBJECT_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_OBJECT; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l) { return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l) { MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT); return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET; } -static MOZ_ALWAYS_INLINE JSObject * +static inline JSObject * JSVAL_TO_OBJECT_IMPL(jsval_layout l) { return l.s.payload.obj; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout OBJECT_TO_JSVAL_IMPL(JSObject *obj) { jsval_layout l; @@ -485,13 +485,13 @@ OBJECT_TO_JSVAL_IMPL(JSObject *obj) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_NULL_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_NULL; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr) { jsval_layout l; @@ -502,50 +502,50 @@ PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr) return l; } -static MOZ_ALWAYS_INLINE void * +static inline void * JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l) { return l.s.payload.ptr; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_GCTHING_IMPL(jsval_layout l) { /* gcc sometimes generates signed < without explicit casts. */ return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET; } -static MOZ_ALWAYS_INLINE void * +static inline void * JSVAL_TO_GCTHING_IMPL(jsval_layout l) { return l.s.payload.ptr; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) { return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT; } -static MOZ_ALWAYS_INLINE uint32_t +static inline uint32_t JSVAL_TRACE_KIND_IMPL(jsval_layout l) { return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32) { return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b) { return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b); } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) { jsval_layout l; @@ -554,14 +554,14 @@ MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs) { JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag; return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR); } -static MOZ_ALWAYS_INLINE JSValueType +static inline JSValueType JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l) { uint32_t type = l.s.tag & 0xF; @@ -571,7 +571,7 @@ JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l) #elif JS_BITS_PER_WORD == 64 -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout BUILD_JSVAL(JSValueTag tag, uint64_t payload) { jsval_layout l; @@ -579,13 +579,13 @@ BUILD_JSVAL(JSValueTag tag, uint64_t payload) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_DOUBLE_IMPL(jsval_layout l) { return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout DOUBLE_TO_JSVAL_IMPL(double d) { jsval_layout l; @@ -594,19 +594,19 @@ DOUBLE_TO_JSVAL_IMPL(double d) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_INT32_IMPL(jsval_layout l) { return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32; } -static MOZ_ALWAYS_INLINE int32_t +static inline int32_t JSVAL_TO_INT32_IMPL(jsval_layout l) { return (int32_t)l.asBits; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout INT32_TO_JSVAL_IMPL(int32_t i32) { jsval_layout l; @@ -614,25 +614,25 @@ INT32_TO_JSVAL_IMPL(int32_t i32) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_NUMBER_IMPL(jsval_layout l) { return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_UNDEFINED_IMPL(jsval_layout l) { return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_STRING_IMPL(jsval_layout l) { return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout STRING_TO_JSVAL_IMPL(JSString *str) { jsval_layout l; @@ -643,25 +643,25 @@ STRING_TO_JSVAL_IMPL(JSString *str) return l; } -static MOZ_ALWAYS_INLINE JSString * +static inline JSString * JSVAL_TO_STRING_IMPL(jsval_layout l) { return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_BOOLEAN_IMPL(jsval_layout l) { return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_TO_BOOLEAN_IMPL(jsval_layout l) { return (JSBool)l.asBits; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout BOOLEAN_TO_JSVAL_IMPL(JSBool b) { jsval_layout l; @@ -670,33 +670,33 @@ BOOLEAN_TO_JSVAL_IMPL(JSBool b) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_MAGIC_IMPL(jsval_layout l) { return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l) { return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_OBJECT_IMPL(jsval_layout l) { MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT); return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l) { MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT); return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET; } -static MOZ_ALWAYS_INLINE JSObject * +static inline JSObject * JSVAL_TO_OBJECT_IMPL(jsval_layout l) { uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK; @@ -704,7 +704,7 @@ JSVAL_TO_OBJECT_IMPL(jsval_layout l) return (JSObject *)ptrBits; } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout OBJECT_TO_JSVAL_IMPL(JSObject *obj) { jsval_layout l; @@ -715,19 +715,19 @@ OBJECT_TO_JSVAL_IMPL(JSObject *obj) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_NULL_IMPL(jsval_layout l) { return l.asBits == JSVAL_SHIFTED_TAG_NULL; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_GCTHING_IMPL(jsval_layout l) { return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET; } -static MOZ_ALWAYS_INLINE void * +static inline void * JSVAL_TO_GCTHING_IMPL(jsval_layout l) { uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK; @@ -735,19 +735,19 @@ JSVAL_TO_GCTHING_IMPL(jsval_layout l) return (void *)ptrBits; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_TRACEABLE_IMPL(jsval_layout l) { return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l); } -static MOZ_ALWAYS_INLINE uint32_t +static inline uint32_t JSVAL_TRACE_KIND_IMPL(jsval_layout l) { return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l)); } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr) { jsval_layout l; @@ -758,26 +758,26 @@ PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr) return l; } -static MOZ_ALWAYS_INLINE void * +static inline void * JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l) { MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0); return (void *)(l.asBits << 1); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32) { return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b) { return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN); } -static MOZ_ALWAYS_INLINE jsval_layout +static inline jsval_layout MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) { jsval_layout l; @@ -785,7 +785,7 @@ MAGIC_TO_JSVAL_IMPL(JSWhyMagic why) return l; } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs) { uint64_t lbits = lhs.asBits, rbits = rhs.asBits; @@ -793,7 +793,7 @@ JSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs) (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0); } -static MOZ_ALWAYS_INLINE JSValueType +static inline JSValueType JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l) { uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF; @@ -803,7 +803,7 @@ JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l) #endif /* JS_BITS_PER_WORD */ -static MOZ_ALWAYS_INLINE double +static inline double JS_CANONICALIZE_NAN(double d) { if (MOZ_UNLIKELY(d != d)) { @@ -814,8 +814,8 @@ JS_CANONICALIZE_NAN(double d) return d; } -static MOZ_ALWAYS_INLINE jsval_layout JSVAL_TO_IMPL(JS::Value v); -static MOZ_ALWAYS_INLINE JS::Value IMPL_TO_JSVAL(jsval_layout l); +static inline jsval_layout JSVAL_TO_IMPL(JS::Value v); +static inline JS::Value IMPL_TO_JSVAL(jsval_layout l); namespace JS { @@ -864,66 +864,54 @@ class Value /*** Mutators ***/ - MOZ_ALWAYS_INLINE void setNull() { data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits; } - MOZ_ALWAYS_INLINE void setUndefined() { data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits; } - MOZ_ALWAYS_INLINE void setInt32(int32_t i) { data = INT32_TO_JSVAL_IMPL(i); } - MOZ_ALWAYS_INLINE int32_t &getInt32Ref() { MOZ_ASSERT(isInt32()); return data.s.payload.i32; } - MOZ_ALWAYS_INLINE void setDouble(double d) { data = DOUBLE_TO_JSVAL_IMPL(d); } - MOZ_ALWAYS_INLINE double &getDoubleRef() { MOZ_ASSERT(isDouble()); return data.asDouble; } - MOZ_ALWAYS_INLINE void setString(JSString *str) { MOZ_ASSERT(!IsPoisonedPtr(str)); data = STRING_TO_JSVAL_IMPL(str); } - MOZ_ALWAYS_INLINE void setString(const JS::Anchor &str) { setString(str.get()); } - MOZ_ALWAYS_INLINE void setObject(JSObject &obj) { MOZ_ASSERT(!IsPoisonedPtr(&obj)); data = OBJECT_TO_JSVAL_IMPL(&obj); } - MOZ_ALWAYS_INLINE void setBoolean(bool b) { data = BOOLEAN_TO_JSVAL_IMPL(b); } - MOZ_ALWAYS_INLINE void setMagic(JSWhyMagic why) { data = MAGIC_TO_JSVAL_IMPL(why); } - MOZ_ALWAYS_INLINE bool setNumber(uint32_t ui) { if (ui > JSVAL_INT_MAX) { setDouble((double)ui); @@ -934,7 +922,6 @@ class Value } } - MOZ_ALWAYS_INLINE bool setNumber(double d) { int32_t i; if (MOZ_DOUBLE_IS_INT32(d, &i)) { @@ -946,7 +933,6 @@ class Value } } - MOZ_ALWAYS_INLINE void setObjectOrNull(JSObject *arg) { if (arg) setObject(*arg); @@ -954,7 +940,6 @@ class Value setNull(); } - MOZ_ALWAYS_INLINE void swap(Value &rhs) { uint64_t tmp = rhs.data.asBits; rhs.data.asBits = data.asBits; @@ -963,104 +948,84 @@ class Value /*** Value type queries ***/ - MOZ_ALWAYS_INLINE bool isUndefined() const { return JSVAL_IS_UNDEFINED_IMPL(data); } - MOZ_ALWAYS_INLINE bool isNull() const { return JSVAL_IS_NULL_IMPL(data); } - MOZ_ALWAYS_INLINE bool isNullOrUndefined() const { return isNull() || isUndefined(); } - MOZ_ALWAYS_INLINE bool isInt32() const { return JSVAL_IS_INT32_IMPL(data); } - MOZ_ALWAYS_INLINE bool isInt32(int32_t i32) const { return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32); } - MOZ_ALWAYS_INLINE bool isDouble() const { return JSVAL_IS_DOUBLE_IMPL(data); } - MOZ_ALWAYS_INLINE bool isNumber() const { return JSVAL_IS_NUMBER_IMPL(data); } - MOZ_ALWAYS_INLINE bool isString() const { return JSVAL_IS_STRING_IMPL(data); } - MOZ_ALWAYS_INLINE bool isObject() const { return JSVAL_IS_OBJECT_IMPL(data); } - MOZ_ALWAYS_INLINE bool isPrimitive() const { return JSVAL_IS_PRIMITIVE_IMPL(data); } - MOZ_ALWAYS_INLINE bool isObjectOrNull() const { return JSVAL_IS_OBJECT_OR_NULL_IMPL(data); } - MOZ_ALWAYS_INLINE bool isGCThing() const { return JSVAL_IS_GCTHING_IMPL(data); } - MOZ_ALWAYS_INLINE bool isBoolean() const { return JSVAL_IS_BOOLEAN_IMPL(data); } - MOZ_ALWAYS_INLINE bool isTrue() const { return JSVAL_IS_SPECIFIC_BOOLEAN(data, true); } - MOZ_ALWAYS_INLINE bool isFalse() const { return JSVAL_IS_SPECIFIC_BOOLEAN(data, false); } - MOZ_ALWAYS_INLINE bool isMagic() const { return JSVAL_IS_MAGIC_IMPL(data); } - MOZ_ALWAYS_INLINE bool isMagic(JSWhyMagic why) const { MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why); return JSVAL_IS_MAGIC_IMPL(data); } - MOZ_ALWAYS_INLINE bool isMarkable() const { return JSVAL_IS_TRACEABLE_IMPL(data); } - MOZ_ALWAYS_INLINE JSGCTraceKind gcKind() const { MOZ_ASSERT(isMarkable()); return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data)); } - MOZ_ALWAYS_INLINE JSWhyMagic whyMagic() const { MOZ_ASSERT(isMagic()); return data.s.payload.why; @@ -1068,12 +1033,10 @@ class Value /*** Comparison ***/ - MOZ_ALWAYS_INLINE bool operator==(const Value &rhs) const { return data.asBits == rhs.data.asBits; } - MOZ_ALWAYS_INLINE bool operator!=(const Value &rhs) const { return data.asBits != rhs.data.asBits; } @@ -1082,66 +1045,55 @@ class Value /*** Extract the value's typed payload ***/ - MOZ_ALWAYS_INLINE int32_t toInt32() const { MOZ_ASSERT(isInt32()); return JSVAL_TO_INT32_IMPL(data); } - MOZ_ALWAYS_INLINE double toDouble() const { MOZ_ASSERT(isDouble()); return data.asDouble; } - MOZ_ALWAYS_INLINE double toNumber() const { MOZ_ASSERT(isNumber()); return isDouble() ? toDouble() : double(toInt32()); } - MOZ_ALWAYS_INLINE JSString *toString() const { MOZ_ASSERT(isString()); return JSVAL_TO_STRING_IMPL(data); } - MOZ_ALWAYS_INLINE JSObject &toObject() const { MOZ_ASSERT(isObject()); return *JSVAL_TO_OBJECT_IMPL(data); } - MOZ_ALWAYS_INLINE JSObject *toObjectOrNull() const { MOZ_ASSERT(isObjectOrNull()); return JSVAL_TO_OBJECT_IMPL(data); } - MOZ_ALWAYS_INLINE void *toGCThing() const { MOZ_ASSERT(isGCThing()); return JSVAL_TO_GCTHING_IMPL(data); } - MOZ_ALWAYS_INLINE bool toBoolean() const { MOZ_ASSERT(isBoolean()); return JSVAL_TO_BOOLEAN_IMPL(data); } - MOZ_ALWAYS_INLINE uint32_t payloadAsRawUint32() const { MOZ_ASSERT(!isDouble()); return data.s.payload.u32; } - MOZ_ALWAYS_INLINE uint64_t asRawBits() const { return data.asBits; } - MOZ_ALWAYS_INLINE JSValueType extractNonDoubleType() const { return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data); } @@ -1152,27 +1104,23 @@ class Value * Private setters/getters allow the caller to read/write arbitrary types * that fit in the 64-bit payload. It is the caller's responsibility, after * storing to a value with setPrivateX to read only using getPrivateX. - * Privates values are given a type type which ensures they are not marked. + * Privates values are given a type which ensures they are not marked. */ - MOZ_ALWAYS_INLINE void setPrivate(void *ptr) { data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr); } - MOZ_ALWAYS_INLINE void *toPrivate() const { MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data)); return JSVAL_TO_PRIVATE_PTR_IMPL(data); } - MOZ_ALWAYS_INLINE void setPrivateUint32(uint32_t ui) { MOZ_ASSERT(uint32_t(int32_t(ui)) == ui); setInt32(int32_t(ui)); } - MOZ_ALWAYS_INLINE uint32_t toPrivateUint32() const { return uint32_t(toInt32()); } @@ -1183,12 +1131,10 @@ class Value * and the ensuing strict-aliasing warnings. */ - MOZ_ALWAYS_INLINE void setUnmarkedPtr(void *ptr) { data.asPtr = ptr; } - MOZ_ALWAYS_INLINE void *toUnmarkedPtr() const { return data.asPtr; } @@ -1243,7 +1189,7 @@ IsPoisonedValue(const Value &v) /************************************************************************/ -static MOZ_ALWAYS_INLINE Value +static inline Value NullValue() { Value v; @@ -1251,7 +1197,7 @@ NullValue() return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value UndefinedValue() { Value v; @@ -1259,7 +1205,7 @@ UndefinedValue() return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value Int32Value(int32_t i32) { Value v; @@ -1267,7 +1213,7 @@ Int32Value(int32_t i32) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value DoubleValue(double dbl) { Value v; @@ -1275,7 +1221,7 @@ DoubleValue(double dbl) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value StringValue(JSString *str) { Value v; @@ -1283,7 +1229,7 @@ StringValue(JSString *str) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value BooleanValue(bool boo) { Value v; @@ -1291,7 +1237,7 @@ BooleanValue(bool boo) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value ObjectValue(JSObject &obj) { Value v; @@ -1299,7 +1245,7 @@ ObjectValue(JSObject &obj) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value ObjectValueCrashOnTouch() { Value v; @@ -1307,7 +1253,7 @@ ObjectValueCrashOnTouch() return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value MagicValue(JSWhyMagic why) { Value v; @@ -1315,7 +1261,7 @@ MagicValue(JSWhyMagic why) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(float f) { Value v; @@ -1323,7 +1269,7 @@ NumberValue(float f) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(double dbl) { Value v; @@ -1331,37 +1277,37 @@ NumberValue(double dbl) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(int8_t i) { return Int32Value(i); } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(uint8_t i) { return Int32Value(i); } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(int16_t i) { return Int32Value(i); } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(uint16_t i) { return Int32Value(i); } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(int32_t i) { return Int32Value(i); } -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(uint32_t i) { Value v; @@ -1406,14 +1352,14 @@ class MakeNumberValue } // namespace detail template -static MOZ_ALWAYS_INLINE Value +static inline Value NumberValue(const T t) { MOZ_ASSERT(T(double(t)) == t, "value creation would be lossy"); return detail::MakeNumberValue::is_signed>::create(t); } -static MOZ_ALWAYS_INLINE Value +static inline Value ObjectOrNullValue(JSObject *obj) { Value v; @@ -1421,7 +1367,7 @@ ObjectOrNullValue(JSObject *obj) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value PrivateValue(void *ptr) { Value v; @@ -1429,7 +1375,7 @@ PrivateValue(void *ptr) return v; } -static MOZ_ALWAYS_INLINE Value +static inline Value PrivateUint32Value(uint32_t ui) { Value v; @@ -1437,7 +1383,7 @@ PrivateUint32Value(uint32_t ui) return v; } -MOZ_ALWAYS_INLINE bool +inline bool SameType(const Value &lhs, const Value &rhs) { return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data); @@ -1451,16 +1397,16 @@ namespace js { template <> struct RootMethods { - static JS::Value initial() { return UndefinedValue(); } + static JS::Value initial() { return JS::UndefinedValue(); } static ThingRootKind kind() { return THING_ROOT_VALUE; } - static bool poisoned(const JS::Value &v) { return IsPoisonedValue(v); } + static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); } }; template <> struct RootMethods { - static JS::Value initial() { return UndefinedValue(); } + static JS::Value initial() { return JS::UndefinedValue(); } static ThingRootKind kind() { return THING_ROOT_VALUE; } - static bool poisoned(const JS::Value &v) { return IsPoisonedValue(v); } + static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); } }; template class MutableValueOperations; @@ -1542,11 +1488,11 @@ class MutableValueOperations : public ValueOperations * and value-extracting operations. */ template <> -class HandleBase : public ValueOperations > +class HandleBase : public ValueOperations > { - friend class ValueOperations >; + friend class ValueOperations >; const JS::Value * extract() const { - return static_cast*>(this)->address(); + return static_cast*>(this)->address(); } }; @@ -1555,16 +1501,16 @@ class HandleBase : public ValueOperations > * type-querying, value-extracting, and mutating operations. */ template <> -class MutableHandleBase : public MutableValueOperations > +class MutableHandleBase : public MutableValueOperations > { - friend class ValueOperations >; + friend class ValueOperations >; const JS::Value * extract() const { - return static_cast*>(this)->address(); + return static_cast*>(this)->address(); } - friend class MutableValueOperations >; + friend class MutableValueOperations >; JS::Value * extractMutable() { - return static_cast*>(this)->address(); + return static_cast*>(this)->address(); } }; @@ -1573,28 +1519,28 @@ class MutableHandleBase : public MutableValueOperations -class RootedBase : public MutableValueOperations > +class RootedBase : public MutableValueOperations > { - friend class ValueOperations >; + friend class ValueOperations >; const JS::Value * extract() const { - return static_cast*>(this)->address(); + return static_cast*>(this)->address(); } - friend class MutableValueOperations >; + friend class MutableValueOperations >; JS::Value * extractMutable() { - return static_cast*>(this)->address(); + return static_cast*>(this)->address(); } }; } // namespace js -MOZ_ALWAYS_INLINE jsval_layout +inline jsval_layout JSVAL_TO_IMPL(JS::Value v) { return v.data; } -MOZ_ALWAYS_INLINE JS::Value +inline JS::Value IMPL_TO_JSVAL(jsval_layout l) { JS::Value v; @@ -1652,44 +1598,44 @@ MOZ_STATIC_ASSERT(sizeof(jsval_layout) == sizeof(JS::Value), /************************************************************************/ -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_NULL(jsval v) { return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_VOID(jsval v) { return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_INT(jsval v) { return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE int32_t +static inline int32_t JSVAL_TO_INT(jsval v) { MOZ_ASSERT(JSVAL_IS_INT(v)); return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE jsval +static inline jsval INT_TO_JSVAL(int32_t i) { return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_DOUBLE(jsval v) { return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE double +static inline double JSVAL_TO_DOUBLE(jsval v) { jsval_layout l; @@ -1698,7 +1644,7 @@ JSVAL_TO_DOUBLE(jsval v) return l.asDouble; } -static MOZ_ALWAYS_INLINE jsval +static inline jsval DOUBLE_TO_JSVAL(double d) { /* @@ -1715,7 +1661,7 @@ DOUBLE_TO_JSVAL(double d) return IMPL_TO_JSVAL(l); } -static MOZ_ALWAYS_INLINE jsval +static inline jsval UINT_TO_JSVAL(uint32_t i) { if (i <= JSVAL_INT_MAX) @@ -1723,39 +1669,39 @@ UINT_TO_JSVAL(uint32_t i) return DOUBLE_TO_JSVAL((double)i); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_NUMBER(jsval v) { return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_STRING(jsval v) { return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE JSString * +static inline JSString * JSVAL_TO_STRING(jsval v) { MOZ_ASSERT(JSVAL_IS_STRING(v)); return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE jsval +static inline jsval STRING_TO_JSVAL(JSString *str) { return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str)); } -static MOZ_ALWAYS_INLINE JSObject * +static inline JSObject * JSVAL_TO_OBJECT(jsval v) { MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v))); return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE jsval +static inline jsval OBJECT_TO_JSVAL(JSObject *obj) { if (obj) @@ -1763,38 +1709,38 @@ OBJECT_TO_JSVAL(JSObject *obj) return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_BOOLEAN(jsval v) { return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_TO_BOOLEAN(jsval v) { MOZ_ASSERT(JSVAL_IS_BOOLEAN(v)); return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE jsval +static inline jsval BOOLEAN_TO_JSVAL(JSBool b) { return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_PRIMITIVE(jsval v) { return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE JSBool +static inline JSBool JSVAL_IS_GCTHING(jsval v) { return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v)); } -static MOZ_ALWAYS_INLINE void * +static inline void * JSVAL_TO_GCTHING(jsval v) { MOZ_ASSERT(JSVAL_IS_GCTHING(v)); @@ -1803,13 +1749,13 @@ JSVAL_TO_GCTHING(jsval v) /* To be GC-safe, privates are tagged as doubles. */ -static MOZ_ALWAYS_INLINE jsval +static inline jsval PRIVATE_TO_JSVAL(void *ptr) { return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr)); } -static MOZ_ALWAYS_INLINE void * +static inline void * JSVAL_TO_PRIVATE(jsval v) { MOZ_ASSERT(JSVAL_IS_DOUBLE(v)); diff --git a/scripting/javascript/spidermonkey-mac/include/js/Vector.h b/scripting/javascript/spidermonkey-mac/include/js/Vector.h index 0a625e346a..b8e2ea6985 100644 --- a/scripting/javascript/spidermonkey-mac/include/js/Vector.h +++ b/scripting/javascript/spidermonkey-mac/include/js/Vector.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -297,7 +297,7 @@ class Vector : private AllocPolicy #endif /* Append operations guaranteed to succeed due to pre-reserved space. */ - template void internalAppend(U t); + template void internalAppend(U u); void internalAppendN(const T &t, size_t n); template void internalAppend(const U *begin, size_t length); template void internalAppend(const Vector &other); @@ -395,8 +395,11 @@ class Vector : private AllocPolicy /* mutators */ + /* Given that the Vector is empty and has no inline storage, grow to |capacity|. */ + bool initCapacity(size_t request); + /* If reserve(length() + N) succeeds, the N next appends are guaranteed to succeed. */ - bool reserve(size_t capacity); + bool reserve(size_t request); /* * Destroy elements in the range [end() - incr, end()). Does not deallocate @@ -441,8 +444,8 @@ class Vector : private AllocPolicy * Guaranteed-infallible append operations for use upon vectors whose * memory has been pre-reserved. */ - void infallibleAppend(const T &t) { - internalAppend(t); + template void infallibleAppend(const U &u) { + internalAppend(u); } void infallibleAppendN(const T &t, size_t n) { internalAppendN(t, n); @@ -479,10 +482,19 @@ class Vector : private AllocPolicy void replaceRawBuffer(T *p, size_t length); /* - * Places |val| at position |p|, shifting existing elements - * from |p| onward one position higher. + * Places |val| at position |p|, shifting existing elements from |p| + * onward one position higher. On success, |p| should not be reused + * because it will be a dangling pointer if reallocation of the vector + * storage occurred; the return value should be used instead. On failure, + * NULL is returned. + * + * Example usage: + * + * if (!(p = vec.insert(p, val))) + * + * */ - bool insert(T *p, const T &val); + T *insert(T *p, const T &val); /* * Removes the element |t|, which must fall in the bounds [begin, end), @@ -520,7 +532,7 @@ Vector::Vector(AllocPolicy ap) : AllocPolicy(ap), mBegin((T *)storage.addr()), mLength(0), mCapacity(sInlineCapacity) #ifdef DEBUG - , mReserved(0), entered(false) + , mReserved(sInlineCapacity), entered(false) #endif {} @@ -557,7 +569,7 @@ Vector::Vector(MoveRef rhs) rhs->mCapacity = sInlineCapacity; rhs->mLength = 0; #ifdef DEBUG - rhs->mReserved = 0; + rhs->mReserved = sInlineCapacity; #endif } } @@ -690,6 +702,25 @@ Vector::growStorageBy(size_t incr) return Impl::growTo(*this, newCap); } +template +inline bool +Vector::initCapacity(size_t request) +{ + JS_ASSERT(empty()); + JS_ASSERT(usingInlineStorage()); + if (request == 0) + return true; + T *newbuf = reinterpret_cast(this->malloc_(request * sizeof(T))); + if (!newbuf) + return false; + mBegin = newbuf; + mCapacity = request; +#ifdef DEBUG + mReserved = request; +#endif + return true; +} + template inline bool Vector::reserve(size_t request) @@ -797,7 +828,7 @@ Vector::clearAndFree() mBegin = (T *)storage.addr(); mCapacity = sInlineCapacity; #ifdef DEBUG - mReserved = 0; + mReserved = sInlineCapacity; #endif } @@ -828,11 +859,11 @@ Vector::append(U t) template template JS_ALWAYS_INLINE void -Vector::internalAppend(U t) +Vector::internalAppend(U u) { JS_ASSERT(mLength + 1 <= mReserved); JS_ASSERT(mReserved <= mCapacity); - new(endNoCheck()) T(t); + new(endNoCheck()) T(u); ++mLength; } @@ -863,24 +894,25 @@ Vector::internalAppendN(const T &t, size_t needed) } template -inline bool +inline T * Vector::insert(T *p, const T &val) { JS_ASSERT(begin() <= p && p <= end()); size_t pos = p - begin(); JS_ASSERT(pos <= mLength); size_t oldLength = mLength; - if (pos == oldLength) - return append(val); - { + if (pos == oldLength) { + if (!append(val)) + return NULL; + } else { T oldBack = back(); if (!append(oldBack)) /* Dup the last element. */ - return false; + return NULL; + for (size_t i = oldLength; i > pos; --i) + (*this)[i] = (*this)[i - 1]; + (*this)[pos] = val; } - for (size_t i = oldLength; i > pos; --i) - (*this)[i] = (*this)[i - 1]; - (*this)[pos] = val; - return true; + return begin() + pos; } template @@ -986,7 +1018,7 @@ Vector::extractRawBuffer() mLength = 0; mCapacity = sInlineCapacity; #ifdef DEBUG - mReserved = 0; + mReserved = sInlineCapacity; #endif } return ret; diff --git a/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id b/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id index 91ec3c73fe..8d449c8dba 100644 --- a/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id +++ b/scripting/javascript/spidermonkey-mac/include/jsapi.h.REMOVED.git-id @@ -1 +1 @@ -c21bc2527f0aff3248f11faab8102827c3728aab \ No newline at end of file +0d7798c67f3b31bcb033a3663a609649637264ce \ No newline at end of file diff --git a/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h b/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h index 195e900b27..ba40cd3e01 100644 --- a/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h +++ b/scripting/javascript/spidermonkey-mac/include/jsdbgapi.h @@ -434,17 +434,6 @@ JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure); /************************************************************************/ -extern JS_PUBLIC_API(size_t) -JS_GetObjectTotalSize(JSContext *cx, JSObject *obj); - -extern JS_PUBLIC_API(size_t) -JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun); - -extern JS_PUBLIC_API(size_t) -JS_GetScriptTotalSize(JSContext *cx, JSScript *script); - -/************************************************************************/ - extern JS_FRIEND_API(void) js_RevertVersion(JSContext *cx); diff --git a/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h b/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h index 0fb00e637e..01b44b4ac3 100644 --- a/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h +++ b/scripting/javascript/spidermonkey-mac/include/jsfriendapi.h @@ -195,6 +195,15 @@ GetContextCompartment(const JSContext *cx) return ContextFriendFields::get(cx)->compartment; } +inline JS::Zone * +GetContextZone(const JSContext *cx) +{ + return ContextFriendFields::get(cx)->zone_; +} + +extern JS_FRIEND_API(JS::Zone *) +GetCompartmentZone(JSCompartment *comp); + typedef bool (* PreserveWrapperCallback)(JSContext *cx, JSObject *obj); @@ -224,10 +233,13 @@ JS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value * #endif extern JS_FRIEND_API(bool) -IsSystemCompartment(const JSCompartment *compartment); +IsSystemCompartment(JSCompartment *comp); extern JS_FRIEND_API(bool) -IsAtomsCompartment(const JSCompartment *c); +IsSystemZone(JS::Zone *zone); + +extern JS_FRIEND_API(bool) +IsAtomsCompartment(JSCompartment *comp); /* * Check whether it is OK to assign an undeclared variable with the name @@ -270,7 +282,7 @@ typedef void (*GCThingCallback)(void *closure, void *gcthing); extern JS_FRIEND_API(void) -VisitGrayWrapperTargets(JSCompartment *comp, GCThingCallback callback, void *closure); +VisitGrayWrapperTargets(JS::Zone *zone, GCThingCallback callback, void *closure); extern JS_FRIEND_API(JSObject *) GetWeakmapKeyDelegate(JSObject *key); @@ -279,16 +291,19 @@ JS_FRIEND_API(JSGCTraceKind) GCThingTraceKind(void *thing); /* - * Invoke cellCallback on every gray JS_OBJECT in the given compartment. + * Invoke cellCallback on every gray JS_OBJECT in the given zone. */ extern JS_FRIEND_API(void) -IterateGrayObjects(JSCompartment *compartment, GCThingCallback cellCallback, void *data); +IterateGrayObjects(JS::Zone *zone, GCThingCallback cellCallback, void *data); #ifdef JS_HAS_CTYPES extern JS_FRIEND_API(size_t) SizeOfDataIfCDataObject(JSMallocSizeOfFun mallocSizeOf, JSObject *obj); #endif +extern JS_FRIEND_API(JSCompartment *) +GetAnyCompartmentInZone(JS::Zone *zone); + /* * Shadow declarations of JS internal structures, for access by inline access * functions below. Do not use these structures in any other way. When adding @@ -305,6 +320,7 @@ struct TypeObject { struct BaseShape { js::Class *clasp; JSObject *parent; + JSCompartment *compartment; }; class Shape { @@ -392,6 +408,12 @@ GetObjectParent(RawObject obj) return reinterpret_cast(obj)->shape->base->parent; } +static JS_ALWAYS_INLINE JSCompartment * +GetObjectCompartment(JSObject *obj) +{ + return reinterpret_cast(obj)->shape->base->compartment; +} + JS_FRIEND_API(JSObject *) GetObjectParentMaybeScope(RawObject obj); @@ -684,8 +706,6 @@ SetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size, JS_FRIEND_API(void) EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled); -// Use RawScript rather than UnrootedScript because it may be called from a -// signal handler JS_FRIEND_API(jsbytecode*) ProfilingGetPC(JSRuntime *rt, RawScript script, void *ip); @@ -723,11 +743,6 @@ CallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value * extern JS_FRIEND_API(bool) IsContextRunningJS(JSContext *cx); -class SystemAllocPolicy; -typedef Vector CompartmentVector; -extern JS_FRIEND_API(const CompartmentVector&) -GetRuntimeCompartments(JSRuntime *rt); - typedef void (* AnalysisPurgeCallback)(JSRuntime *rt, JSFlatString *desc); @@ -1416,6 +1431,24 @@ class JS_FRIEND_API(AutoCTypesActivityCallback) { } }; +#ifdef DEBUG +extern JS_FRIEND_API(void) +assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id); +#else +inline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {}; +#endif + +/* ES5 8.12.8. */ +extern JS_FRIEND_API(JSBool) +DefaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp); + } /* namespace js */ +extern JS_FRIEND_API(JSBool) +js_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg, + const js::PropertyDescriptor& descriptor, JSBool *bp); + +extern JS_FRIEND_API(JSBool) +js_ReportIsNotFunction(JSContext *cx, const JS::Value& v); + #endif /* jsfriendapi_h___ */ diff --git a/scripting/javascript/spidermonkey-mac/include/jsproxy.h b/scripting/javascript/spidermonkey-mac/include/jsproxy.h index 304f04a2a5..0637ceac8f 100644 --- a/scripting/javascript/spidermonkey-mac/include/jsproxy.h +++ b/scripting/javascript/spidermonkey-mac/include/jsproxy.h @@ -48,12 +48,15 @@ class JS_FRIEND_API(Wrapper); * the derived traps in terms of the fundamental ones. This allows consumers of * this class to define any custom behavior they want. */ -class JS_FRIEND_API(BaseProxyHandler) { +class JS_FRIEND_API(BaseProxyHandler) +{ void *mFamily; bool mHasPrototype; + bool mHasPolicy; protected: // Subclasses may set this in their constructor. void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; } + void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; } public: explicit BaseProxyHandler(void *family); @@ -63,6 +66,10 @@ class JS_FRIEND_API(BaseProxyHandler) { return mHasPrototype; } + bool hasPolicy() { + return mHasPolicy; + } + inline void *family() { return mFamily; } @@ -71,44 +78,73 @@ class JS_FRIEND_API(BaseProxyHandler) { return false; } + virtual bool finalizeInBackground(Value priv) { + /* + * Called on creation of a proxy to determine whether its finalize + * method can be finalized on the background thread. + */ + return true; + } + + /* Policy enforcement traps. + * + * enter() allows the policy to specify whether the caller may perform |act| + * on the proxy's |id| property. In the case when |act| is CALL, |id| is + * generally JSID_VOID. + * + * The |act| parameter to enter() specifies the action being performed. + * If |bp| is false, the trap suggests that the caller throw (though it + * may still decide to squelch the error). + */ + enum Action { + GET, + SET, + CALL + }; + virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act, + bool *bp); + /* ES5 Harmony fundamental proxy traps. */ - virtual bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0; + virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc, unsigned flags) = 0; - virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, - jsid id, PropertyDescriptor *desc, unsigned flags) = 0; - virtual bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, + virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, + HandleId id, PropertyDescriptor *desc, + unsigned flags) = 0; + virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc) = 0; - virtual bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, + virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0; - virtual bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp) = 0; - virtual bool enumerate(JSContext *cx, JSObject *proxy, - AutoIdVector &props) = 0; + virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0; + virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0; /* ES5 Harmony derived proxy traps. */ - virtual bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp); - virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp); - virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, - jsid id, Value *vp); - virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, - jsid id, bool strict, Value *vp); - virtual bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props); - virtual bool iterate(JSContext *cx, JSObject *proxy, unsigned flags, - Value *vp); + virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp); + virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp); + virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, + HandleId id, MutableHandleValue vp); + virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, + HandleId id, bool strict, MutableHandleValue vp); + virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props); + virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, + MutableHandleValue vp); /* Spidermonkey extensions. */ - virtual bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp); - virtual bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval); + virtual bool isExtensible(JSObject *proxy) = 0; + virtual bool call(JSContext *cx, HandleObject proxy, unsigned argc, Value *vp); + virtual bool construct(JSContext *cx, HandleObject proxy, unsigned argc, + Value *argv, MutableHandleValue rval); virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args); virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp); - virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx); - virtual JSString *obj_toString(JSContext *cx, JSObject *proxy); - virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent); - virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g); - virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp); + virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx); + virtual JSString *obj_toString(JSContext *cx, HandleObject proxy); + virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent); + virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g); + virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp); virtual void finalize(JSFreeOp *fop, JSObject *proxy); - virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, - uint32_t index, Value *vp, bool *present); - virtual bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, + uint32_t index, MutableHandleValue vp, bool *present); + virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop); /* See comment for weakmapKeyDelegateOp in jsclass.h. */ virtual JSObject *weakmapKeyDelegate(JSObject *proxy); @@ -120,96 +156,107 @@ class JS_FRIEND_API(BaseProxyHandler) { * allows consumers of this class to forward to another object as transparently * and efficiently as possible. */ -class JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler { -public: +class JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler +{ + public: explicit DirectProxyHandler(void *family); /* ES5 Harmony fundamental proxy traps. */ - virtual bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE; + virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; - virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, - jsid id, PropertyDescriptor *desc, + virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, + HandleId id, PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; - virtual bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, + virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc) MOZ_OVERRIDE; - virtual bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, + virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props) MOZ_OVERRIDE; - virtual bool delete_(JSContext *cx, JSObject *proxy, jsid id, + virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE; - virtual bool enumerate(JSContext *cx, JSObject *proxy, + virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) MOZ_OVERRIDE; /* ES5 Harmony derived proxy traps. */ - virtual bool has(JSContext *cx, JSObject *proxy, jsid id, + virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE; - virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, + virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) MOZ_OVERRIDE; - virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, - jsid id, Value *vp) MOZ_OVERRIDE; - virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, - jsid id, bool strict, Value *vp) MOZ_OVERRIDE; - virtual bool keys(JSContext *cx, JSObject *proxy, + virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, + HandleId id, MutableHandleValue vp) MOZ_OVERRIDE; + virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, + HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE; + virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props) MOZ_OVERRIDE; - virtual bool iterate(JSContext *cx, JSObject *proxy, unsigned flags, - Value *vp) MOZ_OVERRIDE; + virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, + MutableHandleValue vp) MOZ_OVERRIDE; /* Spidermonkey extensions. */ + virtual bool isExtensible(JSObject *proxy) MOZ_OVERRIDE; + virtual bool call(JSContext *cx, HandleObject proxy, unsigned argc, Value *vp) MOZ_OVERRIDE; + virtual bool construct(JSContext *cx, HandleObject proxy, unsigned argc, + Value *argv, MutableHandleValue rval) MOZ_OVERRIDE; virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args) MOZ_OVERRIDE; virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp) MOZ_OVERRIDE; - virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, + virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx) MOZ_OVERRIDE; - virtual JSString *obj_toString(JSContext *cx, JSObject *proxy) MOZ_OVERRIDE; - virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, + virtual JSString *obj_toString(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE; + virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) MOZ_OVERRIDE; - virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, + virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE; - virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, - Value *vp) MOZ_OVERRIDE; + virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, + MutableHandleValue vp) MOZ_OVERRIDE; virtual JSObject *weakmapKeyDelegate(JSObject *proxy); }; /* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */ -class Proxy { +class Proxy +{ public: /* ES5 Harmony fundamental proxy traps. */ - static bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + static bool preventExtensions(JSContext *cx, HandleObject proxy); + static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc, unsigned flags); - static bool getPropertyDescriptor(JSContext *cx, JSObject *proxy, unsigned flags, jsid id, - Value *vp); - static bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, jsid id, + static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id, + MutableHandleValue vp); + static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc, unsigned flags); - static bool getOwnPropertyDescriptor(JSContext *cx, JSObject *proxy, unsigned flags, jsid id, - Value *vp); - static bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, PropertyDescriptor *desc); - static bool defineProperty(JSContext *cx, JSObject *proxy, jsid id, const Value &v); - static bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &props); - static bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp); - static bool enumerate(JSContext *cx, JSObject *proxy, AutoIdVector &props); + static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id, + MutableHandleValue vp); + static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc); + static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v); + static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props); + static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp); + static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props); /* ES5 Harmony derived proxy traps. */ - static bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp); - static bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp); - static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, MutableHandleValue vp); + static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp); + static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp); + static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, + MutableHandleValue vp); static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool *present); - static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, bool strict, - MutableHandleValue vp); - static bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props); + static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id, + bool strict, MutableHandleValue vp); + static bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props); static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp); /* Spidermonkey extensions. */ - static bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp); - static bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval); + static bool isExtensible(JSObject *proxy); + static bool call(JSContext *cx, HandleObject proxy, unsigned argc, Value *vp); + static bool construct(JSContext *cx, HandleObject proxy, unsigned argc, Value *argv, + MutableHandleValue rval); static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args); static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp); - static bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx); - static JSString *obj_toString(JSContext *cx, JSObject *proxy); - static JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent); - static bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g); - static bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp); - static bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + static bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx); + static JSString *obj_toString(JSContext *cx, HandleObject proxy); + static JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent); + static bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g); + static bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp); + static bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop); static JSObject * const LazyProto; }; @@ -275,13 +322,6 @@ GetProxyTargetObject(RawObject obj) return GetProxyPrivate(obj).toObjectOrNull(); } -inline const Value & -GetProxyCall(RawObject obj) -{ - JS_ASSERT(IsFunctionProxy(obj)); - return GetReservedSlot(obj, JSSLOT_PROXY_CALL); -} - inline const Value & GetProxyExtra(RawObject obj, size_t n) { @@ -296,13 +336,6 @@ SetProxyHandler(RawObject obj, BaseProxyHandler *handler) SetReservedSlot(obj, JSSLOT_PROXY_HANDLER, PrivateValue(handler)); } -inline void -SetProxyPrivate(RawObject obj, const Value &value) -{ - JS_ASSERT(IsProxy(obj)); - SetReservedSlot(obj, JSSLOT_PROXY_PRIVATE, value); -} - inline void SetProxyExtra(RawObject obj, size_t n, const Value &extra) { @@ -311,14 +344,89 @@ SetProxyExtra(RawObject obj, size_t n, const Value &extra) SetReservedSlot(obj, JSSLOT_PROXY_EXTRA + n, extra); } +enum ProxyCallable { + ProxyNotCallable = false, + ProxyIsCallable = true +}; + JS_FRIEND_API(JSObject *) NewProxyObject(JSContext *cx, BaseProxyHandler *handler, const Value &priv, - JSObject *proto, JSObject *parent, - JSObject *call = NULL, JSObject *construct = NULL); + JSObject *proto, JSObject *parent, ProxyCallable callable = ProxyNotCallable); JSObject * RenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv); +class JS_FRIEND_API(AutoEnterPolicy) +{ + public: + typedef BaseProxyHandler::Action Action; + AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler, + HandleObject wrapper, HandleId id, Action act, bool mayThrow) +#ifdef DEBUG + : context(NULL) +#endif + { + allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv) + : true; + recordEnter(cx, wrapper, id); + // We want to throw an exception if all of the following are true: + // * The policy disallowed access. + // * The policy set rv to false, indicating that we should throw. + // * The caller did not instruct us to ignore exceptions. + // * The policy did not throw itself. + if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx)) + reportError(cx, id); + } + + virtual ~AutoEnterPolicy() { recordLeave(); } + inline bool allowed() { return allow; } + inline bool returnValue() { JS_ASSERT(!allowed()); return rv; } + + protected: + // no-op constructor for subclass + AutoEnterPolicy() +#ifdef DEBUG + : context(NULL) +#endif + {}; + void reportError(JSContext *cx, jsid id); + bool allow; + bool rv; + +#ifdef DEBUG + JSContext *context; + mozilla::Maybe enteredProxy; + mozilla::Maybe enteredId; + // NB: We explicitly don't track the entered action here, because sometimes + // SET traps do an implicit GET during their implementation, leading to + // spurious assertions. + AutoEnterPolicy *prev; + void recordEnter(JSContext *cx, HandleObject proxy, HandleId id); + void recordLeave(); + + friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id); +#else + inline void recordEnter(JSContext *cx, JSObject *proxy, jsid id) {} + inline void recordLeave() {} +#endif + +}; + +#ifdef DEBUG +class JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy { +public: + AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) + { + allow = true; + recordEnter(cx, proxy, id); + } +}; +#else +class JS_FRIEND_API(AutoWaivePolicy) { + public: AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) {}; +}; +#endif + } /* namespace js */ extern JS_FRIEND_API(JSObject *) diff --git a/scripting/javascript/spidermonkey-mac/include/jsprvtd.h b/scripting/javascript/spidermonkey-mac/include/jsprvtd.h index 6d9a2061f5..203df3de58 100644 --- a/scripting/javascript/spidermonkey-mac/include/jsprvtd.h +++ b/scripting/javascript/spidermonkey-mac/include/jsprvtd.h @@ -158,12 +158,13 @@ class FunctionBox; class ObjectBox; struct Token; struct TokenPos; -struct TokenPtr; class TokenStream; -struct Parser; class ParseMapPool; struct ParseNode; +template +struct Parser; + } /* namespace frontend */ namespace analyze { @@ -194,10 +195,10 @@ typedef JS::Handle HandlePropertyName; typedef JS::MutableHandle MutableHandleShape; typedef JS::MutableHandle MutableHandleAtom; -typedef js::Rooted RootedShape; -typedef js::Rooted RootedTypeObject; -typedef js::Rooted RootedAtom; -typedef js::Rooted RootedPropertyName; +typedef JS::Rooted RootedShape; +typedef JS::Rooted RootedTypeObject; +typedef JS::Rooted RootedAtom; +typedef JS::Rooted RootedPropertyName; enum XDRMode { XDR_ENCODE, @@ -209,6 +210,17 @@ class XDRState; class FreeOp; +struct IdValuePair +{ + jsid id; + Value value; + + IdValuePair() {} + IdValuePair(jsid idArg) + : id(idArg), value(UndefinedValue()) + {} +}; + } /* namespace js */ namespace JSC { diff --git a/scripting/javascript/spidermonkey-mac/include/jspubtd.h b/scripting/javascript/spidermonkey-mac/include/jspubtd.h index bcbbd28c69..c629203773 100644 --- a/scripting/javascript/spidermonkey-mac/include/jspubtd.h +++ b/scripting/javascript/spidermonkey-mac/include/jspubtd.h @@ -14,13 +14,21 @@ #include "jsprototypes.h" #include "jstypes.h" + +namespace JS { + /* * Allow headers to reference JS::Value without #including the whole jsapi.h. * Unfortunately, typedefs (hence jsval) cannot be declared. */ -#ifdef __cplusplus -namespace JS { class Value; } -#endif +class Value; + +template +class Rooted; + +struct Zone; + +} /* namespace JS */ /* * In release builds, jsid is defined to be an integral type. This @@ -41,7 +49,7 @@ namespace JS { class Value; } // Needed for cocos2d-js #define JS_NO_JSVAL_JSID_STRUCT_TYPES - + # if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES) # define JS_USE_JSID_STRUCT_TYPES # endif @@ -213,9 +221,6 @@ namespace js { class Allocator; -template -class Rooted; - class SkipRoot; enum ThingRootKind @@ -225,6 +230,7 @@ enum ThingRootKind THING_ROOT_BASE_SHAPE, THING_ROOT_TYPE_OBJECT, THING_ROOT_STRING, + THING_ROOT_ION_CODE, THING_ROOT_SCRIPT, THING_ROOT_ID, THING_ROOT_PROPERTY_ID, @@ -261,8 +267,11 @@ struct ContextFriendFields { /* The current compartment. */ JSCompartment *compartment; + /* The current zone. */ + JS::Zone *zone_; + explicit ContextFriendFields(JSRuntime *rt) - : runtime(rt), compartment(NULL) + : runtime(rt), compartment(NULL), zone_(NULL) { } static const ContextFriendFields *get(const JSContext *cx) { @@ -278,7 +287,7 @@ struct ContextFriendFields { * Stack allocated GC roots for stack GC heap pointers, which may be * overwritten if moved during a GC. */ - Rooted *thingGCRooters[THING_ROOT_LIMIT]; + JS::Rooted *thingGCRooters[THING_ROOT_LIMIT]; #endif #if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) @@ -337,7 +346,7 @@ struct PerThreadDataFriendFields * Stack allocated GC roots for stack GC heap pointers, which may be * overwritten if moved during a GC. */ - Rooted *thingGCRooters[THING_ROOT_LIMIT]; + JS::Rooted *thingGCRooters[THING_ROOT_LIMIT]; #endif #if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) diff --git a/scripting/javascript/spidermonkey-mac/include/jswrapper.h b/scripting/javascript/spidermonkey-mac/include/jswrapper.h index e500e4ed36..6bc8b23213 100644 --- a/scripting/javascript/spidermonkey-mac/include/jswrapper.h +++ b/scripting/javascript/spidermonkey-mac/include/jswrapper.h @@ -32,11 +32,7 @@ class JS_FRIEND_API(Wrapper) : public DirectProxyHandler bool mSafeToUnwrap; public: - enum Action { - GET, - SET, - CALL - }; + using BaseProxyHandler::Action; enum Flags { CROSS_COMPARTMENT = 1 << 0, @@ -50,7 +46,7 @@ class JS_FRIEND_API(Wrapper) : public DirectProxyHandler * object (via UnwrapObjectChecked) will throw. Otherwise, they will succeed. */ void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; } - bool isSafeToUnwrap() { return mSafeToUnwrap; } + virtual bool isSafeToUnwrap() { return mSafeToUnwrap; } static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent, Wrapper *handler); @@ -65,56 +61,13 @@ class JS_FRIEND_API(Wrapper) : public DirectProxyHandler return mFlags; } - /* Policy enforcement traps. - * - * enter() allows the policy to specify whether the caller may perform |act| - * on the underlying object's |id| property. In the case when |act| is CALL, - * |id| is generally JSID_VOID. - * - * The |act| parameter to enter() specifies the action being performed. - */ - virtual bool enter(JSContext *cx, JSObject *wrapper, jsid id, Action act, - bool *bp); - explicit Wrapper(unsigned flags, bool hasPrototype = false); virtual ~Wrapper(); /* ES5 Harmony fundamental wrapper traps. */ - virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, - jsid id, PropertyDescriptor *desc, - unsigned flags) MOZ_OVERRIDE; - virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, - jsid id, PropertyDescriptor *desc, - unsigned flags) MOZ_OVERRIDE; - virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, - PropertyDescriptor *desc) MOZ_OVERRIDE; - virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, - AutoIdVector &props) MOZ_OVERRIDE; - virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, - bool *bp) MOZ_OVERRIDE; - virtual bool enumerate(JSContext *cx, JSObject *wrapper, - AutoIdVector &props) MOZ_OVERRIDE; - - /* ES5 Harmony derived wrapper traps. */ - virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; - virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; - virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp) MOZ_OVERRIDE; - virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict, - Value *vp) MOZ_OVERRIDE; - virtual bool keys(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; - virtual bool iterate(JSContext *cx, JSObject *wrapper, unsigned flags, Value *vp) MOZ_OVERRIDE; - - /* Spidermonkey extensions. */ - virtual bool call(JSContext *cx, JSObject *wrapper, unsigned argc, Value *vp) MOZ_OVERRIDE; - virtual bool construct(JSContext *cx, JSObject *wrapper, unsigned argc, Value *argv, Value *rval) MOZ_OVERRIDE; - virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, - CallArgs args) MOZ_OVERRIDE; - virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v, bool *bp) MOZ_OVERRIDE; - virtual JSString *obj_toString(JSContext *cx, JSObject *wrapper) MOZ_OVERRIDE; - virtual JSString *fun_toString(JSContext *cx, JSObject *wrapper, unsigned indent) MOZ_OVERRIDE; - virtual bool defaultValue(JSContext *cx, JSObject *wrapper_, JSType hint, - Value *vp) MOZ_OVERRIDE; + virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint, + MutableHandleValue vp) MOZ_OVERRIDE; static Wrapper singleton; static Wrapper singletonWithPrototype; @@ -130,37 +83,48 @@ class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper virtual ~CrossCompartmentWrapper(); + virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE; + /* ES5 Harmony fundamental wrapper traps. */ - virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE; + virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; - virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; - virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, + virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, PropertyDescriptor *desc) MOZ_OVERRIDE; - virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; - virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; - virtual bool enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper, + AutoIdVector &props) MOZ_OVERRIDE; + virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE; + virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE; /* ES5 Harmony derived wrapper traps. */ - virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; - virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; - virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp) MOZ_OVERRIDE; - virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict, - Value *vp) MOZ_OVERRIDE; - virtual bool keys(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; - virtual bool iterate(JSContext *cx, JSObject *wrapper, unsigned flags, Value *vp) MOZ_OVERRIDE; + virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE; + virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE; + virtual bool get(JSContext *cx, HandleObject wrapper, HandleObject receiver, + HandleId id, MutableHandleValue vp) MOZ_OVERRIDE; + virtual bool set(JSContext *cx, HandleObject wrapper, HandleObject receiver, + HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE; + virtual bool keys(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE; + virtual bool iterate(JSContext *cx, HandleObject wrapper, unsigned flags, + MutableHandleValue vp) MOZ_OVERRIDE; /* Spidermonkey extensions. */ - virtual bool call(JSContext *cx, JSObject *wrapper, unsigned argc, Value *vp) MOZ_OVERRIDE; - virtual bool construct(JSContext *cx, JSObject *wrapper, unsigned argc, Value *argv, Value *rval) MOZ_OVERRIDE; + virtual bool isExtensible(JSObject *proxy) MOZ_OVERRIDE; + virtual bool call(JSContext *cx, HandleObject wrapper, unsigned argc, Value *vp) MOZ_OVERRIDE; + virtual bool construct(JSContext *cx, HandleObject wrapper, unsigned argc, Value *argv, + MutableHandleValue rval) MOZ_OVERRIDE; virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args) MOZ_OVERRIDE; - virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v, bool *bp) MOZ_OVERRIDE; - virtual JSString *obj_toString(JSContext *cx, JSObject *wrapper) MOZ_OVERRIDE; - virtual JSString *fun_toString(JSContext *cx, JSObject *wrapper, unsigned indent) MOZ_OVERRIDE; - virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g) MOZ_OVERRIDE; - virtual bool defaultValue(JSContext *cx, JSObject *wrapper, JSType hint, Value *vp) MOZ_OVERRIDE; - virtual bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v, + bool *bp) MOZ_OVERRIDE; + virtual JSString *obj_toString(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE; + virtual JSString *fun_toString(JSContext *cx, HandleObject wrapper, + unsigned indent) MOZ_OVERRIDE; + virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE; + virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint, + MutableHandleValue vp) MOZ_OVERRIDE; + virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop); static CrossCompartmentWrapper singleton; static CrossCompartmentWrapper singletonWithPrototype; @@ -181,13 +145,16 @@ class JS_FRIEND_API(SecurityWrapper) : public Base public: SecurityWrapper(unsigned flags); - virtual bool enter(JSContext *cx, JSObject *wrapper, jsid id, Wrapper::Action act, + virtual bool isExtensible(JSObject *wrapper) MOZ_OVERRIDE; + virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE; + virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act, bool *bp) MOZ_OVERRIDE; virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args) MOZ_OVERRIDE; - virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx) MOZ_OVERRIDE; - virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g) MOZ_OVERRIDE; - virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, + virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, + JSContext *cx) MOZ_OVERRIDE; + virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE; + virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, PropertyDescriptor *desc) MOZ_OVERRIDE; /* @@ -209,30 +176,34 @@ class JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler explicit DeadObjectProxy(); /* ES5 Harmony fundamental wrapper traps. */ - virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE; + virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; - virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id, + virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id, PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE; - virtual bool defineProperty(JSContext *cx, JSObject *wrapper, jsid id, + virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id, PropertyDescriptor *desc) MOZ_OVERRIDE; - virtual bool getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; - virtual bool delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp) MOZ_OVERRIDE; - virtual bool enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props) MOZ_OVERRIDE; + virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper, + AutoIdVector &props) MOZ_OVERRIDE; + virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE; + virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE; /* Spidermonkey extensions. */ - virtual bool call(JSContext *cx, JSObject *proxy, unsigned argc, Value *vp); - virtual bool construct(JSContext *cx, JSObject *proxy, unsigned argc, Value *argv, Value *rval); + virtual bool isExtensible(JSObject *proxy) MOZ_OVERRIDE; + virtual bool call(JSContext *cx, HandleObject proxy, unsigned argc, Value *vp); + virtual bool construct(JSContext *cx, HandleObject proxy, unsigned argc, + Value *argv, MutableHandleValue rval); virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args) MOZ_OVERRIDE; virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp); - virtual bool objectClassIs(JSObject *obj, ESClassValue classValue, JSContext *cx); - virtual JSString *obj_toString(JSContext *cx, JSObject *proxy); - virtual JSString *fun_toString(JSContext *cx, JSObject *proxy, unsigned indent); - virtual bool regexp_toShared(JSContext *cx, JSObject *proxy, RegExpGuard *g); - virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp); - virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, - uint32_t index, Value *vp, bool *present); - virtual bool getPrototypeOf(JSContext *cx, JSObject *proxy, JSObject **protop); + virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx); + virtual JSString *obj_toString(JSContext *cx, HandleObject proxy); + virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent); + virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g); + virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp); + virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, + uint32_t index, MutableHandleValue vp, bool *present); + virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop); static DeadObjectProxy singleton; }; diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h index 6b973627cb..8942ddd5b1 100644 --- a/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Assertions.h @@ -76,6 +76,16 @@ # endif #endif #ifndef MOZ_STATIC_ASSERT + /* + * Some of the definitions below create an otherwise-unused typedef. This + * triggers compiler warnings with some versions of gcc, so mark the typedefs + * as permissibly-unused to disable the warnings. + */ +# if defined(__GNUC__) +# define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) +# else +# define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */ +# endif # define MOZ_STATIC_ASSERT_GLUE1(x, y) x##y # define MOZ_STATIC_ASSERT_GLUE(x, y) MOZ_STATIC_ASSERT_GLUE1(x, y) # if defined(__SUNPRO_CC) @@ -108,10 +118,10 @@ * code. */ # define MOZ_STATIC_ASSERT(cond, reason) \ - typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] + typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE # else # define MOZ_STATIC_ASSERT(cond, reason) \ - extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) + extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE # endif #endif diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h b/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h index 941152fb05..2f2d12e8e5 100644 --- a/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/Attributes.h @@ -319,6 +319,64 @@ # define MOZ_WARN_UNUSED_RESULT #endif +/* + * The following macros are attributes that support the static analysis plugin + * included with Mozilla, and will be implemented (when such support is enabled) + * as C++11 attributes. Since such attributes are legal pretty much everywhere + * and have subtly different semantics depending on their placement, the + * following is a guide on where to place the attributes. + * + * Attributes that apply to a struct or class precede the name of the class: + * (Note that this is different from the placement of MOZ_FINAL for classes!) + * + * class MOZ_CLASS_ATTRIBUTE SomeClass {}; + * + * Attributes that apply to functions follow the parentheses and const + * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body: + * + * void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE; + * void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {} + * void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0; + * void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE; + * + * Attributes that apply to variables or parameters follow the variable's name: + * + * int variable MOZ_VARIABLE_ATTRIBUTE; + * + * Attributes that apply to types follow the type name: + * + * typedef int MOZ_TYPE_ATTRIBUTE MagicInt; + * int MOZ_TYPE_ATTRIBUTE someVariable; + * int * MOZ_TYPE_ATTRIBUTE magicPtrInt; + * int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt; + * + * Attributes that apply to statements precede the statement: + * + * MOZ_IF_ATTRIBUTE if (x == 0) + * MOZ_DO_ATTRIBUTE do { } while(0); + * + * Attributes that apply to labels precede the label: + * + * MOZ_LABEL_ATTRIBUTE target: + * goto target; + * MOZ_CASE_ATTRIBUTE case 5: + * MOZ_DEFAULT_ATTRIBUTE default: + * + * The static analyses that are performed by the plugin are as follows: + * + * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate + * subclasses must provide an exact override of this method; if a subclass + * does not override this method, the compiler will emit an error. This + * attribute is not limited to virtual methods, so if it is applied to a + * nonvirtual method and the subclass does not provide an equivalent + * definition, the compiler will emit an error. + */ +#ifdef MOZ_CLANG_PLUGIN +# define MOZ_MUST_OVERRIDE __attribute__((annotate("moz_must_override"))) +#else +# define MOZ_MUST_OVERRIDE /* nothing */ +#endif /* MOZ_CLANG_PLUGIN */ + #endif /* __cplusplus */ #endif /* mozilla_Attributes_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h b/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h index b56ac42b19..1f35b9ec28 100644 --- a/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/CheckedInt.h @@ -8,38 +8,27 @@ #ifndef mozilla_CheckedInt_h_ #define mozilla_CheckedInt_h_ -/* - * Build options. Comment out these #defines to disable the corresponding - * optional feature. Disabling features may be useful for code using - * CheckedInt outside of Mozilla (e.g. WebKit) - */ +// Enable relying of Mozilla's MFBT for possibly-available C++11 features +#define MOZ_CHECKEDINT_USE_MFBT -// Enable usage of MOZ_STATIC_ASSERT to check for unsupported types. -// If disabled, static asserts are replaced by regular assert(). -#define MOZ_CHECKEDINT_ENABLE_MOZ_ASSERTS - -/* - * End of build options - */ - - -#ifdef MOZ_CHECKEDINT_ENABLE_MOZ_ASSERTS +#ifdef MOZ_CHECKEDINT_USE_MFBT # include "mozilla/Assertions.h" +# include "mozilla/StandardInteger.h" #else -# ifndef MOZ_STATIC_ASSERT -# include -# define MOZ_STATIC_ASSERT(cond, reason) assert((cond) && reason) -# define MOZ_ASSERT(cond, reason) assert((cond) && reason) -# endif +# include +# include +# define MOZ_STATIC_ASSERT(cond, reason) assert((cond) && reason) +# define MOZ_ASSERT(cond, reason) assert((cond) && reason) +# define MOZ_DELETE #endif -#include "mozilla/StandardInteger.h" - #include #include namespace mozilla { +template class CheckedInt; + namespace detail { /* @@ -104,6 +93,10 @@ template<> struct IsSupportedPass2 { static const bool value = true; }; +template<> +struct IsSupportedPass2 +{ static const bool value = true; }; + template<> struct IsSupportedPass2 { static const bool value = true; }; @@ -450,23 +443,32 @@ IsDivValid(T x, T y) !(IsSigned::value && x == MinValue::value && y == T(-1)); } -// This is just to shut up msvc warnings about negating unsigned ints. -template::value> -struct OppositeIfSignedImpl -{ - static T run(T x) { return -x; } -}; +template::value> +struct NegateImpl; + template -struct OppositeIfSignedImpl +struct NegateImpl { - static T run(T x) { return x; } + static CheckedInt negate(const CheckedInt& val) + { + // Handle negation separately for signed/unsigned, for simpler code and to + // avoid an MSVC warning negating an unsigned value. + return CheckedInt(0, val.isValid() && val.mValue == 0); + } }; + template -inline T -OppositeIfSigned(T x) +struct NegateImpl { - return OppositeIfSignedImpl::run(x); -} + static CheckedInt negate(const CheckedInt& val) + { + // Watch out for the min-value, which (with twos-complement) can't be + // negated as -min-value is then (max-value + 1). + if (!val.isValid() || val.mValue == MinValue::value) + return CheckedInt(val.mValue, false); + return CheckedInt(-val.mValue, true); + } +}; } // namespace detail @@ -556,6 +558,8 @@ class CheckedInt "This type is not supported by CheckedInt"); } + friend class detail::NegateImpl; + public: /** * Constructs a checked integer with given @a value. The checked integer is @@ -624,14 +628,7 @@ class CheckedInt CheckedInt operator -() const { - // Circumvent msvc warning about - applied to unsigned int. - // if we're unsigned, the only valid case anyway is 0 - // in which case - is a no-op. - T result = detail::OppositeIfSigned(mValue); - /* Help the compiler perform RVO (return value optimization). */ - return CheckedInt(result, - mIsValid && detail::IsSubValid(T(0), - mValue)); + return detail::NegateImpl::negate(*this); } /** diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h b/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h index b545fa544b..0a47810553 100644 --- a/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/MathAlgorithms.h @@ -9,6 +9,11 @@ #define mozilla_MathAlgorithms_h_ #include "mozilla/Assertions.h" +#include "mozilla/StandardInteger.h" +#include "mozilla/TypeTraits.h" + +#include +#include namespace mozilla { @@ -42,6 +47,101 @@ EuclidLCM(IntegerType a, IntegerType b) return (a / EuclidGCD(a, b)) * b; } +namespace detail { + +template +struct AllowDeprecatedAbsFixed : FalseType {}; + +template<> struct AllowDeprecatedAbsFixed : TrueType {}; +template<> struct AllowDeprecatedAbsFixed : TrueType {}; + +template +struct AllowDeprecatedAbs : AllowDeprecatedAbsFixed {}; + +template<> struct AllowDeprecatedAbs : TrueType {}; +template<> struct AllowDeprecatedAbs : TrueType {}; + +} // namespace detail + +// DO NOT USE DeprecatedAbs. It exists only until its callers can be converted +// to Abs below, and it will be removed when all callers have been changed. +template +inline typename mozilla::EnableIf::value, T>::Type +DeprecatedAbs(const T t) +{ + // The absolute value of the smallest possible value of a signed-integer type + // won't fit in that type (on twos-complement systems -- and we're blithely + // assuming we're on such systems, for the non- types listed above), + // so assert that the input isn't that value. + // + // This is the case if: the value is non-negative; or if adding one (giving a + // value in the range [-maxvalue, 0]), then negating (giving a value in the + // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement, + // (minvalue + 1) == -maxvalue). + MOZ_ASSERT(t >= 0 || + -(t + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1), + "You can't negate the smallest possible negative integer!"); + return t >= 0 ? t : -t; +} + +namespace detail { + +// For now mozilla::Abs only takes intN_T, the signed natural types, and +// float/double/long double. Feel free to add overloads for other standard, +// signed types if you need them. + +template +struct AbsReturnTypeFixed; + +template<> struct AbsReturnTypeFixed { typedef uint8_t Type; }; +template<> struct AbsReturnTypeFixed { typedef uint16_t Type; }; +template<> struct AbsReturnTypeFixed { typedef uint32_t Type; }; +template<> struct AbsReturnTypeFixed { typedef uint64_t Type; }; + +template +struct AbsReturnType : AbsReturnTypeFixed {}; + +template<> struct AbsReturnType : EnableIf {}; +template<> struct AbsReturnType { typedef unsigned char Type; }; +template<> struct AbsReturnType { typedef unsigned short Type; }; +template<> struct AbsReturnType { typedef unsigned int Type; }; +template<> struct AbsReturnType { typedef unsigned long Type; }; +template<> struct AbsReturnType { typedef unsigned long long Type; }; +template<> struct AbsReturnType { typedef float Type; }; +template<> struct AbsReturnType { typedef double Type; }; +template<> struct AbsReturnType { typedef long double Type; }; + +} // namespace detail + +template +inline typename detail::AbsReturnType::Type +Abs(const T t) +{ + typedef typename detail::AbsReturnType::Type ReturnType; + return t >= 0 ? ReturnType(t) : ~ReturnType(t) + 1; +} + +template<> +inline float +Abs(const float f) +{ + return std::fabs(f); +} + +template<> +inline double +Abs(const double d) +{ + return std::fabs(d); +} + +template<> +inline long double +Abs(const long double d) +{ + return std::fabs(d); +} + } /* namespace mozilla */ #endif /* mozilla_MathAlgorithms_h_ */ diff --git a/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h b/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h index 1422d44648..661912e116 100644 --- a/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h +++ b/scripting/javascript/spidermonkey-mac/include/mozilla/TypeTraits.h @@ -17,23 +17,146 @@ namespace mozilla { -namespace detail { +/* 20.9.3 Helper classes [meta.help] */ /** - * The trickery used to implement IsBaseOf here makes it possible to use it for - * the cases of private and multiple inheritance. This code was inspired by the - * sample code here: - * - * http://stackoverflow.com/questions/2910979/how-is-base-of-works + * Helper class used as a base for various type traits, exposed publicly + * because exposes it as well. */ +template +struct IntegralConstant +{ + static const T value = Value; + typedef T ValueType; + typedef IntegralConstant Type; +}; + +/** Convenient aliases. */ +typedef IntegralConstant TrueType; +typedef IntegralConstant FalseType; + +/* 20.9.4 Unary type traits [meta.unary] */ + +/* 20.9.4.1 Primary type categories [meta.unary.cat] */ + +/** + * IsPointer determines whether a type is a pointer type (but not a pointer-to- + * member type). + * + * mozilla::IsPointer::value is true; + * mozilla::IsPointer::value is true; + * mozilla::IsPointer::value is true; + * mozilla::IsPointer::value is false; + * mozilla::IsPointer::value is false. + */ +template +struct IsPointer : FalseType {}; + +template +struct IsPointer : TrueType {}; + +/* 20.9.4.2 Composite type traits [meta.unary.comp] */ + +/* 20.9.4.3 Type properties [meta.unary.prop] */ + +/** + * Traits class for identifying POD types. Until C++11 there's no automatic + * way to detect PODs, so for the moment this is done manually. Users may + * define specializations of this class that inherit from mozilla::TrueType and + * mozilla::FalseType (or equivalently mozilla::IntegralConstant, or conveniently from mozilla::IsPod for composite types) as needed to + * ensure correct IsPod behavior. + */ +template +struct IsPod : public FalseType {}; + +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template<> struct IsPod : TrueType {}; +template struct IsPod : TrueType {}; + +/* 20.9.5 Type property queries [meta.unary.prop.query] */ + +/* 20.9.6 Relationships between types [meta.rel] */ + +/** + * IsSame tests whether two types are the same type. + * + * mozilla::IsSame::value is true; + * mozilla::IsSame::value is true; + * mozilla::IsSame::value is false; + * mozilla::IsSame::value is true; + * mozilla::IsSame::value is false; + * mozilla::IsSame::value is true. + */ +template +struct IsSame : FalseType {}; + +template +struct IsSame : TrueType {}; + +namespace detail { + +// The trickery used to implement IsBaseOf here makes it possible to use it for +// the cases of private and multiple inheritance. This code was inspired by the +// sample code here: +// +// http://stackoverflow.com/questions/2910979/how-is-base-of-works template -class IsBaseOfHelper +struct BaseOfHelper { public: operator Base*() const; operator Derived*(); }; +template +struct BaseOfTester +{ + private: + template + static char test(Derived*, T); + static int test(Base*, int); + + public: + static const bool value = + sizeof(test(BaseOfHelper(), int())) == sizeof(char); +}; + +template +struct BaseOfTester +{ + private: + template + static char test(Derived*, T); + static int test(Base*, int); + + public: + static const bool value = + sizeof(test(BaseOfHelper(), int())) == sizeof(char); +}; + +template +struct BaseOfTester : FalseType {}; + +template +struct BaseOfTester : TrueType {}; + +template +struct BaseOfTester : TrueType {}; + } /* namespace detail */ /* @@ -49,53 +172,32 @@ class IsBaseOfHelper * mozilla::IsBaseOf::value is false; */ template -class IsBaseOf +struct IsBaseOf + : IntegralConstant::value> +{}; + +namespace detail { + +template +struct ConvertibleTester { private: - template - static char test(Derived*, T); - static int test(Base*, int); + static From create(); + + template + static char test(To to); + + template + static int test(...); public: static const bool value = - sizeof(test(detail::IsBaseOfHelper(), int())) == sizeof(char); + sizeof(test(create())) == sizeof(char); }; -template -class IsBaseOf -{ - private: - template - static char test(Derived*, T); - static int test(Base*, int); +} // namespace detail - public: - static const bool value = - sizeof(test(detail::IsBaseOfHelper(), int())) == sizeof(char); -}; - -template -class IsBaseOf -{ - public: - static const bool value = false; -}; - -template -class IsBaseOf -{ - public: - static const bool value = true; -}; - -template -class IsBaseOf -{ - public: - static const bool value = true; -}; - -/* +/** * IsConvertible determines whether a value of type From will implicitly convert * to a value of type To. For example: * @@ -118,40 +220,24 @@ class IsBaseOf */ template struct IsConvertible -{ - private: - static From create(); + : IntegralConstant::value> +{}; - template - static char test(To to); +/* 20.9.7 Transformations between types [meta.trans] */ - template - static int test(...); +/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */ - public: - static const bool value = - sizeof(test(create())) == sizeof(char); -}; +/* 20.9.7.2 Reference modifications [meta.trans.ref] */ -/* - * Conditional selects a class between two, depending on a given boolean value. - * - * mozilla::Conditional::Type is A; - * mozilla::Conditional::Type is B; - */ -template -struct Conditional -{ - typedef A Type; -}; +/* 20.9.7.3 Sign modifications [meta.trans.sign] */ -template -struct Conditional -{ - typedef B Type; -}; +/* 20.9.7.4 Array modifications [meta.trans.arr] */ -/* +/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */ + +/* 20.9.7.6 Other transformations [meta.trans.other] */ + +/** * EnableIf is a struct containing a typedef of T if and only if B is true. * * mozilla::EnableIf::Type is int; @@ -164,7 +250,7 @@ struct Conditional * template * class PodVector // vector optimized to store POD (memcpy-able) types * { - * EnableIf, T>::Type* vector; + * EnableIf::value, T>::Type* vector; * size_t length; * ... * }; @@ -180,72 +266,21 @@ struct EnableIf }; /** - * IsSame tests whether two types are the same type. + * Conditional selects a class between two, depending on a given boolean value. * - * mozilla::IsSame::value is true; - * mozilla::IsSame::value is true; - * mozilla::IsSame::value is false; - * mozilla::IsSame::value is true; - * mozilla::IsSame::value is false; - * mozilla::IsSame::value is true. + * mozilla::Conditional::Type is A; + * mozilla::Conditional::Type is B; */ -template -struct IsSame +template +struct Conditional { - static const bool value = false; + typedef A Type; }; -template -struct IsSame +template +struct Conditional { - static const bool value = true; -}; - -/* - * Traits class for identifying POD types. Until C++0x, there is no automatic - * way to detect PODs, so for the moment it is done manually. - */ -template -struct IsPod -{ - static const bool value = false; -}; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template<> struct IsPod { static const bool value = true; }; -template struct IsPod { static const bool value = true; }; - -/** - * IsPointer determines whether a type is a pointer type (but not a pointer-to- - * member type). - * - * mozilla::IsPointer::value is true; - * mozilla::IsPointer::value is true; - * mozilla::IsPointer::value is true; - * mozilla::IsPointer::value is false; - * mozilla::IsPointer::value is false. - */ -template -struct IsPointer -{ - static const bool value = false; -}; -template -struct IsPointer -{ - static const bool value = true; + typedef B Type; }; } /* namespace mozilla */ diff --git a/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id b/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id index a00daec551..3ba4c5faf2 100644 --- a/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id +++ b/scripting/javascript/spidermonkey-mac/lib/libjs_static.a.REMOVED.git-id @@ -1 +1 @@ -dddc2eb85889b606c2bcbdb93bc8a63e0d8edf8a \ No newline at end of file +0c79530f86751f9f84bd310d65e2cb505451e973 \ No newline at end of file From b0de6d0e8c69a7ce1c580ffafe4bb954df3b7f08 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 27 Jun 2013 18:14:24 -0700 Subject: [PATCH 05/43] Project fixes In debug: optimization is NONE, and other small fixes for Mac --- .../project.pbxproj.REMOVED.git-id | 2 +- .../TestJavascript.xcodeproj/project.pbxproj | 5 - .../jsbindings.xcodeproj/project.pbxproj | 320 +++++++++--------- 3 files changed, 153 insertions(+), 174 deletions(-) diff --git a/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id index 8456e51bbc..378c8c51d1 100644 --- a/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -d0d80920ec6a91b8d245eb1905b39fe55135f362 \ No newline at end of file +14f06ca9e6652e501a7f9709b6ef7a2ed52a35b1 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj index fa3acfeaab..2bf0a87cb5 100644 --- a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj +++ b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj @@ -79,8 +79,6 @@ A05FCAD9177C129100BE600E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD1177C129100BE600E /* MainMenu.xib */; }; A05FCADA177C129100BE600E /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD3177C129100BE600E /* Icon.icns */; }; A05FCADB177C129100BE600E /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD3177C129100BE600E /* Icon.icns */; }; - A05FCADC177C129100BE600E /* Test_Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD4177C129100BE600E /* Test_Info.plist */; }; - A05FCADD177C129100BE600E /* Test_Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD4177C129100BE600E /* Test_Info.plist */; }; A05FCAE1177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; A05FCAE2177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; A05FCAEC177C1FBB00BE600E /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAEB177C1FBB00BE600E /* libcurl.dylib */; }; @@ -551,7 +549,6 @@ A05FCAD6177C129100BE600E /* InfoPlist.strings in Resources */, A05FCAD8177C129100BE600E /* MainMenu.xib in Resources */, A05FCADA177C129100BE600E /* Icon.icns in Resources */, - A05FCADC177C129100BE600E /* Test_Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -563,7 +560,6 @@ A05FCAD7177C129100BE600E /* InfoPlist.strings in Resources */, A05FCAD9177C129100BE600E /* MainMenu.xib in Resources */, A05FCADB177C129100BE600E /* Icon.icns in Resources */, - A05FCADD177C129100BE600E /* Test_Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -713,7 +709,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 1; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Test_Prefix.pch; GCC_VERSION = ""; diff --git a/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj b/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj index 8c89badc50..29982d07f5 100644 --- a/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj +++ b/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj @@ -110,75 +110,75 @@ 1A0C0ED71778095000838530 /* spidermonkey_specifics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spidermonkey_specifics.h; path = ../spidermonkey_specifics.h; sourceTree = ""; }; 1A0C0ED81778095000838530 /* XMLHTTPRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XMLHTTPRequest.cpp; path = ../XMLHTTPRequest.cpp; sourceTree = ""; }; 1A0C0ED91778095000838530 /* XMLHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLHTTPRequest.h; path = ../XMLHTTPRequest.h; sourceTree = ""; }; - A00B432A17795C5C00480238 /* BitArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitArray.h; sourceTree = ""; }; - A00B432C17795C5C00480238 /* Root.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Root.h; sourceTree = ""; }; - A00B432E17795C5C00480238 /* Anchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Anchor.h; sourceTree = ""; }; - A00B432F17795C5C00480238 /* CharacterEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterEncoding.h; sourceTree = ""; }; - A00B433017795C5C00480238 /* GCAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCAPI.h; sourceTree = ""; }; - A00B433117795C5C00480238 /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = ""; }; - A00B433217795C5C00480238 /* HeapAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapAPI.h; sourceTree = ""; }; - A00B433317795C5C00480238 /* LegacyIntTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyIntTypes.h; sourceTree = ""; }; - A00B433417795C5C00480238 /* MemoryMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryMetrics.h; sourceTree = ""; }; - A00B433517795C5C00480238 /* PropertyKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyKey.h; sourceTree = ""; }; - A00B433617795C5C00480238 /* RequiredDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequiredDefines.h; sourceTree = ""; }; - A00B433717795C5C00480238 /* TemplateLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateLib.h; sourceTree = ""; }; - A00B433817795C5C00480238 /* Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utility.h; sourceTree = ""; }; - A00B433917795C5C00480238 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = ""; }; - A00B433A17795C5C00480238 /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector.h; sourceTree = ""; }; - A00B433B17795C5C00480238 /* js-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "js-config.h"; sourceTree = ""; }; - A00B433C17795C5C00480238 /* js.msg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = js.msg; sourceTree = ""; }; - A00B433D17795C5C00480238 /* jsalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsalloc.h; sourceTree = ""; }; - A00B433E17795C5C00480238 /* jsapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsapi.h; sourceTree = ""; }; - A00B433F17795C5C00480238 /* jsclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclass.h; sourceTree = ""; }; - A00B434017795C5C00480238 /* jsclist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclist.h; sourceTree = ""; }; - A00B434117795C5C00480238 /* jscpucfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jscpucfg.h; sourceTree = ""; }; - A00B434217795C5C00480238 /* jsdbgapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdbgapi.h; sourceTree = ""; }; - A00B434317795C5C00480238 /* jsdhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdhash.h; sourceTree = ""; }; - A00B434417795C5C00480238 /* jsfriendapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsfriendapi.h; sourceTree = ""; }; - A00B434517795C5C00480238 /* jslock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jslock.h; sourceTree = ""; }; - A00B434617795C5C00480238 /* json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json.h; sourceTree = ""; }; - A00B434717795C5C00480238 /* jsperf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsperf.h; sourceTree = ""; }; - A00B434817795C5C00480238 /* jsprf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprf.h; sourceTree = ""; }; - A00B434917795C5C00480238 /* jsprototypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprototypes.h; sourceTree = ""; }; - A00B434A17795C5C00480238 /* jsproxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsproxy.h; sourceTree = ""; }; - A00B434B17795C5C00480238 /* jsprvtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprvtd.h; sourceTree = ""; }; - A00B434C17795C5C00480238 /* jspubtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jspubtd.h; sourceTree = ""; }; - A00B434D17795C5C00480238 /* jstypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jstypes.h; sourceTree = ""; }; - A00B434E17795C5C00480238 /* jsutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsutil.h; sourceTree = ""; }; - A00B434F17795C5C00480238 /* jsversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsversion.h; sourceTree = ""; }; - A00B435017795C5C00480238 /* jswrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jswrapper.h; sourceTree = ""; }; - A00B435217795C5C00480238 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = ""; }; - A00B435317795C5C00480238 /* Attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attributes.h; sourceTree = ""; }; - A00B435417795C5C00480238 /* BloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilter.h; sourceTree = ""; }; - A00B435517795C5C00480238 /* Char16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Char16.h; sourceTree = ""; }; - A00B435617795C5C00480238 /* CheckedInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedInt.h; sourceTree = ""; }; - A00B435717795C5C00480238 /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; - A00B435817795C5C00480238 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; - A00B435917795C5C00480238 /* DebugOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugOnly.h; sourceTree = ""; }; - A00B435A17795C5C00480238 /* EnumSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnumSet.h; sourceTree = ""; }; - A00B435B17795C5C00480238 /* FloatingPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingPoint.h; sourceTree = ""; }; - A00B435C17795C5C00480238 /* GuardObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuardObjects.h; sourceTree = ""; }; - A00B435D17795C5C00480238 /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = ""; }; - A00B435E17795C5C00480238 /* Likely.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Likely.h; sourceTree = ""; }; - A00B435F17795C5C00480238 /* LinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkedList.h; sourceTree = ""; }; - A00B436017795C5C00480238 /* MathAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathAlgorithms.h; sourceTree = ""; }; - A00B436117795C5C00480238 /* MemoryChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryChecking.h; sourceTree = ""; }; - A00B436217795C5C00480238 /* MSStdInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSStdInt.h; sourceTree = ""; }; - A00B436317795C5C00480238 /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = ""; }; - A00B436417795C5C00480238 /* Range.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = ""; }; - A00B436517795C5C00480238 /* RangedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangedPtr.h; sourceTree = ""; }; - A00B436617795C5C00480238 /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = ""; }; - A00B436717795C5C00480238 /* Scoped.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scoped.h; sourceTree = ""; }; - A00B436817795C5C00480238 /* SHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHA1.h; sourceTree = ""; }; - A00B436917795C5C00480238 /* SplayTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplayTree.h; sourceTree = ""; }; - A00B436A17795C5C00480238 /* StandardInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StandardInteger.h; sourceTree = ""; }; - A00B436B17795C5C00480238 /* ThreadLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadLocal.h; sourceTree = ""; }; - A00B436C17795C5C00480238 /* TypedEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedEnum.h; sourceTree = ""; }; - A00B436D17795C5C00480238 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = ""; }; - A00B436E17795C5C00480238 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = ""; }; - A00B436F17795C5C00480238 /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; - A00B437017795C5C00480238 /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = ""; }; A00B437217795C5C00480238 /* libjs_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjs_static.a; sourceTree = ""; }; + A05FCAF5177D12D900BE600E /* Anchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Anchor.h; sourceTree = ""; }; + A05FCAF6177D12D900BE600E /* CallArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallArgs.h; sourceTree = ""; }; + A05FCAF7177D12D900BE600E /* CharacterEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterEncoding.h; sourceTree = ""; }; + A05FCAF8177D12D900BE600E /* GCAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCAPI.h; sourceTree = ""; }; + A05FCAF9177D12D900BE600E /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = ""; }; + A05FCAFA177D12D900BE600E /* HeapAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapAPI.h; sourceTree = ""; }; + A05FCAFB177D12D900BE600E /* LegacyIntTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyIntTypes.h; sourceTree = ""; }; + A05FCAFC177D12D900BE600E /* MemoryMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryMetrics.h; sourceTree = ""; }; + A05FCAFD177D12D900BE600E /* PropertyKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyKey.h; sourceTree = ""; }; + A05FCAFE177D12D900BE600E /* RequiredDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequiredDefines.h; sourceTree = ""; }; + A05FCAFF177D12D900BE600E /* RootingAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootingAPI.h; sourceTree = ""; }; + A05FCB00177D12D900BE600E /* TemplateLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateLib.h; sourceTree = ""; }; + A05FCB01177D12D900BE600E /* Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utility.h; sourceTree = ""; }; + A05FCB02177D12D900BE600E /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = ""; }; + A05FCB03177D12D900BE600E /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector.h; sourceTree = ""; }; + A05FCB04177D12D900BE600E /* js-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "js-config.h"; sourceTree = ""; }; + A05FCB05177D12D900BE600E /* js.msg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = js.msg; sourceTree = ""; }; + A05FCB06177D12D900BE600E /* jsalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsalloc.h; sourceTree = ""; }; + A05FCB07177D12D900BE600E /* jsapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsapi.h; sourceTree = ""; }; + A05FCB08177D12D900BE600E /* jsclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclass.h; sourceTree = ""; }; + A05FCB09177D12D900BE600E /* jsclist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclist.h; sourceTree = ""; }; + A05FCB0A177D12D900BE600E /* jscpucfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jscpucfg.h; sourceTree = ""; }; + A05FCB0B177D12D900BE600E /* jsdbgapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdbgapi.h; sourceTree = ""; }; + A05FCB0C177D12D900BE600E /* jsdhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdhash.h; sourceTree = ""; }; + A05FCB0D177D12D900BE600E /* jsfriendapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsfriendapi.h; sourceTree = ""; }; + A05FCB0E177D12D900BE600E /* jslock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jslock.h; sourceTree = ""; }; + A05FCB0F177D12D900BE600E /* json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json.h; sourceTree = ""; }; + A05FCB10177D12D900BE600E /* jsperf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsperf.h; sourceTree = ""; }; + A05FCB11177D12D900BE600E /* jsprf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprf.h; sourceTree = ""; }; + A05FCB12177D12D900BE600E /* jsprototypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprototypes.h; sourceTree = ""; }; + A05FCB13177D12D900BE600E /* jsproxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsproxy.h; sourceTree = ""; }; + A05FCB14177D12D900BE600E /* jsprvtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprvtd.h; sourceTree = ""; }; + A05FCB15177D12D900BE600E /* jspubtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jspubtd.h; sourceTree = ""; }; + A05FCB16177D12D900BE600E /* jstypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jstypes.h; sourceTree = ""; }; + A05FCB17177D12D900BE600E /* jsutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsutil.h; sourceTree = ""; }; + A05FCB18177D12D900BE600E /* jsversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsversion.h; sourceTree = ""; }; + A05FCB19177D12D900BE600E /* jswrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jswrapper.h; sourceTree = ""; }; + A05FCB1B177D12D900BE600E /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = ""; }; + A05FCB1C177D12D900BE600E /* Attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attributes.h; sourceTree = ""; }; + A05FCB1D177D12D900BE600E /* BloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilter.h; sourceTree = ""; }; + A05FCB1E177D12D900BE600E /* Char16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Char16.h; sourceTree = ""; }; + A05FCB1F177D12D900BE600E /* CheckedInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedInt.h; sourceTree = ""; }; + A05FCB20177D12D900BE600E /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; + A05FCB21177D12D900BE600E /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; + A05FCB22177D12D900BE600E /* DebugOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugOnly.h; sourceTree = ""; }; + A05FCB23177D12D900BE600E /* EnumSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnumSet.h; sourceTree = ""; }; + A05FCB24177D12D900BE600E /* FloatingPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingPoint.h; sourceTree = ""; }; + A05FCB25177D12D900BE600E /* GuardObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuardObjects.h; sourceTree = ""; }; + A05FCB26177D12D900BE600E /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = ""; }; + A05FCB27177D12D900BE600E /* Likely.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Likely.h; sourceTree = ""; }; + A05FCB28177D12D900BE600E /* LinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkedList.h; sourceTree = ""; }; + A05FCB29177D12D900BE600E /* MathAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathAlgorithms.h; sourceTree = ""; }; + A05FCB2A177D12D900BE600E /* MemoryChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryChecking.h; sourceTree = ""; }; + A05FCB2B177D12D900BE600E /* MSStdInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSStdInt.h; sourceTree = ""; }; + A05FCB2C177D12D900BE600E /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = ""; }; + A05FCB2D177D12D900BE600E /* Range.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = ""; }; + A05FCB2E177D12D900BE600E /* RangedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangedPtr.h; sourceTree = ""; }; + A05FCB2F177D12D900BE600E /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = ""; }; + A05FCB30177D12D900BE600E /* Scoped.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scoped.h; sourceTree = ""; }; + A05FCB31177D12D900BE600E /* SHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHA1.h; sourceTree = ""; }; + A05FCB32177D12D900BE600E /* SplayTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplayTree.h; sourceTree = ""; }; + A05FCB33177D12D900BE600E /* StandardInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StandardInteger.h; sourceTree = ""; }; + A05FCB34177D12D900BE600E /* ThreadLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadLocal.h; sourceTree = ""; }; + A05FCB35177D12D900BE600E /* TypedEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedEnum.h; sourceTree = ""; }; + A05FCB36177D12D900BE600E /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = ""; }; + A05FCB37177D12D900BE600E /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = ""; }; + A05FCB38177D12D900BE600E /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = ""; }; + A05FCB39177D12D900BE600E /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -321,110 +321,34 @@ A00B432817795C5C00480238 /* include */ = { isa = PBXGroup; children = ( - A00B432917795C5C00480238 /* ds */, - A00B432B17795C5C00480238 /* gc */, - A00B432D17795C5C00480238 /* js */, - A00B433B17795C5C00480238 /* js-config.h */, - A00B433C17795C5C00480238 /* js.msg */, - A00B433D17795C5C00480238 /* jsalloc.h */, - A00B433E17795C5C00480238 /* jsapi.h */, - A00B433F17795C5C00480238 /* jsclass.h */, - A00B434017795C5C00480238 /* jsclist.h */, - A00B434117795C5C00480238 /* jscpucfg.h */, - A00B434217795C5C00480238 /* jsdbgapi.h */, - A00B434317795C5C00480238 /* jsdhash.h */, - A00B434417795C5C00480238 /* jsfriendapi.h */, - A00B434517795C5C00480238 /* jslock.h */, - A00B434617795C5C00480238 /* json.h */, - A00B434717795C5C00480238 /* jsperf.h */, - A00B434817795C5C00480238 /* jsprf.h */, - A00B434917795C5C00480238 /* jsprototypes.h */, - A00B434A17795C5C00480238 /* jsproxy.h */, - A00B434B17795C5C00480238 /* jsprvtd.h */, - A00B434C17795C5C00480238 /* jspubtd.h */, - A00B434D17795C5C00480238 /* jstypes.h */, - A00B434E17795C5C00480238 /* jsutil.h */, - A00B434F17795C5C00480238 /* jsversion.h */, - A00B435017795C5C00480238 /* jswrapper.h */, - A00B435117795C5C00480238 /* mozilla */, + A05FCAF4177D12D900BE600E /* js */, + A05FCB04177D12D900BE600E /* js-config.h */, + A05FCB05177D12D900BE600E /* js.msg */, + A05FCB06177D12D900BE600E /* jsalloc.h */, + A05FCB07177D12D900BE600E /* jsapi.h */, + A05FCB08177D12D900BE600E /* jsclass.h */, + A05FCB09177D12D900BE600E /* jsclist.h */, + A05FCB0A177D12D900BE600E /* jscpucfg.h */, + A05FCB0B177D12D900BE600E /* jsdbgapi.h */, + A05FCB0C177D12D900BE600E /* jsdhash.h */, + A05FCB0D177D12D900BE600E /* jsfriendapi.h */, + A05FCB0E177D12D900BE600E /* jslock.h */, + A05FCB0F177D12D900BE600E /* json.h */, + A05FCB10177D12D900BE600E /* jsperf.h */, + A05FCB11177D12D900BE600E /* jsprf.h */, + A05FCB12177D12D900BE600E /* jsprototypes.h */, + A05FCB13177D12D900BE600E /* jsproxy.h */, + A05FCB14177D12D900BE600E /* jsprvtd.h */, + A05FCB15177D12D900BE600E /* jspubtd.h */, + A05FCB16177D12D900BE600E /* jstypes.h */, + A05FCB17177D12D900BE600E /* jsutil.h */, + A05FCB18177D12D900BE600E /* jsversion.h */, + A05FCB19177D12D900BE600E /* jswrapper.h */, + A05FCB1A177D12D900BE600E /* mozilla */, ); path = include; sourceTree = ""; }; - A00B432917795C5C00480238 /* ds */ = { - isa = PBXGroup; - children = ( - A00B432A17795C5C00480238 /* BitArray.h */, - ); - path = ds; - sourceTree = ""; - }; - A00B432B17795C5C00480238 /* gc */ = { - isa = PBXGroup; - children = ( - A00B432C17795C5C00480238 /* Root.h */, - ); - path = gc; - sourceTree = ""; - }; - A00B432D17795C5C00480238 /* js */ = { - isa = PBXGroup; - children = ( - A00B432E17795C5C00480238 /* Anchor.h */, - A00B432F17795C5C00480238 /* CharacterEncoding.h */, - A00B433017795C5C00480238 /* GCAPI.h */, - A00B433117795C5C00480238 /* HashTable.h */, - A00B433217795C5C00480238 /* HeapAPI.h */, - A00B433317795C5C00480238 /* LegacyIntTypes.h */, - A00B433417795C5C00480238 /* MemoryMetrics.h */, - A00B433517795C5C00480238 /* PropertyKey.h */, - A00B433617795C5C00480238 /* RequiredDefines.h */, - A00B433717795C5C00480238 /* TemplateLib.h */, - A00B433817795C5C00480238 /* Utility.h */, - A00B433917795C5C00480238 /* Value.h */, - A00B433A17795C5C00480238 /* Vector.h */, - ); - path = js; - sourceTree = ""; - }; - A00B435117795C5C00480238 /* mozilla */ = { - isa = PBXGroup; - children = ( - A00B435217795C5C00480238 /* Assertions.h */, - A00B435317795C5C00480238 /* Attributes.h */, - A00B435417795C5C00480238 /* BloomFilter.h */, - A00B435517795C5C00480238 /* Char16.h */, - A00B435617795C5C00480238 /* CheckedInt.h */, - A00B435717795C5C00480238 /* Compiler.h */, - A00B435817795C5C00480238 /* Constants.h */, - A00B435917795C5C00480238 /* DebugOnly.h */, - A00B435A17795C5C00480238 /* EnumSet.h */, - A00B435B17795C5C00480238 /* FloatingPoint.h */, - A00B435C17795C5C00480238 /* GuardObjects.h */, - A00B435D17795C5C00480238 /* HashFunctions.h */, - A00B435E17795C5C00480238 /* Likely.h */, - A00B435F17795C5C00480238 /* LinkedList.h */, - A00B436017795C5C00480238 /* MathAlgorithms.h */, - A00B436117795C5C00480238 /* MemoryChecking.h */, - A00B436217795C5C00480238 /* MSStdInt.h */, - A00B436317795C5C00480238 /* NullPtr.h */, - A00B436417795C5C00480238 /* Range.h */, - A00B436517795C5C00480238 /* RangedPtr.h */, - A00B436617795C5C00480238 /* RefPtr.h */, - A00B436717795C5C00480238 /* Scoped.h */, - A00B436817795C5C00480238 /* SHA1.h */, - A00B436917795C5C00480238 /* SplayTree.h */, - A00B436A17795C5C00480238 /* StandardInteger.h */, - A00B436B17795C5C00480238 /* ThreadLocal.h */, - A00B436C17795C5C00480238 /* TypedEnum.h */, - A00B436D17795C5C00480238 /* Types.h */, - A00B436E17795C5C00480238 /* TypeTraits.h */, - A00B436F17795C5C00480238 /* Util.h */, - A00B437017795C5C00480238 /* WeakPtr.h */, - ); - path = mozilla; - sourceTree = ""; - }; A00B437117795C5C00480238 /* lib */ = { isa = PBXGroup; children = ( @@ -433,6 +357,66 @@ path = lib; sourceTree = ""; }; + A05FCAF4177D12D900BE600E /* js */ = { + isa = PBXGroup; + children = ( + A05FCAF5177D12D900BE600E /* Anchor.h */, + A05FCAF6177D12D900BE600E /* CallArgs.h */, + A05FCAF7177D12D900BE600E /* CharacterEncoding.h */, + A05FCAF8177D12D900BE600E /* GCAPI.h */, + A05FCAF9177D12D900BE600E /* HashTable.h */, + A05FCAFA177D12D900BE600E /* HeapAPI.h */, + A05FCAFB177D12D900BE600E /* LegacyIntTypes.h */, + A05FCAFC177D12D900BE600E /* MemoryMetrics.h */, + A05FCAFD177D12D900BE600E /* PropertyKey.h */, + A05FCAFE177D12D900BE600E /* RequiredDefines.h */, + A05FCAFF177D12D900BE600E /* RootingAPI.h */, + A05FCB00177D12D900BE600E /* TemplateLib.h */, + A05FCB01177D12D900BE600E /* Utility.h */, + A05FCB02177D12D900BE600E /* Value.h */, + A05FCB03177D12D900BE600E /* Vector.h */, + ); + path = js; + sourceTree = ""; + }; + A05FCB1A177D12D900BE600E /* mozilla */ = { + isa = PBXGroup; + children = ( + A05FCB1B177D12D900BE600E /* Assertions.h */, + A05FCB1C177D12D900BE600E /* Attributes.h */, + A05FCB1D177D12D900BE600E /* BloomFilter.h */, + A05FCB1E177D12D900BE600E /* Char16.h */, + A05FCB1F177D12D900BE600E /* CheckedInt.h */, + A05FCB20177D12D900BE600E /* Compiler.h */, + A05FCB21177D12D900BE600E /* Constants.h */, + A05FCB22177D12D900BE600E /* DebugOnly.h */, + A05FCB23177D12D900BE600E /* EnumSet.h */, + A05FCB24177D12D900BE600E /* FloatingPoint.h */, + A05FCB25177D12D900BE600E /* GuardObjects.h */, + A05FCB26177D12D900BE600E /* HashFunctions.h */, + A05FCB27177D12D900BE600E /* Likely.h */, + A05FCB28177D12D900BE600E /* LinkedList.h */, + A05FCB29177D12D900BE600E /* MathAlgorithms.h */, + A05FCB2A177D12D900BE600E /* MemoryChecking.h */, + A05FCB2B177D12D900BE600E /* MSStdInt.h */, + A05FCB2C177D12D900BE600E /* NullPtr.h */, + A05FCB2D177D12D900BE600E /* Range.h */, + A05FCB2E177D12D900BE600E /* RangedPtr.h */, + A05FCB2F177D12D900BE600E /* RefPtr.h */, + A05FCB30177D12D900BE600E /* Scoped.h */, + A05FCB31177D12D900BE600E /* SHA1.h */, + A05FCB32177D12D900BE600E /* SplayTree.h */, + A05FCB33177D12D900BE600E /* StandardInteger.h */, + A05FCB34177D12D900BE600E /* ThreadLocal.h */, + A05FCB35177D12D900BE600E /* TypedEnum.h */, + A05FCB36177D12D900BE600E /* Types.h */, + A05FCB37177D12D900BE600E /* TypeTraits.h */, + A05FCB38177D12D900BE600E /* Util.h */, + A05FCB39177D12D900BE600E /* WeakPtr.h */, + ); + path = mozilla; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ From 2cccadeaabef105257cdb48771dfd36e41accd3c Mon Sep 17 00:00:00 2001 From: boyu0 Date: Fri, 28 Jun 2013 10:12:55 +0800 Subject: [PATCH 06/43] closed #2339 refactor checkParams() in create_project.py, use OptionParser to parse the params --- tools/project-creator/create_project.py | 83 ++++++++++--------------- 1 file changed, 32 insertions(+), 51 deletions(-) diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index bd8a052d8b..af8f235cc5 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -5,16 +5,7 @@ # Author: WangZhe # define global variables -context = { -"language" : "undefined", -"src_project_name" : "undefined", -"src_package_name" : "undefined", -"dst_project_name" : "undeifned", -"dst_package_name" : "undefined", -"src_project_path" : "undefined", -"dst_project_path" : "undefined", -"script_dir" : "undefined", -} +context = {}.fromkeys(("language", "src_project_name", "src_package_name", "dst_project_name", "dst_package_name", "src_project_path", "dst_project_path", "script_dir")); platforms_list = [] # begin @@ -23,52 +14,42 @@ import os, os.path import json import shutil -def dumpUsage(): - print "Usage: create_project.py -project PROJECT_NAME -package PACKAGE_NAME -language PROGRAMING_LANGUAGE" - print "Options:" - print " -project PROJECT_NAME Project name, for example: MyGame" - print " -package PACKAGE_NAME Package name, for example: com.MyCompany.MyAwesomeGame" - print " -language PROGRAMING_LANGUAGE Major programing lanauge you want to used, should be [cpp | lua | javascript]" - print "" - print "Sample : ./create_project.py -project MyGame -package com.MyCompany.AwesomeGame -language javascript" - print "" - def checkParams(context): + from optparse import OptionParser + + # set the parser to parse input params + # the correspond variable name of "-x, --xxx" is parser.xxx + parser = OptionParser(usage="Usage: ./%prog -p PROJECT_NAME -k PACKAGE_NAME -l PROGRAMING_LANGUAGE\nSample : ./%prog -p MyGame -k com.MyCompany.AwesomeGame -l javascript") + parser.add_option("-p", "--project", metavar="PROJECT_NAME", help="Set a project name") + parser.add_option("-k", "--package", metavar="PACKAGE_NAME", help="Set a package name for project") + parser.add_option("-l", "--language", + metavar="PROGRAMMING_NAME", + type="choice", + choices=["cpp", "lua", "javascript"], + help="Major programing lanauge you want to used, should be [cpp | lua | javascript]") + + #parse the params + (opts, args) = parser.parse_args() + # generate our internal params context["script_dir"] = os.getcwd() + "/" global platforms_list - # invalid invoke, tell users how to input params - if len(sys.argv) < 7: - dumpUsage() - sys.exit() - - # find our params - for i in range(1, len(sys.argv)): - if "-project" == sys.argv[i]: - # read the next param as project_name - context["dst_project_name"] = sys.argv[i+1] - context["dst_project_path"] = os.getcwd() + "/../../projects/" + context["dst_project_name"] - elif "-package" == sys.argv[i]: - # read the next param as g_PackageName - context["dst_package_name"] = sys.argv[i+1] - elif "-language" == sys.argv[i]: - # choose a scripting language - context["language"] = sys.argv[i+1] - - # pinrt error log our required paramters are not ready - raise_error = False - if context["dst_project_name"] == "undefined": - print "Invalid -project parameter" - raise_error = True - if context["dst_package_name"] == "undefined": - print "Invalid -package parameter" - raise_error = True - if context["language"] == "undefined": - print "Invalid -language parameter" - raise_error = True - if raise_error != False: - sys.exit() + if opts.project: + context["dst_project_name"] = opts.project + context["dst_project_path"] = os.getcwd() + "/../../projects/" + context["dst_project_name"] + else: + parser.error("-p or --project is not specified") + + if opts.package: + context["dst_package_name"] = opts.package + else: + parser.error("-k or --package is not specified") + + if opts.language: + context["language"] = opts.language + else: + parser.error("-k or --package is not specified") # fill in src_project_name and src_package_name according to "language" if ("cpp" == context["language"]): From 96a50bf7363cc93ae13ead5f6d643083e03b6e63 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 27 Jun 2013 22:14:26 -0700 Subject: [PATCH 07/43] updates cocos2d-mac workspace --- cocos2d-mac.xcworkspace/contents.xcworkspacedata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d-mac.xcworkspace/contents.xcworkspacedata b/cocos2d-mac.xcworkspace/contents.xcworkspacedata index 6f413213c3..3468d0041e 100644 --- a/cocos2d-mac.xcworkspace/contents.xcworkspacedata +++ b/cocos2d-mac.xcworkspace/contents.xcworkspacedata @@ -27,7 +27,7 @@ location = "container:" name = "libs"> + location = "group:scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj"> @@ -42,7 +42,7 @@ location = "group:CocosDenshion/proj.mac/CocosDenshion.xcodeproj"> + location = "group:cocos2dx/proj.mac/cocos2dx.xcodeproj"> From 6e1af21c0edf82894f74428dec3265225305fced Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 27 Jun 2013 22:19:33 -0700 Subject: [PATCH 08/43] Uses new cocos2d-console --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index df447d6134..f4c555cdb4 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit df447d6134b52f7a3ce98da12f5140a4dead5d2d +Subproject commit f4c555cdb48bb8f522515e25a6290d728c830e32 From b846a3060edcbf521560d7fd4f220a8baf3c5eff Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 28 Jun 2013 19:02:10 -0700 Subject: [PATCH 09/43] cocos2d-x in Mac: Works as expected. All the projects defines CC_KEYBOARD_SUPPORT. Either all of them should define them, or none, otherwise the vtable will be broken --- .../CocosDenshion.xcodeproj/project.pbxproj | 1 - cocos2dx/CCDirector.cpp | 8 +-- cocos2dx/CCDirector.h | 4 +- .../CCLayer.cpp | 7 ++- .../layers_scenes_transitions_nodes/CCLayer.h | 14 ++--- .../project.pbxproj.REMOVED.git-id | 2 +- .../extensions.xcodeproj/project.pbxproj | 3 +- .../Classes/KeyboardTest/KeyboardTest.cpp | 2 +- .../Classes/KeyboardTest/KeyboardTest.h | 2 +- .../TestCpp/Classes/LayerTest/LayerTest.cpp | 51 ++++++++++++++++++- .../Cpp/TestCpp/Classes/LayerTest/LayerTest.h | 16 ++++++ samples/Cpp/TestCpp/Classes/controller.cpp | 2 +- samples/Cpp/TestCpp/Classes/tests.h | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- .../TestJavascript.xcodeproj/project.pbxproj | 3 +- scripting/javascript/bindings/generated | 2 +- .../jsbindings.xcodeproj/project.pbxproj | 3 +- 17 files changed, 95 insertions(+), 29 deletions(-) diff --git a/CocosDenshion/proj.mac/CocosDenshion.xcodeproj/project.pbxproj b/CocosDenshion/proj.mac/CocosDenshion.xcodeproj/project.pbxproj index 1c31a62577..810beeb4d2 100644 --- a/CocosDenshion/proj.mac/CocosDenshion.xcodeproj/project.pbxproj +++ b/CocosDenshion/proj.mac/CocosDenshion.xcodeproj/project.pbxproj @@ -258,7 +258,6 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = macosx; VALIDATE_PRODUCT = YES; }; diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index b96b617be2..1780a60f10 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -64,7 +64,7 @@ THE SOFTWARE. #include "platform/CCImage.h" #include "CCEGLView.h" #include "CCConfiguration.h" -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT #include "keyboard_dispatcher/CCKeyboardDispatcher.h" #endif @@ -154,7 +154,7 @@ bool Director::init(void) _touchDispatcher = new TouchDispatcher(); _touchDispatcher->init(); -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT // KeyboardDispatcher _keyboardDispatcher = new KeyboardDispatcher(); #endif @@ -185,7 +185,7 @@ Director::~Director(void) CC_SAFE_RELEASE(_scheduler); CC_SAFE_RELEASE(_actionManager); CC_SAFE_RELEASE(_touchDispatcher); -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT CC_SAFE_RELEASE(_keyboardDispatcher); #endif CC_SAFE_RELEASE(_keypadDispatcher); @@ -1004,7 +1004,7 @@ TouchDispatcher* Director::getTouchDispatcher() return _touchDispatcher; } -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT void Director::setKeyboardDispatcher(KeyboardDispatcher* pKeyboardDispatcher) { CC_SAFE_RETAIN(pKeyboardDispatcher); diff --git a/cocos2dx/CCDirector.h b/cocos2dx/CCDirector.h index 97f14c9e34..0a1d642d00 100644 --- a/cocos2dx/CCDirector.h +++ b/cocos2dx/CCDirector.h @@ -71,7 +71,7 @@ class Node; class Scheduler; class ActionManager; class TouchDispatcher; -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT class KeyboardDispatcher; #endif class KeypadDispatcher; @@ -328,7 +328,7 @@ public: */ CC_PROPERTY(TouchDispatcher*, _touchDispatcher, TouchDispatcher); -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT /** KeyboardDispatcher associated with this director @since v?.? */ diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index ae5d984085..00a544dc7d 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -38,7 +38,7 @@ THE SOFTWARE. #include "support/TransformUtils.h" // extern #include "kazmath/GL/matrix.h" -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT #include "keyboard_dispatcher/CCKeyboardDispatcher.h" #endif @@ -48,7 +48,7 @@ NS_CC_BEGIN Layer::Layer() : _touchEnabled(false) , _accelerometerEnabled(false) -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT , _keyboardEnabled(false) #endif , _keypadEnabled(false) @@ -279,7 +279,7 @@ void Layer::unregisterScriptAccelerateHandler(void) CC_SAFE_RELEASE_NULL(_scriptAccelerateHandlerEntry); } -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT /// isKeyboardEnabled getter bool Layer::isKeyboardEnabled() { @@ -845,7 +845,6 @@ void LayerColor::setOpacity(GLubyte opacity) // // LayerGradient // - LayerGradient* LayerGradient::create(const ccColor4B& start, const ccColor4B& end) { LayerGradient * pLayer = new LayerGradient(); diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h index 7ca3929557..54182869f9 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h @@ -67,7 +67,7 @@ public: virtual ~Layer(); virtual bool init(); - /** create one layer */ + /** creates a fullscreen black layer */ static Layer *create(void); virtual void onEnter(); @@ -134,7 +134,7 @@ public: You can enable / disable accelerometer events with this property. it's new in cocos2d-x */ -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT virtual bool isKeyboardEnabled(); virtual void setKeyboardEnabled(bool value); virtual void keyPressed(int keyCode) {}; @@ -157,7 +157,7 @@ public: protected: bool _touchEnabled; bool _accelerometerEnabled; -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT bool _keyboardEnabled; #endif bool _keypadEnabled; @@ -243,7 +243,8 @@ public: virtual void draw(); virtual void setContentSize(const Size & var); - + + /** creates a fullscreen black layer */ static LayerColor* create(); /** creates a Layer with color, width and height in Points */ @@ -304,6 +305,9 @@ class CC_DLL LayerGradient : public LayerColor { public: + /** Creates a fullscreen black layer */ + static LayerGradient* create(); + /** Creates a full-screen Layer with a gradient between start and end. */ static LayerGradient* create(const ccColor4B& start, const ccColor4B& end); @@ -332,8 +336,6 @@ public: virtual void setCompressedInterpolation(bool bCompressedInterpolation); virtual bool isCompressedInterpolation(); - static LayerGradient* create(); - protected: virtual void updateColor(); }; diff --git a/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id index 378c8c51d1..c674431d3e 100644 --- a/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -14f06ca9e6652e501a7f9709b6ef7a2ed52a35b1 \ No newline at end of file +1dc917cb6f1a62d8d7536db3c3db9f25562d59b7 \ No newline at end of file diff --git a/extensions/proj.mac/extensions.xcodeproj/project.pbxproj b/extensions/proj.mac/extensions.xcodeproj/project.pbxproj index d49984c136..bdee787e8f 100644 --- a/extensions/proj.mac/extensions.xcodeproj/project.pbxproj +++ b/extensions/proj.mac/extensions.xcodeproj/project.pbxproj @@ -1013,7 +1013,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", - "$(inherited)", + CC_KEYBOARD_SUPPORT, CC_TARGET_OS_MAC, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; @@ -1042,6 +1042,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( NDEBUG, CC_TARGET_OS_MAC, + CC_KEYBOARD_SUPPORT, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; diff --git a/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.cpp b/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.cpp index 430260c1f5..f5c8f341c5 100644 --- a/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.cpp +++ b/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.cpp @@ -1,6 +1,6 @@ #include "KeyboardTest.h" -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT KeyboardTest::KeyboardTest() { diff --git a/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.h b/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.h index 2586741b2f..f688037834 100644 --- a/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.h +++ b/samples/Cpp/TestCpp/Classes/KeyboardTest/KeyboardTest.h @@ -1,7 +1,7 @@ #ifndef _KEYBOARD_TEST_H_ #define _KEYBOARD_TEST_H_ -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT #include "cocos2d.h" #include "../testBasic.h" diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp index ee41c03f98..944b50dca2 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.cpp @@ -16,7 +16,9 @@ static std::function createFunctions[] = { CL(LayerTest1), CL(LayerTest2), CL(LayerTestBlend), - CL(LayerGradient), + CL(LayerGradientTest), + CL(LayerGradientTest2), + CL(LayerGradientTest3), CL(LayerIgnoreAnchorPointPos), CL(LayerIgnoreAnchorPointRot), CL(LayerIgnoreAnchorPointScale), @@ -581,7 +583,7 @@ std::string LayerTestBlend::title() //------------------------------------------------------------------ // -// LayerGradient +// LayerGradientTest // //------------------------------------------------------------------ LayerGradientTest::LayerGradientTest() @@ -633,6 +635,51 @@ string LayerGradientTest::subtitle() return "Touch the screen and move your finger"; } +//------------------------------------------------------------------ +// +// LayerGradientTest2 +// +//------------------------------------------------------------------ +LayerGradientTest2::LayerGradientTest2() +{ + LayerGradient* layer = new LayerGradient; + layer->initWithColor(ccc4(255,0,0,255), ccc4(255,255,0,255)); + layer->autorelease(); + addChild(layer); +} + +std::string LayerGradientTest2::title() +{ + return "LayerGradientTest 2"; +} + +string LayerGradientTest2::subtitle() +{ + return "You should see a gradient"; +} + + +//------------------------------------------------------------------ +// +// LayerGradientTest3 +// +//------------------------------------------------------------------ +LayerGradientTest3::LayerGradientTest3() +{ + LayerGradient* layer1 = LayerGradient::create(ccc4(255,0,0,255), ccc4(255,255,0,255)); + addChild(layer1); +} + +std::string LayerGradientTest3::title() +{ + return "LayerGradientTest 3"; +} + +string LayerGradientTest3::subtitle() +{ + return "You should see a gradient"; +} + // LayerIgnoreAnchorPointPos #define kLayerIgnoreAnchorPoint 1000 diff --git a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h index 7f3f66188a..7dd3186959 100644 --- a/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h +++ b/samples/Cpp/TestCpp/Classes/LayerTest/LayerTest.h @@ -105,6 +105,22 @@ public: void toggleItem(cocos2d::Object *sender); }; +class LayerGradientTest2 : public LayerTest +{ +public: + LayerGradientTest2(); + virtual std::string title(); + virtual std::string subtitle(); +}; + +class LayerGradientTest3 : public LayerTest +{ +public: + LayerGradientTest3(); + virtual std::string title(); + virtual std::string subtitle(); +}; + class LayerIgnoreAnchorPointPos : public LayerTest { public: diff --git a/samples/Cpp/TestCpp/Classes/controller.cpp b/samples/Cpp/TestCpp/Classes/controller.cpp index 46b931a430..e2bc5e59a6 100644 --- a/samples/Cpp/TestCpp/Classes/controller.cpp +++ b/samples/Cpp/TestCpp/Classes/controller.cpp @@ -49,7 +49,7 @@ struct { { "FileUtilsTest", []() { return new FileUtilsTestScene(); } }, { "FontTest", []() { return new FontTestScene(); } }, { "IntervalTest", [](){return new IntervalTestScene(); } }, -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT { "KeyboardTest", []() { return new KeyboardTestScene(); } }, #endif #if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) diff --git a/samples/Cpp/TestCpp/Classes/tests.h b/samples/Cpp/TestCpp/Classes/tests.h index 7b2b9b2464..c9c119f2cd 100644 --- a/samples/Cpp/TestCpp/Classes/tests.h +++ b/samples/Cpp/TestCpp/Classes/tests.h @@ -29,7 +29,7 @@ #include "EffectsAdvancedTest/EffectsAdvancedTest.h" #include "AccelerometerTest/AccelerometerTest.h" #include "KeypadTest/KeypadTest.h" -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT #include "KeyboardTest/KeyboardTest.h" #endif #include "PerformanceTest/PerformanceTest.h" diff --git a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index eb3adc8ac0..1e68e05c46 100644 --- a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -a1c526dca23c3ded2ceec95cfd144e0e99c49b79 \ No newline at end of file +71bef727d03198fd6e3a9fe575af0d7c7c3e5449 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj index 2bf0a87cb5..f493c8157b 100644 --- a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj +++ b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj @@ -639,6 +639,7 @@ CC_ENABLE_CHIPMUNK_INTEGRATION, CC_TARGET_OS_MAC, DEBUG, + CC_KEYBOARD_SUPPORT, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -678,6 +679,7 @@ CC_ENABLE_CHIPMUNK_INTEGRATION, CC_TARGET_OS_MAC, NDEBUG, + CC_KEYBOARD_SUPPORT, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; @@ -698,7 +700,6 @@ "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac/libraries\"", "\"$(SRCROOT)/../../../../external/libwebsockets/mac/lib\"", ); - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = macosx; }; name = Release; diff --git a/scripting/javascript/bindings/generated b/scripting/javascript/bindings/generated index 1629fa860d..0e511fd6d1 160000 --- a/scripting/javascript/bindings/generated +++ b/scripting/javascript/bindings/generated @@ -1 +1 @@ -Subproject commit 1629fa860dd1c378c0c1d2d39463d796e51f0043 +Subproject commit 0e511fd6d1f9ff3117b27c4ebc40c4b01f296437 diff --git a/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj b/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj index 29982d07f5..fd51d91ed6 100644 --- a/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj +++ b/scripting/javascript/bindings/proj.mac/jsbindings.xcodeproj/project.pbxproj @@ -511,9 +511,9 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", "DEBUG=1", CC_TARGET_OS_MAC, + CC_KEYBOARD_SUPPORT, ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -541,6 +541,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( NDEBUG, CC_TARGET_OS_MAC, + CC_KEYBOARD_SUPPORT, ); GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; From e2b9863bf773819599aef8c7149f261b685d79c5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 29 Jun 2013 11:44:14 +0800 Subject: [PATCH 10/43] issue #2325: [Linux] KEYBOARD_SUPPORT --> CC_KEYBOARD_SUPPORT. --- cocos2dx/platform/linux/CCEGLView.cpp | 6 +++--- cocos2dx/proj.linux/cocos2dx.mk | 2 +- samples/Cpp/TestCpp/proj.linux/Makefile | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos2dx/platform/linux/CCEGLView.cpp index 95bbae6c82..a195d56edc 100644 --- a/cocos2dx/platform/linux/CCEGLView.cpp +++ b/cocos2dx/platform/linux/CCEGLView.cpp @@ -13,7 +13,7 @@ #include "touch_dispatcher/CCTouch.h" #include "touch_dispatcher/CCTouchDispatcher.h" #include "text_input_node/CCIMEDispatcher.h" -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT #include "keyboard_dispatcher/CCKeyboardDispatcher.h" #endif @@ -157,7 +157,7 @@ int closeEventHandle() { return GL_TRUE; } -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT void GLFWCALL keyboardEventHandle(int keyCode, int action) { KeyboardDispatcher *kbDisp = Director::sharedDirector()->getKeyboardDispatcher(); @@ -248,7 +248,7 @@ void EGLView::setFrameSize(float width, float height) glfwSetMouseButtonCallback(mouseButtonEventHandle); //register the glfw mouse pos event glfwSetMousePosCallback(mousePosEventHandle); -#ifdef KEYBOARD_SUPPORT +#ifdef CC_KEYBOARD_SUPPORT //register the glfw keyboard event glfwSetKeyCallback(keyboardEventHandle); #endif diff --git a/cocos2dx/proj.linux/cocos2dx.mk b/cocos2dx/proj.linux/cocos2dx.mk index 522d3fb0bc..bb1b98d495 100644 --- a/cocos2dx/proj.linux/cocos2dx.mk +++ b/cocos2dx/proj.linux/cocos2dx.mk @@ -11,7 +11,7 @@ CCFLAGS += -MMD -Werror -Wno-deprecated-declarations -fPIC CXXFLAGS += -MMD -Werror -Wno-deprecated-declarations -fPIC -std=gnu++0x ARFLAGS = cr -DEFINES += -DLINUX -DKEYBOARD_SUPPORT +DEFINES += -DLINUX -DCC_KEYBOARD_SUPPORT ifdef USE_BOX2D DEFINES += -DCC_ENABLE_BOX2D_INTEGRATION=1 diff --git a/samples/Cpp/TestCpp/proj.linux/Makefile b/samples/Cpp/TestCpp/proj.linux/Makefile index 00c2445c4b..62c38a39cc 100644 --- a/samples/Cpp/TestCpp/proj.linux/Makefile +++ b/samples/Cpp/TestCpp/proj.linux/Makefile @@ -1,6 +1,6 @@ EXECUTABLE = TestCpp -DEFINES += -DKEYBOARD_SUPPORT +DEFINES += -DCC_KEYBOARD_SUPPORT SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \ ../Classes/ActionManagerTest/ActionManagerTest.cpp \ From e20de6b6aa49fa21f2700e4c6f2c7a3e3cb9badb Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 29 Jun 2013 11:45:16 +0800 Subject: [PATCH 11/43] Reverting submodules. --- scripting/javascript/bindings/generated | 2 +- tools/cocos2d-console | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripting/javascript/bindings/generated b/scripting/javascript/bindings/generated index 0e511fd6d1..1629fa860d 160000 --- a/scripting/javascript/bindings/generated +++ b/scripting/javascript/bindings/generated @@ -1 +1 @@ -Subproject commit 0e511fd6d1f9ff3117b27c4ebc40c4b01f296437 +Subproject commit 1629fa860dd1c378c0c1d2d39463d796e51f0043 diff --git a/tools/cocos2d-console b/tools/cocos2d-console index f4c555cdb4..df447d6134 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit f4c555cdb48bb8f522515e25a6290d728c830e32 +Subproject commit df447d6134b52f7a3ce98da12f5140a4dead5d2d From 7dd6218344c593bb5cf3538294896b383b4e5df0 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 29 Jun 2013 12:12:26 +0800 Subject: [PATCH 12/43] issue #2325: [MAC] Setting the windows size to 800x450 which is the same as HTML5-tests. --- samples/Javascript/TestJavascript/proj.mac/AppController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/TestJavascript/proj.mac/AppController.mm b/samples/Javascript/TestJavascript/proj.mac/AppController.mm index 0d30617caa..43d05cf28a 100644 --- a/samples/Javascript/TestJavascript/proj.mac/AppController.mm +++ b/samples/Javascript/TestJavascript/proj.mac/AppController.mm @@ -36,7 +36,7 @@ // create the window // note that using NSResizableWindowMask causes the window to be a little // smaller and therefore ipad graphics are not loaded - NSRect rect = NSMakeRect(200, 200, 480, 320); + NSRect rect = NSMakeRect(100, 100, 800, 450); window = [[NSWindow alloc] initWithContentRect:rect styleMask:( NSClosableWindowMask | NSTitledWindowMask ) backing:NSBackingStoreBuffered From 9bac943040c9cf17c7e117374abd2e112fb8ca4e Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 29 Jun 2013 12:25:44 +0800 Subject: [PATCH 13/43] issue #2325: [MAC] Removing libxml2.dylib, adding libcurl.dylib and updating dependence for TestCpp. --- .../proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index 1e68e05c46..8f9958a187 100644 --- a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -71bef727d03198fd6e3a9fe575af0d7c7c3e5449 \ No newline at end of file +226867e25e3d039a278ae385c4b8822461b82427 \ No newline at end of file From bc6acb6411be2cc6253e18142e8085fa74a63651 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Sat, 29 Jun 2013 04:35:21 +0000 Subject: [PATCH 14/43] [AUTO] : updating submodule reference to latest autogenerated bindings --- scripting/javascript/bindings/generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/generated b/scripting/javascript/bindings/generated index 1629fa860d..1aef083d39 160000 --- a/scripting/javascript/bindings/generated +++ b/scripting/javascript/bindings/generated @@ -1 +1 @@ -Subproject commit 1629fa860dd1c378c0c1d2d39463d796e51f0043 +Subproject commit 1aef083d3959574072f234cd31c5a53ac52b58a9 From 37ca32e75ca534b3b4a583a6dc790edd5b1375f5 Mon Sep 17 00:00:00 2001 From: Justin Hawkwood Date: Wed, 26 Jun 2013 22:22:21 -0700 Subject: [PATCH 15/43] Corrected code to use textDefinition properties --- cocos2dx/textures/CCTexture2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index d468a1a390..092e7578f7 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -515,7 +515,7 @@ bool Texture2D::initWithString(const char *text, ccFontDefinition *textDefinitio #if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture data - VolatileTexture::addStringTexture(this, text, dimensions, hAlignment, vAlignment, fontName, fontSize); + VolatileTexture::addStringTexture(this, text, textDefinition->m_dimensions, textDefinition->m_alignment, textDefinition->m_vertAlignment, textDefinition->m_fontName.c_str(), textDefinition->m_fontSize); #endif bool bRet = false; From bb2f19535bea9631da5d6fafcf8d9ec77170671b Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 29 Jun 2013 15:01:50 +0800 Subject: [PATCH 16/43] closed #2342: Fixing compilation errors when CC_ENABLE_CACHE_TEXTURE_DATA is enabled. --- cocos2dx/textures/CCTexture2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index 092e7578f7..847f0153b7 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -515,7 +515,7 @@ bool Texture2D::initWithString(const char *text, ccFontDefinition *textDefinitio #if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture data - VolatileTexture::addStringTexture(this, text, textDefinition->m_dimensions, textDefinition->m_alignment, textDefinition->m_vertAlignment, textDefinition->m_fontName.c_str(), textDefinition->m_fontSize); + VolatileTexture::addStringTexture(this, text, textDefinition->_dimensions, textDefinition->_alignment, textDefinition->_vertAlignment, textDefinition->_fontName.c_str(), textDefinition->_fontSize); #endif bool bRet = false; From b76798505c3bfebadf81025c2a1cc1f534b2a2a9 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 29 Jun 2013 15:04:43 +0800 Subject: [PATCH 17/43] closed #2342: Fixing indention. --- cocos2dx/textures/CCTexture2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index 847f0153b7..21ae506be5 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -515,7 +515,7 @@ bool Texture2D::initWithString(const char *text, ccFontDefinition *textDefinitio #if CC_ENABLE_CACHE_TEXTURE_DATA // cache the texture data - VolatileTexture::addStringTexture(this, text, textDefinition->_dimensions, textDefinition->_alignment, textDefinition->_vertAlignment, textDefinition->_fontName.c_str(), textDefinition->_fontSize); + VolatileTexture::addStringTexture(this, text, textDefinition->_dimensions, textDefinition->_alignment, textDefinition->_vertAlignment, textDefinition->_fontName.c_str(), textDefinition->_fontSize); #endif bool bRet = false; From 2625847a741c469c5fd19e847cebad48b98fe792 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 1 Jul 2013 01:04:01 +0800 Subject: [PATCH 18/43] closed #2339 refactor checkParams() in create_project.py, use OptionParser to parse the params --- tools/project-creator/create_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index af8f235cc5..59ea32122c 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -49,7 +49,7 @@ def checkParams(context): if opts.language: context["language"] = opts.language else: - parser.error("-k or --package is not specified") + parser.error("-l or --language is not specified") # fill in src_project_name and src_package_name according to "language" if ("cpp" == context["language"]): From c3e043ef2037cd0fc60dc95ff0f06461c017b458 Mon Sep 17 00:00:00 2001 From: Squallium Date: Sun, 30 Jun 2013 21:38:06 +0200 Subject: [PATCH 19/43] Added CocosDenshion dependency to libextension project --- extensions/proj.linux/.cproject | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/proj.linux/.cproject b/extensions/proj.linux/.cproject index a4aac1c02c..9918728542 100644 --- a/extensions/proj.linux/.cproject +++ b/extensions/proj.linux/.cproject @@ -40,6 +40,7 @@ + @@ -66,6 +67,7 @@ + @@ -133,6 +135,7 @@ + @@ -159,6 +162,7 @@ + @@ -218,6 +222,7 @@ + @@ -244,6 +249,7 @@ + @@ -312,6 +318,7 @@ + @@ -338,6 +345,7 @@ + From aeb9c5a45f04c7fe78ce776a9f9e9ef85cea2a50 Mon Sep 17 00:00:00 2001 From: Squallium Date: Sun, 30 Jun 2013 21:43:40 +0200 Subject: [PATCH 20/43] adding ccFPSImages entity as linked resource --- cocos2dx/proj.linux/.project | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cocos2dx/proj.linux/.project b/cocos2dx/proj.linux/.project index 65b43549e7..306260a9da 100755 --- a/cocos2dx/proj.linux/.project +++ b/cocos2dx/proj.linux/.project @@ -96,6 +96,16 @@ 1 PARENT-1-PROJECT_LOC/CCConfiguration.h + + ccFPSImages.c + 1 + PARENT-1-PROJECT_LOC/ccFPSImages.c + + + ccFPSImages.h + 1 + PARENT-1-PROJECT_LOC/ccFPSImages.h + CCDirector.cpp 1 From c770a4bdc866e762cea60198ca8721b513dd2ec9 Mon Sep 17 00:00:00 2001 From: Squallium Date: Sun, 30 Jun 2013 22:00:29 +0200 Subject: [PATCH 21/43] Added ccFPSImages entity as linked resource --- cocos2dx/proj.linux/.project | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cocos2dx/proj.linux/.project b/cocos2dx/proj.linux/.project index 65b43549e7..306260a9da 100755 --- a/cocos2dx/proj.linux/.project +++ b/cocos2dx/proj.linux/.project @@ -96,6 +96,16 @@ 1 PARENT-1-PROJECT_LOC/CCConfiguration.h + + ccFPSImages.c + 1 + PARENT-1-PROJECT_LOC/ccFPSImages.c + + + ccFPSImages.h + 1 + PARENT-1-PROJECT_LOC/ccFPSImages.h + CCDirector.cpp 1 From 9697c5af9acb9a5021f75a1e2167c288e2705171 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 1 Jul 2013 10:14:12 +0800 Subject: [PATCH 22/43] [ci ignore] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 4ec7b7de70..b572d20555 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,9 @@ Developers: Rolando Abarca Javascript Binding and testjs + Squallium + Added ccFPSImages entity as linked resource on linux eclipse project setting + longlene Improve android project creation script From 40cf6a7956b042fe3f514f629b5a64793dc2ae0f Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Sun, 30 Jun 2013 23:07:56 -0700 Subject: [PATCH 23/43] unified mac project for all the cocos2d-x libraries --- cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id | 1 + 1 file changed, 1 insertion(+) create mode 100644 cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id diff --git a/cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..43fa30187c --- /dev/null +++ b/cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +d8c7e473cad03a458a109e54a6def0a97b92da8c \ No newline at end of file From 1156ae4f60804ee4846ab3973efd4ae3fc2da4dc Mon Sep 17 00:00:00 2001 From: boyu0 Date: Mon, 1 Jul 2013 14:10:14 +0800 Subject: [PATCH 24/43] change the useage text --- tools/project-creator/create_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/project-creator/create_project.py b/tools/project-creator/create_project.py index 59ea32122c..5492cbeb2c 100755 --- a/tools/project-creator/create_project.py +++ b/tools/project-creator/create_project.py @@ -19,7 +19,7 @@ def checkParams(context): # set the parser to parse input params # the correspond variable name of "-x, --xxx" is parser.xxx - parser = OptionParser(usage="Usage: ./%prog -p PROJECT_NAME -k PACKAGE_NAME -l PROGRAMING_LANGUAGE\nSample : ./%prog -p MyGame -k com.MyCompany.AwesomeGame -l javascript") + parser = OptionParser(usage="Usage: ./%prog -p -k -l \nSample: ./%prog -p MyGame -k com.MyCompany.AwesomeGame -l javascript") parser.add_option("-p", "--project", metavar="PROJECT_NAME", help="Set a project name") parser.add_option("-k", "--package", metavar="PACKAGE_NAME", help="Set a package name for project") parser.add_option("-l", "--language", From 0d040bae76c7ec01d851b2cc089bb40ac69a4d44 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Jul 2013 16:48:42 +0800 Subject: [PATCH 25/43] closed #2347: Macros like CC_KEYBOARD_SUPPORT should not be in header file. --- cocos2dx/CCDirector.cpp | 8 -------- cocos2dx/CCDirector.h | 6 ++---- cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp | 6 ------ cocos2dx/layers_scenes_transitions_nodes/CCLayer.h | 6 ++---- cocos2dx/platform/linux/CCEGLView.cpp | 4 ---- .../cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 6 files changed, 5 insertions(+), 27 deletions(-) diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index 1780a60f10..5fdeaa9f39 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -64,9 +64,7 @@ THE SOFTWARE. #include "platform/CCImage.h" #include "CCEGLView.h" #include "CCConfiguration.h" -#ifdef CC_KEYBOARD_SUPPORT #include "keyboard_dispatcher/CCKeyboardDispatcher.h" -#endif /** @@ -154,10 +152,8 @@ bool Director::init(void) _touchDispatcher = new TouchDispatcher(); _touchDispatcher->init(); -#ifdef CC_KEYBOARD_SUPPORT // KeyboardDispatcher _keyboardDispatcher = new KeyboardDispatcher(); -#endif // KeypadDispatcher _keypadDispatcher = new KeypadDispatcher(); @@ -185,9 +181,7 @@ Director::~Director(void) CC_SAFE_RELEASE(_scheduler); CC_SAFE_RELEASE(_actionManager); CC_SAFE_RELEASE(_touchDispatcher); -#ifdef CC_KEYBOARD_SUPPORT CC_SAFE_RELEASE(_keyboardDispatcher); -#endif CC_SAFE_RELEASE(_keypadDispatcher); CC_SAFE_DELETE(_accelerometer); @@ -1004,7 +998,6 @@ TouchDispatcher* Director::getTouchDispatcher() return _touchDispatcher; } -#ifdef CC_KEYBOARD_SUPPORT void Director::setKeyboardDispatcher(KeyboardDispatcher* pKeyboardDispatcher) { CC_SAFE_RETAIN(pKeyboardDispatcher); @@ -1016,7 +1009,6 @@ KeyboardDispatcher* Director::getKeyboardDispatcher() { return _keyboardDispatcher; } -#endif void Director::setKeypadDispatcher(KeypadDispatcher* pKeypadDispatcher) { diff --git a/cocos2dx/CCDirector.h b/cocos2dx/CCDirector.h index 0a1d642d00..88b05e95f6 100644 --- a/cocos2dx/CCDirector.h +++ b/cocos2dx/CCDirector.h @@ -71,9 +71,7 @@ class Node; class Scheduler; class ActionManager; class TouchDispatcher; -#ifdef CC_KEYBOARD_SUPPORT class KeyboardDispatcher; -#endif class KeypadDispatcher; class Accelerometer; @@ -328,12 +326,12 @@ public: */ CC_PROPERTY(TouchDispatcher*, _touchDispatcher, TouchDispatcher); -#ifdef CC_KEYBOARD_SUPPORT /** KeyboardDispatcher associated with this director + @note Supported on Mac and Linux only now. @since v?.? */ CC_PROPERTY(KeyboardDispatcher*, _keyboardDispatcher, KeyboardDispatcher); -#endif + /** KeypadDispatcher associated with this director @since v2.0 */ diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index 00a544dc7d..d6950a23f7 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -38,9 +38,7 @@ THE SOFTWARE. #include "support/TransformUtils.h" // extern #include "kazmath/GL/matrix.h" -#ifdef CC_KEYBOARD_SUPPORT #include "keyboard_dispatcher/CCKeyboardDispatcher.h" -#endif NS_CC_BEGIN @@ -48,9 +46,7 @@ NS_CC_BEGIN Layer::Layer() : _touchEnabled(false) , _accelerometerEnabled(false) -#ifdef CC_KEYBOARD_SUPPORT , _keyboardEnabled(false) -#endif , _keypadEnabled(false) , _scriptTouchHandlerEntry(NULL) , _scriptKeypadHandlerEntry(NULL) @@ -279,7 +275,6 @@ void Layer::unregisterScriptAccelerateHandler(void) CC_SAFE_RELEASE_NULL(_scriptAccelerateHandlerEntry); } -#ifdef CC_KEYBOARD_SUPPORT /// isKeyboardEnabled getter bool Layer::isKeyboardEnabled() { @@ -305,7 +300,6 @@ void Layer::setKeyboardEnabled(bool enabled) } } } -#endif /// isKeypadEnabled getter bool Layer::isKeypadEnabled() diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h index 54182869f9..9b5a17a375 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h @@ -134,12 +134,12 @@ public: You can enable / disable accelerometer events with this property. it's new in cocos2d-x */ -#ifdef CC_KEYBOARD_SUPPORT + virtual bool isKeyboardEnabled(); virtual void setKeyboardEnabled(bool value); virtual void keyPressed(int keyCode) {}; virtual void keyReleased(int keyCode) {}; -#endif + virtual bool isKeypadEnabled(); virtual void setKeypadEnabled(bool value); @@ -157,9 +157,7 @@ public: protected: bool _touchEnabled; bool _accelerometerEnabled; -#ifdef CC_KEYBOARD_SUPPORT bool _keyboardEnabled; -#endif bool _keypadEnabled; private: diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos2dx/platform/linux/CCEGLView.cpp index a195d56edc..2b9b497581 100644 --- a/cocos2dx/platform/linux/CCEGLView.cpp +++ b/cocos2dx/platform/linux/CCEGLView.cpp @@ -13,9 +13,7 @@ #include "touch_dispatcher/CCTouch.h" #include "touch_dispatcher/CCTouchDispatcher.h" #include "text_input_node/CCIMEDispatcher.h" -#ifdef CC_KEYBOARD_SUPPORT #include "keyboard_dispatcher/CCKeyboardDispatcher.h" -#endif PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT = NULL; PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT = NULL; @@ -157,7 +155,6 @@ int closeEventHandle() { return GL_TRUE; } -#ifdef CC_KEYBOARD_SUPPORT void GLFWCALL keyboardEventHandle(int keyCode, int action) { KeyboardDispatcher *kbDisp = Director::sharedDirector()->getKeyboardDispatcher(); @@ -172,7 +169,6 @@ void GLFWCALL keyboardEventHandle(int keyCode, int action) break; } } -#endif void EGLView::setFrameSize(float width, float height) { diff --git a/cocos2dx/proj.ios/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2dx/proj.ios/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id index 8228a6509a..ac1c60fb66 100644 --- a/cocos2dx/proj.ios/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2dx/proj.ios/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -0bfb5fd7085d3486aae4789b60c34035491f0338 \ No newline at end of file +d668f142f61f02f102e45e6839b7df302d545b79 \ No newline at end of file From cedfd6bbdc8bb8853233c15e91145b8f578a56a5 Mon Sep 17 00:00:00 2001 From: Peter Young Date: Mon, 1 Jul 2013 16:51:31 +0800 Subject: [PATCH 26/43] [plugin-x][Umeng] fix not sending Event when paramMap is nil --- plugin/plugins/umeng/proj.ios/AnalyticsUmeng.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/plugins/umeng/proj.ios/AnalyticsUmeng.m b/plugin/plugins/umeng/proj.ios/AnalyticsUmeng.m index 7805586e6b..9260004579 100644 --- a/plugin/plugins/umeng/proj.ios/AnalyticsUmeng.m +++ b/plugin/plugins/umeng/proj.ios/AnalyticsUmeng.m @@ -74,7 +74,11 @@ THE SOFTWARE. - (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap { OUTPUT_LOG(@"Umeng logEventWithParam invoked"); - [MobClick event:eventId attributes:paramMap]; + if (paramMap != nil) { + [MobClick event:eventId attributes:paramMap]; + } else { + [MobClick event:eventId]; + } } - (void) logTimedEventBegin: (NSString*) eventId From 728f6cd4849de0077fd46beb047943c5fbfb876e Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Jul 2013 16:56:22 +0800 Subject: [PATCH 27/43] Update AUTHORS [ci skip] --- AUTHORS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index b572d20555..d048693925 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,7 +14,8 @@ Developers: Javascript Binding and testjs Squallium - Added ccFPSImages entity as linked resource on linux eclipse project setting + Added ccFPSImages entity as linked resource on linux eclipse project setting. + Added CocosDenshion dependency to libextension project for eclipse project of linux. longlene Improve android project creation script From fd72f87b7f9b35775afed7c2f0d174d68e372257 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Jul 2013 17:13:58 +0800 Subject: [PATCH 28/43] Update AUTHORS [ci skip] --- AUTHORS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index d048693925..1fb0ec6e9e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -366,7 +366,8 @@ Developers: Refactoring emscripten building script. Peter Young (young40) - Implements setVisible() for CCEditBox + Implements setVisible() for CCEditBox. + Fixing a bug that event will not be sent to server when paramMap parameter of logEvent function is nil in plugin-x. csy1988525 Fixing a bug about display result is wrong when invoking CCControlButton:: setHighlighted. From 1ae41d07aa36dc206013fe9faf81b88700edc784 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Jul 2013 17:15:49 +0800 Subject: [PATCH 29/43] closed #2347: Keyboard is supported from cocos2d-x 3.0. --- cocos2dx/CCDirector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/CCDirector.h b/cocos2dx/CCDirector.h index 88b05e95f6..8f44a6a862 100644 --- a/cocos2dx/CCDirector.h +++ b/cocos2dx/CCDirector.h @@ -328,7 +328,7 @@ public: /** KeyboardDispatcher associated with this director @note Supported on Mac and Linux only now. - @since v?.? + @since v3.0 */ CC_PROPERTY(KeyboardDispatcher*, _keyboardDispatcher, KeyboardDispatcher); From c2ce65a32b3b9b768eaadf4b016956d3ccd6b03c Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Jul 2013 17:35:51 +0800 Subject: [PATCH 30/43] issue #2347: Compiled ok for android, marmalade and nacl, windows needs to be tested too. --- cocos2dx/Android.mk | 1 + cocos2dx/proj.marmalade/cocos2dx.mkf | 5 +++++ cocos2dx/proj.nacl/Makefile | 1 + 3 files changed, 7 insertions(+) diff --git a/cocos2dx/Android.mk b/cocos2dx/Android.mk index cc6ed94737..fae21b44c0 100644 --- a/cocos2dx/Android.mk +++ b/cocos2dx/Android.mk @@ -59,6 +59,7 @@ kazmath/src/GL/mat4stack.c \ kazmath/src/GL/matrix.c \ keypad_dispatcher/CCKeypadDelegate.cpp \ keypad_dispatcher/CCKeypadDispatcher.cpp \ +keyboard_dispatcher/CCKeyboardDispatcher.cpp \ label_nodes/CCLabelAtlas.cpp \ label_nodes/CCLabelBMFont.cpp \ label_nodes/CCLabelTTF.cpp \ diff --git a/cocos2dx/proj.marmalade/cocos2dx.mkf b/cocos2dx/proj.marmalade/cocos2dx.mkf index 8f5a075930..c5a696ef41 100644 --- a/cocos2dx/proj.marmalade/cocos2dx.mkf +++ b/cocos2dx/proj.marmalade/cocos2dx.mkf @@ -109,6 +109,11 @@ files "*.h" "*.cpp" + ("../keyboard_dispatcher") + [keyboard_dispatcher] + "*.h" + "*.cpp" + ("../label_nodes") [label_nodes] "*.h" diff --git a/cocos2dx/proj.nacl/Makefile b/cocos2dx/proj.nacl/Makefile index 1b625891b1..5150410a89 100644 --- a/cocos2dx/proj.nacl/Makefile +++ b/cocos2dx/proj.nacl/Makefile @@ -37,6 +37,7 @@ SOURCES = ../actions/CCAction.cpp \ ../effects/CCGrid.cpp \ ../keypad_dispatcher/CCKeypadDelegate.cpp \ ../keypad_dispatcher/CCKeypadDispatcher.cpp \ +../keyboard_dispatcher/CCKeyboardDispatcher.cpp \ ../label_nodes/CCLabelAtlas.cpp \ ../label_nodes/CCLabelBMFont.cpp \ ../label_nodes/CCLabelTTF.cpp \ From 4e5ee103ec2f3550ac0f84902306f3e93c7a51f7 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Jul 2013 18:22:09 +0800 Subject: [PATCH 31/43] Fixing errors on windows. --- .../CCKeyboardDispatcher.cpp | 4 +- .../CCLayer.cpp | 4 +- cocos2dx/proj.win32/cocos2d.vcxproj | 2 + cocos2dx/proj.win32/cocos2d.vcxproj.filters | 1931 +++++++++-------- 4 files changed, 976 insertions(+), 965 deletions(-) diff --git a/cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.cpp b/cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.cpp index be57e9477b..fbb089d176 100644 --- a/cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.cpp +++ b/cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.cpp @@ -33,8 +33,8 @@ NS_CC_BEGIN // //------------------------------------------------------------------ KeyboardDispatcher::KeyboardDispatcher() -: _keyPressDelegate(NULL) -, _keyReleaseDelegate(NULL) +: _keyPressDelegate(nullptr) +, _keyReleaseDelegate(nullptr) { } diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index d6950a23f7..37b874dd4e 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -295,8 +295,8 @@ void Layer::setKeyboardEnabled(bool enabled) } else { - pDirector->getKeyboardDispatcher()->setKeyPressDelegate(NULL); - pDirector->getKeyboardDispatcher()->setKeyReleaseDelegate(NULL); + pDirector->getKeyboardDispatcher()->setKeyPressDelegate(nullptr); + pDirector->getKeyboardDispatcher()->setKeyReleaseDelegate(nullptr); } } } diff --git a/cocos2dx/proj.win32/cocos2d.vcxproj b/cocos2dx/proj.win32/cocos2d.vcxproj index 014fcb908c..d8b0573358 100644 --- a/cocos2dx/proj.win32/cocos2d.vcxproj +++ b/cocos2dx/proj.win32/cocos2d.vcxproj @@ -172,6 +172,7 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir + @@ -312,6 +313,7 @@ xcopy /Y /Q "$(ProjectDir)..\platform\third_party\win32\libraries\*.*" "$(OutDir + diff --git a/cocos2dx/proj.win32/cocos2d.vcxproj.filters b/cocos2dx/proj.win32/cocos2d.vcxproj.filters index 380ced350c..b0d6e07b4f 100644 --- a/cocos2dx/proj.win32/cocos2d.vcxproj.filters +++ b/cocos2dx/proj.win32/cocos2d.vcxproj.filters @@ -1,962 +1,971 @@ - - - - - {cc64f5ad-2234-494c-9c51-b7a20c8887aa} - - - {aec8225f-81a7-4213-b97b-7004d5535398} - - - {736cf4ab-e0d6-40ba-912a-b062d28d318a} - - - {1c7c61b8-3d36-4ba0-a87c-457eb4c782d0} - - - {0b3a64bd-79fa-476a-a461-6b97e5072453} - - - {e455af5e-da09-4f41-b79f-df4dd311820d} - - - {206bd96b-f80e-4722-8675-d7c6ff9b3639} - - - {075492ba-08bc-404c-92da-32029797a600} - - - {41abe422-1602-4fe0-ac1c-6b04a14c1abb} - - - {8bf0f517-2ac3-4fc3-a1ad-999d9ea103cd} - - - {926fc31c-8742-4984-9940-c972dd02fc8a} - - - {9428f8e6-4ce3-4596-b8af-14d70b7c5b5d} - - - {755e5282-111e-46a5-9169-7c12b37f5ffc} - - - {d94bbf20-8de9-49a7-ae20-6a1140cf633b} - - - {4a64789e-cc8d-4f84-a869-e6dae2e0d58c} - - - {bb98a889-9a48-4e31-af2f-117f14da388a} - - - {fdea327e-b905-47db-8c33-b70d7866166b} - - - {46c8d130-b8b5-47f5-a063-ca700e1c32cc} - - - {f2671200-b2d8-4d2e-9728-06719cf6f835} - - - {eaa16c9b-dfbc-4a37-8e3e-e961d9ca1d1a} - - - {3c91932f-7667-4049-b9bd-caac4c8eab15} - - - {535c04b0-fe2b-44c9-9a8c-9029e2b6de5c} - - - {5b082c5c-d396-43ca-b3b1-997d0f6247d0} - - - {7751500e-ac9e-4604-a96d-670b30b7d8bd} - - - {b38113b1-3d59-4f6e-ac5a-f43921f6ed09} - - - {569c49c9-27eb-456e-a3f4-9f403e28a3a1} - - - {191b3e94-47dc-4054-b1cb-bf145d281521} - - - {a91a4cc0-41e6-43e9-80c0-2c9101924386} - - - {e278b354-1e41-4e92-95b3-7f661ba67140} - - - {163895ae-8a8e-46bf-bdf2-98bb2c1347fc} - - - {1179d205-d065-49f0-8457-bc4c3f1d0cb3} - - - {cc25bb83-527d-4218-8d68-ebf963ce7698} - - - {c45b97e8-fa1f-4e58-8ec5-d46371c2dd26} - - - {caa78ce0-9b58-4314-b117-1acae278691e} - - - - - base_nodes - - - base_nodes - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - effects - - - effects - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - label_nodes - - - label_nodes - - - label_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - menu_nodes - - - menu_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - platform - - - platform - - - platform - - - platform - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - support - - - support - - - support - - - support - - - support - - - support - - - support - - - support\data_support - - - support\image_support - - - support\zip_support - - - support\zip_support - - - support\zip_support - - - textures - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - touch_dispatcher - - - touch_dispatcher - - - touch_dispatcher - - - keypad_dispatcher - - - keypad_dispatcher - - - text_input_node - - - text_input_node - - - script_support - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src - - - kazmath\src\GL - - - kazmath\src\GL - - - - - - - - draw_nodes - - - draw_nodes - - - misc_nodes - - - shaders - - - shaders - - - shaders - - - shaders - - - platform\win32 - - - platform - - - platform - - - platform\win32 - - - support - - - support\user_default - - - support\tinyxml2 - - - cocoa - - - - textures - - - support\component - - - support\component - - - - - base_nodes - - - base_nodes - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - effects - - - effects - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - include - - - include - - - include - - - include - - - include - - - include - - - label_nodes - - - label_nodes - - - label_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - menu_nodes - - - menu_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - support - - - support - - - support - - - support - - - support - - - support - - - support - - - support\data_support - - - support\data_support - - - support\data_support - - - support\image_support - - - support\zip_support - - - support\zip_support - - - support\zip_support - - - textures - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - touch_dispatcher - - - touch_dispatcher - - - touch_dispatcher - - - touch_dispatcher - - - keypad_dispatcher - - - keypad_dispatcher - - - text_input_node - - - text_input_node - - - text_input_node - - - script_support - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath - - - kazmath\include\kazmath\GL - - - kazmath\include\kazmath\GL - - - - - - - draw_nodes - - - draw_nodes - - - misc_nodes - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - shaders - - - platform\win32 - - - support - - - support\user_default - - - support\tinyxml2 - - - cocoa - - - cocoa - - - cocoa - - - cocoa - - - textures - - - - support\component - - - support\component - - + + + + + {cc64f5ad-2234-494c-9c51-b7a20c8887aa} + + + {aec8225f-81a7-4213-b97b-7004d5535398} + + + {736cf4ab-e0d6-40ba-912a-b062d28d318a} + + + {1c7c61b8-3d36-4ba0-a87c-457eb4c782d0} + + + {0b3a64bd-79fa-476a-a461-6b97e5072453} + + + {e455af5e-da09-4f41-b79f-df4dd311820d} + + + {206bd96b-f80e-4722-8675-d7c6ff9b3639} + + + {075492ba-08bc-404c-92da-32029797a600} + + + {41abe422-1602-4fe0-ac1c-6b04a14c1abb} + + + {8bf0f517-2ac3-4fc3-a1ad-999d9ea103cd} + + + {926fc31c-8742-4984-9940-c972dd02fc8a} + + + {9428f8e6-4ce3-4596-b8af-14d70b7c5b5d} + + + {755e5282-111e-46a5-9169-7c12b37f5ffc} + + + {d94bbf20-8de9-49a7-ae20-6a1140cf633b} + + + {4a64789e-cc8d-4f84-a869-e6dae2e0d58c} + + + {bb98a889-9a48-4e31-af2f-117f14da388a} + + + {fdea327e-b905-47db-8c33-b70d7866166b} + + + {46c8d130-b8b5-47f5-a063-ca700e1c32cc} + + + {f2671200-b2d8-4d2e-9728-06719cf6f835} + + + {eaa16c9b-dfbc-4a37-8e3e-e961d9ca1d1a} + + + {3c91932f-7667-4049-b9bd-caac4c8eab15} + + + {535c04b0-fe2b-44c9-9a8c-9029e2b6de5c} + + + {5b082c5c-d396-43ca-b3b1-997d0f6247d0} + + + {7751500e-ac9e-4604-a96d-670b30b7d8bd} + + + {b38113b1-3d59-4f6e-ac5a-f43921f6ed09} + + + {569c49c9-27eb-456e-a3f4-9f403e28a3a1} + + + {191b3e94-47dc-4054-b1cb-bf145d281521} + + + {a91a4cc0-41e6-43e9-80c0-2c9101924386} + + + {e278b354-1e41-4e92-95b3-7f661ba67140} + + + {163895ae-8a8e-46bf-bdf2-98bb2c1347fc} + + + {1179d205-d065-49f0-8457-bc4c3f1d0cb3} + + + {cc25bb83-527d-4218-8d68-ebf963ce7698} + + + {c45b97e8-fa1f-4e58-8ec5-d46371c2dd26} + + + {caa78ce0-9b58-4314-b117-1acae278691e} + + + {e7134ba0-4220-4dd1-b120-3533883394ac} + + + + + base_nodes + + + base_nodes + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + effects + + + effects + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + label_nodes + + + label_nodes + + + label_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + menu_nodes + + + menu_nodes + + + misc_nodes + + + misc_nodes + + + misc_nodes + + + particle_nodes + + + particle_nodes + + + particle_nodes + + + particle_nodes + + + platform + + + platform + + + platform + + + platform + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + support + + + support + + + support + + + support + + + support + + + support + + + support + + + support\data_support + + + support\image_support + + + support\zip_support + + + support\zip_support + + + support\zip_support + + + textures + + + textures + + + textures + + + textures + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + touch_dispatcher + + + touch_dispatcher + + + touch_dispatcher + + + keypad_dispatcher + + + keypad_dispatcher + + + text_input_node + + + text_input_node + + + script_support + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src + + + kazmath\src\GL + + + kazmath\src\GL + + + + + + + + draw_nodes + + + draw_nodes + + + misc_nodes + + + shaders + + + shaders + + + shaders + + + shaders + + + platform\win32 + + + platform + + + platform + + + platform\win32 + + + support + + + support\user_default + + + support\tinyxml2 + + + cocoa + + + + textures + + + support\component + + + support\component + + + keyboard_dispatcher + + + + + base_nodes + + + base_nodes + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + effects + + + effects + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + actions + + + include + + + include + + + include + + + include + + + include + + + include + + + label_nodes + + + label_nodes + + + label_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + layers_scenes_transitions_nodes + + + menu_nodes + + + menu_nodes + + + misc_nodes + + + misc_nodes + + + misc_nodes + + + particle_nodes + + + particle_nodes + + + particle_nodes + + + particle_nodes + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + sprite_nodes + + + support + + + support + + + support + + + support + + + support + + + support + + + support + + + support\data_support + + + support\data_support + + + support\data_support + + + support\image_support + + + support\zip_support + + + support\zip_support + + + support\zip_support + + + textures + + + textures + + + textures + + + textures + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + tilemap_parallax_nodes + + + touch_dispatcher + + + touch_dispatcher + + + touch_dispatcher + + + touch_dispatcher + + + keypad_dispatcher + + + keypad_dispatcher + + + text_input_node + + + text_input_node + + + text_input_node + + + script_support + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath + + + kazmath\include\kazmath\GL + + + kazmath\include\kazmath\GL + + + + + + + draw_nodes + + + draw_nodes + + + misc_nodes + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + shaders + + + platform\win32 + + + support + + + support\user_default + + + support\tinyxml2 + + + cocoa + + + cocoa + + + cocoa + + + cocoa + + + textures + + + + support\component + + + support\component + + + keyboard_dispatcher + + \ No newline at end of file From 34871d47af02ee54cd42e83ee38c2140ada363ad Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 1 Jul 2013 22:34:57 +0800 Subject: [PATCH 32/43] close #2347: Updating tools/tojs/cocos2dx.ini. --- tools/tojs/cocos2dx.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index 8654839dc8..14ec24745a 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -44,7 +44,7 @@ skip = Node::[convertToWindowSpace ^setPosition$ getGrid setGLServerState descri LayerColor::[getBlendFunc setBlendFunc], ParticleSystem::[getBlendFunc setBlendFunc], DrawNode::[getBlendFunc setBlendFunc drawPolygon], - Director::[getAccelerometer getKeypadDispatcher getTouchDispatcher setWatcherCallbackFun getOpenGLView getProjection getClassTypeInfo], + Director::[getAccelerometer (g|s)et.*Dispatcher getOpenGLView getProjection getClassTypeInfo], Layer.*::[didAccelerate (g|s)etBlendFunc], Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns], MenuItem.*::[create setCallback initWithCallback], From b434f7332ab9bb6952056b00e09c6ace5a9944f3 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 11:52:04 -0700 Subject: [PATCH 33/43] Removes #if from header class preventing ugly bugs --- extensions/physics_nodes/CCPhysicsSprite.cpp | 170 ++++++++++++------- extensions/physics_nodes/CCPhysicsSprite.h | 27 ++- 2 files changed, 124 insertions(+), 73 deletions(-) diff --git a/extensions/physics_nodes/CCPhysicsSprite.cpp b/extensions/physics_nodes/CCPhysicsSprite.cpp index c9a8193273..feba6a3f57 100644 --- a/extensions/physics_nodes/CCPhysicsSprite.cpp +++ b/extensions/physics_nodes/CCPhysicsSprite.cpp @@ -23,6 +23,10 @@ #include "CCPhysicsSprite.h" #include "support/CCPointExtension.h" +#if defined(CC_ENABLE_CHIPMUNK_INTEGRATION) && defined(CC_ENABLE_BOX2D_INTEGRATION) +#error "Either Chipmunk or Box2d should be enabled, but not both at the same time" +#endif + #if CC_ENABLE_CHIPMUNK_INTEGRATION #include "chipmunk.h" #elif CC_ENABLE_BOX2D_INTEGRATION @@ -33,12 +37,9 @@ NS_CC_EXT_BEGIN PhysicsSprite::PhysicsSprite() : _ignoreBodyRotation(false) -#if CC_ENABLE_CHIPMUNK_INTEGRATION , _CPBody(NULL) -#elif CC_ENABLE_BOX2D_INTEGRATION , _pB2Body(NULL) , _PTMRatio(0.0f) -#endif {} PhysicsSprite* PhysicsSprite::create() @@ -189,6 +190,10 @@ float PhysicsSprite::getPositionY() return _position.y; } +// +// Chipmunk only +// + #if CC_ENABLE_CHIPMUNK_INTEGRATION cpBody* PhysicsSprite::getCPBody() const @@ -201,56 +206,31 @@ void PhysicsSprite::setCPBody(cpBody *pBody) _CPBody = pBody; } -void PhysicsSprite::updatePosFromPhysics() +b2Body* PhysicsSprite::getB2Body() const { - cpVect cpPos = cpBodyGetPos(_CPBody); - _position = ccp(cpPos.x, cpPos.y); + CCAssert(false, "Can't call box2d methods when Chipmunk is enabled"); + return NULL; } -void PhysicsSprite::setPosition(const Point &pos) +void PhysicsSprite::setB2Body(b2Body *pBody) { - cpVect cpPos = cpv(pos.x, pos.y); - cpBodySetPos(_CPBody, cpPos); + CCAssert(false, "Can't call box2d methods when Chipmunk is enabled"); } -float PhysicsSprite::getRotation() +float PhysicsSprite::getPTMRatio() const { - return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + CCAssert(false, "Can't call box2d methods when Chipmunk is enabled"); + return 0; } -void PhysicsSprite::setRotation(float fRotation) +void PhysicsSprite::setPTMRatio(float fRatio) { - if (_ignoreBodyRotation) - { - Sprite::setRotation(fRotation); - } - else - { - cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); - } -} - -// returns the transform matrix according the Chipmunk Body values -AffineTransform PhysicsSprite::nodeToParentTransform() -{ - // Although scale is not used by physics engines, it is calculated just in case - // the sprite is animated (scaled up/down) using actions. - // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : _CPBody->rot); - float x = _CPBody->p.x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; - float y = _CPBody->p.y + rot.y * -_anchorPointInPoints.x * _scaleX + rot.x * -_anchorPointInPoints.y * _scaleY; - - if (_ignoreAnchorPointForPosition) - { - x += _anchorPointInPoints.x; - y += _anchorPointInPoints.y; - } - - return (_transform = AffineTransformMake(rot.x * _scaleX, rot.y * _scaleX, - -rot.y * _scaleY, rot.x * _scaleY, - x, y)); + CCAssert(false, "Can't call box2d methods when Chipmunk is enabled"); } +// +// Box2d only +// #elif CC_ENABLE_BOX2D_INTEGRATION b2Body* PhysicsSprite::getB2Body() const @@ -273,25 +253,68 @@ void PhysicsSprite::setPTMRatio(float fRatio) _PTMRatio = fRatio; } -// Override the setters and getters to always reflect the body's properties. +cpBody* PhysicsSprite::getCPBody() const +{ + CCAssert(false, "Can't call Chipmunk methods when Box2d is enabled"); + return NULL; +} + +void PhysicsSprite::setCPBody(cpBody *pBody) +{ + CCAssert(false, "Can't call Chipmunk methods when Box2d is enabled"); +} + +#endif + +// +// Common to Box2d and Chipmunk +// + void PhysicsSprite::updatePosFromPhysics() { + +#if CC_ENABLE_CHIPMUNK_INTEGRATION + + cpVect cpPos = cpBodyGetPos(_CPBody); + _position = ccp(cpPos.x, cpPos.y); + +#elif CC_ENABLE_BOX2D_INTEGRATION + b2Vec2 pos = _pB2Body->GetPosition(); float x = pos.x * _PTMRatio; float y = pos.y * _PTMRatio; _position = ccp(x,y); +#endif + } void PhysicsSprite::setPosition(const Point &pos) { +#if CC_ENABLE_CHIPMUNK_INTEGRATION + + cpVect cpPos = cpv(pos.x, pos.y); + cpBodySetPos(_CPBody, cpPos); + +#elif CC_ENABLE_BOX2D_INTEGRATION + float angle = _pB2Body->GetAngle(); _pB2Body->SetTransform(b2Vec2(pos.x / _PTMRatio, pos.y / _PTMRatio), angle); +#endif + } float PhysicsSprite::getRotation() { +#if CC_ENABLE_CHIPMUNK_INTEGRATION + + return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); + +#elif CC_ENABLE_BOX2D_INTEGRATION + return (_ignoreBodyRotation ? Sprite::getRotation() : CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); +#endif + } void PhysicsSprite::setRotation(float fRotation) @@ -300,50 +323,79 @@ void PhysicsSprite::setRotation(float fRotation) { Sprite::setRotation(fRotation); } + +#if CC_ENABLE_CHIPMUNK_INTEGRATION + else + { + cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); + } + +#elif CC_ENABLE_BOX2D_INTEGRATION else { b2Vec2 p = _pB2Body->GetPosition(); float radians = CC_DEGREES_TO_RADIANS(fRotation); _pB2Body->SetTransform(p, radians); } +#endif + } -// returns the transform matrix according the Box2D Body values +// returns the transform matrix according the Chipmunk Body values AffineTransform PhysicsSprite::nodeToParentTransform() { - b2Vec2 pos = _pB2Body->GetPosition(); - - float x = pos.x * _PTMRatio; - float y = pos.y * _PTMRatio; - + // Although scale is not used by physics engines, it is calculated just in case + // the sprite is animated (scaled up/down) using actions. + // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 + +#if CC_ENABLE_CHIPMUNK_INTEGRATION + + cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : _CPBody->rot); + float x = _CPBody->p.x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; + float y = _CPBody->p.y + rot.y * -_anchorPointInPoints.x * _scaleX + rot.x * -_anchorPointInPoints.y * _scaleY; + if (_ignoreAnchorPointForPosition) { x += _anchorPointInPoints.x; y += _anchorPointInPoints.y; } - + + return (_transform = AffineTransformMake(rot.x * _scaleX, rot.y * _scaleX, + -rot.y * _scaleY, rot.x * _scaleY, + x, y)); + + +#elif CC_ENABLE_BOX2D_INTEGRATION + + b2Vec2 pos = _pB2Body->GetPosition(); + + float x = pos.x * _PTMRatio; + float y = pos.y * _PTMRatio; + + if (_ignoreAnchorPointForPosition) + { + x += _anchorPointInPoints.x; + y += _anchorPointInPoints.y; + } + // Make matrix float radians = _pB2Body->GetAngle(); float c = cosf(radians); float s = sinf(radians); - - // Although scale is not used by physics engines, it is calculated just in case - // the sprite is animated (scaled up/down) using actions. - // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 + if (!_anchorPointInPoints.equals(PointZero)) { x += ((c * -_anchorPointInPoints.x * _scaleX) + (-s * -_anchorPointInPoints.y * _scaleY)); y += ((s * -_anchorPointInPoints.x * _scaleX) + (c * -_anchorPointInPoints.y * _scaleY)); } - + // Rot, Translate Matrix _transform = AffineTransformMake( c * _scaleX, s * _scaleX, - -s * _scaleY, c * _scaleY, - x, y ); - + -s * _scaleY, c * _scaleY, + x, y ); + return _transform; +#endif } -#endif - NS_CC_EXT_END diff --git a/extensions/physics_nodes/CCPhysicsSprite.h b/extensions/physics_nodes/CCPhysicsSprite.h index da11ce90ef..1d11738a20 100644 --- a/extensions/physics_nodes/CCPhysicsSprite.h +++ b/extensions/physics_nodes/CCPhysicsSprite.h @@ -25,13 +25,8 @@ #include "cocos2d.h" #include "ExtensionMacros.h" -#if CC_ENABLE_CHIPMUNK_INTEGRATION -#include "chipmunk.h" -#elif CC_ENABLE_BOX2D_INTEGRATION +struct cpBody; class b2Body; -#else // CC_ENABLE_BOX2D_INTEGRATION -#error "You must define either CC_ENABLE_CHIPMUNK_INTEGRATION or CC_ENABLE_BOX2D_INTEGRATION to use PhysicsSprite.h" -#endif NS_CC_EXT_BEGIN /** A Sprite subclass that is bound to a physics body. @@ -50,15 +45,15 @@ class PhysicsSprite : public Sprite { protected: bool _ignoreBodyRotation; -#if CC_ENABLE_CHIPMUNK_INTEGRATION + + + // chipmunk specific cpBody *_CPBody; -#elif CC_ENABLE_BOX2D_INTEGRATION + // box2d specific b2Body *_pB2Body; - - // Pixels to Meters ratio float _PTMRatio; -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION + public: PhysicsSprite(); @@ -110,18 +105,22 @@ public: virtual void setRotation(float fRotation); virtual AffineTransform nodeToParentTransform(); -#if CC_ENABLE_CHIPMUNK_INTEGRATION + // + // Chipmunk specific + // /** Body accessor when using regular Chipmunk */ cpBody* getCPBody() const; void setCPBody(cpBody *pBody); -#elif CC_ENABLE_BOX2D_INTEGRATION + + // + // Box2d specific + // /** Body accessor when using box2d */ b2Body* getB2Body() const; void setB2Body(b2Body *pBody); float getPTMRatio() const; void setPTMRatio(float fPTMRatio); -#endif // CC_ENABLE_BOX2D_INTEGRATION protected: void updatePosFromPhysics(); From 87fc7d4d622daae0b97f97eeef2466007237f5c3 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 14:41:39 -0700 Subject: [PATCH 34/43] cocos2d mac project redesigned --- cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id | 1 + cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id | 1 - samples/Cpp/TestCpp/proj.mac/AppController.mm | 2 +- samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id delete mode 100644 cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id create mode 100644 samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id diff --git a/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..5e63c07f00 --- /dev/null +++ b/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +a60876d05cf1f77a6d9b67a88e8828c01bff15fc \ No newline at end of file diff --git a/cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id deleted file mode 100644 index 43fa30187c..0000000000 --- a/cocos2dx-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d8c7e473cad03a458a109e54a6def0a97b92da8c \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.mac/AppController.mm b/samples/Cpp/TestCpp/proj.mac/AppController.mm index 0d30617caa..29962c843e 100644 --- a/samples/Cpp/TestCpp/proj.mac/AppController.mm +++ b/samples/Cpp/TestCpp/proj.mac/AppController.mm @@ -36,7 +36,7 @@ // create the window // note that using NSResizableWindowMask causes the window to be a little // smaller and therefore ipad graphics are not loaded - NSRect rect = NSMakeRect(200, 200, 480, 320); + NSRect rect = NSMakeRect(200, 200, 960, 640); window = [[NSWindow alloc] initWithContentRect:rect styleMask:( NSClosableWindowMask | NSTitledWindowMask ) backing:NSBackingStoreBuffered diff --git a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..ce30620a43 --- /dev/null +++ b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +994a103390dc71b1e4e9e55207da846577540410 \ No newline at end of file From f83383b86cae9b98b2f82056ea2bcb160a30622d Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 14:43:47 -0700 Subject: [PATCH 35/43] removes unused projects --- .../contents.xcworkspacedata | 48 - .../project.pbxproj.REMOVED.git-id | 1 - .../TestJavascript.xcodeproj/project.pbxproj | 825 ------------------ .../xcshareddata/TestJavascript.xccheckout | 63 -- 4 files changed, 937 deletions(-) delete mode 100644 cocos2d-mac.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id delete mode 100644 samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj delete mode 100644 samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout diff --git a/cocos2d-mac.xcworkspace/contents.xcworkspacedata b/cocos2d-mac.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 3468d0041e..0000000000 --- a/cocos2d-mac.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id deleted file mode 100644 index 8f9958a187..0000000000 --- a/samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -226867e25e3d039a278ae385c4b8822461b82427 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj deleted file mode 100644 index f493c8157b..0000000000 --- a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.pbxproj +++ /dev/null @@ -1,825 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 15A3D5631682F20C002FB0C5 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4621682F14C002FB0C5 /* main.js */; }; - 15A3D5651682F20C002FB0C5 /* tests_resources-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */; }; - 15A3D5681682F20C002FB0C5 /* tests-main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4741682F14C002FB0C5 /* tests-main.js */; }; - 1A4C3F1317784B6000EDFB3B /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */; }; - 1A4C3F1417784B6000EDFB3B /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */; }; - 1A4C3F1517784B6000EDFB3B /* libCocosDenshion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */; }; - 1A4C3F1617784B6000EDFB3B /* libextensions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1117784B6000EDFB3B /* libextensions.a */; }; - 1A4C3F1717784B6000EDFB3B /* libjsbindings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1217784B6000EDFB3B /* libjsbindings.a */; }; - 1A6B05C517782A2400FFE52B /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6B05C417782A2400FFE52B /* libsqlite3.dylib */; }; - 1A6B05C717782B0500FFE52B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A6B05C617782B0500FFE52B /* libz.dylib */; }; - 1A6E468A177812D20055514D /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4672177812AF0055514D /* jsb.js */; }; - 1A6E468B177812D20055514D /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4673177812AF0055514D /* jsb_chipmunk.js */; }; - 1A6E468C177812D20055514D /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4674177812AF0055514D /* jsb_chipmunk_constants.js */; }; - 1A6E468D177812D20055514D /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4675177812AF0055514D /* jsb_cocos2d.js */; }; - 1A6E468E177812D20055514D /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4676177812AF0055514D /* jsb_cocos2d_constants.js */; }; - 1A6E468F177812D20055514D /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4677177812AF0055514D /* jsb_cocos2d_extension.js */; }; - 1A6E4690177812D20055514D /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4678177812AF0055514D /* jsb_cocosbuilder.js */; }; - 1A6E4691177812D20055514D /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E4679177812AF0055514D /* jsb_debugger.js */; }; - 1A6E4692177812D20055514D /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467A177812AF0055514D /* jsb_opengl.js */; }; - 1A6E4693177812D20055514D /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467B177812AF0055514D /* jsb_opengl_constants.js */; }; - 1A6E4694177812D20055514D /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467C177812AF0055514D /* jsb_sys.js */; }; - 1A6E4695177812D20055514D /* main.debug.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6E467D177812AF0055514D /* main.debug.js */; }; - 1A80332A1728DECD00240CC3 /* EffectsAdvancedTest in Resources */ = {isa = PBXBuildFile; fileRef = 1A8033291728DECD00240CC3 /* EffectsAdvancedTest */; }; - 1A80332C1728F1FB00240CC3 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1A80332B1728F1FB00240CC3 /* res */; }; - 1AA51A9F16F708FA000FDF05 /* ActionManagerTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7816F708FA000FDF05 /* ActionManagerTest */; }; - 1AA51AA016F708FA000FDF05 /* ActionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7916F708FA000FDF05 /* ActionsTest */; }; - 1AA51AA116F708FA000FDF05 /* BaseTestLayer in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7A16F708FA000FDF05 /* BaseTestLayer */; }; - 1AA51AA216F708FA000FDF05 /* Box2dTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7B16F708FA000FDF05 /* Box2dTest */; }; - 1AA51AA316F708FA000FDF05 /* ChipmunkTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7C16F708FA000FDF05 /* ChipmunkTest */; }; - 1AA51AA416F708FA000FDF05 /* ClickAndMoveTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */; }; - 1AA51AA516F708FA000FDF05 /* CocosDenshionTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */; }; - 1AA51AA616F708FA000FDF05 /* CocosNodeTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A7F16F708FA000FDF05 /* CocosNodeTest */; }; - 1AA51AA716F708FA000FDF05 /* CurrentLanguageTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */; }; - 1AA51AA816F708FA000FDF05 /* DrawPrimitivesTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8116F708FA000FDF05 /* DrawPrimitivesTest */; }; - 1AA51AA916F708FA000FDF05 /* EaseActionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8216F708FA000FDF05 /* EaseActionsTest */; }; - 1AA51AAA16F708FA000FDF05 /* EffectsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8316F708FA000FDF05 /* EffectsTest */; }; - 1AA51AAB16F708FA000FDF05 /* EventTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8416F708FA000FDF05 /* EventTest */; }; - 1AA51AAC16F708FA000FDF05 /* ExtensionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8516F708FA000FDF05 /* ExtensionsTest */; }; - 1AA51AAD16F708FA000FDF05 /* FileUtils in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8616F708FA000FDF05 /* FileUtils */; }; - 1AA51AAE16F708FA000FDF05 /* FontTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8716F708FA000FDF05 /* FontTest */; }; - 1AA51AAF16F708FA000FDF05 /* IntervalTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8816F708FA000FDF05 /* IntervalTest */; }; - 1AA51AB016F708FA000FDF05 /* LabelTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8916F708FA000FDF05 /* LabelTest */; }; - 1AA51AB116F708FA000FDF05 /* LayerTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8A16F708FA000FDF05 /* LayerTest */; }; - 1AA51AB216F708FA000FDF05 /* MenuTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8B16F708FA000FDF05 /* MenuTest */; }; - 1AA51AB316F708FA000FDF05 /* OpenGLTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8C16F708FA000FDF05 /* OpenGLTest */; }; - 1AA51AB416F708FA000FDF05 /* ParallaxTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8D16F708FA000FDF05 /* ParallaxTest */; }; - 1AA51AB516F708FA000FDF05 /* ParticleTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8E16F708FA000FDF05 /* ParticleTest */; }; - 1AA51AB616F708FA000FDF05 /* PerformanceTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A8F16F708FA000FDF05 /* PerformanceTest */; }; - 1AA51AB716F708FA000FDF05 /* Presentation in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9016F708FA000FDF05 /* Presentation */; }; - 1AA51AB816F708FA000FDF05 /* ProgressActionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9116F708FA000FDF05 /* ProgressActionsTest */; }; - 1AA51AB916F708FA000FDF05 /* RenderTextureTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9216F708FA000FDF05 /* RenderTextureTest */; }; - 1AA51ABB16F708FA000FDF05 /* RotateWorldTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9416F708FA000FDF05 /* RotateWorldTest */; }; - 1AA51ABC16F708FA000FDF05 /* SceneTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9516F708FA000FDF05 /* SceneTest */; }; - 1AA51ABD16F708FA000FDF05 /* SchedulerTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9616F708FA000FDF05 /* SchedulerTest */; }; - 1AA51ABE16F708FA000FDF05 /* SpriteTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9716F708FA000FDF05 /* SpriteTest */; }; - 1AA51ABF16F708FA000FDF05 /* SysTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9816F708FA000FDF05 /* SysTest */; }; - 1AA51AC016F708FA000FDF05 /* TextInputTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9916F708FA000FDF05 /* TextInputTest */; }; - 1AA51AC116F708FA000FDF05 /* TextureCacheTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9A16F708FA000FDF05 /* TextureCacheTest */; }; - 1AA51AC216F708FA000FDF05 /* TileMapTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9B16F708FA000FDF05 /* TileMapTest */; }; - 1AA51AC316F708FA000FDF05 /* TouchesTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9C16F708FA000FDF05 /* TouchesTest */; }; - 1AA51AC416F708FA000FDF05 /* TransitionsTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9D16F708FA000FDF05 /* TransitionsTest */; }; - 1AA51AC516F708FA000FDF05 /* UnitTest in Resources */ = {isa = PBXBuildFile; fileRef = 1AA51A9E16F708FA000FDF05 /* UnitTest */; }; - A05FCAC8177C123600BE600E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAC7177C123600BE600E /* OpenGL.framework */; }; - A05FCAC9177C123F00BE600E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAC7177C123600BE600E /* OpenGL.framework */; }; - A05FCACC177C125300BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCACB177C125300BE600E /* Cocoa.framework */; }; - A05FCACD177C125800BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCACB177C125300BE600E /* Cocoa.framework */; }; - A05FCAD6177C129100BE600E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A05FCACF177C129100BE600E /* InfoPlist.strings */; }; - A05FCAD7177C129100BE600E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A05FCACF177C129100BE600E /* InfoPlist.strings */; }; - A05FCAD8177C129100BE600E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD1177C129100BE600E /* MainMenu.xib */; }; - A05FCAD9177C129100BE600E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD1177C129100BE600E /* MainMenu.xib */; }; - A05FCADA177C129100BE600E /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD3177C129100BE600E /* Icon.icns */; }; - A05FCADB177C129100BE600E /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = A05FCAD3177C129100BE600E /* Icon.icns */; }; - A05FCAE1177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; - A05FCAE2177C12B500BE600E /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAE0177C12B500BE600E /* AppController.mm */; }; - A05FCAEC177C1FBB00BE600E /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAEB177C1FBB00BE600E /* libcurl.dylib */; }; - A05FCAEE177C208D00BE600E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAED177C208D00BE600E /* main.m */; }; - A05FCAEF177C208D00BE600E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A05FCAED177C208D00BE600E /* main.m */; }; - A05FCAF1177C273700BE600E /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05FCAF0177C273700BE600E /* ApplicationServices.framework */; }; - A218F7DC1743D97E00F65883 /* XHRTest in Resources */ = {isa = PBXBuildFile; fileRef = A218F7DB1743D97E00F65883 /* XHRTest */; }; - A22656EF1743DCBB00598A2C /* ClippingNodeTest in Resources */ = {isa = PBXBuildFile; fileRef = A22656EE1743DCBB00598A2C /* ClippingNodeTest */; }; - A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; - A92275461517C094001B78AA /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; - A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; - A922754E1517C094001B78AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; - A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; - D401B61116FB637400F2529D /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; - D401B67D16FB637400F2529D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; - D401B67F16FB637400F2529D /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; - D401B68016FB637400F2529D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; - D401B68116FB637400F2529D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; - D401B68316FB637400F2529D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; - D401B68416FB637400F2529D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; - D401B6D716FBF49A00F2529D /* game.js in Resources */ = {isa = PBXBuildFile; fileRef = D401B6D516FBF48000F2529D /* game.js */; }; - D401B6E016FC072B00F2529D /* tests-boot-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = D401B6DE16FC071100F2529D /* tests-boot-jsb.js */; }; - D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 15A3D4621682F14C002FB0C5 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../../Shared/tests/main.js; sourceTree = ""; }; - 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests_resources-jsb.js"; path = "../../Shared/tests/tests_resources-jsb.js"; sourceTree = ""; }; - 15A3D4741682F14C002FB0C5 /* tests-main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests-main.js"; path = "../../Shared/tests/tests-main.js"; sourceTree = ""; }; - 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libchipmunk.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libcocos2dx.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libCocosDenshion.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A4C3F1117784B6000EDFB3B /* libextensions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libextensions.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A4C3F1217784B6000EDFB3B /* libjsbindings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libjsbindings.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A6B05C417782A2400FFE52B /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; - 1A6B05C617782B0500FFE52B /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; - 1A6E4672177812AF0055514D /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb.js; sourceTree = ""; }; - 1A6E4673177812AF0055514D /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk.js; sourceTree = ""; }; - 1A6E4674177812AF0055514D /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_chipmunk_constants.js; sourceTree = ""; }; - 1A6E4675177812AF0055514D /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d.js; sourceTree = ""; }; - 1A6E4676177812AF0055514D /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_constants.js; sourceTree = ""; }; - 1A6E4677177812AF0055514D /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocos2d_extension.js; sourceTree = ""; }; - 1A6E4678177812AF0055514D /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_cocosbuilder.js; sourceTree = ""; }; - 1A6E4679177812AF0055514D /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_debugger.js; sourceTree = ""; }; - 1A6E467A177812AF0055514D /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl.js; sourceTree = ""; }; - 1A6E467B177812AF0055514D /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_opengl_constants.js; sourceTree = ""; }; - 1A6E467C177812AF0055514D /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jsb_sys.js; sourceTree = ""; }; - 1A6E467D177812AF0055514D /* main.debug.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.debug.js; sourceTree = ""; }; - 1A8033291728DECD00240CC3 /* EffectsAdvancedTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EffectsAdvancedTest; path = ../../Shared/tests/EffectsAdvancedTest; sourceTree = ""; }; - 1A80332B1728F1FB00240CC3 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../../Shared/tests/res; sourceTree = ""; }; - 1AA51A7816F708FA000FDF05 /* ActionManagerTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ActionManagerTest; path = ../../Shared/tests/ActionManagerTest; sourceTree = ""; }; - 1AA51A7916F708FA000FDF05 /* ActionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ActionsTest; path = ../../Shared/tests/ActionsTest; sourceTree = ""; }; - 1AA51A7A16F708FA000FDF05 /* BaseTestLayer */ = {isa = PBXFileReference; lastKnownFileType = folder; name = BaseTestLayer; path = ../../Shared/tests/BaseTestLayer; sourceTree = ""; }; - 1AA51A7B16F708FA000FDF05 /* Box2dTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Box2dTest; path = ../../Shared/tests/Box2dTest; sourceTree = ""; }; - 1AA51A7C16F708FA000FDF05 /* ChipmunkTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ChipmunkTest; path = ../../Shared/tests/ChipmunkTest; sourceTree = ""; }; - 1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ClickAndMoveTest; path = ../../Shared/tests/ClickAndMoveTest; sourceTree = ""; }; - 1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CocosDenshionTest; path = ../../Shared/tests/CocosDenshionTest; sourceTree = ""; }; - 1AA51A7F16F708FA000FDF05 /* CocosNodeTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CocosNodeTest; path = ../../Shared/tests/CocosNodeTest; sourceTree = ""; }; - 1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = CurrentLanguageTest; path = ../../Shared/tests/CurrentLanguageTest; sourceTree = ""; }; - 1AA51A8116F708FA000FDF05 /* DrawPrimitivesTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = DrawPrimitivesTest; path = ../../Shared/tests/DrawPrimitivesTest; sourceTree = ""; }; - 1AA51A8216F708FA000FDF05 /* EaseActionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EaseActionsTest; path = ../../Shared/tests/EaseActionsTest; sourceTree = ""; }; - 1AA51A8316F708FA000FDF05 /* EffectsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EffectsTest; path = ../../Shared/tests/EffectsTest; sourceTree = ""; }; - 1AA51A8416F708FA000FDF05 /* EventTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = EventTest; path = ../../Shared/tests/EventTest; sourceTree = ""; }; - 1AA51A8516F708FA000FDF05 /* ExtensionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ExtensionsTest; path = ../../Shared/tests/ExtensionsTest; sourceTree = ""; }; - 1AA51A8616F708FA000FDF05 /* FileUtils */ = {isa = PBXFileReference; lastKnownFileType = folder; name = FileUtils; path = ../../Shared/tests/FileUtils; sourceTree = ""; }; - 1AA51A8716F708FA000FDF05 /* FontTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = FontTest; path = ../../Shared/tests/FontTest; sourceTree = ""; }; - 1AA51A8816F708FA000FDF05 /* IntervalTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = IntervalTest; path = ../../Shared/tests/IntervalTest; sourceTree = ""; }; - 1AA51A8916F708FA000FDF05 /* LabelTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = LabelTest; path = ../../Shared/tests/LabelTest; sourceTree = ""; }; - 1AA51A8A16F708FA000FDF05 /* LayerTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = LayerTest; path = ../../Shared/tests/LayerTest; sourceTree = ""; }; - 1AA51A8B16F708FA000FDF05 /* MenuTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = MenuTest; path = ../../Shared/tests/MenuTest; sourceTree = ""; }; - 1AA51A8C16F708FA000FDF05 /* OpenGLTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = OpenGLTest; path = ../../Shared/tests/OpenGLTest; sourceTree = ""; }; - 1AA51A8D16F708FA000FDF05 /* ParallaxTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ParallaxTest; path = ../../Shared/tests/ParallaxTest; sourceTree = ""; }; - 1AA51A8E16F708FA000FDF05 /* ParticleTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ParticleTest; path = ../../Shared/tests/ParticleTest; sourceTree = ""; }; - 1AA51A8F16F708FA000FDF05 /* PerformanceTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = PerformanceTest; path = ../../Shared/tests/PerformanceTest; sourceTree = ""; }; - 1AA51A9016F708FA000FDF05 /* Presentation */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Presentation; path = ../../Shared/tests/Presentation; sourceTree = ""; }; - 1AA51A9116F708FA000FDF05 /* ProgressActionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ProgressActionsTest; path = ../../Shared/tests/ProgressActionsTest; sourceTree = ""; }; - 1AA51A9216F708FA000FDF05 /* RenderTextureTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = RenderTextureTest; path = ../../Shared/tests/RenderTextureTest; sourceTree = ""; }; - 1AA51A9416F708FA000FDF05 /* RotateWorldTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = RotateWorldTest; path = ../../Shared/tests/RotateWorldTest; sourceTree = ""; }; - 1AA51A9516F708FA000FDF05 /* SceneTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SceneTest; path = ../../Shared/tests/SceneTest; sourceTree = ""; }; - 1AA51A9616F708FA000FDF05 /* SchedulerTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SchedulerTest; path = ../../Shared/tests/SchedulerTest; sourceTree = ""; }; - 1AA51A9716F708FA000FDF05 /* SpriteTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SpriteTest; path = ../../Shared/tests/SpriteTest; sourceTree = ""; }; - 1AA51A9816F708FA000FDF05 /* SysTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SysTest; path = ../../Shared/tests/SysTest; sourceTree = ""; }; - 1AA51A9916F708FA000FDF05 /* TextInputTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TextInputTest; path = ../../Shared/tests/TextInputTest; sourceTree = ""; }; - 1AA51A9A16F708FA000FDF05 /* TextureCacheTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TextureCacheTest; path = ../../Shared/tests/TextureCacheTest; sourceTree = ""; }; - 1AA51A9B16F708FA000FDF05 /* TileMapTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TileMapTest; path = ../../Shared/tests/TileMapTest; sourceTree = ""; }; - 1AA51A9C16F708FA000FDF05 /* TouchesTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TouchesTest; path = ../../Shared/tests/TouchesTest; sourceTree = ""; }; - 1AA51A9D16F708FA000FDF05 /* TransitionsTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TransitionsTest; path = ../../Shared/tests/TransitionsTest; sourceTree = ""; }; - 1AA51A9E16F708FA000FDF05 /* UnitTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = UnitTest; path = ../../Shared/tests/UnitTest; sourceTree = ""; }; - A05FCAC7177C123600BE600E /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; - A05FCACB177C125300BE600E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - A05FCAD0177C129100BE600E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; - A05FCAD2177C129100BE600E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = ""; }; - A05FCAD3177C129100BE600E /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; - A05FCAD4177C129100BE600E /* Test_Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Test_Info.plist; sourceTree = ""; }; - A05FCAD5177C129100BE600E /* Test_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test_Prefix.pch; sourceTree = ""; }; - A05FCADF177C12B500BE600E /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; - A05FCAE0177C12B500BE600E /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; - A05FCAEB177C1FBB00BE600E /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; - A05FCAED177C208D00BE600E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - A05FCAF0177C273700BE600E /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; }; - A218F7DB1743D97E00F65883 /* XHRTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = XHRTest; path = ../../Shared/tests/XHRTest; sourceTree = ""; }; - A22656EE1743DCBB00598A2C /* ClippingNodeTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ClippingNodeTest; path = ../../Shared/tests/ClippingNodeTest; sourceTree = ""; }; - A922753D1517C094001B78AA /* TestJavascript.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestJavascript.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A92275411517C094001B78AA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - A92275451517C094001B78AA /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; - A92275471517C094001B78AA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - A92275491517C094001B78AA /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - A922754D1517C094001B78AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - A922754F1517C094001B78AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - D401B5FD16FB199B00F2529D /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-57.png"; sourceTree = ""; }; - D401B5FF16FB19A000F2529D /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-114.png"; sourceTree = ""; }; - D401B60116FB19A600F2529D /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = ""; }; - D401B60316FB19A900F2529D /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-144.png"; sourceTree = ""; }; - D401B6C816FB637400F2529D /* TestJavascriptObfuscated.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestJavascriptObfuscated.app; sourceTree = BUILT_PRODUCTS_DIR; }; - D401B6D516FBF48000F2529D /* game.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = game.js; path = ../game.js; sourceTree = ""; }; - D401B6DE16FC071100F2529D /* tests-boot-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests-boot-jsb.js"; path = "../../Shared/tests/tests-boot-jsb.js"; sourceTree = ""; }; - D446FDA216102D7D000ADA7B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - D446FDA416102D82000ADA7B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; - D446FDA616102D86000ADA7B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - D4545215156E28EF00887EB5 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = ""; }; - D4545216156E28EF00887EB5 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - A922753A1517C094001B78AA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A05FCAEC177C1FBB00BE600E /* libcurl.dylib in Frameworks */, - 1A4C3F1317784B6000EDFB3B /* libchipmunk.a in Frameworks */, - 1A4C3F1417784B6000EDFB3B /* libcocos2dx.a in Frameworks */, - 1A4C3F1517784B6000EDFB3B /* libCocosDenshion.a in Frameworks */, - 1A4C3F1617784B6000EDFB3B /* libextensions.a in Frameworks */, - 1A4C3F1717784B6000EDFB3B /* libjsbindings.a in Frameworks */, - 1A6B05C717782B0500FFE52B /* libz.dylib in Frameworks */, - 1A6B05C517782A2400FFE52B /* libsqlite3.dylib in Frameworks */, - A92275461517C094001B78AA /* OpenAL.framework in Frameworks */, - A05FCAF1177C273700BE600E /* ApplicationServices.framework in Frameworks */, - A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, - A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */, - A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, - A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, - A05FCAC9177C123F00BE600E /* OpenGL.framework in Frameworks */, - A05FCACD177C125800BE600E /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D401B67816FB637400F2529D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A05FCACC177C125300BE600E /* Cocoa.framework in Frameworks */, - A05FCAC8177C123600BE600E /* OpenGL.framework in Frameworks */, - D401B67D16FB637400F2529D /* QuartzCore.framework in Frameworks */, - D401B67F16FB637400F2529D /* OpenAL.framework in Frameworks */, - D401B68016FB637400F2529D /* AudioToolbox.framework in Frameworks */, - D401B68116FB637400F2529D /* AVFoundation.framework in Frameworks */, - D401B68316FB637400F2529D /* Foundation.framework in Frameworks */, - D401B68416FB637400F2529D /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 15628F5B15F0F5C2000CF24B /* Resources */ = { - isa = PBXGroup; - children = ( - 1A6E4671177812AF0055514D /* js */, - 1A80332B1728F1FB00240CC3 /* res */, - D446FDA616102D86000ADA7B /* Default-568h@2x.png */, - D446FDA216102D7D000ADA7B /* Default.png */, - D446FDA416102D82000ADA7B /* Default@2x.png */, - D401B60316FB19A900F2529D /* Icon-144.png */, - D401B60116FB19A600F2529D /* Icon-72.png */, - D401B5FF16FB19A000F2529D /* Icon-114.png */, - D401B5FD16FB199B00F2529D /* Icon-57.png */, - ); - name = Resources; - sourceTree = ""; - }; - 1A6E4671177812AF0055514D /* js */ = { - isa = PBXGroup; - children = ( - 1A6E4672177812AF0055514D /* jsb.js */, - 1A6E4673177812AF0055514D /* jsb_chipmunk.js */, - 1A6E4674177812AF0055514D /* jsb_chipmunk_constants.js */, - 1A6E4675177812AF0055514D /* jsb_cocos2d.js */, - 1A6E4676177812AF0055514D /* jsb_cocos2d_constants.js */, - 1A6E4677177812AF0055514D /* jsb_cocos2d_extension.js */, - 1A6E4678177812AF0055514D /* jsb_cocosbuilder.js */, - 1A6E4679177812AF0055514D /* jsb_debugger.js */, - 1A6E467A177812AF0055514D /* jsb_opengl.js */, - 1A6E467B177812AF0055514D /* jsb_opengl_constants.js */, - 1A6E467C177812AF0055514D /* jsb_sys.js */, - 1A6E467D177812AF0055514D /* main.debug.js */, - ); - name = js; - path = ../../../../scripting/javascript/bindings/js; - sourceTree = ""; - }; - A05FCACE177C129100BE600E /* en.lproj */ = { - isa = PBXGroup; - children = ( - A05FCACF177C129100BE600E /* InfoPlist.strings */, - A05FCAD1177C129100BE600E /* MainMenu.xib */, - ); - path = en.lproj; - sourceTree = ""; - }; - A05FCADE177C129A00BE600E /* mac */ = { - isa = PBXGroup; - children = ( - A05FCAED177C208D00BE600E /* main.m */, - A05FCADF177C12B500BE600E /* AppController.h */, - A05FCAE0177C12B500BE600E /* AppController.mm */, - A05FCACE177C129100BE600E /* en.lproj */, - A05FCAD3177C129100BE600E /* Icon.icns */, - A05FCAD4177C129100BE600E /* Test_Info.plist */, - A05FCAD5177C129100BE600E /* Test_Prefix.pch */, - ); - name = mac; - sourceTree = ""; - }; - A92275321517C094001B78AA = { - isa = PBXGroup; - children = ( - D4545214156E28EF00887EB5 /* Classes */, - A05FCADE177C129A00BE600E /* mac */, - A92275401517C094001B78AA /* Frameworks */, - D401B60716FB632B00F2529D /* js_src_obfuscated */, - D401B5FC16FB169100F2529D /* js_src_raw */, - A922753E1517C094001B78AA /* Products */, - 15628F5B15F0F5C2000CF24B /* Resources */, - ); - sourceTree = ""; - }; - A922753E1517C094001B78AA /* Products */ = { - isa = PBXGroup; - children = ( - A922753D1517C094001B78AA /* TestJavascript.app */, - D401B6C816FB637400F2529D /* TestJavascriptObfuscated.app */, - ); - name = Products; - sourceTree = ""; - }; - A92275401517C094001B78AA /* Frameworks */ = { - isa = PBXGroup; - children = ( - A05FCAEB177C1FBB00BE600E /* libcurl.dylib */, - 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */, - 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */, - 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */, - 1A4C3F1117784B6000EDFB3B /* libextensions.a */, - 1A4C3F1217784B6000EDFB3B /* libjsbindings.a */, - 1A6B05C617782B0500FFE52B /* libz.dylib */, - 1A6B05C417782A2400FFE52B /* libsqlite3.dylib */, - A05FCAF0177C273700BE600E /* ApplicationServices.framework */, - A05FCACB177C125300BE600E /* Cocoa.framework */, - A05FCAC7177C123600BE600E /* OpenGL.framework */, - A92275411517C094001B78AA /* QuartzCore.framework */, - A92275451517C094001B78AA /* OpenAL.framework */, - A92275471517C094001B78AA /* AudioToolbox.framework */, - A92275491517C094001B78AA /* AVFoundation.framework */, - A922754D1517C094001B78AA /* Foundation.framework */, - A922754F1517C094001B78AA /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - D401B5FC16FB169100F2529D /* js_src_raw */ = { - isa = PBXGroup; - children = ( - A22656EE1743DCBB00598A2C /* ClippingNodeTest */, - A218F7DB1743D97E00F65883 /* XHRTest */, - 1AA51A7816F708FA000FDF05 /* ActionManagerTest */, - 1AA51A7916F708FA000FDF05 /* ActionsTest */, - 1AA51A7A16F708FA000FDF05 /* BaseTestLayer */, - 1AA51A7B16F708FA000FDF05 /* Box2dTest */, - 1AA51A7C16F708FA000FDF05 /* ChipmunkTest */, - 1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */, - 1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */, - 1AA51A7F16F708FA000FDF05 /* CocosNodeTest */, - 1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */, - 1AA51A8116F708FA000FDF05 /* DrawPrimitivesTest */, - 1AA51A8216F708FA000FDF05 /* EaseActionsTest */, - 1A8033291728DECD00240CC3 /* EffectsAdvancedTest */, - 1AA51A8316F708FA000FDF05 /* EffectsTest */, - 1AA51A8416F708FA000FDF05 /* EventTest */, - 1AA51A8516F708FA000FDF05 /* ExtensionsTest */, - 1AA51A8616F708FA000FDF05 /* FileUtils */, - 1AA51A8716F708FA000FDF05 /* FontTest */, - 1AA51A8816F708FA000FDF05 /* IntervalTest */, - 1AA51A8916F708FA000FDF05 /* LabelTest */, - 1AA51A8A16F708FA000FDF05 /* LayerTest */, - 1AA51A8B16F708FA000FDF05 /* MenuTest */, - 1AA51A8C16F708FA000FDF05 /* OpenGLTest */, - 1AA51A8D16F708FA000FDF05 /* ParallaxTest */, - 1AA51A8E16F708FA000FDF05 /* ParticleTest */, - 1AA51A8F16F708FA000FDF05 /* PerformanceTest */, - 1AA51A9016F708FA000FDF05 /* Presentation */, - 1AA51A9116F708FA000FDF05 /* ProgressActionsTest */, - 1AA51A9216F708FA000FDF05 /* RenderTextureTest */, - 1AA51A9416F708FA000FDF05 /* RotateWorldTest */, - 1AA51A9516F708FA000FDF05 /* SceneTest */, - 1AA51A9616F708FA000FDF05 /* SchedulerTest */, - 1AA51A9716F708FA000FDF05 /* SpriteTest */, - 1AA51A9816F708FA000FDF05 /* SysTest */, - 1AA51A9916F708FA000FDF05 /* TextInputTest */, - 1AA51A9A16F708FA000FDF05 /* TextureCacheTest */, - 1AA51A9B16F708FA000FDF05 /* TileMapTest */, - 1AA51A9C16F708FA000FDF05 /* TouchesTest */, - 1AA51A9D16F708FA000FDF05 /* TransitionsTest */, - 1AA51A9E16F708FA000FDF05 /* UnitTest */, - 15A3D4621682F14C002FB0C5 /* main.js */, - D401B6DE16FC071100F2529D /* tests-boot-jsb.js */, - 15A3D4741682F14C002FB0C5 /* tests-main.js */, - 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */, - ); - name = js_src_raw; - sourceTree = ""; - }; - D401B60716FB632B00F2529D /* js_src_obfuscated */ = { - isa = PBXGroup; - children = ( - D401B6D516FBF48000F2529D /* game.js */, - ); - name = js_src_obfuscated; - sourceTree = ""; - }; - D4545214156E28EF00887EB5 /* Classes */ = { - isa = PBXGroup; - children = ( - D4545215156E28EF00887EB5 /* AppDelegate.cpp */, - D4545216156E28EF00887EB5 /* AppDelegate.h */, - ); - name = Classes; - path = ../Classes; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - A922753C1517C094001B78AA /* TestJavascript */ = { - isa = PBXNativeTarget; - buildConfigurationList = A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "TestJavascript" */; - buildPhases = ( - A92275391517C094001B78AA /* Sources */, - A922753A1517C094001B78AA /* Frameworks */, - A922753B1517C094001B78AA /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestJavascript; - productName = TestJavascript; - productReference = A922753D1517C094001B78AA /* TestJavascript.app */; - productType = "com.apple.product-type.application"; - }; - D401B60A16FB637400F2529D /* TestJavascriptObfuscated */ = { - isa = PBXNativeTarget; - buildConfigurationList = D401B6C516FB637400F2529D /* Build configuration list for PBXNativeTarget "TestJavascriptObfuscated" */; - buildPhases = ( - D401B60D16FB637400F2529D /* Sources */, - D401B67816FB637400F2529D /* Frameworks */, - D401B6E116FC076200F2529D /* ShellScript */, - D401B68516FB637400F2529D /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestJavascriptObfuscated; - productName = TestJavascript; - productReference = D401B6C816FB637400F2529D /* TestJavascriptObfuscated.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - A92275341517C094001B78AA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0430; - }; - buildConfigurationList = A92275371517C094001B78AA /* Build configuration list for PBXProject "TestJavascript" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = A92275321517C094001B78AA; - productRefGroup = A922753E1517C094001B78AA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - A922753C1517C094001B78AA /* TestJavascript */, - D401B60A16FB637400F2529D /* TestJavascriptObfuscated */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - A922753B1517C094001B78AA /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1A6E468A177812D20055514D /* jsb.js in Resources */, - 1A6E468B177812D20055514D /* jsb_chipmunk.js in Resources */, - 1A6E468C177812D20055514D /* jsb_chipmunk_constants.js in Resources */, - 1A6E468D177812D20055514D /* jsb_cocos2d.js in Resources */, - 1A6E468E177812D20055514D /* jsb_cocos2d_constants.js in Resources */, - 1A6E468F177812D20055514D /* jsb_cocos2d_extension.js in Resources */, - 1A6E4690177812D20055514D /* jsb_cocosbuilder.js in Resources */, - 1A6E4691177812D20055514D /* jsb_debugger.js in Resources */, - 1A6E4692177812D20055514D /* jsb_opengl.js in Resources */, - 1A6E4693177812D20055514D /* jsb_opengl_constants.js in Resources */, - 1A6E4694177812D20055514D /* jsb_sys.js in Resources */, - 1A6E4695177812D20055514D /* main.debug.js in Resources */, - D401B6E016FC072B00F2529D /* tests-boot-jsb.js in Resources */, - 15A3D5631682F20C002FB0C5 /* main.js in Resources */, - 15A3D5651682F20C002FB0C5 /* tests_resources-jsb.js in Resources */, - 15A3D5681682F20C002FB0C5 /* tests-main.js in Resources */, - 1AA51A9F16F708FA000FDF05 /* ActionManagerTest in Resources */, - 1AA51AA016F708FA000FDF05 /* ActionsTest in Resources */, - 1AA51AA116F708FA000FDF05 /* BaseTestLayer in Resources */, - 1AA51AA216F708FA000FDF05 /* Box2dTest in Resources */, - 1AA51AA316F708FA000FDF05 /* ChipmunkTest in Resources */, - 1AA51AA416F708FA000FDF05 /* ClickAndMoveTest in Resources */, - 1AA51AA516F708FA000FDF05 /* CocosDenshionTest in Resources */, - 1AA51AA616F708FA000FDF05 /* CocosNodeTest in Resources */, - 1AA51AA716F708FA000FDF05 /* CurrentLanguageTest in Resources */, - 1AA51AA816F708FA000FDF05 /* DrawPrimitivesTest in Resources */, - 1AA51AA916F708FA000FDF05 /* EaseActionsTest in Resources */, - 1AA51AAA16F708FA000FDF05 /* EffectsTest in Resources */, - 1AA51AAB16F708FA000FDF05 /* EventTest in Resources */, - 1AA51AAC16F708FA000FDF05 /* ExtensionsTest in Resources */, - 1AA51AAD16F708FA000FDF05 /* FileUtils in Resources */, - 1AA51AAE16F708FA000FDF05 /* FontTest in Resources */, - 1AA51AAF16F708FA000FDF05 /* IntervalTest in Resources */, - 1AA51AB016F708FA000FDF05 /* LabelTest in Resources */, - 1AA51AB116F708FA000FDF05 /* LayerTest in Resources */, - 1AA51AB216F708FA000FDF05 /* MenuTest in Resources */, - 1AA51AB316F708FA000FDF05 /* OpenGLTest in Resources */, - 1AA51AB416F708FA000FDF05 /* ParallaxTest in Resources */, - 1AA51AB516F708FA000FDF05 /* ParticleTest in Resources */, - 1AA51AB616F708FA000FDF05 /* PerformanceTest in Resources */, - 1AA51AB716F708FA000FDF05 /* Presentation in Resources */, - 1AA51AB816F708FA000FDF05 /* ProgressActionsTest in Resources */, - 1AA51AB916F708FA000FDF05 /* RenderTextureTest in Resources */, - 1AA51ABB16F708FA000FDF05 /* RotateWorldTest in Resources */, - 1AA51ABC16F708FA000FDF05 /* SceneTest in Resources */, - 1AA51ABD16F708FA000FDF05 /* SchedulerTest in Resources */, - 1AA51ABE16F708FA000FDF05 /* SpriteTest in Resources */, - 1AA51ABF16F708FA000FDF05 /* SysTest in Resources */, - 1AA51AC016F708FA000FDF05 /* TextInputTest in Resources */, - 1AA51AC116F708FA000FDF05 /* TextureCacheTest in Resources */, - 1AA51AC216F708FA000FDF05 /* TileMapTest in Resources */, - 1AA51AC316F708FA000FDF05 /* TouchesTest in Resources */, - 1AA51AC416F708FA000FDF05 /* TransitionsTest in Resources */, - 1AA51AC516F708FA000FDF05 /* UnitTest in Resources */, - 1A80332A1728DECD00240CC3 /* EffectsAdvancedTest in Resources */, - 1A80332C1728F1FB00240CC3 /* res in Resources */, - A218F7DC1743D97E00F65883 /* XHRTest in Resources */, - A22656EF1743DCBB00598A2C /* ClippingNodeTest in Resources */, - A05FCAD6177C129100BE600E /* InfoPlist.strings in Resources */, - A05FCAD8177C129100BE600E /* MainMenu.xib in Resources */, - A05FCADA177C129100BE600E /* Icon.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D401B68516FB637400F2529D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D401B6D716FBF49A00F2529D /* game.js in Resources */, - A05FCAD7177C129100BE600E /* InfoPlist.strings in Resources */, - A05FCAD9177C129100BE600E /* MainMenu.xib in Resources */, - A05FCADB177C129100BE600E /* Icon.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - D401B6E116FC076200F2529D /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "pushd $SRCROOT/../\nrm game.js\nant -buildfile obfuscate.xml\npopd\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - A92275391517C094001B78AA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */, - A05FCAE1177C12B500BE600E /* AppController.mm in Sources */, - A05FCAEE177C208D00BE600E /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D401B60D16FB637400F2529D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D401B61116FB637400F2529D /* AppDelegate.cpp in Sources */, - A05FCAE2177C12B500BE600E /* AppController.mm in Sources */, - A05FCAEF177C208D00BE600E /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - A05FCACF177C129100BE600E /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - A05FCAD0177C129100BE600E /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - A05FCAD1177C129100BE600E /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - A05FCAD2177C129100BE600E /* en */, - ); - name = MainMenu.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - A92276FE1517C097001B78AA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "COCOS2D_DEBUG=1", - COCOS2D_JAVASCRIPT, - USE_FILE32API, - CC_ENABLE_CHIPMUNK_INTEGRATION, - CC_TARGET_OS_MAC, - DEBUG, - CC_KEYBOARD_SUPPORT, - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../../cocos2dx", - "$(SRCROOT)/../../../../cocos2dx/include", - "$(SRCROOT)/../../../../cocos2dx/platform/mac", - "$(SRCROOT)/../../../../cocos2dx/kazmath/include", - "${SRCROOT}/../../../../cocos2dx/platform/third_party/mac", - "$(SRCROOT)/../../../../CocosDenshion/include", - "$(SRCROOT)/../../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/include", - "$(SRCROOT)/../../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../../extensions", - ); - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/lib\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../../external/libwebsockets/mac/lib\"", - ); - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - A92276FF1517C097001B78AA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = ( - COCOS2D_JAVASCRIPT, - USE_FILE32API, - CC_ENABLE_CHIPMUNK_INTEGRATION, - CC_TARGET_OS_MAC, - NDEBUG, - CC_KEYBOARD_SUPPORT, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../../cocos2dx", - "$(SRCROOT)/../../../../cocos2dx/include", - "$(SRCROOT)/../../../../cocos2dx/platform/mac", - "$(SRCROOT)/../../../../cocos2dx/kazmath/include", - "${SRCROOT}/../../../../cocos2dx/platform/third_party/mac", - "$(SRCROOT)/../../../../CocosDenshion/include", - "$(SRCROOT)/../../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/include", - "$(SRCROOT)/../../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../../extensions", - ); - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../../scripting/javascript/spidermonkey-mac/lib\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../../external/libwebsockets/mac/lib\"", - ); - SDKROOT = macosx; - }; - name = Release; - }; - A92277011517C097001B78AA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Test_Prefix.pch; - GCC_VERSION = ""; - INFOPLIST_FILE = "$(SRCROOT)/Test_Info.plist"; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = TestJavascript; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - A92277021517C097001B78AA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Test_Prefix.pch; - GCC_VERSION = ""; - INFOPLIST_FILE = "$(SRCROOT)/Test_Info.plist"; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = TestJavascript; - VALIDATE_PRODUCT = YES; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - D401B6C616FB637400F2529D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 1; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Test_Prefix.pch; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "$(SRCROOT)/Info-obfuscated.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); - PRODUCT_NAME = TestJavascriptObfuscated; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - D401B6C716FB637400F2529D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Test_Prefix.pch; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "$(SRCROOT)/Info-obfuscated.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); - PRODUCT_NAME = TestJavascriptObfuscated; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - A92275371517C094001B78AA /* Build configuration list for PBXProject "TestJavascript" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A92276FE1517C097001B78AA /* Debug */, - A92276FF1517C097001B78AA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "TestJavascript" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A92277011517C097001B78AA /* Debug */, - A92277021517C097001B78AA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D401B6C516FB637400F2529D /* Build configuration list for PBXNativeTarget "TestJavascriptObfuscated" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D401B6C616FB637400F2529D /* Debug */, - D401B6C716FB637400F2529D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = A92275341517C094001B78AA /* Project object */; -} diff --git a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout b/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout deleted file mode 100644 index 58f6193c12..0000000000 --- a/samples/Javascript/TestJavascript/proj.mac/TestJavascript.xcodeproj/project.xcworkspace/xcshareddata/TestJavascript.xccheckout +++ /dev/null @@ -1,63 +0,0 @@ - - - - - IDESourceControlProjectIdentifier - 0B98B4D8-828E-460D-817C-495BE3652AD5 - IDESourceControlProjectName - TestJavascript - IDESourceControlProjectOriginsDictionary - - 5B0F35E6-1A4B-4F3D-A082-C30150726270 - git://github.com/folecr/cocos2dx-autogen-bindings.git - D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A - https://github.com/minggo/cocos2d-x.git - E0C8B176-3A21-43EF-A355-D004DE1F4825 - https://github.com/minggo/cocos2d-js-tests.git - - IDESourceControlProjectPath - samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj/project.xcworkspace - IDESourceControlProjectRelativeInstallPathDictionary - - 5B0F35E6-1A4B-4F3D-A082-C30150726270 - ../../../../../../scripting/javascript/bindings/generated - D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A - ../../../../../.. - E0C8B176-3A21-43EF-A355-D004DE1F4825 - ../../../../Shared - - IDESourceControlProjectURL - https://github.com/minggo/cocos2d-x.git - IDESourceControlProjectVersion - 110 - IDESourceControlProjectWCCIdentifier - D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - D2399FF0-C90F-4E4F-8E8D-F9BE2AA9DC5A - IDESourceControlWCCName - cocos2d-x - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - E0C8B176-3A21-43EF-A355-D004DE1F4825 - IDESourceControlWCCName - Shared - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - 5B0F35E6-1A4B-4F3D-A082-C30150726270 - IDESourceControlWCCName - generated - - - - From 527d209ca80e53b897f6913b27db6777526dc0eb Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 15:20:31 -0700 Subject: [PATCH 36/43] Tries to compile WaterMelonWithMe --- .../project.pbxproj.REMOVED.git-id | 2 +- .../WatermelonWithMe/proj.mac/AppController.h | 42 + .../proj.mac/AppController.mm | 93 ++ .../WatermelonWithMe/proj.mac/Icon.icns | Bin 0 -> 77152 bytes .../proj.mac/en.lproj/InfoPlist.strings | 2 + .../proj.mac/en.lproj/MainMenu.xib | 812 ++++++++++++++++++ .../WatermelonWithMe/proj.mac/main.m | 30 + .../project.pbxproj.REMOVED.git-id | 2 +- 8 files changed, 981 insertions(+), 2 deletions(-) create mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/AppController.h create mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm create mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns create mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/InfoPlist.strings create mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/MainMenu.xib create mode 100644 samples/Javascript/WatermelonWithMe/proj.mac/main.m diff --git a/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id index 5e63c07f00..36e62f549c 100644 --- a/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -a60876d05cf1f77a6d9b67a88e8828c01bff15fc \ No newline at end of file +661daee9d7fc4628c056ccb24d6eca9a146c9e36 \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/AppController.h b/samples/Javascript/WatermelonWithMe/proj.mac/AppController.h new file mode 100644 index 0000000000..96c717304b --- /dev/null +++ b/samples/Javascript/WatermelonWithMe/proj.mac/AppController.h @@ -0,0 +1,42 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#pragma once + +#import "cocos2d.h" +#import "EAGLView.h" + +@interface AppController : NSObject + { + NSWindow *window; + CCEAGLView *glView; + } + + @property (nonatomic, assign) IBOutlet NSWindow* window; + @property (nonatomic, assign) IBOutlet CCEAGLView* glView; + + -(IBAction) toggleFullScreen:(id)sender; + -(IBAction) exitFullScreen:(id)sender; + +@end diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm b/samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm new file mode 100644 index 0000000000..43d05cf28a --- /dev/null +++ b/samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm @@ -0,0 +1,93 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "AppController.h" +#import "AppDelegate.h" + +@implementation AppController + + static AppDelegate s_sharedApplication; + + @synthesize window, glView; + + -(void) applicationDidFinishLaunching:(NSNotification *)aNotification + { + // create the window + // note that using NSResizableWindowMask causes the window to be a little + // smaller and therefore ipad graphics are not loaded + NSRect rect = NSMakeRect(100, 100, 800, 450); + window = [[NSWindow alloc] initWithContentRect:rect + styleMask:( NSClosableWindowMask | NSTitledWindowMask ) + backing:NSBackingStoreBuffered + defer:YES]; + + NSOpenGLPixelFormatAttribute attributes[] = { + NSOpenGLPFADoubleBuffer, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAStencilSize, 8, + 0 + }; + + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease]; + + // allocate our GL view + // (isn't there already a shared CCEAGLView?) + glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; + + // set window parameters + [window becomeFirstResponder]; + [window setContentView:glView]; + [window setTitle:@"TestCpp"]; + [window makeKeyAndOrderFront:self]; + [window setAcceptsMouseMovedEvents:NO]; + + cocos2d::Application::sharedApplication()->run(); + } + + -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication + { + return YES; + } + + -(void) dealloc + { + cocos2d::Director::sharedDirector()->end(); + [super dealloc]; + } + +#pragma mark - +#pragma mark IB Actions + + -(IBAction) toggleFullScreen:(id)sender + { + CCEAGLView* pView = [CCEAGLView sharedEGLView]; + [pView setFullScreen:!pView.isFullScreen]; + } + + -(IBAction) exitFullScreen:(id)sender + { + [[CCEAGLView sharedEGLView] setFullScreen:NO]; + } + +@end diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns new file mode 100644 index 0000000000000000000000000000000000000000..285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c GIT binary patch literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@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@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX literal 0 HcmV?d00001 diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/MainMenu.xib new file mode 100644 index 0000000000..3dacdedbd0 --- /dev/null +++ b/samples/Javascript/WatermelonWithMe/proj.mac/en.lproj/MainMenu.xib @@ -0,0 +1,812 @@ + + + + 1060 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSMenuItem + NSCustomObject + NSMenu + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + TestCpp + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + TestCpp + + YES + + + About TestCpp + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide TestCpp + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit TestCpp + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Fullscreen + f + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + TestCpp Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + AppController + + + NSFontManager + + + + + YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + showHelp: + + + + 493 + + + + toggleFullScreen: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + 420 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 536 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 129.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency + 134.IBPluginDependency + 136.IBPluginDependency + 143.IBPluginDependency + 144.IBPluginDependency + 145.IBPluginDependency + 149.IBPluginDependency + 150.IBPluginDependency + 19.IBPluginDependency + 23.IBPluginDependency + 236.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 29.IBPluginDependency + 295.IBPluginDependency + 296.IBPluginDependency + 420.IBPluginDependency + 490.IBPluginDependency + 491.IBPluginDependency + 492.IBPluginDependency + 494.IBPluginDependency + 5.IBPluginDependency + 536.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 92.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 541 + + + + YES + + AppController + NSObject + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + id + id + + + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + + exitFullScreen: + id + + + toggleFullScreen: + id + + + + + YES + + YES + glView + window + + + YES + EAGLView + NSWindow + + + + YES + + YES + glView + window + + + YES + + glView + EAGLView + + + window + NSWindow + + + + + IBProjectSource + ./Classes/AppController.h + + + + EAGLView + NSOpenGLView + + IBProjectSource + ./Classes/EAGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/main.m b/samples/Javascript/WatermelonWithMe/proj.mac/main.m new file mode 100644 index 0000000000..97d9b73282 --- /dev/null +++ b/samples/Javascript/WatermelonWithMe/proj.mac/main.m @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id index ce30620a43..849bd4998f 100644 --- a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -994a103390dc71b1e4e9e55207da846577540410 \ No newline at end of file +736b139f483c3a830c88bf391812411325fdc605 \ No newline at end of file From 631ea4ef1dffc9224d2466c25464ecc97c5d3e28 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 15:26:03 -0700 Subject: [PATCH 37/43] restore js shared --- samples/Javascript/Shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index 38374930ae..aa2707ac3c 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit 38374930ae707c70611ad1fcb3a5af91d50d72d0 +Subproject commit aa2707ac3cec2282be25e55205ed6b672876d9b4 From 1e6a7f6bbc703280aa504f4a9689412b86563507 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 16:02:36 -0700 Subject: [PATCH 38/43] MoonWarriors works on Mac --- .../MoonWarriors/proj.mac/AppController.h | 42 + .../MoonWarriors/proj.mac/AppController.mm | 93 ++ .../MoonWarriors/proj.mac/Icon.icns | Bin 0 -> 77152 bytes .../proj.mac/en.lproj/InfoPlist.strings | 2 + .../proj.mac/en.lproj/MainMenu.xib | 812 ++++++++++++++++++ .../Javascript/MoonWarriors/proj.mac/main.m | 30 + samples/Javascript/Shared | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- 8 files changed, 981 insertions(+), 2 deletions(-) create mode 100644 samples/Javascript/MoonWarriors/proj.mac/AppController.h create mode 100644 samples/Javascript/MoonWarriors/proj.mac/AppController.mm create mode 100644 samples/Javascript/MoonWarriors/proj.mac/Icon.icns create mode 100644 samples/Javascript/MoonWarriors/proj.mac/en.lproj/InfoPlist.strings create mode 100644 samples/Javascript/MoonWarriors/proj.mac/en.lproj/MainMenu.xib create mode 100644 samples/Javascript/MoonWarriors/proj.mac/main.m diff --git a/samples/Javascript/MoonWarriors/proj.mac/AppController.h b/samples/Javascript/MoonWarriors/proj.mac/AppController.h new file mode 100644 index 0000000000..96c717304b --- /dev/null +++ b/samples/Javascript/MoonWarriors/proj.mac/AppController.h @@ -0,0 +1,42 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#pragma once + +#import "cocos2d.h" +#import "EAGLView.h" + +@interface AppController : NSObject + { + NSWindow *window; + CCEAGLView *glView; + } + + @property (nonatomic, assign) IBOutlet NSWindow* window; + @property (nonatomic, assign) IBOutlet CCEAGLView* glView; + + -(IBAction) toggleFullScreen:(id)sender; + -(IBAction) exitFullScreen:(id)sender; + +@end diff --git a/samples/Javascript/MoonWarriors/proj.mac/AppController.mm b/samples/Javascript/MoonWarriors/proj.mac/AppController.mm new file mode 100644 index 0000000000..43d05cf28a --- /dev/null +++ b/samples/Javascript/MoonWarriors/proj.mac/AppController.mm @@ -0,0 +1,93 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "AppController.h" +#import "AppDelegate.h" + +@implementation AppController + + static AppDelegate s_sharedApplication; + + @synthesize window, glView; + + -(void) applicationDidFinishLaunching:(NSNotification *)aNotification + { + // create the window + // note that using NSResizableWindowMask causes the window to be a little + // smaller and therefore ipad graphics are not loaded + NSRect rect = NSMakeRect(100, 100, 800, 450); + window = [[NSWindow alloc] initWithContentRect:rect + styleMask:( NSClosableWindowMask | NSTitledWindowMask ) + backing:NSBackingStoreBuffered + defer:YES]; + + NSOpenGLPixelFormatAttribute attributes[] = { + NSOpenGLPFADoubleBuffer, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAStencilSize, 8, + 0 + }; + + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease]; + + // allocate our GL view + // (isn't there already a shared CCEAGLView?) + glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; + + // set window parameters + [window becomeFirstResponder]; + [window setContentView:glView]; + [window setTitle:@"TestCpp"]; + [window makeKeyAndOrderFront:self]; + [window setAcceptsMouseMovedEvents:NO]; + + cocos2d::Application::sharedApplication()->run(); + } + + -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication + { + return YES; + } + + -(void) dealloc + { + cocos2d::Director::sharedDirector()->end(); + [super dealloc]; + } + +#pragma mark - +#pragma mark IB Actions + + -(IBAction) toggleFullScreen:(id)sender + { + CCEAGLView* pView = [CCEAGLView sharedEGLView]; + [pView setFullScreen:!pView.isFullScreen]; + } + + -(IBAction) exitFullScreen:(id)sender + { + [[CCEAGLView sharedEGLView] setFullScreen:NO]; + } + +@end diff --git a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns new file mode 100644 index 0000000000000000000000000000000000000000..285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c GIT binary patch literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qI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 HcmV?d00001 diff --git a/samples/Javascript/MoonWarriors/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/MoonWarriors/proj.mac/en.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/samples/Javascript/MoonWarriors/proj.mac/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/Javascript/MoonWarriors/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/MoonWarriors/proj.mac/en.lproj/MainMenu.xib new file mode 100644 index 0000000000..3dacdedbd0 --- /dev/null +++ b/samples/Javascript/MoonWarriors/proj.mac/en.lproj/MainMenu.xib @@ -0,0 +1,812 @@ + + + + 1060 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSMenuItem + NSCustomObject + NSMenu + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + TestCpp + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + TestCpp + + YES + + + About TestCpp + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide TestCpp + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit TestCpp + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Fullscreen + f + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + TestCpp Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + AppController + + + NSFontManager + + + + + YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + showHelp: + + + + 493 + + + + toggleFullScreen: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + 420 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 536 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 129.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency + 134.IBPluginDependency + 136.IBPluginDependency + 143.IBPluginDependency + 144.IBPluginDependency + 145.IBPluginDependency + 149.IBPluginDependency + 150.IBPluginDependency + 19.IBPluginDependency + 23.IBPluginDependency + 236.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 29.IBPluginDependency + 295.IBPluginDependency + 296.IBPluginDependency + 420.IBPluginDependency + 490.IBPluginDependency + 491.IBPluginDependency + 492.IBPluginDependency + 494.IBPluginDependency + 5.IBPluginDependency + 536.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 92.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 541 + + + + YES + + AppController + NSObject + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + id + id + + + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + + exitFullScreen: + id + + + toggleFullScreen: + id + + + + + YES + + YES + glView + window + + + YES + EAGLView + NSWindow + + + + YES + + YES + glView + window + + + YES + + glView + EAGLView + + + window + NSWindow + + + + + IBProjectSource + ./Classes/AppController.h + + + + EAGLView + NSOpenGLView + + IBProjectSource + ./Classes/EAGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/samples/Javascript/MoonWarriors/proj.mac/main.m b/samples/Javascript/MoonWarriors/proj.mac/main.m new file mode 100644 index 0000000000..97d9b73282 --- /dev/null +++ b/samples/Javascript/MoonWarriors/proj.mac/main.m @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/samples/Javascript/Shared b/samples/Javascript/Shared index aa2707ac3c..38374930ae 160000 --- a/samples/Javascript/Shared +++ b/samples/Javascript/Shared @@ -1 +1 @@ -Subproject commit aa2707ac3cec2282be25e55205ed6b672876d9b4 +Subproject commit 38374930ae707c70611ad1fcb3a5af91d50d72d0 diff --git a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id index 849bd4998f..e1fbca4dc0 100644 --- a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -736b139f483c3a830c88bf391812411325fdc605 \ No newline at end of file +efc02a757e1ede9a93b631c2d6763c98b6946f53 \ No newline at end of file From 92469a635c2e737e6c1b79dbca56869623f7a05c Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 16:24:41 -0700 Subject: [PATCH 39/43] CrystalCraze and CocosDragon added --- .../project.pbxproj.REMOVED.git-id | 2 +- .../CocosDragonJS/Classes/AppDelegate.cpp | 2 +- .../CocosDragonJS/proj.mac/AppController.h | 42 + .../CocosDragonJS/proj.mac/AppController.mm | 93 ++ .../CocosDragonJS/proj.mac/Icon.icns | Bin 0 -> 77152 bytes .../proj.mac/en.lproj/InfoPlist.strings | 2 + .../proj.mac/en.lproj/MainMenu.xib | 812 ++++++++++++++++++ .../Javascript/CocosDragonJS/proj.mac/main.m | 30 + .../CrystalCraze/Classes/AppDelegate.cpp | 2 +- .../CrystalCraze/proj.mac/AppController.h | 42 + .../CrystalCraze/proj.mac/AppController.mm | 93 ++ .../CrystalCraze/proj.mac/Icon.icns | Bin 0 -> 77152 bytes .../proj.mac/en.lproj/InfoPlist.strings | 2 + .../proj.mac/en.lproj/MainMenu.xib | 812 ++++++++++++++++++ .../Javascript/CrystalCraze/proj.mac/main.m | 30 + .../project.pbxproj.REMOVED.git-id | 2 +- 16 files changed, 1962 insertions(+), 4 deletions(-) create mode 100644 samples/Javascript/CocosDragonJS/proj.mac/AppController.h create mode 100644 samples/Javascript/CocosDragonJS/proj.mac/AppController.mm create mode 100644 samples/Javascript/CocosDragonJS/proj.mac/Icon.icns create mode 100644 samples/Javascript/CocosDragonJS/proj.mac/en.lproj/InfoPlist.strings create mode 100644 samples/Javascript/CocosDragonJS/proj.mac/en.lproj/MainMenu.xib create mode 100644 samples/Javascript/CocosDragonJS/proj.mac/main.m create mode 100644 samples/Javascript/CrystalCraze/proj.mac/AppController.h create mode 100644 samples/Javascript/CrystalCraze/proj.mac/AppController.mm create mode 100644 samples/Javascript/CrystalCraze/proj.mac/Icon.icns create mode 100644 samples/Javascript/CrystalCraze/proj.mac/en.lproj/InfoPlist.strings create mode 100644 samples/Javascript/CrystalCraze/proj.mac/en.lproj/MainMenu.xib create mode 100644 samples/Javascript/CrystalCraze/proj.mac/main.m diff --git a/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id index 36e62f549c..340b3b1076 100644 --- a/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2d_libs-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -661daee9d7fc4628c056ccb24d6eca9a146c9e36 \ No newline at end of file +4e36b65ca40f9ebd3b17d251c4cd0e5c953f23b8 \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp index 890ea93f70..d29b239b3f 100644 --- a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp +++ b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp @@ -42,7 +42,7 @@ bool AppDelegate::applicationDidFinishLaunching() std::vector resDirOrders; TargetPlatform platform = Application::sharedApplication()->getTargetPlatform(); - if (platform == kTargetIphone || platform == kTargetIpad) + if (platform == kTargetIphone || platform == kTargetIpad || platform == kTargetMacOS) { std::vector searchPaths = FileUtils::sharedFileUtils()->getSearchPaths(); searchPaths.insert(searchPaths.begin(), "Published files iOS"); diff --git a/samples/Javascript/CocosDragonJS/proj.mac/AppController.h b/samples/Javascript/CocosDragonJS/proj.mac/AppController.h new file mode 100644 index 0000000000..96c717304b --- /dev/null +++ b/samples/Javascript/CocosDragonJS/proj.mac/AppController.h @@ -0,0 +1,42 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#pragma once + +#import "cocos2d.h" +#import "EAGLView.h" + +@interface AppController : NSObject + { + NSWindow *window; + CCEAGLView *glView; + } + + @property (nonatomic, assign) IBOutlet NSWindow* window; + @property (nonatomic, assign) IBOutlet CCEAGLView* glView; + + -(IBAction) toggleFullScreen:(id)sender; + -(IBAction) exitFullScreen:(id)sender; + +@end diff --git a/samples/Javascript/CocosDragonJS/proj.mac/AppController.mm b/samples/Javascript/CocosDragonJS/proj.mac/AppController.mm new file mode 100644 index 0000000000..43d05cf28a --- /dev/null +++ b/samples/Javascript/CocosDragonJS/proj.mac/AppController.mm @@ -0,0 +1,93 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "AppController.h" +#import "AppDelegate.h" + +@implementation AppController + + static AppDelegate s_sharedApplication; + + @synthesize window, glView; + + -(void) applicationDidFinishLaunching:(NSNotification *)aNotification + { + // create the window + // note that using NSResizableWindowMask causes the window to be a little + // smaller and therefore ipad graphics are not loaded + NSRect rect = NSMakeRect(100, 100, 800, 450); + window = [[NSWindow alloc] initWithContentRect:rect + styleMask:( NSClosableWindowMask | NSTitledWindowMask ) + backing:NSBackingStoreBuffered + defer:YES]; + + NSOpenGLPixelFormatAttribute attributes[] = { + NSOpenGLPFADoubleBuffer, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAStencilSize, 8, + 0 + }; + + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease]; + + // allocate our GL view + // (isn't there already a shared CCEAGLView?) + glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; + + // set window parameters + [window becomeFirstResponder]; + [window setContentView:glView]; + [window setTitle:@"TestCpp"]; + [window makeKeyAndOrderFront:self]; + [window setAcceptsMouseMovedEvents:NO]; + + cocos2d::Application::sharedApplication()->run(); + } + + -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication + { + return YES; + } + + -(void) dealloc + { + cocos2d::Director::sharedDirector()->end(); + [super dealloc]; + } + +#pragma mark - +#pragma mark IB Actions + + -(IBAction) toggleFullScreen:(id)sender + { + CCEAGLView* pView = [CCEAGLView sharedEGLView]; + [pView setFullScreen:!pView.isFullScreen]; + } + + -(IBAction) exitFullScreen:(id)sender + { + [[CCEAGLView sharedEGLView] setFullScreen:NO]; + } + +@end diff --git a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns new file mode 100644 index 0000000000000000000000000000000000000000..285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c GIT binary patch literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93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R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX literal 0 HcmV?d00001 diff --git a/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/MainMenu.xib new file mode 100644 index 0000000000..3dacdedbd0 --- /dev/null +++ b/samples/Javascript/CocosDragonJS/proj.mac/en.lproj/MainMenu.xib @@ -0,0 +1,812 @@ + + + + 1060 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSMenuItem + NSCustomObject + NSMenu + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + TestCpp + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + TestCpp + + YES + + + About TestCpp + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide TestCpp + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit TestCpp + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Fullscreen + f + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + TestCpp Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + AppController + + + NSFontManager + + + + + YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + showHelp: + + + + 493 + + + + toggleFullScreen: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + 420 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 536 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 129.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency + 134.IBPluginDependency + 136.IBPluginDependency + 143.IBPluginDependency + 144.IBPluginDependency + 145.IBPluginDependency + 149.IBPluginDependency + 150.IBPluginDependency + 19.IBPluginDependency + 23.IBPluginDependency + 236.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 29.IBPluginDependency + 295.IBPluginDependency + 296.IBPluginDependency + 420.IBPluginDependency + 490.IBPluginDependency + 491.IBPluginDependency + 492.IBPluginDependency + 494.IBPluginDependency + 5.IBPluginDependency + 536.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 92.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 541 + + + + YES + + AppController + NSObject + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + id + id + + + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + + exitFullScreen: + id + + + toggleFullScreen: + id + + + + + YES + + YES + glView + window + + + YES + EAGLView + NSWindow + + + + YES + + YES + glView + window + + + YES + + glView + EAGLView + + + window + NSWindow + + + + + IBProjectSource + ./Classes/AppController.h + + + + EAGLView + NSOpenGLView + + IBProjectSource + ./Classes/EAGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/samples/Javascript/CocosDragonJS/proj.mac/main.m b/samples/Javascript/CocosDragonJS/proj.mac/main.m new file mode 100644 index 0000000000..97d9b73282 --- /dev/null +++ b/samples/Javascript/CocosDragonJS/proj.mac/main.m @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp index 77873c1622..1e65bf4734 100644 --- a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp +++ b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp @@ -39,7 +39,7 @@ bool AppDelegate::applicationDidFinishLaunching() std::vector resDirOrders; TargetPlatform platform = Application::sharedApplication()->getTargetPlatform(); - if (platform == kTargetIphone || platform == kTargetIpad) + if (platform == kTargetIphone || platform == kTargetIpad || platform == kTargetMacOS) { searchPaths.push_back("Published-iOS"); // Resources/Published-iOS FileUtils::sharedFileUtils()->setSearchPaths(searchPaths); diff --git a/samples/Javascript/CrystalCraze/proj.mac/AppController.h b/samples/Javascript/CrystalCraze/proj.mac/AppController.h new file mode 100644 index 0000000000..96c717304b --- /dev/null +++ b/samples/Javascript/CrystalCraze/proj.mac/AppController.h @@ -0,0 +1,42 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#pragma once + +#import "cocos2d.h" +#import "EAGLView.h" + +@interface AppController : NSObject + { + NSWindow *window; + CCEAGLView *glView; + } + + @property (nonatomic, assign) IBOutlet NSWindow* window; + @property (nonatomic, assign) IBOutlet CCEAGLView* glView; + + -(IBAction) toggleFullScreen:(id)sender; + -(IBAction) exitFullScreen:(id)sender; + +@end diff --git a/samples/Javascript/CrystalCraze/proj.mac/AppController.mm b/samples/Javascript/CrystalCraze/proj.mac/AppController.mm new file mode 100644 index 0000000000..43d05cf28a --- /dev/null +++ b/samples/Javascript/CrystalCraze/proj.mac/AppController.mm @@ -0,0 +1,93 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "AppController.h" +#import "AppDelegate.h" + +@implementation AppController + + static AppDelegate s_sharedApplication; + + @synthesize window, glView; + + -(void) applicationDidFinishLaunching:(NSNotification *)aNotification + { + // create the window + // note that using NSResizableWindowMask causes the window to be a little + // smaller and therefore ipad graphics are not loaded + NSRect rect = NSMakeRect(100, 100, 800, 450); + window = [[NSWindow alloc] initWithContentRect:rect + styleMask:( NSClosableWindowMask | NSTitledWindowMask ) + backing:NSBackingStoreBuffered + defer:YES]; + + NSOpenGLPixelFormatAttribute attributes[] = { + NSOpenGLPFADoubleBuffer, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAStencilSize, 8, + 0 + }; + + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease]; + + // allocate our GL view + // (isn't there already a shared CCEAGLView?) + glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat]; + + // set window parameters + [window becomeFirstResponder]; + [window setContentView:glView]; + [window setTitle:@"TestCpp"]; + [window makeKeyAndOrderFront:self]; + [window setAcceptsMouseMovedEvents:NO]; + + cocos2d::Application::sharedApplication()->run(); + } + + -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication + { + return YES; + } + + -(void) dealloc + { + cocos2d::Director::sharedDirector()->end(); + [super dealloc]; + } + +#pragma mark - +#pragma mark IB Actions + + -(IBAction) toggleFullScreen:(id)sender + { + CCEAGLView* pView = [CCEAGLView sharedEGLView]; + [pView setFullScreen:!pView.isFullScreen]; + } + + -(IBAction) exitFullScreen:(id)sender + { + [[CCEAGLView sharedEGLView] setFullScreen:NO]; + } + +@end diff --git a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns new file mode 100644 index 0000000000000000000000000000000000000000..285dee82b3d3f80acf3c0037b6b6ce35df0e9e5c GIT binary patch literal 77152 zcmeFZXIxat_Ab0T(TVPcCg&WwF((wvIgtbb0l@$Yf+$9U!rtBFj7Ss^6+xmXS&|aF z0l}Pe9`lUjIL3ZgHO@J6=AQq(U*1pmcR^-g*WPQbTD7Y7s%Jgb0ULvNVx+O_0(MTG zgkcnJ)SEEf@#a<*=Hn~`LW^;F@yiUYEQJKZ+=Qc z@;C=Ct#KBLYV?`;X4u#qA!fFSC$v=LaWrsMs`_?qirQk9g*k`KC#_sfo*6ckVr!*o zZp=~SaF|Yk>zo}H3pfV)h8!M;qew9xD=_6Vb+mO2tr;9eHk(9MpeQIQtLrF7eY@Q^ z*gw=Gx!N@-kqq=bywpD+8SEYKE4bA)B$W>Ib@aj2;qLifao4*CCDMUYOsqAiFMWCN%jT>Ly@S&1;^L0ra@nm@kJ?xIfsBN-+{E3|Q}16qt4&(a zE0u=FhN~T`t-ly|wK93@k*hsXK@kDts@odtvO3};Lz1ubcyISyU*j_;xh`qk@~sDM zbg%O9Se|Ku2@aZLMy?xr`t9vJCPy+o-5q`0S<5H1x7jaSJ$1Rm1aE(jaZ@J8*VowD ztypEb%*Vxf!R$$%1v#ZF?d?{s)HfMtF~)R}I3_)J%QCy=v#d4wn(CHzUVFtcI^W+s zc>Lh$-G}dPJ$?A-@q>5p--l1`J>FjX@zzuPQPjhm_a8pK|NQO}&%9snJbC!&(eUNF z_n+Mg2!9oF@b}wrbGP)um8V-Sd<74j_~qV{N6qIt?-FIQo2MSOuiW+ft*15h%@yJO zr{BMLTAR4!-lIoHYV!1t*VbQ>d!X^%ovh=DV{6(PkOQK&7rwodc!=<=@t&1bpEzcD z;IR+uZWGBd&gsYlW|-mXZTB8TMkFtaV6F9X+~C1lHvQJM$j~^irH&K90~4l9K7M5& zGBP}7?&9^US1+7BVb{5)zOcy1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fQtju zS82(%r+7ak@)d+o6F%*uz$x*ihVmg#9Ym?iOv^A9gRpn|%2HK(yLr3so1b9VQVwbR z@FmC&rZ-5~5&tN}CP5$~P`Ldew(1KnC`C*Qj8>u@F!uBMRs2c_{})`5Ow&ZVvK0*O zRPqu48QLqsYf@7k*c&mN5OBU|ET$saJ@sn*MK|EB)M`xQ_MU#zuiAzCP;vWFziKb- zLj9-MKT#*@Aii{;sF3ll>UOcnyWw1tDj3Ket1ya&Bjp6S=1|j6&p&@IFB#!3X;VoA zhI3(-yv2Nv);#0abRlUYv)4QA1cLF@Ez;XfsHbGTye%l5$=%xbYRgn{AP{jOG?z*t zCi=NjcxZ((B@h!A3;Qy0MD_9x;zB0$u*SgehV(H{8ByjW;dH3>Z2)_=IQi4A^XL_& zB0`H*$5ZTxwGi-x6=zZIQ#BH-*y%B3%TY_v(YRcpuYj|F$v__!;z5t2G0z!WN@Eu# zJr=~m{~%L>6{mahVSrJDZ%NSh;N78}uHe_>y{|PB6C%5SHQT&fx`yi~rG^?46JNQm zFx1rUB}${#pXE3DBd$?gR}KB4R7tNh$-Jx)-zYalW6t4En*;D^g(+3C`{uq2eJP3zWKe~G{)r! z@iYLa*Lva->>j`d8_l}kfHY*2xd03!TvLdZXDJD>5x$_|$$isrs3t zaotCkK|ZXkmMid;fArveL^*9q3mj$ZIV#vtku^ju`ns^NV&tE%*PiDYaRugMPK04wg39rM>?Qm!c1G}zS~6C1J)sgWpvk_CD$qp~zo5_zM*<|d z4iPoYher_|qB-%rimEyXUspvX%gFJpX7#)8D~n}Hx(>6yG2rd1|0k;zr_=x0X=83y L0000CLjGoE&y@FX literal 0 HcmV?d00001 diff --git a/samples/Javascript/CrystalCraze/proj.mac/en.lproj/InfoPlist.strings b/samples/Javascript/CrystalCraze/proj.mac/en.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/samples/Javascript/CrystalCraze/proj.mac/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/Javascript/CrystalCraze/proj.mac/en.lproj/MainMenu.xib b/samples/Javascript/CrystalCraze/proj.mac/en.lproj/MainMenu.xib new file mode 100644 index 0000000000..3dacdedbd0 --- /dev/null +++ b/samples/Javascript/CrystalCraze/proj.mac/en.lproj/MainMenu.xib @@ -0,0 +1,812 @@ + + + + 1060 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSMenuItem + NSCustomObject + NSMenu + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + TestCpp + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + TestCpp + + YES + + + About TestCpp + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide TestCpp + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit TestCpp + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Fullscreen + f + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + TestCpp Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + AppController + + + NSFontManager + + + + + YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + showHelp: + + + + 493 + + + + toggleFullScreen: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + 420 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 536 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 129.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency + 134.IBPluginDependency + 136.IBPluginDependency + 143.IBPluginDependency + 144.IBPluginDependency + 145.IBPluginDependency + 149.IBPluginDependency + 150.IBPluginDependency + 19.IBPluginDependency + 23.IBPluginDependency + 236.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 29.IBPluginDependency + 295.IBPluginDependency + 296.IBPluginDependency + 420.IBPluginDependency + 490.IBPluginDependency + 491.IBPluginDependency + 492.IBPluginDependency + 494.IBPluginDependency + 5.IBPluginDependency + 536.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 92.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 541 + + + + YES + + AppController + NSObject + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + id + id + + + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + + exitFullScreen: + id + + + toggleFullScreen: + id + + + + + YES + + YES + glView + window + + + YES + EAGLView + NSWindow + + + + YES + + YES + glView + window + + + YES + + glView + EAGLView + + + window + NSWindow + + + + + IBProjectSource + ./Classes/AppController.h + + + + EAGLView + NSOpenGLView + + IBProjectSource + ./Classes/EAGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/samples/Javascript/CrystalCraze/proj.mac/main.m b/samples/Javascript/CrystalCraze/proj.mac/main.m new file mode 100644 index 0000000000..97d9b73282 --- /dev/null +++ b/samples/Javascript/CrystalCraze/proj.mac/main.m @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id index e1fbca4dc0..215a5751eb 100644 --- a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -efc02a757e1ede9a93b631c2d6763c98b6946f53 \ No newline at end of file +e647d626f71c45529f3a6c6ee9c446f48b621c32 \ No newline at end of file From 9e13cb91a5a8bc417389d7c1bbd1f3d95abcf39f Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 16:33:17 -0700 Subject: [PATCH 40/43] Adds xcworspace data --- .gitignore | 1 - .../project.xcworkspace/contents.xcworkspacedata | 7 +++++++ .../project.xcworkspace/contents.xcworkspacedata | 7 +++++++ .../samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- .../project.xcworkspace/contents.xcworkspacedata | 7 +++++++ 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 cocos2d_libs-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 samples/samples-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/.gitignore b/.gitignore index da34e166e5..3a7452a855 100644 --- a/.gitignore +++ b/.gitignore @@ -59,7 +59,6 @@ build_*_vc10/ *.pbxuser *.xcbkptlist *.xcscheme -*.xcworkspacedata *.xcuserstate xcschememanagement.plist build/ diff --git a/cocos2d_libs-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cocos2d_libs-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..1318c00196 --- /dev/null +++ b/cocos2d_libs-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..82d5bd52fd --- /dev/null +++ b/samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id index 215a5751eb..d02fdd589e 100644 --- a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -e647d626f71c45529f3a6c6ee9c446f48b621c32 \ No newline at end of file +3e7005e2a5b2a481ae8a8925b1188ccb77216e52 \ No newline at end of file diff --git a/samples/samples-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/samples-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..04bd8fb314 --- /dev/null +++ b/samples/samples-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + From c38e932fe8af01ee1aebe9cb41b7cd614b36a963 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 1 Jul 2013 17:31:03 -0700 Subject: [PATCH 41/43] Adds SimpleGame and HelloCpp to the mac samples project --- .../HelloCpp.xcodeproj/project.pbxproj | 458 ------------- .../SampleGame.xcodeproj/project.pbxproj | 612 ------------------ .../xcshareddata/WorkspaceSettings.xcsettings | 8 - .../project.pbxproj.REMOVED.git-id | 2 +- 4 files changed, 1 insertion(+), 1079 deletions(-) delete mode 100644 samples/Cpp/HelloCpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj delete mode 100644 samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.pbxproj delete mode 100644 samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/samples/Cpp/HelloCpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj b/samples/Cpp/HelloCpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj deleted file mode 100644 index 6a01166504..0000000000 --- a/samples/Cpp/HelloCpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,458 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1514DA3F163004980095A81C /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 1514DA3C163004980095A81C /* ipad */; }; - 1514DA40163004980095A81C /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 1514DA3D163004980095A81C /* ipadhd */; }; - 1514DA41163004980095A81C /* iphone in Resources */ = {isa = PBXBuildFile; fileRef = 1514DA3E163004980095A81C /* iphone */; }; - 15C156BB1683155600D239F2 /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C156B81683151A00D239F2 /* libcocos2dx.a */; }; - 41BC70AD15BF7CCE006A0A6C /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 41BC70AC15BF7CCE006A0A6C /* Icon.icns */; }; - 41CD6C6515BF7574005E6F29 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C6315BF7574005E6F29 /* AppController.mm */; }; - 41CD6C6615BF7574005E6F29 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C6415BF7574005E6F29 /* main.m */; }; - 41CD6C6E15BF7673005E6F29 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */; }; - 41CD6C6F15BF7673005E6F29 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */; }; - 41CD6C7515BF76FB005E6F29 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */; }; - 41CD6C7615BF76FB005E6F29 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */; }; - 41CD6C8F15BF7793005E6F29 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8715BF7793005E6F29 /* AppKit.framework */; }; - 41CD6C9015BF7793005E6F29 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */; }; - 41CD6C9115BF7793005E6F29 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8915BF7793005E6F29 /* Cocoa.framework */; }; - 41CD6C9215BF7793005E6F29 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */; }; - 41CD6C9315BF7793005E6F29 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8B15BF7793005E6F29 /* Foundation.framework */; }; - 41CD6C9415BF7793005E6F29 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */; }; - 41CD6C9515BF7793005E6F29 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */; }; - 41CD6C9615BF7793005E6F29 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */; }; - 41CD6C9915BF77CE005E6F29 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */; }; - 41CD6C9A15BF77CE005E6F29 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C9815BF77CE005E6F29 /* libz.dylib */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 15C156B71683151A00D239F2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 1551A33F158F2AB200E66CFE; - remoteInfo = cocos2dx; - }; - 15C156B91683155000D239F2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 1551A33E158F2AB200E66CFE; - remoteInfo = cocos2dx; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1514DA3C163004980095A81C /* ipad */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ipad; path = ../Resources/ipad; sourceTree = ""; }; - 1514DA3D163004980095A81C /* ipadhd */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ipadhd; path = ../Resources/ipadhd; sourceTree = ""; }; - 1514DA3E163004980095A81C /* iphone */ = {isa = PBXFileReference; lastKnownFileType = folder; name = iphone; path = ../Resources/iphone; sourceTree = ""; }; - 15A6969B1630E63B00D7A229 /* AppMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppMacros.h; path = ../Classes/AppMacros.h; sourceTree = ""; }; - 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2dx.xcodeproj; path = ../../../../cocos2dx/proj.mac/cocos2dx.xcodeproj; sourceTree = ""; }; - 41BC70AC15BF7CCE006A0A6C /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; - 41CD6C5115BF748C005E6F29 /* HelloCpp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloCpp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 41CD6C6215BF7574005E6F29 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; - 41CD6C6315BF7574005E6F29 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; - 41CD6C6415BF7574005E6F29 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 41CD6C6915BF7673005E6F29 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; - 41CD6C6B15BF7673005E6F29 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = ""; }; - 41CD6C6C15BF7673005E6F29 /* HelloCpp_Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = HelloCpp_Info.plist; sourceTree = ""; }; - 41CD6C6D15BF7673005E6F29 /* HelloCpp_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloCpp_Prefix.pch; sourceTree = ""; }; - 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; - 41CD6C7215BF76FB005E6F29 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; - 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = ""; }; - 41CD6C7415BF76FB005E6F29 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../Classes/HelloWorldScene.h; sourceTree = ""; }; - 41CD6C8715BF7793005E6F29 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; - 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 41CD6C8915BF7793005E6F29 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; - 41CD6C8B15BF7793005E6F29 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; - 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; - 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; - 41CD6C9815BF77CE005E6F29 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 41851B8F15B93C32004083E9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 15C156BB1683155600D239F2 /* libcocos2dx.a in Frameworks */, - 41CD6C8F15BF7793005E6F29 /* AppKit.framework in Frameworks */, - 41CD6C9015BF7793005E6F29 /* AudioToolbox.framework in Frameworks */, - 41CD6C9115BF7793005E6F29 /* Cocoa.framework in Frameworks */, - 41CD6C9215BF7793005E6F29 /* CoreFoundation.framework in Frameworks */, - 41CD6C9315BF7793005E6F29 /* Foundation.framework in Frameworks */, - 41CD6C9415BF7793005E6F29 /* OpenAL.framework in Frameworks */, - 41CD6C9515BF7793005E6F29 /* OpenGL.framework in Frameworks */, - 41CD6C9615BF7793005E6F29 /* QuartzCore.framework in Frameworks */, - 41CD6C9915BF77CE005E6F29 /* libxml2.dylib in Frameworks */, - 41CD6C9A15BF77CE005E6F29 /* libz.dylib in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 15C156B11683151A00D239F2 /* Products */ = { - isa = PBXGroup; - children = ( - 15C156B81683151A00D239F2 /* libcocos2dx.a */, - ); - name = Products; - sourceTree = ""; - }; - 41851B8715B93C32004083E9 = { - isa = PBXGroup; - children = ( - 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */, - 41CD6C5D15BF750B005E6F29 /* Classes */, - 41CD6C5E15BF7514005E6F29 /* Frameworks */, - 41CD6C5F15BF7522005E6F29 /* mac */, - 41EFC1BB15BF7AC30083EA95 /* Products */, - 41CD6C6115BF7556005E6F29 /* Resources */, - ); - sourceTree = ""; - }; - 41CD6C5D15BF750B005E6F29 /* Classes */ = { - isa = PBXGroup; - children = ( - 15A6969B1630E63B00D7A229 /* AppMacros.h */, - 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */, - 41CD6C7215BF76FB005E6F29 /* AppDelegate.h */, - 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */, - 41CD6C7415BF76FB005E6F29 /* HelloWorldScene.h */, - ); - name = Classes; - sourceTree = ""; - }; - 41CD6C5E15BF7514005E6F29 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 41CD6C8715BF7793005E6F29 /* AppKit.framework */, - 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */, - 41CD6C8915BF7793005E6F29 /* Cocoa.framework */, - 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */, - 41CD6C8B15BF7793005E6F29 /* Foundation.framework */, - 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */, - 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */, - 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */, - 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */, - 41CD6C9815BF77CE005E6F29 /* libz.dylib */, - ); - name = Frameworks; - sourceTree = ""; - }; - 41CD6C5F15BF7522005E6F29 /* mac */ = { - isa = PBXGroup; - children = ( - 41CD6C6215BF7574005E6F29 /* AppController.h */, - 41CD6C6315BF7574005E6F29 /* AppController.mm */, - 41CD6C6415BF7574005E6F29 /* main.m */, - 41BC70AC15BF7CCE006A0A6C /* Icon.icns */, - 41CD6C6715BF7673005E6F29 /* en.lproj */, - 41CD6C6C15BF7673005E6F29 /* HelloCpp_Info.plist */, - 41CD6C6D15BF7673005E6F29 /* HelloCpp_Prefix.pch */, - ); - name = mac; - sourceTree = ""; - }; - 41CD6C6115BF7556005E6F29 /* Resources */ = { - isa = PBXGroup; - children = ( - 1514DA3C163004980095A81C /* ipad */, - 1514DA3D163004980095A81C /* ipadhd */, - 1514DA3E163004980095A81C /* iphone */, - ); - name = Resources; - sourceTree = ""; - }; - 41CD6C6715BF7673005E6F29 /* en.lproj */ = { - isa = PBXGroup; - children = ( - 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */, - 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */, - ); - path = en.lproj; - sourceTree = ""; - }; - 41EFC1BB15BF7AC30083EA95 /* Products */ = { - isa = PBXGroup; - children = ( - 41CD6C5115BF748C005E6F29 /* HelloCpp.app */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 41851B9115B93C32004083E9 /* HelloCpp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 41851BB015B93C33004083E9 /* Build configuration list for PBXNativeTarget "HelloCpp" */; - buildPhases = ( - 41851B8E15B93C32004083E9 /* Sources */, - 41851B8F15B93C32004083E9 /* Frameworks */, - 41851B9015B93C32004083E9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 15C156BA1683155000D239F2 /* PBXTargetDependency */, - ); - name = HelloCpp; - productName = Paralaxer; - productReference = 41CD6C5115BF748C005E6F29 /* HelloCpp.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 41851B8915B93C32004083E9 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0420; - ORGANIZATIONNAME = "Bullets in a Burning Box, Inc."; - }; - buildConfigurationList = 41851B8C15B93C32004083E9 /* Build configuration list for PBXProject "HelloCpp" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 41851B8715B93C32004083E9; - productRefGroup = 41851B8715B93C32004083E9; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 15C156B11683151A00D239F2 /* Products */; - ProjectRef = 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 41851B9115B93C32004083E9 /* HelloCpp */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 15C156B81683151A00D239F2 /* libcocos2dx.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libcocos2dx.a; - remoteRef = 15C156B71683151A00D239F2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 41851B9015B93C32004083E9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 41CD6C6E15BF7673005E6F29 /* InfoPlist.strings in Resources */, - 41CD6C6F15BF7673005E6F29 /* MainMenu.xib in Resources */, - 41BC70AD15BF7CCE006A0A6C /* Icon.icns in Resources */, - 1514DA3F163004980095A81C /* ipad in Resources */, - 1514DA40163004980095A81C /* ipadhd in Resources */, - 1514DA41163004980095A81C /* iphone in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 41851B8E15B93C32004083E9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 41CD6C6515BF7574005E6F29 /* AppController.mm in Sources */, - 41CD6C6615BF7574005E6F29 /* main.m in Sources */, - 41CD6C7515BF76FB005E6F29 /* AppDelegate.cpp in Sources */, - 41CD6C7615BF76FB005E6F29 /* HelloWorldScene.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 15C156BA1683155000D239F2 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = cocos2dx; - targetProxy = 15C156B91683155000D239F2 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 41CD6C6915BF7673005E6F29 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 41CD6C6B15BF7673005E6F29 /* en */, - ); - name = MainMenu.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 41851BAE15B93C33004083E9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 41851BAF15B93C33004083E9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; - SDKROOT = macosx; - }; - name = Release; - }; - 41851BB115B93C33004083E9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = HelloCpp_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - CC_TARGET_OS_MAC, - "DEBUG=1", - USE_FILE32API, - "$(inherited)", - ); - GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/include/libxml2/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - ); - INFOPLIST_FILE = HelloCpp_Info.plist; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.7; - OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = HelloCpp; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 41851BB215B93C33004083E9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = HelloCpp_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_FILE32API, - CC_TARGET_OS_MAC, - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/include/libxml2/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - ); - INFOPLIST_FILE = HelloCpp_Info.plist; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.7; - OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = HelloCpp; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 41851B8C15B93C32004083E9 /* Build configuration list for PBXProject "HelloCpp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 41851BAE15B93C33004083E9 /* Debug */, - 41851BAF15B93C33004083E9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 41851BB015B93C33004083E9 /* Build configuration list for PBXNativeTarget "HelloCpp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 41851BB115B93C33004083E9 /* Debug */, - 41851BB215B93C33004083E9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 41851B8915B93C32004083E9 /* Project object */; -} diff --git a/samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.pbxproj b/samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.pbxproj deleted file mode 100644 index cfae81c6bc..0000000000 --- a/samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.pbxproj +++ /dev/null @@ -1,612 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 15C156BB1683155600D239F2 /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C156B81683151A00D239F2 /* libcocos2dx.a */; }; - 41BC70AD15BF7CCE006A0A6C /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 41BC70AC15BF7CCE006A0A6C /* Icon.icns */; }; - 41CD6C6515BF7574005E6F29 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C6315BF7574005E6F29 /* AppController.mm */; }; - 41CD6C6615BF7574005E6F29 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C6415BF7574005E6F29 /* main.m */; }; - 41CD6C6E15BF7673005E6F29 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */; }; - 41CD6C6F15BF7673005E6F29 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */; }; - 41CD6C7515BF76FB005E6F29 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */; }; - 41CD6C7615BF76FB005E6F29 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */; }; - 41CD6C8F15BF7793005E6F29 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8715BF7793005E6F29 /* AppKit.framework */; }; - 41CD6C9015BF7793005E6F29 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */; }; - 41CD6C9115BF7793005E6F29 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8915BF7793005E6F29 /* Cocoa.framework */; }; - 41CD6C9215BF7793005E6F29 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */; }; - 41CD6C9315BF7793005E6F29 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8B15BF7793005E6F29 /* Foundation.framework */; }; - 41CD6C9415BF7793005E6F29 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */; }; - 41CD6C9515BF7793005E6F29 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */; }; - 41CD6C9615BF7793005E6F29 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */; }; - 41CD6C9915BF77CE005E6F29 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */; }; - 41CD6C9A15BF77CE005E6F29 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C9815BF77CE005E6F29 /* libz.dylib */; }; - AB63787616FE1A4C00079CB7 /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AB63781416FE1A4C00079CB7 /* CDAudioManager.m */; }; - AB63787716FE1A4C00079CB7 /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = AB63781716FE1A4C00079CB7 /* CDOpenALSupport.m */; }; - AB63787816FE1A4C00079CB7 /* CDXMacOSXSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB63781916FE1A4C00079CB7 /* CDXMacOSXSupport.mm */; }; - AB63787916FE1A4C00079CB7 /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = AB63781B16FE1A4C00079CB7 /* CocosDenshion.m */; }; - AB63787A16FE1A4C00079CB7 /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB63781C16FE1A4C00079CB7 /* SimpleAudioEngine.mm */; }; - AB63787B16FE1A4C00079CB7 /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = AB63781E16FE1A4C00079CB7 /* SimpleAudioEngine_objc.m */; }; - AB63789A16FE1A8D00079CB7 /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB63789916FE1A8D00079CB7 /* GameOverScene.cpp */; }; - ABC96BDA16FE18D00089A41B /* app.config.txt in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BC516FE18D00089A41B /* app.config.txt */; }; - ABC96BDB16FE18D00089A41B /* app.icf in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BC616FE18D00089A41B /* app.icf */; }; - ABC96BDC16FE18D00089A41B /* background-music-aac.wav in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BC716FE18D00089A41B /* background-music-aac.wav */; }; - ABC96BDD16FE18D00089A41B /* development.icf in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BC816FE18D00089A41B /* development.icf */; }; - ABC96BDE16FE18D00089A41B /* Marker Felt.ttf in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BCA16FE18D00089A41B /* Marker Felt.ttf */; }; - ABC96BDF16FE18D00089A41B /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BCC16FE18D00089A41B /* CloseNormal.png */; }; - ABC96BE016FE18D00089A41B /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BCD16FE18D00089A41B /* CloseSelected.png */; }; - ABC96BE116FE18D00089A41B /* Player.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BCE16FE18D00089A41B /* Player.png */; }; - ABC96BE216FE18D00089A41B /* Projectile.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BCF16FE18D00089A41B /* Projectile.png */; }; - ABC96BE316FE18D00089A41B /* Target.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD016FE18D00089A41B /* Target.png */; }; - ABC96BE416FE18D00089A41B /* pew-pew-lei.wav in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD116FE18D00089A41B /* pew-pew-lei.wav */; }; - ABC96BE516FE18D00089A41B /* app.icf in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD316FE18D00089A41B /* app.icf */; }; - ABC96BE616FE18D00089A41B /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD416FE18D00089A41B /* CloseNormal.png */; }; - ABC96BE716FE18D00089A41B /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD516FE18D00089A41B /* CloseSelected.png */; }; - ABC96BE816FE18D00089A41B /* Player.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD616FE18D00089A41B /* Player.png */; }; - ABC96BE916FE18D00089A41B /* Projectile.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD716FE18D00089A41B /* Projectile.png */; }; - ABC96BEA16FE18D00089A41B /* Target.png in Resources */ = {isa = PBXBuildFile; fileRef = ABC96BD816FE18D00089A41B /* Target.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 15C156B71683151A00D239F2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 1551A33F158F2AB200E66CFE; - remoteInfo = cocos2dx; - }; - 15C156B91683155000D239F2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 1551A33E158F2AB200E66CFE; - remoteInfo = cocos2dx; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2dx.xcodeproj; path = ../../../../cocos2dx/proj.mac/cocos2dx.xcodeproj; sourceTree = ""; }; - 41BC70AC15BF7CCE006A0A6C /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; - 41CD6C5115BF748C005E6F29 /* SampleGame.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleGame.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 41CD6C6215BF7574005E6F29 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; - 41CD6C6315BF7574005E6F29 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; - 41CD6C6415BF7574005E6F29 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 41CD6C6915BF7673005E6F29 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; - 41CD6C6B15BF7673005E6F29 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = ""; }; - 41CD6C6C15BF7673005E6F29 /* SampleGame_Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SampleGame_Info.plist; sourceTree = ""; }; - 41CD6C6D15BF7673005E6F29 /* SampleGame_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleGame_Prefix.pch; sourceTree = ""; }; - 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; - 41CD6C7215BF76FB005E6F29 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; - 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = ""; }; - 41CD6C7415BF76FB005E6F29 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../Classes/HelloWorldScene.h; sourceTree = ""; }; - 41CD6C8715BF7793005E6F29 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; - 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 41CD6C8915BF7793005E6F29 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; - 41CD6C8B15BF7793005E6F29 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; - 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; - 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; - 41CD6C9815BF77CE005E6F29 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; - AB63780016FE1A4C00079CB7 /* Export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; }; - AB63780116FE1A4C00079CB7 /* SimpleAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine.h; sourceTree = ""; }; - AB63781316FE1A4C00079CB7 /* CDAudioManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = ""; }; - AB63781416FE1A4C00079CB7 /* CDAudioManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = ""; }; - AB63781516FE1A4C00079CB7 /* CDConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = ""; }; - AB63781616FE1A4C00079CB7 /* CDOpenALSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = ""; }; - AB63781716FE1A4C00079CB7 /* CDOpenALSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = ""; }; - AB63781816FE1A4C00079CB7 /* CDXMacOSXSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDXMacOSXSupport.h; sourceTree = ""; }; - AB63781916FE1A4C00079CB7 /* CDXMacOSXSupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDXMacOSXSupport.mm; sourceTree = ""; }; - AB63781A16FE1A4C00079CB7 /* CocosDenshion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = ""; }; - AB63781B16FE1A4C00079CB7 /* CocosDenshion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = ""; }; - AB63781C16FE1A4C00079CB7 /* SimpleAudioEngine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleAudioEngine.mm; sourceTree = ""; }; - AB63781D16FE1A4C00079CB7 /* SimpleAudioEngine_objc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine_objc.h; sourceTree = ""; }; - AB63781E16FE1A4C00079CB7 /* SimpleAudioEngine_objc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine_objc.m; sourceTree = ""; }; - AB63789816FE1A8D00079CB7 /* GameOverScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameOverScene.h; path = ../Classes/GameOverScene.h; sourceTree = ""; }; - AB63789916FE1A8D00079CB7 /* GameOverScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GameOverScene.cpp; path = ../Classes/GameOverScene.cpp; sourceTree = ""; }; - ABC96BC516FE18D00089A41B /* app.config.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = app.config.txt; sourceTree = ""; }; - ABC96BC616FE18D00089A41B /* app.icf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = app.icf; sourceTree = ""; }; - ABC96BC716FE18D00089A41B /* background-music-aac.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "background-music-aac.wav"; sourceTree = ""; }; - ABC96BC816FE18D00089A41B /* development.icf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = development.icf; sourceTree = ""; }; - ABC96BCA16FE18D00089A41B /* Marker Felt.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Marker Felt.ttf"; sourceTree = ""; }; - ABC96BCC16FE18D00089A41B /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = ""; }; - ABC96BCD16FE18D00089A41B /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = ""; }; - ABC96BCE16FE18D00089A41B /* Player.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Player.png; sourceTree = ""; }; - ABC96BCF16FE18D00089A41B /* Projectile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Projectile.png; sourceTree = ""; }; - ABC96BD016FE18D00089A41B /* Target.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Target.png; sourceTree = ""; }; - ABC96BD116FE18D00089A41B /* pew-pew-lei.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "pew-pew-lei.wav"; sourceTree = ""; }; - ABC96BD316FE18D00089A41B /* app.icf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = app.icf; sourceTree = ""; }; - ABC96BD416FE18D00089A41B /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = ""; }; - ABC96BD516FE18D00089A41B /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = ""; }; - ABC96BD616FE18D00089A41B /* Player.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Player.png; sourceTree = ""; }; - ABC96BD716FE18D00089A41B /* Projectile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Projectile.png; sourceTree = ""; }; - ABC96BD816FE18D00089A41B /* Target.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Target.png; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 41851B8F15B93C32004083E9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 15C156BB1683155600D239F2 /* libcocos2dx.a in Frameworks */, - 41CD6C8F15BF7793005E6F29 /* AppKit.framework in Frameworks */, - 41CD6C9015BF7793005E6F29 /* AudioToolbox.framework in Frameworks */, - 41CD6C9115BF7793005E6F29 /* Cocoa.framework in Frameworks */, - 41CD6C9215BF7793005E6F29 /* CoreFoundation.framework in Frameworks */, - 41CD6C9315BF7793005E6F29 /* Foundation.framework in Frameworks */, - 41CD6C9415BF7793005E6F29 /* OpenAL.framework in Frameworks */, - 41CD6C9515BF7793005E6F29 /* OpenGL.framework in Frameworks */, - 41CD6C9615BF7793005E6F29 /* QuartzCore.framework in Frameworks */, - 41CD6C9915BF77CE005E6F29 /* libxml2.dylib in Frameworks */, - 41CD6C9A15BF77CE005E6F29 /* libz.dylib in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 15C156B11683151A00D239F2 /* Products */ = { - isa = PBXGroup; - children = ( - 15C156B81683151A00D239F2 /* libcocos2dx.a */, - ); - name = Products; - sourceTree = ""; - }; - 41851B8715B93C32004083E9 = { - isa = PBXGroup; - children = ( - 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */, - 41CD6C5D15BF750B005E6F29 /* Classes */, - AB6377E916FE1A4B00079CB7 /* CocosDenshion */, - 41CD6C5E15BF7514005E6F29 /* Frameworks */, - 41CD6C5F15BF7522005E6F29 /* mac */, - 41EFC1BB15BF7AC30083EA95 /* Products */, - ABC96BC316FE18D00089A41B /* Resources */, - ); - sourceTree = ""; - }; - 41CD6C5D15BF750B005E6F29 /* Classes */ = { - isa = PBXGroup; - children = ( - AB63789816FE1A8D00079CB7 /* GameOverScene.h */, - AB63789916FE1A8D00079CB7 /* GameOverScene.cpp */, - 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */, - 41CD6C7215BF76FB005E6F29 /* AppDelegate.h */, - 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */, - 41CD6C7415BF76FB005E6F29 /* HelloWorldScene.h */, - ); - name = Classes; - sourceTree = ""; - }; - 41CD6C5E15BF7514005E6F29 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 41CD6C8715BF7793005E6F29 /* AppKit.framework */, - 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */, - 41CD6C8915BF7793005E6F29 /* Cocoa.framework */, - 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */, - 41CD6C8B15BF7793005E6F29 /* Foundation.framework */, - 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */, - 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */, - 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */, - 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */, - 41CD6C9815BF77CE005E6F29 /* libz.dylib */, - ); - name = Frameworks; - sourceTree = ""; - }; - 41CD6C5F15BF7522005E6F29 /* mac */ = { - isa = PBXGroup; - children = ( - 41CD6C6215BF7574005E6F29 /* AppController.h */, - 41CD6C6315BF7574005E6F29 /* AppController.mm */, - 41CD6C6415BF7574005E6F29 /* main.m */, - 41BC70AC15BF7CCE006A0A6C /* Icon.icns */, - 41CD6C6715BF7673005E6F29 /* en.lproj */, - 41CD6C6C15BF7673005E6F29 /* SampleGame_Info.plist */, - 41CD6C6D15BF7673005E6F29 /* SampleGame_Prefix.pch */, - ); - name = mac; - sourceTree = ""; - }; - 41CD6C6715BF7673005E6F29 /* en.lproj */ = { - isa = PBXGroup; - children = ( - 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */, - 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */, - ); - path = en.lproj; - sourceTree = ""; - }; - 41EFC1BB15BF7AC30083EA95 /* Products */ = { - isa = PBXGroup; - children = ( - 41CD6C5115BF748C005E6F29 /* SampleGame.app */, - ); - name = Products; - sourceTree = ""; - }; - AB6377E916FE1A4B00079CB7 /* CocosDenshion */ = { - isa = PBXGroup; - children = ( - AB6377FF16FE1A4C00079CB7 /* include */, - AB63781216FE1A4C00079CB7 /* mac */, - ); - name = CocosDenshion; - path = ../../../../CocosDenshion; - sourceTree = ""; - }; - AB6377FF16FE1A4C00079CB7 /* include */ = { - isa = PBXGroup; - children = ( - AB63780016FE1A4C00079CB7 /* Export.h */, - AB63780116FE1A4C00079CB7 /* SimpleAudioEngine.h */, - ); - path = include; - sourceTree = ""; - }; - AB63781216FE1A4C00079CB7 /* mac */ = { - isa = PBXGroup; - children = ( - AB63781316FE1A4C00079CB7 /* CDAudioManager.h */, - AB63781416FE1A4C00079CB7 /* CDAudioManager.m */, - AB63781516FE1A4C00079CB7 /* CDConfig.h */, - AB63781616FE1A4C00079CB7 /* CDOpenALSupport.h */, - AB63781716FE1A4C00079CB7 /* CDOpenALSupport.m */, - AB63781816FE1A4C00079CB7 /* CDXMacOSXSupport.h */, - AB63781916FE1A4C00079CB7 /* CDXMacOSXSupport.mm */, - AB63781A16FE1A4C00079CB7 /* CocosDenshion.h */, - AB63781B16FE1A4C00079CB7 /* CocosDenshion.m */, - AB63781C16FE1A4C00079CB7 /* SimpleAudioEngine.mm */, - AB63781D16FE1A4C00079CB7 /* SimpleAudioEngine_objc.h */, - AB63781E16FE1A4C00079CB7 /* SimpleAudioEngine_objc.m */, - ); - path = mac; - sourceTree = ""; - }; - ABC96BC316FE18D00089A41B /* Resources */ = { - isa = PBXGroup; - children = ( - ABC96BC516FE18D00089A41B /* app.config.txt */, - ABC96BC616FE18D00089A41B /* app.icf */, - ABC96BC716FE18D00089A41B /* background-music-aac.wav */, - ABC96BC816FE18D00089A41B /* development.icf */, - ABC96BC916FE18D00089A41B /* fonts */, - ABC96BCB16FE18D00089A41B /* hd */, - ABC96BD116FE18D00089A41B /* pew-pew-lei.wav */, - ABC96BD216FE18D00089A41B /* sd */, - ); - name = Resources; - path = ../Resources; - sourceTree = ""; - }; - ABC96BC916FE18D00089A41B /* fonts */ = { - isa = PBXGroup; - children = ( - ABC96BCA16FE18D00089A41B /* Marker Felt.ttf */, - ); - path = fonts; - sourceTree = ""; - }; - ABC96BCB16FE18D00089A41B /* hd */ = { - isa = PBXGroup; - children = ( - ABC96BCC16FE18D00089A41B /* CloseNormal.png */, - ABC96BCD16FE18D00089A41B /* CloseSelected.png */, - ABC96BCE16FE18D00089A41B /* Player.png */, - ABC96BCF16FE18D00089A41B /* Projectile.png */, - ABC96BD016FE18D00089A41B /* Target.png */, - ); - path = hd; - sourceTree = ""; - }; - ABC96BD216FE18D00089A41B /* sd */ = { - isa = PBXGroup; - children = ( - ABC96BD316FE18D00089A41B /* app.icf */, - ABC96BD416FE18D00089A41B /* CloseNormal.png */, - ABC96BD516FE18D00089A41B /* CloseSelected.png */, - ABC96BD616FE18D00089A41B /* Player.png */, - ABC96BD716FE18D00089A41B /* Projectile.png */, - ABC96BD816FE18D00089A41B /* Target.png */, - ); - path = sd; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 41851B9115B93C32004083E9 /* SampleGame */ = { - isa = PBXNativeTarget; - buildConfigurationList = 41851BB015B93C33004083E9 /* Build configuration list for PBXNativeTarget "SampleGame" */; - buildPhases = ( - 41851B8E15B93C32004083E9 /* Sources */, - 41851B8F15B93C32004083E9 /* Frameworks */, - 41851B9015B93C32004083E9 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 15C156BA1683155000D239F2 /* PBXTargetDependency */, - ); - name = SampleGame; - productName = Paralaxer; - productReference = 41CD6C5115BF748C005E6F29 /* SampleGame.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 41851B8915B93C32004083E9 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0420; - ORGANIZATIONNAME = "Bullets in a Burning Box, Inc."; - }; - buildConfigurationList = 41851B8C15B93C32004083E9 /* Build configuration list for PBXProject "SampleGame" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 41851B8715B93C32004083E9; - productRefGroup = 41851B8715B93C32004083E9; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 15C156B11683151A00D239F2 /* Products */; - ProjectRef = 15C156B01683151A00D239F2 /* cocos2dx.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 41851B9115B93C32004083E9 /* SampleGame */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 15C156B81683151A00D239F2 /* libcocos2dx.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libcocos2dx.a; - remoteRef = 15C156B71683151A00D239F2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 41851B9015B93C32004083E9 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 41CD6C6E15BF7673005E6F29 /* InfoPlist.strings in Resources */, - 41CD6C6F15BF7673005E6F29 /* MainMenu.xib in Resources */, - 41BC70AD15BF7CCE006A0A6C /* Icon.icns in Resources */, - ABC96BDA16FE18D00089A41B /* app.config.txt in Resources */, - ABC96BDB16FE18D00089A41B /* app.icf in Resources */, - ABC96BDC16FE18D00089A41B /* background-music-aac.wav in Resources */, - ABC96BDD16FE18D00089A41B /* development.icf in Resources */, - ABC96BDE16FE18D00089A41B /* Marker Felt.ttf in Resources */, - ABC96BDF16FE18D00089A41B /* CloseNormal.png in Resources */, - ABC96BE016FE18D00089A41B /* CloseSelected.png in Resources */, - ABC96BE116FE18D00089A41B /* Player.png in Resources */, - ABC96BE216FE18D00089A41B /* Projectile.png in Resources */, - ABC96BE316FE18D00089A41B /* Target.png in Resources */, - ABC96BE416FE18D00089A41B /* pew-pew-lei.wav in Resources */, - ABC96BE516FE18D00089A41B /* app.icf in Resources */, - ABC96BE616FE18D00089A41B /* CloseNormal.png in Resources */, - ABC96BE716FE18D00089A41B /* CloseSelected.png in Resources */, - ABC96BE816FE18D00089A41B /* Player.png in Resources */, - ABC96BE916FE18D00089A41B /* Projectile.png in Resources */, - ABC96BEA16FE18D00089A41B /* Target.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 41851B8E15B93C32004083E9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 41CD6C6515BF7574005E6F29 /* AppController.mm in Sources */, - 41CD6C6615BF7574005E6F29 /* main.m in Sources */, - 41CD6C7515BF76FB005E6F29 /* AppDelegate.cpp in Sources */, - 41CD6C7615BF76FB005E6F29 /* HelloWorldScene.cpp in Sources */, - AB63787616FE1A4C00079CB7 /* CDAudioManager.m in Sources */, - AB63787716FE1A4C00079CB7 /* CDOpenALSupport.m in Sources */, - AB63787816FE1A4C00079CB7 /* CDXMacOSXSupport.mm in Sources */, - AB63787916FE1A4C00079CB7 /* CocosDenshion.m in Sources */, - AB63787A16FE1A4C00079CB7 /* SimpleAudioEngine.mm in Sources */, - AB63787B16FE1A4C00079CB7 /* SimpleAudioEngine_objc.m in Sources */, - AB63789A16FE1A8D00079CB7 /* GameOverScene.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 15C156BA1683155000D239F2 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = cocos2dx; - targetProxy = 15C156B91683155000D239F2 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 41CD6C6915BF7673005E6F29 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 41CD6C6B15BF7673005E6F29 /* en */, - ); - name = MainMenu.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 41851BAE15B93C33004083E9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.6; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 41851BAF15B93C33004083E9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.6; - SDKROOT = macosx; - }; - name = Release; - }; - 41851BB115B93C33004083E9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = SampleGame_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - CC_TARGET_OS_MAC, - "DEBUG=1", - USE_FILE32API, - "$(inherited)", - ); - GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/include/libxml2/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - ); - INFOPLIST_FILE = SampleGame_Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../CocosDenshion/third_party/blackberry/libraries/armle-v7\"", - "\"$(SRCROOT)/../../../../CocosDenshion/third_party/blackberry/libraries/x86\"", - ); - MACOSX_DEPLOYMENT_TARGET = 10.7; - OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = SampleGame; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 41851BB215B93C33004083E9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_CXX_LIBRARY = "libc++"; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_INLINES_ARE_PRIVATE_EXTERN = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = SampleGame_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = ( - USE_FILE32API, - CC_TARGET_OS_MAC, - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - HEADER_SEARCH_PATHS = ( - "\"$(SDKROOT)/usr/include/libxml2/\"", - "\"$(SRCROOT)/../../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../../cocos2dx\"", - "\"$(SRCROOT)/../../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../../cocos2dx/kazmath/include\"", - ); - INFOPLIST_FILE = SampleGame_Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../CocosDenshion/third_party/blackberry/libraries/armle-v7\"", - "\"$(SRCROOT)/../../../../CocosDenshion/third_party/blackberry/libraries/x86\"", - ); - MACOSX_DEPLOYMENT_TARGET = 10.7; - OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = SampleGame; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 41851B8C15B93C32004083E9 /* Build configuration list for PBXProject "SampleGame" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 41851BAE15B93C33004083E9 /* Debug */, - 41851BAF15B93C33004083E9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 41851BB015B93C33004083E9 /* Build configuration list for PBXNativeTarget "SampleGame" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 41851BB115B93C33004083E9 /* Debug */, - 41851BB215B93C33004083E9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 41851B8915B93C32004083E9 /* Project object */; -} diff --git a/samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 54782e32fd..0000000000 --- a/samples/Cpp/SimpleGame/proj.mac/SampleGame.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded - - - diff --git a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id index d02fdd589e..1710ee06ca 100644 --- a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -3e7005e2a5b2a481ae8a8925b1188ccb77216e52 \ No newline at end of file +797feb376f901c35325d28f6898780cf162a938f \ No newline at end of file From ec5edeb8f673ff43991f1304eab2e1860d64e57c Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 2 Jul 2013 10:42:50 +0800 Subject: [PATCH 42/43] issue #2325: Updating title for Mac projects. --- samples/Javascript/CocosDragonJS/proj.mac/AppController.mm | 4 ++-- samples/Javascript/CrystalCraze/proj.mac/AppController.mm | 4 ++-- samples/Javascript/MoonWarriors/proj.mac/AppController.mm | 4 ++-- samples/Javascript/TestJavascript/proj.mac/AppController.mm | 2 +- samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/Javascript/CocosDragonJS/proj.mac/AppController.mm b/samples/Javascript/CocosDragonJS/proj.mac/AppController.mm index 43d05cf28a..7339f0ccbd 100644 --- a/samples/Javascript/CocosDragonJS/proj.mac/AppController.mm +++ b/samples/Javascript/CocosDragonJS/proj.mac/AppController.mm @@ -36,7 +36,7 @@ // create the window // note that using NSResizableWindowMask causes the window to be a little // smaller and therefore ipad graphics are not loaded - NSRect rect = NSMakeRect(100, 100, 800, 450); + NSRect rect = NSMakeRect(100, 100, 480, 720); window = [[NSWindow alloc] initWithContentRect:rect styleMask:( NSClosableWindowMask | NSTitledWindowMask ) backing:NSBackingStoreBuffered @@ -58,7 +58,7 @@ // set window parameters [window becomeFirstResponder]; [window setContentView:glView]; - [window setTitle:@"TestCpp"]; + [window setTitle:@"JS CocosDragon"]; [window makeKeyAndOrderFront:self]; [window setAcceptsMouseMovedEvents:NO]; diff --git a/samples/Javascript/CrystalCraze/proj.mac/AppController.mm b/samples/Javascript/CrystalCraze/proj.mac/AppController.mm index 43d05cf28a..3bd0be382b 100644 --- a/samples/Javascript/CrystalCraze/proj.mac/AppController.mm +++ b/samples/Javascript/CrystalCraze/proj.mac/AppController.mm @@ -36,7 +36,7 @@ // create the window // note that using NSResizableWindowMask causes the window to be a little // smaller and therefore ipad graphics are not loaded - NSRect rect = NSMakeRect(100, 100, 800, 450); + NSRect rect = NSMakeRect(100, 100, 480, 720); window = [[NSWindow alloc] initWithContentRect:rect styleMask:( NSClosableWindowMask | NSTitledWindowMask ) backing:NSBackingStoreBuffered @@ -58,7 +58,7 @@ // set window parameters [window becomeFirstResponder]; [window setContentView:glView]; - [window setTitle:@"TestCpp"]; + [window setTitle:@"JS CrystalCraze"]; [window makeKeyAndOrderFront:self]; [window setAcceptsMouseMovedEvents:NO]; diff --git a/samples/Javascript/MoonWarriors/proj.mac/AppController.mm b/samples/Javascript/MoonWarriors/proj.mac/AppController.mm index 43d05cf28a..6e5fe701d6 100644 --- a/samples/Javascript/MoonWarriors/proj.mac/AppController.mm +++ b/samples/Javascript/MoonWarriors/proj.mac/AppController.mm @@ -36,7 +36,7 @@ // create the window // note that using NSResizableWindowMask causes the window to be a little // smaller and therefore ipad graphics are not loaded - NSRect rect = NSMakeRect(100, 100, 800, 450); + NSRect rect = NSMakeRect(100, 100, 320, 480); window = [[NSWindow alloc] initWithContentRect:rect styleMask:( NSClosableWindowMask | NSTitledWindowMask ) backing:NSBackingStoreBuffered @@ -58,7 +58,7 @@ // set window parameters [window becomeFirstResponder]; [window setContentView:glView]; - [window setTitle:@"TestCpp"]; + [window setTitle:@"JS MoonWarriors"]; [window makeKeyAndOrderFront:self]; [window setAcceptsMouseMovedEvents:NO]; diff --git a/samples/Javascript/TestJavascript/proj.mac/AppController.mm b/samples/Javascript/TestJavascript/proj.mac/AppController.mm index 43d05cf28a..bee7f8375c 100644 --- a/samples/Javascript/TestJavascript/proj.mac/AppController.mm +++ b/samples/Javascript/TestJavascript/proj.mac/AppController.mm @@ -58,7 +58,7 @@ // set window parameters [window becomeFirstResponder]; [window setContentView:glView]; - [window setTitle:@"TestCpp"]; + [window setTitle:@"JS Test"]; [window makeKeyAndOrderFront:self]; [window setAcceptsMouseMovedEvents:NO]; diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm b/samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm index 43d05cf28a..382c1bd000 100644 --- a/samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm +++ b/samples/Javascript/WatermelonWithMe/proj.mac/AppController.mm @@ -58,7 +58,7 @@ // set window parameters [window becomeFirstResponder]; [window setContentView:glView]; - [window setTitle:@"TestCpp"]; + [window setTitle:@"JS WatermelonWithMe"]; [window makeKeyAndOrderFront:self]; [window setAcceptsMouseMovedEvents:NO]; From eeff9b3d75469690195afb45a305ee30f140cb06 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 2 Jul 2013 10:43:21 +0800 Subject: [PATCH 43/43] issue #2325: [MAC] Adding missing resources for TestCpp. --- samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id index 1710ee06ca..82ef08f00f 100644 --- a/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/samples-mac.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -797feb376f901c35325d28f6898780cf162a938f \ No newline at end of file +d8108ac4fae1c2dd8cd94ebdb89b0faacfc990f7 \ No newline at end of file