Skip to content

Commit

Permalink
[wasi] Stop using V8 fast API
Browse files Browse the repository at this point in the history
  • Loading branch information
gahaas committed Jun 21, 2024
1 parent 286ed38 commit 0d5d171
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/node_wasi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,14 @@ void WASI::New(const FunctionCallbackInfo<Value>& args) {
template <typename FT, FT F, typename R, typename... Args>
void WASI::WasiFunction<FT, F, R, Args...>::SetFunction(
Environment* env, const char* name, Local<FunctionTemplate> tmpl) {
auto c_function = CFunction::Make(FastCallback);
Local<FunctionTemplate> t =
FunctionTemplate::New(env->isolate(),
SlowCallback,
Local<Value>(),
Local<Signature>(),
sizeof...(Args),
v8::ConstructorBehavior::kThrow,
v8::SideEffectType::kHasSideEffect,
&c_function);
v8::SideEffectType::kHasSideEffect);
const v8::NewStringType type = v8::NewStringType::kInternalized;
Local<String> name_string =
String::NewFromUtf8(env->isolate(), name, type).ToLocalChecked();
Expand Down Expand Up @@ -251,7 +249,7 @@ R WASI::WasiFunction<FT, F, R, Args...>::FastCallback(
v8::Isolate* isolate = receiver->GetIsolate();
if (wasi->memory_.IsEmpty()) {
THROW_ERR_WASI_NOT_STARTED(isolate);
return;
return EinvalError<R>();
}
Local<ArrayBuffer> ab = wasi->memory_.Get(isolate)->Buffer();
size_t mem_size = ab->ByteLength();
Expand Down

0 comments on commit 0d5d171

Please sign in to comment.