Reduce value of WASM_TABLE_SIZE and incraese JIT_THRESHOLD

Now that WASM_TABLE_SIZE may be capped, we set it slightly below the
limit under which chromium crashes: https://bugs.chromium.org/p/v8/issues/detail?id=8427

JIT_THRESHOLD is also reduced due to two reasons:

- With the lower WASM_TABLE_SIZE, we want to avoid compiling too many
  modules
- It has occasionally been observed that under node, the engine's wasm
  compiler can't catch up with the number of modules we produce, thus
  resulting in 100s of pending compiled modules. This most likely
  happens only under node as we don't render the screen and
  the main loop (based on setImmediate) is faster.
  The new value doesn't seem to exhibit this problem, but we may want to
  increase the threshold further if the problem appears again
This commit is contained in:
Fabian 2018-11-20 16:28:55 -06:00
parent 562c66ac6c
commit 23c5ebdf61
2 changed files with 4 additions and 4 deletions

View file

@ -346,9 +346,9 @@ var PREFIX_66 = PREFIX_MASK_OPSIZE; // alias
/** @const */
var MXCSR_MASK = (0xFFFF & ~(1 << 6));
// See same constant in jit.rs
/** @const */
var WASM_TABLE_SIZE = 0x10000;
var WASM_TABLE_SIZE = 900;
/** @const */
var WASM_TABLE_OFFSET = 1024;

View file

@ -15,7 +15,7 @@ use wasmgen::module_init;
use wasmgen::module_init::WasmBuilder;
use wasmgen::wasm_util::WasmBuf;
pub const WASM_TABLE_SIZE: u32 = 0x10000;
pub const WASM_TABLE_SIZE: u32 = 900;
pub const HASH_PRIME: u32 = 6151;
@ -25,7 +25,7 @@ pub const JIT_MAX_ITERATIONS_PER_FUNCTION: u32 = 10000;
pub const JIT_ALWAYS_USE_LOOP_SAFETY: bool = true;
pub const JIT_THRESHOLD: u32 = 8 * 10000;
pub const JIT_THRESHOLD: u32 = 200 * 1000;
const CONDITION_FUNCTIONS: [&str; 16] = [
"test_o", "test_no", "test_b", "test_nb", "test_z", "test_nz", "test_be", "test_nbe", "test_s",