File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 455
455
* WASM_STACK_GUARD_SIZE needs to be large enough for:
456
456
*
457
457
* - native functions
458
+ *
458
459
* w/o hw bound check, the overhead (aot_call_function etc) + the native
459
460
* function itself. as of writing this, the former is about 1000 bytes
460
461
* on macOS amd64.
462
+ *
461
463
* with hw bound check, theoretically, only needs to cover the logic to
462
464
* set up the jmp_buf stack.
463
465
*
466
468
*
467
469
* - w/o hw bound check, the intepreter loop
468
470
*
471
+ * the classic interpreter wasm_interp_call_func_bytecode alone
472
+ * seems to consume about 2600 bytes stack.
473
+ * (with the default configuration for macOS/amd64)
474
+ *
475
+ * libc snprintf (used by eg. wasm_runtime_set_exception) consumes about
476
+ * 1600 bytes stack on macOS/amd64, about 2000 bytes on Ubuntu amd64 20.04.
477
+ *
469
478
* - stack check wrapper functions generated by the aot compiler
470
479
* (--stack-bounds-checks=1)
471
480
*
481
+ * wamrc issues a warning
482
+ * "precheck functions themselves consume relatively large amount of stack"
483
+ * when it detects wrapper functions requiring more than 1KB.
484
+ *
472
485
* Note: on platforms with lazy function binding, don't forget to consider
473
486
* the symbol resolution overhead on the first call. For example,
474
487
* on Ubuntu amd64 20.04, it seems to consume about 1500 bytes.
You can’t perform that action at this time.
0 commit comments