Skip to content

Commit 15ae220

Browse files
committed
Experimental fixes
1 parent 0e41c1f commit 15ae220

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

patches/handle_scope.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git forkSrcPrefix/deps/v8/src/api/api.cc forkDstPrefix/deps/v8/src/api/api.cc
2-
index 2dd476dda34f1cfe3a75b7895009af24963372f2..6476204733a8aa87c4681dbeb5fee12db54e529d 100644
2+
index f9ce798dc29e1d48c6cb4de84cbcea9ddae0106b..ef607b02a7feaeca918abedbef86d16497ca8809 100644
33
--- forkSrcPrefix/deps/v8/src/api/api.cc
44
+++ forkDstPrefix/deps/v8/src/api/api.cc
55
@@ -883,7 +883,21 @@ void InternalFieldOutOfBounds(int index) {
@@ -25,16 +25,16 @@ index 2dd476dda34f1cfe3a75b7895009af24963372f2..6476204733a8aa87c4681dbeb5fee12d
2525

2626
void HandleScope::Initialize(Isolate* v8_isolate) {
2727
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
28-
@@ -908,6 +922,9 @@ void HandleScope::Initialize(Isolate* v8_isolate) {
29-
}
30-
31-
HandleScope::~HandleScope() {
28+
@@ -912,6 +926,9 @@ HandleScope::~HandleScope() {
29+
CHECK_EQ(scope_level_, i_isolate_->handle_scope_data()->level);
30+
#endif
31+
i::HandleScope::CloseScope(i_isolate_, prev_next_, prev_limit_);
3232
+ if(g_leaveScopeCB) {
3333
+ g_leaveScopeCB(reinterpret_cast<Isolate*>(i_isolate_));
3434
+ }
35-
#ifdef V8_ENABLE_CHECKS
36-
CHECK_EQ(scope_level_, i_isolate_->handle_scope_data()->level);
37-
#endif
35+
}
36+
37+
void* HandleScope::operator new(size_t) { base::OS::Abort(); }
3838
@@ -938,6 +955,9 @@ i::Address* HandleScope::CreateHandleForCurrentIsolate(i::Address value) {
3939
#endif // V8_ENABLE_DIRECT_LOCAL
4040

patches/race-condition-fix.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git forkSrcPrefix/src/node_api.cc forkDstPrefix/src/node_api.cc
2+
index 2769997f0ede0e921fcb8826942609e497e5f9cb..7a10dc53a036531d869b3fcff2496ddf1e28038d 100644
3+
--- forkSrcPrefix/src/node_api.cc
4+
+++ forkDstPrefix/src/node_api.cc
5+
@@ -1206,7 +1206,7 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork {
6+
// Establish a handle scope here so that every callback doesn't have to.
7+
// Also it is needed for the exception-handling below.
8+
v8::HandleScope scope(_env->isolate);
9+
-
10+
+ v8::Context::Scope context_scope(_env->context());
11+
CallbackScope callback_scope(this);
12+
13+
_env->CallbackIntoModule<true>([&](napi_env env) {

0 commit comments

Comments
 (0)