Commit Graph

36 Commits

Author SHA1 Message Date
613e4de9fc Fix LLVM object loader exceptions. 2019-08-22 18:57:26 -07:00
f503764780 Restore previous unwind_state. 2019-08-22 17:22:33 -07:00
56e735349d Format everything 2019-08-21 15:23:56 -07:00
74faaa3be8 Merge branch 'fix/llvm-trap-windows' into feature/llvm-osr 2019-08-21 15:02:17 -07:00
bf471fbc24 Cleanup LLVM object loader. 2019-08-21 11:08:23 -07:00
98ef9182d7 Run clang-format and cargo fmt 2019-08-14 16:35:40 -07:00
0e0573c73c Merge remote-tracking branch 'origin/master' into feature/llvm-osr 2019-08-14 16:33:26 -07:00
b113f5a24b longjmp turns out to work on Windows. Remove custom unwinding code. 2019-08-08 03:19:19 +08:00
4b1d337ebe Custom setjmp/longjmp to avoid SEH. (will it work?) 2019-08-07 00:38:42 +08:00
b50fd31adb Use setjmp/longjmp to handle LLVM exceptions. 2019-08-07 00:06:35 +08:00
83aa9c67c7 Replace throw() with noexcept. Unlike throw(), noexcept indicates that the function does not throw.
Before C++17, throw() was equivalent to wrapping the function in a try {} catch
{ std::unexpected(); }. In C++17 throw() was made equivalent to noexcept and
in C++20 throw() was removed.
2019-08-01 17:13:23 -07:00
ac49e57c2d Run clang-format-8 over the C++ code. No functionality change. 2019-08-01 17:12:46 -07:00
536f9813dc Implement InternalEvent::Breakpoint in the llvm backend.
Enable now-working metering unit tests when run with the llvm backend.
2019-08-01 12:44:25 -07:00
22f8b3f3dc Improved LLVM compilation for Unix 2019-07-30 15:32:21 -07:00
12f8f3d085 First working version of LLVM in Windows 2019-07-30 14:47:53 -07:00
2e030c9c4a Parsing LLVM stackmaps. 2019-07-19 02:02:15 +08:00
ea83924547 Update to LLVM 8.0. 2019-07-10 13:48:12 -07:00
706ddabf61 Hook up error propagation 2019-04-22 15:06:40 -07:00
443663aa3f Add caching support to llvm backend 2019-04-19 13:54:48 -07:00
1cb3fbea0a Add support for panicking/returning err back to llvm 2019-04-10 14:17:10 -07:00
cc656b26a9 Add implementations for typed func errors to cranelift and llvm 2019-04-09 17:09:33 -07:00
48b36a3b01 Runs on linux and also hopefully ci 2019-03-05 14:54:44 -08:00
fe8f8a0132 Add illegal arithmetic runtime error 2019-03-04 19:56:02 -08:00
3be7144892 Some cleanup 2019-03-04 17:37:05 -08:00
87c453a0ec Add check for table bounds on call_indirect. 2019-03-03 21:38:35 -08:00
51cf9dde05 Move SSA value caches to the entry block.
The supporting framework around LLVM will make sure to only compute values once if they
are known to never change. Previously, these values were attempted to be reused from places where
the users may not dominate the creation of the value. To avoid that, they are always created
in the entry block now.
2019-03-03 21:13:37 -08:00
9cfda6800f Try to return an error from call_protected when an exception occurs.
Something breaks pretty drastically sometimes, not sure why.
2019-03-02 19:08:15 -08:00
caf2205936 Add a signal handler for macos and linux.
Implementation Notes:
- To avoid setjmp, longjmp, and the mess that those create, we instead set the interrupting
    context of the signal handler to return into the `throw_trap` routine. To my surprise,
    this actually works. The stack ends up getting unwound normally and the memory-oob error
    is caught by the trampoline.
2019-03-02 17:00:05 -08:00
57bfa9b0a4 Remove multiple throwing functions, just use one. 2019-03-02 14:16:02 -08:00
9a90689b93 Add preliminary support for throwing and catching uncatchable exceptions.
Additional info:
- WebAssembly "traps" are uncatchable, but are still caught by the trampoline caller.
2019-03-02 12:57:35 -08:00
5760f6006a Start implementing exception handling by adding frame descriptor entry processing.
- Soon, we should be able basic exceptions.
2019-03-02 10:56:02 -08:00
f0ac76517a Start running spectests
Additional info:
- Execution is turned off, this is just to make sure the backend can compile the entire specsuite.
- That being said, trampolines are implemented and protected call works (just doesn't protect).
2019-03-01 17:11:20 -08:00
6a20676fa9 Actually unmap the code after it's done being used 2019-02-28 17:20:18 -08:00
d4ae5cdd40 Get function addresses from llvm-compiled code 2019-02-28 12:31:39 -08:00
5d77769381 Hopefully finish the memory manager implementation for llvm RuntimeDyLd 2019-02-27 17:21:20 -08:00
4f833876e0 Start work on object loader using llvm's RuntimeDyld api. 2019-02-25 18:08:06 -08:00