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
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/async-wrap.cc +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -181,7 +181,6 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb, |
181 | 181 | Local<Function> post_fn = env()->async_hooks_post_function(); |
182 | 182 | Local<Value> uid = Integer::New(env()->isolate(), get_uid()); |
183 | 183 | Local<Object> context = object(); |
184 | | - Local<Object> process = env()->process_object(); |
185 | 184 | Local<Object> domain; |
186 | 185 | bool has_domain = false; |
187 | 186 |
|
@@ -233,16 +232,18 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb, |
233 | 232 | } |
234 | 233 | } |
235 | 234 |
|
236 | | - Environment::TickInfo* tick_info = env()->tick_info(); |
237 | | - |
238 | 235 | if (callback_scope.in_makecallback()) { |
239 | 236 | return ret; |
240 | 237 | } |
241 | 238 |
|
| 239 | + Environment::TickInfo* tick_info = env()->tick_info(); |
| 240 | + |
242 | 241 | if (tick_info->length() == 0) { |
243 | 242 | env()->isolate()->RunMicrotasks(); |
244 | 243 | } |
245 | 244 |
|
| 245 | + Local<Object> process = env()->process_object(); |
| 246 | + |
246 | 247 | if (tick_info->length() == 0) { |
247 | 248 | tick_info->set_index(0); |
248 | 249 | return ret; |
|
Collapse file
Copy file name to clipboardExpand all lines: src/env.cc -23Lines changed: 0 additions & 23 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -64,27 +64,4 @@ void Environment::PrintSyncTrace() const { |
64 | 64 | fflush(stderr); |
65 | 65 | } |
66 | 66 |
|
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 | | - |
90 | 67 | } // namespace node |
Collapse file
Copy file name to clipboardExpand all lines: src/env.h -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -467,8 +467,6 @@ class Environment { |
467 | 467 |
|
468 | 468 | inline int64_t get_async_wrap_uid(); |
469 | 469 |
|
470 | | - bool KickNextTick(AsyncCallbackScope* scope); |
471 | | - |
472 | 470 | inline uint32_t* heap_statistics_buffer() const; |
473 | 471 | inline void set_heap_statistics_buffer(uint32_t* pointer); |
474 | 472 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/node.cc +17-1Lines changed: 17 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1204,7 +1204,23 @@ Local<Value> MakeCallback(Environment* env, |
1204 | 1204 | } |
1205 | 1205 | } |
1206 | 1206 |
|
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()) { |
1208 | 1224 | return Undefined(env->isolate()); |
1209 | 1225 | } |
1210 | 1226 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/node_http_parser.cc -4Lines changed: 0 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -587,8 +587,6 @@ class Parser : public AsyncWrap { |
587 | 587 | if (!cb->IsFunction()) |
588 | 588 | return; |
589 | 589 |
|
590 | | - Environment::AsyncCallbackScope callback_scope(parser->env()); |
591 | | - |
592 | 590 | // Hooks for GetCurrentBuffer |
593 | 591 | parser->current_buffer_len_ = nread; |
594 | 592 | parser->current_buffer_data_ = buf->base; |
@@ -597,8 +595,6 @@ class Parser : public AsyncWrap { |
597 | 595 |
|
598 | 596 | parser->current_buffer_len_ = 0; |
599 | 597 | parser->current_buffer_data_ = nullptr; |
600 | | - |
601 | | - parser->env()->KickNextTick(&callback_scope); |
602 | 598 | } |
603 | 599 |
|
604 | 600 |
|
|