1. 08 Dec, 2018 3 commits
    • Yorick Peterse's avatar
      Reset maiting state when there is a process · a51d1b62
      Yorick Peterse authored
      When a process was waiting for a message and there is one now, we need
      to make sure we reset the waiting state.
      a51d1b62
    • Yorick Peterse's avatar
      Removed storing of entire process statuses · 86cadf10
      Yorick Peterse authored
      Obtaining the process status has always been a bit questionable. For
      one, it's not particularly useful to see that a process is running or
      being garbage collected. Second, it requires a full 8 bytes of memory
      per process to store.
      
      In this commit, we drop the storing of full process statuses, and add a
      boolean flag "waiting for message" that we use instead where necessary.
      Currently this won't reduce the size of a process due to alignment
      requirements, but in the future we may be able to work around this by
      reducing the size of other fields.
      86cadf10
    • Yorick Peterse's avatar
      Use two survivor spaces for local allocators · 3caf9631
      Yorick Peterse authored
      Using three survivor spaces instead of two does not really offer many
      benefits, as objects surviving two collections are likely to also
      survive a third. Removing one survivor space reduces the size of a
      process by at least 32 bytes.
      3caf9631
  2. 07 Dec, 2018 4 commits
  3. 06 Dec, 2018 5 commits
    • Yorick Peterse's avatar
      Clean up code for Clippy on Rust 1.31 · 05d8972f
      Yorick Peterse authored
      The latest version of Clippy introduced some new lints, and will now
      complain about the deprecated syntax. Unfortunately, the new tool_lints
      syntax doesn't work on older Rust versions so we can not yet start
      using it.
      
      This commit also refactors various disabled Clippy lints away. Some of
      the disable lines are still necessary as Clippy is overly pedantic, but
      this at least gets rid of a large portion of them.
      05d8972f
    • Yorick Peterse's avatar
      Move histograms from buckets to allocators · f0b6fde0
      Yorick Peterse authored
      This moves the mark and available histograms outside of the Bucket type
      and into the local and mailbox allocators, reducing the memory required
      per process by at least 100 bytes. Behaviour wise nothing changes, as
      for the LocalAllocator we would evacuate objects for all Buckets the
      moment we'd find one that was fragmented.
      f0b6fde0
    • Yorick Peterse's avatar
      Use i8 for the bucket ages · 5aaa746b
      Yorick Peterse authored
      An i8 is large enough to store all values, but requires only half the
      space compared to an i16. This reduces the size of the Process type by
      24 bytes.
      5aaa746b
    • Yorick Peterse's avatar
      Use u32 for block allocation thresholds · ff158aae
      Yorick Peterse authored
      An u32 is enough to represent 128 TB worth of Immix blocks, and means a
      GenerationConfig only takes up 8 bytes of space, instead of 16 bytes.
      ff158aae
    • Yorick Peterse's avatar
      Rework storage and use of GC statistics · e5b1919f
      Yorick Peterse authored
      This commit makes two main changes:
      
      1. Various configuration statistics that were duplicated in the
         GenerationConfig type have been removed, in favour of using the
         source values from the Config type directly.
      
      2. Updating garbage collection statistics has been reworked, to prevent
         garbage collection from running too frequently.
      
      The first change results in processes requiring less memory, though we
      are talking about only a handful of bytes.
      
      The second change is more interesting. Prior to this commit, the number
      of allocated blocks was reset to the number of live blocks. If this
      number would be great enough, the next garbage collection cycle could be
      scheduled much sooner than necessary.
      
      To illustrate this, let's say our threshold is 10 Immix blocks. For the
      first garbage collection to occur, we thus need to allocate 10 Immix
      blocks. If 5 Immix blocks remain live after a cycle, we would only need
      to allocate 5 Immix blocks to trigger the next cycle; instead of
      allocating 10 Immix blocks. This commit fixes this by resetting the
      number of allocated blocks after every cycle.
      e5b1919f
  4. 04 Dec, 2018 2 commits
    • Yorick Peterse's avatar
      Removed double zeroing of Immix histograms · 0a762c81
      Yorick Peterse authored
      Immix histograms use a Chunk under the hood, and the memory for a Chunk
      is already zeroed upon allocation. Since AtomicUsize has the same memory
      representation as usize, we can just leave out the additional zeroing in
      Histogram::new().
      0a762c81
    • Yorick Peterse's avatar
      Use 1 env variable for concurrency settings · d1496336
      Yorick Peterse authored
      The number of OS threads to use for the various worker pools in the VM
      is now controlled using a single environment variable
      (INKO_CONCURRENCY), instead of using one environment variable for every
      pool. This should make it a little easier to scale things up, without
      having to set five different environment variables accordingly.
      d1496336
  5. 03 Dec, 2018 1 commit
  6. 28 Nov, 2018 1 commit
  7. 27 Nov, 2018 2 commits
    • Yorick Peterse's avatar
      Add tests for std::iterator · ab0f61db
      Yorick Peterse authored
      ab0f61db
    • Yorick Peterse's avatar
      Improve remapping of initialised type parameters · 8450931d
      Yorick Peterse authored
      This improves the compiler's support for remapping type parameters to
      the appropriate type parameter instance. For example, consider type T
      that has type parameter A initialised to type parameter B, and B is
      initialised to C. Previously, when looking up the instance of A the
      compiler would produce B. As of this commit, the compiler would produce
      type C instead. This removes the need for type annotations in various
      cases, most notably when working with iterators.
      
      Fixes #117
      8450931d
  8. 26 Nov, 2018 1 commit
  9. 25 Nov, 2018 7 commits
  10. 23 Nov, 2018 1 commit
  11. 22 Nov, 2018 1 commit
  12. 21 Nov, 2018 5 commits
    • Yorick Peterse's avatar
      Remove uninitialised params from return types · d95a357c
      Yorick Peterse authored
      This changes the compiler so that type parameters that map to
      uninitialised type parameters have their instances removed. For type
      `Thing!(A -> B)` this means that the mapping of A to B is removed if B
      is an uninitialised type parameter.
      
      This change ensures that the compiler can better handle HashMap literals
      and other types that may not initialise all type parameters. This in
      turn ensures that code such as the following no longer errors:
      
          let x: HashMap!(String, String) = %[]
      
      Previously this would error because `%[]` was inferred has
      `HashMap!(Hash + Equal, V)`, and that type can not safely substitute
      `Hashmap!(String, String)`. With this change, `%[]` is basically
      inferred as `HashMap!(?, ?)`, allowing the compiler to then infer it
      into `HashMap!(String, String)`.
      d95a357c
    • Yorick Peterse's avatar
      8cd6b796
    • Yorick Peterse's avatar
      Don't use caching for the rustfmt job · 0da7f2e1
      Yorick Peterse authored
      This job doesn't need any cache, so this should reduce the job time by
      not having to download an existing cache.
      0da7f2e1
    • Yorick Peterse's avatar
      Fix caching of Ruby dependencies in CI · afa7ef9a
      Yorick Peterse authored
      afa7ef9a
    • Yorick Peterse's avatar
      Use custom Docker images for all builds · 5700a30e
      Yorick Peterse authored
      These Docker images are built automatically, removing the need for
      installing various dependencies on the fly. This in turn should reduce
      build timings a bit, depending on the number of dependencies necessary
      per build.
      5700a30e
  13. 13 Nov, 2018 2 commits
  14. 10 Nov, 2018 1 commit
  15. 09 Nov, 2018 1 commit
    • Yorick Peterse's avatar
      Fix race condition in ObjectPointer::status() · 93bbd5ee
      Yorick Peterse authored
      When promoting or evacuating an object, `ObjectPointer::status()` would
      only return Promote/Evacuate for the first caller, returning OK for all
      following calls. This could lead to a race condition where multiple
      threads try to process a pointer to the same object that has to be
      moved. In this case, one thread would win, and the other one(s) would
      lose. All threads that lose would then simply mark the object and move
      on, without resolving a forwarding pointer produced by the winning
      thread. This could then lead to pointers being used that still point to
      moved objects.
      
      To resolve this, `ObjectPointer::status()` now returns a "PendingMove"
      status whenever a thread witnesses an object that has to be moved but is
      already being moved by another thread. As long as this status is
      observed, the pointer is rescheduled for marking. This allows the thread
      to continue marking other objects, instead of having to spin for an
      undetermined amount of time.
      
      Fixes #148
      93bbd5ee
  16. 08 Nov, 2018 1 commit
  17. 07 Nov, 2018 2 commits
    • Yorick Peterse's avatar
      Use seconds instead of milliseconds for timeouts · 21b0ab04
      Yorick Peterse authored
      This ensures that we use seconds (a SI base unit) for timeouts and
      intervals in both the runtime and the VM. This means that in order to
      suspend a process for one second, you now write this:
      
          process.suspend(1)
          process.suspend(1.0) # also valid
      
      Instead of this:
      
          process.suspend(1000)
      
      Fixes #152
      21b0ab04
    • Yorick Peterse's avatar
      Cache the vm/target directory in CI · bd47576b
      Yorick Peterse authored
      This should reduce the time spent compiling the same crates between
      pipelines.
      bd47576b