Commit Graph

28 Commits

Author SHA1 Message Date
98e4ef066a feat(runtime-core) Feed imported functions with vm::Ctx again.
… and look for the associated `vm::FuncCtx`. This way, we don't break
the rule: “all functions receive a vmctx pointer as first argument.”.
2019-11-12 00:50:25 +01:00
6035bd2d9b feat(runtime-core,clif-backend,llvm-backend) Rename an ImportFunc offset.
`ImportedFunc::offset_vmctx` becomes `ImportedFunc::offset_func_ctx`.
2019-11-06 14:48:46 +01:00
f101775380 fix(cranelift-backend) Remove broken (and useless?) debug code.
This debug code is broken (it doesn't compile). It can be assumed
nobody uses it, and can be considered as dead code. As such, this PR
removes it.
2019-10-17 22:55:30 +02:00
f48d6f6690 Cranelift backend update to fork of clif version 0.43.1 2019-09-21 13:06:54 -05:00
5a41686192 Fix bare_trait_objects warnings 2019-08-08 16:46:52 -06:00
2f70a199e4 Add deny dead_code lint and fix one error 2019-08-01 20:46:35 -06:00
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
d7c11bcf5f Fixes case with empty module, handle case with no signatures 2019-07-26 17:58:57 -05:00
8019505e65 Merge remote-tracking branch 'origin/feature/clif-cgapi' into feature/metering 2019-05-31 15:40:05 +08:00
bf1cfc2578 Re-enable deny warnings in clif backend 2019-05-26 22:17:49 -05:00
f42ca84480 Add calling convention to function signatures 2019-05-26 14:44:17 -05:00
cc4b1871d0 Fix get global type 2019-05-26 14:15:30 -05:00
6ca311f92d Fix compilation errors and warnings 2019-05-26 11:13:37 -05:00
5da0c4766a Update to Arc<RwLock<ModuleInfo>> for interior mutability 2019-05-25 19:30:44 -05:00
d440776bc0 Update lifetime of function builder references 2019-05-25 18:06:41 -05:00
9f2e068ff4 Implement conversion of signatures into clif signatures 2019-05-23 20:04:55 -05:00
a713043360 Update translate_operator op argument 2019-05-22 23:46:38 -05:00
5d3f6ea167 Fixing lifetime issues in clif codegen refactor 2019-05-22 17:21:16 -05:00
04d6ccc95c Pass module info to FCG as Arc 2019-05-21 23:44:31 -05:00
5db575e8ef Fix clif_signatures in function codegen 2019-05-19 15:22:02 -05:00
db669f7eb7 Fix more codegen compilation issues 2019-05-19 15:01:25 -05:00
d547beda72 Fix self.info compilation error in MCG.finalize 2019-05-19 13:05:35 -05:00
47479b547f Implement MCG.{finalize, from_cache} 2019-05-19 10:53:33 -05:00
6d5dd5ff21 Implement more function codegen 2019-05-19 00:27:39 -05:00
2d10306c87 Add copyright notice 2019-05-18 16:32:22 -05:00
74a758d39e Add progress on next_event 2019-05-18 16:31:08 -05:00
7315cd1100 Add some basic partial implementation of Cranelift codegen 2019-05-12 19:16:01 -05:00
d9cd4fc3e0 Add scaffold to use new code generator API for Cranelift 2019-05-12 11:05:26 -05:00