GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src,http_parser: remove KickNextTick call · nodejs/node@f1488bb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • async-wrap.cc
    • env.cc
    • env.h
    • node.cc
    • node_http_parser.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/async-wrap.cc‎

Copy file name to clipboardExpand all lines: src/async-wrap.cc
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
181181
Local<Function> post_fn = env()->async_hooks_post_function();
182182
Local<Value> uid = Integer::New(env()->isolate(), get_uid());
183183
Local<Object> context = object();
184-
Local<Object> process = env()->process_object();
185184
Local<Object> domain;
186185
bool has_domain = false;
187186

@@ -233,16 +232,18 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
233232
}
234233
}
235234

236-
Environment::TickInfo* tick_info = env()->tick_info();
237-
238235
if (callback_scope.in_makecallback()) {
239236
return ret;
240237
}
241238

239+
Environment::TickInfo* tick_info = env()->tick_info();
240+
242241
if (tick_info->length() == 0) {
243242
env()->isolate()->RunMicrotasks();
244243
}
245244

245+
Local<Object> process = env()->process_object();
246+
246247
if (tick_info->length() == 0) {
247248
tick_info->set_index(0);
248249
return ret;
Collapse file

‎src/env.cc‎

Copy file name to clipboardExpand all lines: src/env.cc
-23Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,27 +64,4 @@ void Environment::PrintSyncTrace() const {
6464
fflush(stderr);
6565
}
6666

67-
68-
bool Environment::KickNextTick(Environment::AsyncCallbackScope* scope) {
69-
TickInfo* info = tick_info();
70-
71-
if (scope->in_makecallback()) {
72-
return true;
73-
}
74-
75-
if (info->length() == 0) {
76-
isolate()->RunMicrotasks();
77-
}
78-
79-
if (info->length() == 0) {
80-
info->set_index(0);
81-
return true;
82-
}
83-
84-
Local<Value> ret =
85-
tick_callback_function()->Call(process_object(), 0, nullptr);
86-
87-
return !ret.IsEmpty();
88-
}
89-
9067
} // namespace node
Collapse file

‎src/env.h‎

Copy file name to clipboardExpand all lines: src/env.h
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,6 @@ class Environment {
467467

468468
inline int64_t get_async_wrap_uid();
469469

470-
bool KickNextTick(AsyncCallbackScope* scope);
471-
472470
inline uint32_t* heap_statistics_buffer() const;
473471
inline void set_heap_statistics_buffer(uint32_t* pointer);
474472

Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+17-1Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,23 @@ Local<Value> MakeCallback(Environment* env,
12041204
}
12051205
}
12061206

1207-
if (!env->KickNextTick(&callback_scope)) {
1207+
if (callback_scope.in_makecallback()) {
1208+
return ret;
1209+
}
1210+
1211+
Environment::TickInfo* tick_info = env->tick_info();
1212+
1213+
if (tick_info->length() == 0) {
1214+
env->isolate()->RunMicrotasks();
1215+
}
1216+
1217+
Local<Object> process = env->process_object();
1218+
1219+
if (tick_info->length() == 0) {
1220+
tick_info->set_index(0);
1221+
}
1222+
1223+
if (env->tick_callback_function()->Call(process, 0, nullptr).IsEmpty()) {
12081224
return Undefined(env->isolate());
12091225
}
12101226

Collapse file

‎src/node_http_parser.cc‎

Copy file name to clipboardExpand all lines: src/node_http_parser.cc
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,6 @@ class Parser : public AsyncWrap {
587587
if (!cb->IsFunction())
588588
return;
589589

590-
Environment::AsyncCallbackScope callback_scope(parser->env());
591-
592590
// Hooks for GetCurrentBuffer
593591
parser->current_buffer_len_ = nread;
594592
parser->current_buffer_data_ = buf->base;
@@ -597,8 +595,6 @@ class Parser : public AsyncWrap {
597595

598596
parser->current_buffer_len_ = 0;
599597
parser->current_buffer_data_ = nullptr;
600-
601-
parser->env()->KickNextTick(&callback_scope);
602598
}
603599

604600

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.