Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: src/wasm/wasm-module-builder.cc

Issue 2595733003: [wasm] Remove non-standard kExprI8Const bytecode (Closed)
Patch Set: Remove regression test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/wasm/wasm-module-builder.cc
diff --git a/src/wasm/wasm-module-builder.cc b/src/wasm/wasm-module-builder.cc
index f5228439ce5b581ef943ae290c67c3b549a42883..c6e4ab6e956cce271d31568141154cf04e8ef70a 100644
--- a/src/wasm/wasm-module-builder.cc
+++ b/src/wasm/wasm-module-builder.cc
@@ -122,10 +122,10 @@ void WasmFunctionBuilder::EmitWithVarInt(WasmOpcode opcode,
}
void WasmFunctionBuilder::EmitI32Const(int32_t value) {
- // TODO(titzer): variable-length signed and unsigned i32 constants.
- if (-128 <= value && value <= 127) {
- EmitWithU8(kExprI8Const, static_cast<byte>(value));
+ if (-64 <= value && value <= 63) {
+ EmitWithU8(kExprI32Const, static_cast<byte>(value & 0x7F));
} else {
+ // TODO(titzer): variable-length signed and unsigned i32 constants.
byte code[] = {WASM_I32V_5(value)};
EmitCode(code, sizeof(code));
}

Powered by Google App Engine
This is Rietveld 408576698