From 6a546bd967290ad67a635d47ee849dc940f5b045 Mon Sep 17 00:00:00 2001 From: Clemens Backes Date: Mon, 22 Jun 2020 14:54:04 +0200 Subject: [PATCH] [wasm] Minor cleanup in wasm module builder This addresses a review comment from https://github.com/WebAssembly/spec/pull/1214. R=ahaas@chromium.org Change-Id: Icd473aa16bbf35839556b052271489a2889fe0fb Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2257229 Reviewed-by: Andreas Haas Commit-Queue: Clemens Backes Cr-Commit-Position: refs/heads/master@{#68461} --- test/mjsunit/wasm/wasm-module-builder.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js index e8423aa627..553c3f2f43 100644 --- a/test/mjsunit/wasm/wasm-module-builder.js +++ b/test/mjsunit/wasm/wasm-module-builder.js @@ -1119,14 +1119,10 @@ class WasmModuleBuilder { section.emit_u64v(global.init); break; case kWasmF32: - section.emit_u8(kExprF32Const); - data_view.setFloat32(0, global.init, true); - section.emit_bytes(byte_view.subarray(0, 4)); + section.emit_bytes(wasmF32Const(global.init)); break; case kWasmF64: - section.emit_u8(kExprF64Const); - data_view.setFloat64(0, global.init, true); - section.emit_bytes(byte_view); + section.emit_bytes(wasmF64Const(global.init)); break; case kWasmExternRef: section.emit_u8(kExprRefNull);