Skip to content

Commit

Permalink
Revert "[wasi] Stop using V8 fast API"
Browse files Browse the repository at this point in the history
This reverts commit 0d5d171.
  • Loading branch information
gahaas committed Jun 24, 2024
1 parent 0d5d171 commit ff04a69
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/node_wasi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,16 @@ 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);
v8::SideEffectType::kHasSideEffect,
&c_function);
const v8::NewStringType type = v8::NewStringType::kInternalized;
Local<String> name_string =
String::NewFromUtf8(env->isolate(), name, type).ToLocalChecked();
Expand Down Expand Up @@ -249,7 +251,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 EinvalError<R>();
return;
}
Local<ArrayBuffer> ab = wasi->memory_.Get(isolate)->Buffer();
size_t mem_size = ab->ByteLength();
Expand Down

0 comments on commit ff04a69

Please sign in to comment.