1. 01 Dec, 2018 17 commits
    • Philip Chimento's avatar
      release: More release notes · dc51d506
      Philip Chimento authored
      Copy the bullet points from the master NEWS so they are easier to cross
      reference, and include a blurb about the Big Hammer.
    • Marco Trevisan's avatar
      release: Prepare for 1.52.5 · 8f827635
      Marco Trevisan authored and Philip Chimento's avatar Philip Chimento committed
    • Philip Chimento's avatar
      object: Avoid segfault in debug mode · 2a87c22d
      Philip Chimento authored
      This null pointer access could only happen when debug logging was turned
      on, but nonetheless it can be avoided easily.
    • Philip Chimento's avatar
      object: Fix logging statement · 2ad75b9d
      Philip Chimento authored
      Unreviewed, pushing to fix logging build.
    • Philip Chimento's avatar
      object: Move context dispose notify to GjsContext · bca20b4f
      Philip Chimento authored
      This allows us to not deal with an "ensure_..." function, since the
      context dispose notify callback will always be there.
      See #144.
    • Carlos Garnacho's avatar
      js: Schedule a compacting GC on gjs_gc_if_needed() · 70159e10
      Carlos Garnacho authored and Philip Chimento's avatar Philip Chimento committed
      JS_GC() during gjs regular operation will indeed end up scheduling objects
      for destruction in a timely manner. However on long lived applications
      object creation/destruction patterns may leave uneven gaps in JS heap
      arenas that get harder and harder to reuse. Side effects may include more
      expensive/infructuous GC-ing and increased memory usage.
      Introduce the compacting GC [1], a (slightly more expensive) GC mode that
      is able to transparently compact underused arenas. This mode does not
      happen by default, Firefox explicitly triggers it from DOM code on user
      inactivity and memory pressure situations.
      We can do similarly, one ideal place to call this is gjs_gc_if_needed(),
      since we are interested on the application giving up as many pages as it
      can. This keeps memory fragmentation on hold, helping gnome-shell memory
      usage stay within certain parameters on long running sessions.
      [1] https://hacks.mozilla.org/2015/07/compacting-garbage-collection-in-spidermonkey/
      [skip cpplint] because of having to include jsapi-wrapper before
      SpiderMonkey headers.
      Closes: #151
      (cherry picked from commit 2ee0b385)
    • Carlos Garnacho's avatar
      util-root: Allow null notification functions when rooting · 1c011c3c
      Carlos Garnacho authored and Philip Chimento's avatar Philip Chimento committed
      This basically drops the safety net for whenever the context goes
      away, and potentially leaking.. However unconditionally adding this
      weak ref may result in quite expensive in memory relocations, the
      caller may handle this in a smarter way.
      Currently the only paths triggering this are in test folder, in
      tests not explicitly tracking dispose behavior, so it may be "fine"
      to leave as is.
      Closes: #144
      (cherry picked from commit 99032dc3)
    • Carlos Garnacho's avatar
      object: Set up a single weak ref on the context · e5742d55
      Carlos Garnacho authored and Philip Chimento's avatar Philip Chimento committed
      Instead of setting up a callback when rooting GjsMaybeOwned objects,
      set up a single weak ref on the GjsContext to reset all currently
      rooted objects by iterating the ObjectInstance list.
      Closes: #144
      (cherry picked from commit 0f5c81e0)
    • Marco Trevisan's avatar
      gtype: delete heap wrappers on gtype removal · 12172aa3
      Marco Trevisan authored and Philip Chimento's avatar Philip Chimento committed
      (cherry picked from commit 926be39c)
    • Marco Trevisan's avatar
      context: use timeout with seconds to schedule a gc trigger · a472883f
      Marco Trevisan authored and Philip Chimento's avatar Philip Chimento committed
      We can use lower granularity as we care about seconds anyway
      (cherry picked from commit 0fb9228d)
    • Daniel van Vugt's avatar
      context: Defer and therefore batch forced GC runs · bf12d276
      Daniel van Vugt authored and Philip Chimento's avatar Philip Chimento committed
      Since commit e9e96955, forced GC runs get queued very often in some
      cases. For example, during the gnome-shell icon spring animation around
      60% of gnome-shell's CPU time was spent in `trigger_gc_if_needed`.
      That's too much.
      We now defer the forced GC runs by 10 seconds, which provides two
      significant performance benefits:
        1. Animations triggering garbage collection are unlikely to have their
           performance adversely affected by the run because the animation
           will be finished before it starts.
        2. The total number of garbage collection runs is much lower because
           they're more likely to have been batched into the same run.
      This has the observed benefit, for example, of reducing the CPU usage
      of the gnome-shell icon spring animation from 78% to 47% on an i7-7700
      (a 40% relative reduction).
      Closes: gnome-shell#582
      (cherry picked from commit e62ee84a)
    • Carlos Garnacho's avatar
      context: Ensure force_gc flag is not lost if the idle is scheduled · 1c865703
      Carlos Garnacho authored and Philip Chimento's avatar Philip Chimento committed
      If the first caller that triggers the idle happens to be non-forcing,
      all later forcing calls would be ignored.
      Closes: #150
      (cherry picked from commit c0420db9)
    • Georges Basile Stavracas Neto's avatar
      object: Queue a forced GC when toggling down · cd17a773
      Georges Basile Stavracas Neto authored and Philip Chimento's avatar Philip Chimento committed
      During a GC, the collector asks each object which other
      objects that it wants to hold on to so if there's an entire
      section of the heap graph that's not connected to anything
      else, and not reachable from the root set, then it can be
      trashed all at once.
      GObjects, however, don't work like that, there's only a
      reference count but no notion of who owns the reference so,
      a JS object that's proxying a GObject is unconditionally held
      alive as long as the GObject has >1 references.
      Since we cannot know how many more wrapped GObjects are going
      be marked for garbage collection after the owner is destroyed,
      always queue a garbage collection when a toggle reference goes
      Issue: #140
      (cherry picked from commit e9e96955)
    • Georges Basile Stavracas Neto's avatar
      context: Add API to force GC schedule · dca70cc5
      Georges Basile Stavracas Neto authored and Philip Chimento's avatar Philip Chimento committed
      There are situations where we cannot run the
      GC right away, but we also cannot ignore the
      need of running it.
      For those cases, add a new private function
      that forces GC to happen on idle.
      (cherry picked from commit 09029851)
    • Georges Basile Stavracas Neto's avatar
      object: Only weak unref if GObject is still alive · 8d85400b
      Georges Basile Stavracas Neto authored and Philip Chimento's avatar Philip Chimento committed
      The function disassociate_js_gobject() is currently unconditionally
      removing the weak reference of the wrapped GObject. This is because
      we were previously assuming that there was always a toggle ref, and
      so we would never reach this code path after the wrapped GObject was
      Turns out, with commit 0cc23474 it is now a regular case to call
      this function after the GObject is finalized. When that happens, it
      will reach wrapped_gobj_dispose_notify() and the wrapped GObject will
      be marked as finalized. disassociate_js_gobject(), however, will try
      to weak unref it, without checking if the GObject was finalized already.
      This commit fix that by simply checking if the wrapped GObject was
      finalized before trying to weak unref it.
      (cherry picked from commit 8d50e2b4)
    • Georges Basile Stavracas Neto's avatar
      object: properly disassociate wrappers · 79cd92c9
      Georges Basile Stavracas Neto authored and Philip Chimento's avatar Philip Chimento committed
      Now that we allow different JS wrappers during the lifetime of
      a single GObject, the code must be extra careful to really
      disassociate wrapper and wrapped objects.
      The current code, however, was not really disassociating the
      wrapper from the GObject it wraps, causing a segfault when
      the first wrapper is destroyed and the second is created.
      (cherry picked from commit 72d970b4)
    • Giovanni Campagna's avatar
      object: don't use toggle references unless necessary · 29579aad
      Giovanni Campagna authored and Philip Chimento's avatar Philip Chimento committed
      Many GObjects (such as widgets and actors) don't have JS state, but
      they're kept alive by C code. We can therefore save some memory
      by GCing these objects, and creating new wrappers when needed.
      If state is ever set, we transparently switch to toggle refs, so
      no change should be visible at the JS level.
      (cherry picked from commit 0cc23474)
  2. 27 Nov, 2018 1 commit
  3. 01 Oct, 2018 1 commit
  4. 29 Jul, 2018 2 commits
    • Philip Chimento's avatar
      build: Vendor ax_code_coverage.m4 · 82f09525
      Philip Chimento authored
      The newest version of this macro changes the way you include it, which is
      a mess because we don't know which version a particular distro will have.
      We copy the old version of the macro into the m4/ directory and include
      it in git. That should prevent aclocal from installing the newer version.
      (It would be better to include the newer version, but that has a bug that
      clobbers the GITIGNORE variable.)
      Closes #149
    • Philip Chimento's avatar
      build: Check for SIGEV_THREAD_ID if profiler enabled · fc550820
      Philip Chimento authored
      Apparently this is not available in some standard libraries, so it should
      be checked during configure.
      Closes: #132
  5. 22 Jul, 2018 1 commit
  6. 20 Jul, 2018 5 commits
    • rockon999's avatar
      Export GObject static class properties. · 0abb9415
      rockon999 authored
    • Christopher Wheeldon's avatar
      Fix up GJS_DISABLE_JIT flag now the JIT is enabled by default in spidermonkey... · 3fbc78be
      Christopher Wheeldon authored
      Fix up GJS_DISABLE_JIT flag now the JIT is enabled by default in spidermonkey (https://bugzilla.mozilla.org/show_bug.cgi?id=1160311)
    • Philip Chimento's avatar
      object: Warn about finalized GObject in fewer cases · 4e60cccf
      Philip Chimento authored
      We want to remove this warning in cases where the subsequent code isn't
      actually trying to access the underlying GObject and therefore isn't
      going to crash. On resolve() we don't want the warning, as that only
      applies to prototype objects. On trace() we don't want it either, as that
      may legitimately be called during the GC mark phase on a JS wrapper with
      a disposed GObject.
      In the typecheck function, we only use the GObject for a debug assertion.
      All the other checks use the GType. We relax the assertion and only do
      the debug sanity check if the GObject is still alive. Instead of logging
      the warning here, we log the warning in gjs_g_object_from_object() which
      happens later when the GObject is actually used.
      We keep the warnings in property getters and setters, since those would
      access the underlying GObject, and they are now only called for names
      that really do resolve to GObject properties and fields.
      Closes: #24
    • Ole Jørgen Brønner's avatar
      importer: Retrieve names while iterating search path · 544c9f47
      Ole Jørgen Brønner authored
      Previously, only the file type was requested. Even though the name was
      not requested, query_info still returns the file name for non-symlink
      files, so this bug went unnoticed in most cases. However, when there was
      a symlink in the search path this broke.
      Closes: #154
    • rockon999's avatar
      Fix UTF8 encoding for some GJS string arrays. · 98e7edaa
      rockon999 authored
      - The function that constructs string arrays for imports and argv utilized a JS_NewStringCopyZ call instead of the proper JS_NewStringCopyUTF8Z (the input is UTF8).
  7. 06 May, 2018 13 commits