From 58d5221386c2e689af778c03a71188829f4e52c1 Mon Sep 17 00:00:00 2001 From: gahaas Date: Mon, 24 Jun 2024 12:16:04 +0200 Subject: [PATCH] Reverts https://github.com/v8/node/pull/192 (#193) * [wasi] Stop using V8 fast API * Revert "[wasi] Stop using V8 fast API" This reverts commit 0d5d171017e857712093189f3a357cee862635e0. * Revert "[v8] Stop using deprecated fields of v8::FastApiCallbackOptions (#192)" This reverts commit 286ed38fb55e183f20e4d51d30e8ffb844cd5864. --- src/node_wasi.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/node_wasi.cc b/src/node_wasi.cc index e4503a8c6a70dc..4c06761c6ac1ce 100644 --- a/src/node_wasi.cc +++ b/src/node_wasi.cc @@ -258,12 +258,12 @@ R WASI::WasiFunction::FastCallback( THROW_ERR_WASI_NOT_STARTED(isolate); return EinvalError(); } - Local ab = wasi->memory_.Get(isolate)->Buffer(); - size_t mem_size = ab->ByteLength(); - char* mem_data = static_cast(ab->Data()); - CHECK_NOT_NULL(mem_data); + uint8_t* memory = nullptr; + CHECK(LIKELY(options.wasm_memory->getStorageIfAligned(&memory))); - return F(*wasi, {mem_data, mem_size}, args...); + return F(*wasi, + {reinterpret_cast(memory), options.wasm_memory->length()}, + args...); } namespace {