Commit Graph

142 Commits

Author SHA1 Message Date
Brandon Fish
2f70a199e4 Add deny dead_code lint and fix one error 2019-08-01 20:46:35 -06:00
Brandon Fish
dfef2b6899
Merge branch 'master' into clif-backend 2019-08-01 11:59:02 -06:00
Pekka Enberg
869ac21f7b clif-backend: Eliminate FunctionEnvironment construction in feed_event()
The feed_event() function is called for every wasm binary instruction.
Let's optimize it by storing FunctionEnvironment object in
CraneliftFunctionCodeGenerator, rather than constructing it for every
feed_event() invocation.

This change reduces the time to run "ngix compile" benchmark by 68%:

Before:

  nginx compile           time:   [1.4152 s 1.4186 s 1.4222 s]
  Found 1 outliers among 10 measurements (10.00%)
    1 (10.00%) high mild

After:

  nginx compile           time:   [447.76 ms 448.32 ms 448.80 ms]
                          change: [-68.542% -68.440% -68.352%] (p = 0.00 < 0.05)
                          Performance has improved.

I assume some of the clone() calls are very expensive (Vec::clone(),
likely). I did see libc malloc()/free() high up in "perf top" profiles,
which are eliminted by this change.

I also looked into eliminating FunctionBuilder construction from
feed_event(). That turns out to be painful on lifetime rules because it
borrows bunch of other objects, so I am leaving it for someone who knows
the code better than I do.
2019-08-01 18:06:40 +03:00
Syrus
a6461c3b14 Removed explicit hashbrown dependency 2019-07-31 23:18:38 -07:00
Brandon Fish
d7c11bcf5f Fixes case with empty module, handle case with no signatures 2019-07-26 17:58:57 -05:00
Nick Lewycky
18307bb79c Improve panic/unreachable/unimplemented usage. Refactor a little. 2019-07-22 12:15:56 -07:00
Nick Lewycky
df5c12cbe1 Add V128 to wasmer runtime. Unimplemented in clif-backend. Other backends don't build. 2019-07-10 13:48:12 -07:00
Nick Lewycky
75faae2912 Disable jump tables. We don't have an implementation of reloc_jt yet. 2019-07-02 09:55:46 -07:00
losfair
8019505e65 Merge remote-tracking branch 'origin/feature/clif-cgapi' into feature/metering 2019-05-31 15:40:05 +08:00
Brandon Fish
3f0cafce5c Remove old Cranelift compiler code 2019-05-26 22:32:11 -05:00
Brandon Fish
bf1cfc2578 Re-enable deny warnings in clif backend 2019-05-26 22:17:49 -05:00
Brandon Fish
f42ca84480 Add calling convention to function signatures 2019-05-26 14:44:17 -05:00
Brandon Fish
cc4b1871d0 Fix get global type 2019-05-26 14:15:30 -05:00
Brandon Fish
6ca311f92d Fix compilation errors and warnings 2019-05-26 11:13:37 -05:00
Brandon Fish
5da0c4766a Update to Arc<RwLock<ModuleInfo>> for interior mutability 2019-05-25 19:30:44 -05:00
Brandon Fish
d440776bc0 Update lifetime of function builder references 2019-05-25 18:06:41 -05:00
Brandon Fish
9f2e068ff4 Implement conversion of signatures into clif signatures 2019-05-23 20:04:55 -05:00
Brandon Fish
a713043360 Update translate_operator op argument 2019-05-22 23:46:38 -05:00
Brandon Fish
5d3f6ea167 Fixing lifetime issues in clif codegen refactor 2019-05-22 17:21:16 -05:00
Brandon Fish
04d6ccc95c Pass module info to FCG as Arc 2019-05-21 23:44:31 -05:00
Brandon Fish
5db575e8ef Fix clif_signatures in function codegen 2019-05-19 15:22:02 -05:00
Brandon Fish
db669f7eb7 Fix more codegen compilation issues 2019-05-19 15:01:25 -05:00
Brandon Fish
d547beda72 Fix self.info compilation error in MCG.finalize 2019-05-19 13:05:35 -05:00
Brandon Fish
47479b547f Implement MCG.{finalize, from_cache} 2019-05-19 10:53:33 -05:00
Brandon Fish
6d5dd5ff21 Implement more function codegen 2019-05-19 00:27:39 -05:00
Brandon Fish
2d10306c87 Add copyright notice 2019-05-18 16:32:22 -05:00
Brandon Fish
74a758d39e Add progress on next_event 2019-05-18 16:31:08 -05:00
Brandon Fish
ac3fafae9a
Merge branch 'master' into feature/clif-cgapi 2019-05-14 23:01:28 -05:00
Syrus
8218e550fc Improved docs and fixed few typos 2019-05-13 11:18:57 -07:00
Brandon Fish
7315cd1100 Add some basic partial implementation of Cranelift codegen 2019-05-12 19:16:01 -05:00
Brandon Fish
d9cd4fc3e0 Add scaffold to use new code generator API for Cranelift 2019-05-12 11:05:26 -05:00
Brandon Fish
2aefa731a6 Add deny for unreachable patterns and unused unsafe 2019-05-12 00:33:02 -05:00
Brandon Fish
85158ac22a Add some initial deny for unused_imports and unused_variables
Additional unused variable fix on unix

Remove unused import on unix

Remove unused windows import
2019-05-11 09:23:25 -05:00
Henrik Rydgård
5e37368ec9 Exception logging (win32): Handle error codes correctly, add some more strings. 2019-05-02 12:45:52 +02:00
Mackenzie Clark
9ab7199fe5
Merge branch 'master' into feature/cleanup-imports-unsafe 2019-04-24 08:37:06 -07:00
Lachlan Sneff
14325c975e Rename internal enum to make less confusing 2019-04-22 15:36:47 -07:00
Lachlan Sneff
706ddabf61 Hook up error propagation 2019-04-22 15:06:40 -07:00
Lachlan Sneff
74b6ba4eaf Return type normalization, and change return errors from imported functions 2019-04-22 11:42:52 -07:00
Brandon Fish
9e93565a49 Cleanup build warnings imports and unnecessary unsafe 2019-04-20 20:37:39 -05:00
Lachlan Sneff
443663aa3f Add caching support to llvm backend 2019-04-19 13:54:48 -07:00
Lachlan Sneff
4dd64ed72e Remove UserTrapper trait 2019-04-18 10:00:15 -07:00
Lachlan Sneff
051d435423 Warnings and unused code cleanup 2019-04-12 10:27:14 -07:00
Lachlan Sneff
8b5da1d86e Update cranelift backend to new backend abstraction 2019-04-12 09:58:29 -07:00
Lachlan Sneff
751dff0f9d Attempt to fix windows build 2019-04-09 16:46:01 -07:00
Lachlan Sneff
c212ba3619 Add implementations for typed func errors to cranelift and llvm 2019-04-09 15:53:01 -07:00
bors[bot]
77f8186507 Merge #321
321: Update to Cranelift 0.3.0 r=bjfish a=bjfish

Some API changes were addressed:
- `ModuleEnvironment` many trait methods removed: 459f6ddb26 (diff-0682a088315ee358a75d4b60bc72dafc)
- `declare_table_elements` parameter type changed: 64ea964bc0
- `UnreachableCodeReached` trap code added: 1c43ad771e
- `declare_signature` signature updated: 8a24539e0c
- `define_function_body` parameter added: 37dffdaea1
- `target_lexicon` dependency updated to version `0.3.0`

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-04-04 17:10:51 +00:00
Mark McCaskey
9e601c42f9 change func_index offset by number of imported funcs 2019-04-04 09:29:30 -07:00
Syrus Akbary
7ff51c3b9e
Update lib/clif-backend/src/module.rs
Remove unnecessary `<'a>` from Converter

Co-Authored-By: bjfish <bjfish@users.noreply.github.com>
2019-04-03 13:35:36 -05:00
Brandon Fish
5627f80548 Update to Cranelift 0.3.0 2019-04-03 00:13:40 -05:00
Mackenzie Clark
5294eb6b0d merge and respond to feedback 2019-03-28 11:41:45 -07:00