Skip to content

Commit

Permalink
Reland: [v8] Stop using deprecated fields of v8::FastApiCallbackOptio…
Browse files Browse the repository at this point in the history
…ns (#196)

* Reland: [v8] Stop using deprecated fields of v8::FastApiCallbackOptions

Two fields on the v8::FastApiCallbackOptions struct were deprecated
recently, fallback and wasm_memory. This PR removes uses of these two
fields in node.js.

This change is a refactoring and does not add new features. Therefore
existing tests should be sufficient.

* return correct type
  • Loading branch information
gahaas authored and pthier committed Oct 2, 2024
1 parent 58d5221 commit 9990172
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/node_wasi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ R WASI::WasiFunction<FT, F, R, Args...>::FastCallback(
THROW_ERR_WASI_NOT_STARTED(isolate);
return EinvalError<R>();
}
uint8_t* memory = nullptr;
CHECK(LIKELY(options.wasm_memory->getStorageIfAligned(&memory)));
Local<ArrayBuffer> ab = wasi->memory_.Get(isolate)->Buffer();
size_t mem_size = ab->ByteLength();
char* mem_data = static_cast<char*>(ab->Data());
CHECK_NOT_NULL(mem_data);

return F(*wasi,
{reinterpret_cast<char*>(memory), options.wasm_memory->length()},
args...);
return F(*wasi, {mem_data, mem_size}, args...);
}

namespace {
Expand Down

0 comments on commit 9990172

Please sign in to comment.