diff options
author | Ben Smith <binji@chromium.org> | 2016-04-25 14:02:22 -0700 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-04-28 23:47:03 -0700 |
commit | bcc7c471e160a6648abf61b1860072b25a9bfbc6 (patch) | |
tree | b929dfeb08a682b08945c6447b3f825295e824bf /src/wasm-binary-reader-interpreter.c | |
parent | 4b65b16cba2eb3aa173848377079c0523c9c896f (diff) | |
download | wabt-bcc7c471e160a6648abf61b1860072b25a9bfbc6.tar.gz wabt-bcc7c471e160a6648abf61b1860072b25a9bfbc6.tar.bz2 wabt-bcc7c471e160a6648abf61b1860072b25a9bfbc6.zip |
rename memory_size -> current_memory
* current_memory and grow_memory return page size, not byte size
* also update testsuite, which fixes a couple of spec tests
* disable d8/spec tests (in a hacky way), because the binary_0xb v8
support isn't landed yet, so we can't easily test it
Diffstat (limited to 'src/wasm-binary-reader-interpreter.c')
-rw-r--r-- | src/wasm-binary-reader-interpreter.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wasm-binary-reader-interpreter.c b/src/wasm-binary-reader-interpreter.c index 8916ad70..2b5e16c6 100644 --- a/src/wasm-binary-reader-interpreter.c +++ b/src/wasm-binary-reader-interpreter.c @@ -879,9 +879,9 @@ static WasmResult on_store_expr(WasmOpcode opcode, return push_expr(ctx, type, opcode); } -static WasmResult on_memory_size_expr(void* user_data) { +static WasmResult on_current_memory_expr(void* user_data) { WasmContext* ctx = user_data; - return push_expr(ctx, WASM_TYPE_I32, WASM_OPCODE_MEMORY_SIZE); + return push_expr(ctx, WASM_TYPE_I32, WASM_OPCODE_CURRENT_MEMORY); } static WasmResult on_nop_expr(void* user_data) { @@ -1526,11 +1526,11 @@ static WasmResult on_emit_store_expr(WasmOpcode opcode, return WASM_OK; } -static WasmResult on_emit_memory_size_expr(void* user_data) { +static WasmResult on_emit_current_memory_expr(void* user_data) { WasmContext* ctx = user_data; LOGF("%3" PRIzd ": %s\n", ctx->value_stack_size, - s_opcode_name[WASM_OPCODE_MEMORY_SIZE]); - CHECK_RESULT(emit_opcode(ctx, WASM_OPCODE_MEMORY_SIZE)); + s_opcode_name[WASM_OPCODE_CURRENT_MEMORY]); + CHECK_RESULT(emit_opcode(ctx, WASM_OPCODE_CURRENT_MEMORY)); adjust_value_stack(ctx, 1); CHECK_RESULT(maybe_emit_discard(ctx, ctx->expr_count)); ctx->expr_count++; @@ -1707,7 +1707,7 @@ static WasmBinaryReader s_binary_reader = { .on_if_expr = &on_if_expr, .on_load_expr = &on_load_expr, .on_loop_expr = &on_loop_expr, - .on_memory_size_expr = &on_memory_size_expr, + .on_current_memory_expr = &on_current_memory_expr, .on_nop_expr = &on_nop_expr, .on_return_expr = &on_return_expr, .on_select_expr = &on_select_expr, @@ -1755,7 +1755,7 @@ static WasmBinaryReader s_binary_reader_emit = { .on_if_expr = &on_emit_if_expr, .on_load_expr = &on_emit_load_expr, .on_loop_expr = &on_emit_loop_expr, - .on_memory_size_expr = &on_emit_memory_size_expr, + .on_current_memory_expr = &on_emit_current_memory_expr, .on_nop_expr = &on_emit_nop_expr, .on_return_expr = &on_emit_return_expr, .on_select_expr = &on_emit_select_expr, |