1
0
forked from Mirror/wren
Files
wren/src
Robert Nystrom 2a1499b04b Fix horrendously bad bit hashing function.
hashBits() is used to generate a hash code from the same 64 bits used
to represent a Wren number as a double. When building a map containing
a large number of integer keys, it's important for this to do a good
job scattering the bits across the 32-bit key space.

Alas, it does not. Worse, the benchmark to test this happens to stop
just before the performance falls off a cliff, so this was easy to
overlook.

This replaces it with the hash function V8 uses, which has much better
performance across the numeric range.
2019-07-27 13:34:07 -07:00
..
2019-06-13 14:51:28 +08:00
2018-03-24 11:10:36 -07:00
2019-02-14 07:33:30 -08:00
2016-05-04 00:16:02 +10:00

This contains the Wren source code. It is organized like so:

  • optional: the Wren and C source code for the optional modules. These are built in to the VM and can be used even when you embed the VM in your own application. But they are also optional and can be compiled out by setting defines.

  • cli: the source code for the command line interface. This is a custom executable that embeds the VM in itself. Code here handles reading command-line, running the REPL, loading modules from disc, etc.

  • include: the public header directory for the VM. If you are embedding the VM in your own application, you will add this to your include path.

  • module: the source code for the built-in modules that come with the CLI. These modules are written in a mixture of C and Wren and generally use libuv to implement their underlying functionality.

  • vm: the source code for the Wren VM itself. Unlike code in cli and module, this has no dependencies on libuv. If you are embedding the VM in your own application from source, you will compile the files here into your app.