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