Skip to content

Commit

Permalink
frame_locals_cellidx: give the compiler a hint for optimization
Browse files Browse the repository at this point in the history
clang produces considerably simpler code with this.
probably we can replace all assert() with xassert().

coremark w/o this change:

400.097917
400.005627
396.283992
398.154210
400.181149
N  |min       |max       |mean      |median    |stddev
  5|    396.28|    400.18|    398.94|    400.01|      1.71

coremark with this change:

405.394942
403.464089
404.581726
398.732456
398.893735
N  |min       |max       |mean      |median    |stddev
  5|    398.73|    405.39|    402.21|    403.46|      3.18
  • Loading branch information
yamt committed Jan 21, 2023
1 parent b0b9fdb commit fcc08ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/cell.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ uint32_t
frame_locals_cellidx(struct exec_context *ctx, uint32_t localidx,
uint32_t *cszp)
{
xassert(cszp != NULL);
#if defined(TOYWASM_USE_SMALL_CELLS)
uint32_t cidx;
uint32_t nparams = ctx->paramtype->ntypes;
Expand Down

0 comments on commit fcc08ef

Please sign in to comment.