1
0
forked from Mirror/wren
Commit Graph

49 Commits

Author SHA1 Message Date
a5147aa2d9 Add a limited form of re-entrant calls.
This doesn't let you arbitrarily call back into the VM from within
foreign methods. I'm still not sure if that's even a good idea since
God knows what that would mean if you switch fibers while doing that.

But this does allow the very important use case of being able to call
a foreign method from within a call to wrenCall(). In other words,
foreign methods need to always be leaf calls on the call stack, but the
root of that stack can now come from runInterpreter() or wrenCall().

Fix #510.
2019-02-08 17:09:39 -08:00
5f29a72d65 Remove the special method type for Fn.call(...).
Instead, using regular primitives for each of the call() methods.
Doesn't help performance (alas), but does seem cleaner to me.
2018-07-18 08:20:11 -07:00
7a42a20b98 Merge branch 'master' into smarter-imports
# Conflicts:
#	src/module/io.c
#	src/vm/wren_vm.c
2018-07-15 21:01:14 -07:00
492763205b introduced docs auto publish step to travisci 2018-04-04 20:37:05 +01:00
5539c59750 Add a minimal path manipulation C module.
This is just for the VM's own internal use, for resolving relative
imports.

Also added a tiny unit test framework for writing tests of low-level
C functionality that isn't exposed directly by the language or VM.
2018-03-24 10:58:07 -07:00
f866ee7003 Vendor GYP and libuv into the repo.
Instead of dynamically downloading these as needed during a build, this
checks in those two dependencies directly into the Wren repo. That's a
little lame because users of Wren who aren't building the CLI don't
actually need them, but they aren't too big, so it's not a huge deal.

It makes builds (particularly on Travis) more reliable, because they
don't have to pull down additional content over the network.
2018-03-14 07:27:29 -07:00
97b2e1c818 Add web server to doc generator. 2017-10-12 06:38:34 -07:00
d301fefac2 Add a comment explaining the ci targets. 2017-01-12 21:55:35 -08:00
04a7c9b5c8 Improve Travis Build & Test Coverage
Build Wren for more targets, and run the test suite on both 32 and 64
bit builds.

 * Update the build config to test both with and without NAN_TAGGING
   defined.

 * Updatest `util/test.py` to take the executable suffix as a
   parameter. This allows the makefile to control which binaries will be
   tested.

   Adds a new target to the makefile to be run by travis, this runs the
   test suite against all of the configurations it builds.

 * Gcc on some 32 bit platforms was complaining about numeric overflows
   when -INFINITY was used. Update the logic for converting a double to
   a string to not explicitly check against the literal values.

 * Make CI builds run the tests on both 64 _and_ 32 bit builds.

 * If I limit the number of CPUs on my MBP I can get some of the tests
   to time out, I'm imagining that the specs of the Travis Macs means
   that the same is happening there too. Updated the test script to
   allow an extra few seconds for the test to complete successfully
   before killing it.

 * Due to slight differences in accuracy in some computations tests were
   failing on 32 bit builds. Stop comparing things quite as exactly in
   the cases where it is causing issues.

   For some reason 12.34 was refusing to compare equal to itself. Bad
   show 12.34 :-/. I've also updated the test so it doesn't leak handles
   even if the assertions fail.

 * Double-cast from `double` to `uint32_t` to prevent undefined
   behaviour on overflow of basic integers. This should hopefully
   prevent 32 bit test failures on Linux.

 * Move to a version of LibUV with a fix for the 32 bit build error on
   Travis.
2016-12-29 17:52:38 +00:00
b41a0f7c07 Allow builds to be verbose
It’s impossible to disable @s in Makefiles to get a verbose build.
Adding them conditionally using a variable lets users choose if they
want a verbose build by using the VERBOSE variable.

Normal build:

    make

Verbose build:

    make VERBOSE=1
2016-07-02 11:21:47 +02:00
bec5181bdb Add separate targets for building just the shared or static library.
make static
make shared

Running "make vm" will build both, as usual.

Fixes #322.
2016-02-19 07:22:10 -08:00
a09892de32 Use a fiber for a finalizer's foreign stack. 2015-12-27 21:43:08 -08:00
01e8f9053e Add a benchmark to test the Wren C API.
I've got some ideas on how to tweak the embedding API, but I want to
see what performance impact they have first, so this adds a little
benchmark that just calls a foreign method a ton of times.
2015-12-15 16:02:13 -08:00
36f7d74183 Unify "script" and "project" under "util". 2015-09-22 07:45:58 -07:00
f36a795534 Automatically update the string constants when a builtin module changes. 2015-09-13 10:03:02 -07:00
b4deb30a02 Reorganize build scripts for libuv.
- Create separate libs for each architecture. OS X doesn't need this
  (we just build a universal binary), but it will help Linux.
- Move the libuv build stuff into wren.mk where the actual dependency
  on the lib is.
- Download libuv to deps/ instead of build/. That way "make clean"
  doesn't blow it away.
- Don't redownload libuv unless needed.
2015-08-28 19:31:03 -07:00
0ae59be11a Use the same libuv output directory on Mac and Linux. 2015-08-27 07:55:12 -07:00
d4acbe8a70 A vertical slice of real libuv integration.
This adds a "timer" module to the CLI that provides a Timer class with
a static sleep() method. Not the most exciting functionality in the
world, but it requires the full hunk of libuv integration:

- The CLI sets up libuv and runs the event loop.
- Added a new directory src/module for CLI modules.
- Updated all the make scripts to handle it.
- Reorganized some other CLI code.
2015-08-07 08:10:55 -07:00
4a6d7e0428 Integrate libuv into Wren.
- Add a script that downloads and compiles libuv.
- Hook that up to the Makefile so it pulls down libuv on build.
- Add a separate "vm" target that just builds the VM library and skips
  libuv.
- Link to libuv when compiling the CLI.
- Update the XCode project to link to libuv too.

Linux and Windows support isn't done yet, but it should be pretty
straightforward to add to the Python script.
2015-08-02 10:43:38 -07:00
7084d6bfd5 Add infrastructure to test embedding API. 2015-05-24 09:23:30 -07:00
3be0a396c4 Remove unneeded line from Makefile. 2015-05-19 07:00:44 -07:00
bead9a3406 Output amalgamation into build/. 2015-04-25 08:38:45 -07:00
796639e371 Fix amalgamation to work with X Macro files 2015-04-16 14:45:22 +02:00
9bcf31e14d Add amalgamation generation script 2015-04-16 14:45:22 +02:00
e2a72282a1 Move gh-pages directory under build/. 2015-03-14 12:19:03 -07:00
037a2bdb66 Massive Makefile clean up!
- "make all" builds all combinations of configurations
- Binaries are built to "bin"
- (For convenience, the release interpreter also goes in the top level dir)
- Libraries are built to "lib"

This will also make it easier to support building and testing other
configurations like Nan tagging versus union, computed goto, etc.
2015-02-22 10:19:23 -08:00
ffc770b4a7 Also clean Mac .dylibs. 2015-02-12 09:07:41 -08:00
e4caeb2a7c made ``make clean`` more explicit 2015-02-12 10:23:13 -05:00
5b348e61d7 ``make clean`` now removes the libraries
```make clean``` now removes ```libwren.a``` and ```libwren.so``` where it only removed ```build```` and ```wren```
2015-02-06 15:15:41 -05:00
3bed04e0b9 Support clang/OS X shared libraries in the Makefile. 2015-01-28 19:50:53 -08:00
2f97ef57d3 Change Makefile to differentiate between static and shared library
Previously, just the static libraries (libwren*.a) were created. In the Makefile documentation these were mentioned in the comments as shared.
Now both variants will be created.
2015-01-27 15:05:53 +01:00
eb4e50a500 Don't use -fPIC on Windows (cygwin, mingw32). 2015-01-20 13:42:46 -08:00
9fcaddaa07 Make prep Phony 2015-01-17 20:20:05 -06:00
6e369fc639 Finish making Wren compile as C++98.
- Get Value, the hard part, compiling as C++.
- Add some rudimentary C++ support to the makefile, mainly for testing.
2015-01-15 21:12:51 -08:00
d74e11b80e Allow better debugging
This will ensure that we have better output when running `wren` under
{g,ll}db.
2015-01-12 10:01:34 -05:00
728cb2cbca Gitignore shared libraries and comment makefile a bit. 2015-01-04 10:02:50 -08:00
7cb77b7729 First try at building separate lib + binary 2015-01-02 15:24:07 -05:00
23ba46a9f9 Move the -lm after the list of object files
Fixes linking through `gcc`, doesn't affect `clang`.

Closes #43
2015-01-02 09:32:30 -05:00
d65bd1382b Add gh-pages build step. 2015-01-01 20:58:36 -08:00
8417fadc2f Make all heap objects store a reference to their class and inline class lookup.
This is redundant, but significantly optimizes method dispatch:

binary_trees - wren           ..........  3347  0.30s  110.30% relative to baseline
delta_blue - wren             ..........  7161  0.14s  110.39% relative to baseline
fib - wren                    ..........  2445  0.41s  112.78% relative to baseline
for - wren                    ..........  8600  0.12s  143.00% relative to baseline
method_call - wren            ..........  5112  0.20s  114.15% relative to baseline
2014-12-07 14:29:50 -08:00
83c2013dfb Fixes to make GCC happier. 2014-11-26 14:03:05 -08:00
acceea2206 Clean up makefile a bit. 2014-04-26 08:07:03 -07:00
28021dc63e Redo site design. 2014-04-05 15:39:02 -07:00
36df70dba1 Move IO into a separate module. 2014-02-04 08:44:59 -08:00
7e850637f9 Allow passing a suite to make test. 2014-02-02 10:30:58 -08:00
66f0b57bf3 Allow ranges in list subscript operator. 2014-01-30 09:12:44 -08:00
f2aeb30b31 Hack on the docs a bit. 2014-01-30 06:51:52 -08:00
96d728cc5d Reorganize makefile and scripts. 2014-01-23 23:29:50 -08:00
0334cb3367 init Makefile 2014-01-21 10:24:33 -06:00