Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
src: remove unnecessary Isolate::GetCurrent() calls
These calls are unnecessary in Release mode but would still have
been included, so move them to the `DebugSealHandleScope` constructor.
  • Loading branch information
addaleax committed May 8, 2020
commit 773e6699c5d79330c89e699261565ff2312dfe71
2 changes: 1 addition & 1 deletion src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class DebugSealHandleScope {
public:
explicit inline DebugSealHandleScope(v8::Isolate* isolate)
Comment thread
addaleax marked this conversation as resolved.
Outdated
#ifdef DEBUG
: actual_scope_(isolate)
: actual_scope_(isolate != nullptr ? isolate : v8::Isolate::GetCurrent())
#endif
{}

Expand Down
10 changes: 5 additions & 5 deletions src/stream_base-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,29 @@ void StreamResource::RemoveStreamListener(StreamListener* listener) {
}

uv_buf_t StreamResource::EmitAlloc(size_t suggested_size) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
return listener_->OnStreamAlloc(suggested_size);
}

void StreamResource::EmitRead(ssize_t nread, const uv_buf_t& buf) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
if (nread > 0)
bytes_read_ += static_cast<uint64_t>(nread);
listener_->OnStreamRead(nread, buf);
}

void StreamResource::EmitAfterWrite(WriteWrap* w, int status) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
listener_->OnStreamAfterWrite(w, status);
}

void StreamResource::EmitAfterShutdown(ShutdownWrap* w, int status) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
listener_->OnStreamAfterShutdown(w, status);
}

void StreamResource::EmitWantsWrite(size_t suggested_size) {
DebugSealHandleScope handle_scope(v8::Isolate::GetCurrent());
DebugSealHandleScope handle_scope(nullptr);
listener_->OnStreamWantsWrite(suggested_size);
}

Expand Down