summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [REBASE] Add missing return value set in success pathwip/xulrunner-2-rebase4Colin Walters2010-10-291-2/+6
|
* Port more custom functions to be "fast" nativesColin Walters2010-10-297-171/+181
| | | | | These were missed in the big conversion to fast natives in c78646ed3f24bd915c7cfe4aca
* Use fast constructors if availableColin Walters2010-10-2928-280/+323
| | | | | | | | | | "slow" natives were removed in the mozjs commit: http://hg.mozilla.org/mozilla-central/rev/66c8ad02543b In order to work with both, add compatibility macros to compat.h, and also update the ones in jsapi-util.h to use these. Port all constructors to use these macros.
* compat.h: Don't include config.h, instead do inspection of jsapi.hColin Walters2010-10-291-8/+24
| | | | | This allows us to sanely install this header file, which will allow us to make jsapi-util.h depend on it.
* Handle JS_InitClass throwing an error more cleanlyColin Walters2010-10-292-2/+5
|
* boxed: Avoid recursion and conversion during constructionColin Walters2010-10-291-14/+9
| | | | | | | | | | | | boxed_new previously called gjs_invoke_c_function_uncached() on the first C constructor it found; this recursed and we would wrap the boxed, creating a JSObject etc., only to unwrap it and get the native pointer again. For a reason I'm not going to debug in depth, this started failing with xulrunner 2. Regardless, we should avoid this insanity and call the C function more directly with g_function_info_invoke, which gives us the raw pointer we wanted anyways.
* Switch from JS_ARGV_CALLEE to JS_CALLEEColin Walters2010-10-291-1/+1
|
* Adapt to JS_GetFrameThis API changeColin Walters2010-10-292-0/+14
| | | | | | See upstraem commit 38cbd4e02afc. We can detect the difference by checking for JS_EndPC, which was introduced around the same time.
* Bump required glib to 2.18Colin Walters2010-10-292-9/+1
| | | | | | The verison of g-i we require itself needs 2.24. Now, I'm not actually going to claim we work with 2.18, but doing this allows me to drop the glib stuff from compat.h at least.
* Makefile-test.am: Ensure we build dependencies for gdb-check tooColin Walters2010-10-291-3/+5
| | | | We need the .typelibs too.
* testEverythingEncapsulated: Add an additional assertionColin Walters2010-10-291-0/+1
| | | | We fail this check in my current wip/xulrunner-2 branch.
* tests: Don't time out when run under gdbColin Walters2010-10-282-2/+10
| | | | | | | Have the test timeout behavior be controlled by the GJS_TEST_TIMEOUT environment variable, and the "gdb-check" target set that to 0. This ensures the process won't suicide when you're in the middle of investigating a crash.
* Fix some compilation warningsColin Walters2010-10-282-2/+1
|
* Use AM_SILENT_RULESColin Walters2010-10-281-0/+1
|
* Post-release version bumpOwen W. Taylor2010-10-271-1/+1
|
* console: Only use basic GJS API <gjs/gjs.h> and link against GLibGJS_0_7_5Colin Walters2010-10-253-12/+7
| | | | | | | | | | | | | | We need to link explicitly against GObject, since we use The commit 25681375970de9 intentionally removed the dependency on all the "internal" GJS libraries like libmozjs.so from gjs-console, but first, we need to explicitly link against libgobject, because we do use it. Secondly, to make things more clear here, drop the random unnecessary use of "internal" GJS API like gjs_debug and gjs_memory_report ( the memory report could be an environment variable). https://bugzilla.gnome.org/show_bug.cgi?id=632844
* Comment why we need to search through GType data in object invoke pathColin Walters2010-10-221-0/+5
|
* Add missing install rule for previous commitColin Walters2010-10-211-0/+1
|
* Separate "basic" API from "embedder/module" APIColin Walters2010-10-2152-74/+116
| | | | | | | | | | | | | | | | | | | | | | Previously <gjs/gjs.h> pulled in a lot of stuff, and in particular, <gjs/jsapi-util.h>, which in turn required <jsapi.h>. For a simple app that wants to embed GJS we should not be pulling that in. So <gjs/gjs.h> is now the "simple" API that actually just includes <gjs/context.h>, suitable for creating a context and calling eval(). <gjs/gjs-module.h> is now equivalent to the old <gjs/gjs.h>, it pulls in the world. Also, create a corresponding .pc file, gjs-internals-1.0.pc. This one includes mozjs as Requires, and adds the requisite Cflags. For gjs-1.0.pc, change the Requires to simply be gobject-2.0. Conceptually, a gjs-devel RPM should not Require gobject-introspection-devel or xulrunner-devel, and a simple embedder program just using gjs_context_new()/gjs_context_eval() should not have DT_NEEDED on gobject-introspection-1.0.so or mozjs.so. https://bugzilla.gnome.org/show_bug.cgi?id=632795
* JS_IsNativeFrame replaced by JS_IsScriptFrameSardem FF72010-10-202-0/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=632485
* Port all functions to JSFUN_FAST_NATIVEColin Walters2010-10-2010-300/+312
| | | | | | | | | "slow" natives have been removed in mozjs; this prepares us for a patch which adapts to their removal. See upstream commit: http://hg.mozilla.org/mozilla-central/rev/66c8ad02543b https://bugzilla.gnome.org/show_bug.cgi?id=632159
* Conditionally check for JS_FreezeObjectColin Walters2010-10-202-1/+4
| | | | This ensures we work with a pre-2.0 snapshot.
* Replace JS_SealObject by JS_FreezeObjectSardem FF72010-10-201-0/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=632529
* Base version detection on mozilla-js.pc versionColin Walters2010-10-204-23/+15
| | | | | Remove the base library checks, and just differentiate between xulrunner 1.9.x and 2.
* Post-release version bumpOwen W. Taylor2010-10-041-1/+1
|
* Bump version to 0.7.3GJS_0_7_4Owen W. Taylor2010-10-041-2/+2
| | | | Also switch to building a dist tarball in bzip2 format.
* Remove test typelibs and girs during make cleanOwen W. Taylor2010-10-041-0/+4
| | | | Add Regress and GIMarshallingTests typelibs and girs to CLEANFILES
* xulrunner < 1.9.3 compat: Define INT_TO_JSIDColin Walters2010-09-301-0/+1
| | | | Taken from the xulrunner 1.9.2 headers.
* Use JS_SetRuntimePrivate() rather than GDataset for runtime dataOwen W. Taylor2010-09-303-47/+68
| | | | | | | | | | | | GDataset is slow - it requires thread locking and hash table lookups. Since we don't support foreign JSRuntimes at the moment we can use JS_SetRuntimePrivate() which will have better performance. The public API functions gjs_runtime_get/set_data() are removed; if they were being used outside of GJS the users will have to track their data themselves. https://bugzilla.gnome.org/show_bug.cgi?id=630964
* Optimize pushing the current contextOwen W. Taylor2010-09-301-6/+30
| | | | | | | | | For gjs_runtime_push_context() keep track of the number of times an identical context has been pushed. This allows avoiding allocating a GSList node for the most common case of repeatedly pushing the default context. https://bugzilla.gnome.org/show_bug.cgi?id=630964
* Adapt tests to removals from Regress test suiteOwen W. Taylor2010-09-301-5/+0
| | | | | | | In values with a transfer != None are still supported, but no longer tested because using them is discouraged. https://bugzilla.gnome.org/show_bug.cgi?id=630963
* Use separate SetPrototype() and SetParent callsColin Walters2010-09-304-6/+24
| | | | | | | | | In XULRunner 1.9.3, passing a custom prototype or parent to JS_ConstructObject for Object fails, so work around with a separate calls to SetPrototype()/SetParent(). See https://bugzilla.mozilla.org/show_bug.cgi?id=599651. https://bugzilla.gnome.org/show_bug.cgi?id=622896
* Replace "load context" with a "import global"Owen W. Taylor2010-09-3019-357/+205
| | | | | | | | | | | | | | | | | The idea of the load context was to have a single context where modules and native were defined and shared between different JSContexts in the same runtime. But this caused context switching when loading modules, which isn't very tested in Spidermonkey and caused lots of use of gjs_move_exception() and other complications. Instead, switch to the idea of a "import global" object; this is the global object that is used in the scope chain for modules, and is also where the constructors for our native classes are stored, allowing native classes to be shared between different contexts. https://bugzilla.gnome.org/show_bug.cgi?id=622896
* Replace call context with a concept of "current context"Owen W. Taylor2010-09-3010-104/+224
| | | | | | | | | | | | | | | | | | | | | | | Using multiple nested contexts on the same thread isn't normal usage of Spidermonkey and triggers bugs in Spidermonkey that might not be caught in upstream testing. (It is theoretically supported, to at least some extent.) When calling a callback, the best context to use is the current context. If that's not available, then using the default context from the GjsContext is usually sensible. Add functions: gjs_runtime_push_context() gjs_runtime_pop_context() gjs_runtime_get_current_context() One potential concern here is the extensive use of GDataset to get data from a context, which involves locking overhead and hash table lookups and can be slow; since we can't use GJS with multiple JS_Runtimes in the same process due to the limitations of toggle references, perhaps we should enforce that and use global variables. https://bugzilla.gnome.org/show_bug.cgi?id=622896
* importer: JSID != JSVALColin Walters2010-09-301-2/+2
| | | | | | | Also, the first entry should be JSID(0) technically, to indicate "unknown length". https://bugzilla.gnome.org/show_bug.cgi?id=622896
* importer: Don't crash if we're enumerating the prototypeColin Walters2010-09-301-0/+3
| | | | | | | | | | | | Apparently enumeration changed so that (for v in importer) now *also* loops over the prototype properties. However, the code didn't handle this, because the _INIT case for prototype just stuffed JSVAL_NULL into the custom data. Handle this by simply ignoring JSVAL_NULL in ENUMERATE_NEXT, and finish the iteration. https://bugzilla.gnome.org/show_bug.cgi?id=622896
* importer: Handle JSENUMERATE_INIT_ALLColin Walters2010-09-302-0/+5
| | | | | | | We don't have any non-enumerable properties on the importer object, so just handle this like JSENUMERATE_INIT. https://bugzilla.gnome.org/show_bug.cgi?id=622896
* Cast users of JS_EnterLocalRootScopeColin Walters2010-09-304-6/+6
| | | | | | | | | | | In Xulrunner 1.9.3, this is now a no-op. See upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=519949 Now in theory, we should be checking the return value and handling that. I wrote a nontrivial patch to do this, but decided it wasn't worth it, since in newer xulrunners it's just pointless code spaghetti, and in older, it's not like we're really going to go OOM in reality.
* xulrunner 1.9.3: Drop use of JS_PushArgumentsVAMaxim Ermilov2010-09-302-44/+0
| | | | | | | | JS_PushArgumentsVA vanished in 1.9.3; since it was only used in debugger.c, which was itself just removed, delete it. Separated from a larger patch by Colin Walters <walters@verbum.org>
* xulrunner 1.9.3: Use JS_NewGlobalObject if availableColin Walters2010-09-306-29/+50
| | | | | | | | | | | | In 1.9.3, we need to explicitly say when we're making the global object. Clean this up by introducing a wrapper function; while we're at it, also call JS_InitStandardClasses here since everything else creating a global did too. Note that rooting the global object is not necessary, so remove that. From a grep of the sources (going back to at least 1.9.2): ./src/jsgc.cpp: if (acx->globalObject && !JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL)) ./src/jsgc.cpp: JS_CALL_OBJECT_TRACER(trc, acx->globalObject, "global object");
* xulrunner 1.9.3: Fix assumption that jsid == jsvalColin Walters2010-09-3017-93/+114
| | | | | | | | | | The two have always been conceptually distinct types. Even in 1.9.3, they are still the same in implementation, but to avoid a pile of warnings, we should avoid confusing them. Unfortunately, even the SpiderMonkey docs are wrong in a few places, so gjs' code confusing them is understandable. Anyways, fix up places that made this assumption.
* xulrunner 1.9.3: Use JS_AddValueRoot if availableColin Walters2010-09-3016-110/+131
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=622896
* xulrunner 1.9.3: Consistently include compat.hColin Walters2010-09-3046-0/+47
|
* Remove -Wfloat-equalOwen W. Taylor2010-09-301-1/+1
| | | | | | | | | | While -Wfloat-equal warns on dubious constructs, it also warns on valid constructs, and there is no way to suppress the warning. In particular, it's currently warning for every single file because of JS_CANONICALIZE_NAN() in the xulrunner headers. https://bugzilla.gnome.org/show_bug.cgi?id=630853
* xulrunner 1.9.3: Fix up assumption JSVAL_NULL == NULLColin Walters2010-09-232-5/+5
| | | | | | Use C NULL where it's expected, not JSVAL_NULL. https://bugzilla.gnome.org/show_bug.cgi?id=622896
* xulrunner 1.9.3: Remove callers of JS_NewDoubleValueColin Walters2010-09-233-4/+4
| | | | | | | This function isn't intended for normal numeric conversions: see https://developer.mozilla.org/en/JS_NewNumberValue https://bugzilla.gnome.org/show_bug.cgi?id=622896
* jsapi-util-string: Add missing JS_EndRequestColin Walters2010-09-231-0/+1
| | | | | | Found by visual inspection. https://bugzilla.gnome.org/show_bug.cgi?id=630423
* jsapi-util-error: Add missing JS_EndRequest pairColin Walters2010-09-231-0/+1
| | | | | | Just found by visual auditing while looking for mismatched pairs. https://bugzilla.gnome.org/show_bug.cgi?id=630423
* closure: Add missing JS_EndRequest in error pathColin Walters2010-09-231-1/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=630423
* dbus: Use hex in string literals instead of deprecated octal syntaxColin Walters2010-09-231-1/+1
| | | | | | Octal appears to be deprecated in XULRunner 1.9.3. https://bugzilla.gnome.org/show_bug.cgi?id=630416