Skip to content

Commit 3dc9cfc

Browse files
committed
deps: backport StackFrame::GetFrame with isolate
This overload was added in V8 6.9 and the one without isolate was removed in V8 7.0. Refs: v8/v8@8a011b5 PR-URL: #22531 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 1be23f7 commit 3dc9cfc

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Reset this number to 0 on major V8 upgrades.
3131
# Increment by one for each non-official patch applied to deps/v8.
32-
'v8_embedder_string': '-node.19',
32+
'v8_embedder_string': '-node.20',
3333

3434
# Enable disassembler for `--print-code` v8 options
3535
'v8_enable_disassembler': 1,

deps/v8/include/v8.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,9 @@ class V8_EXPORT StackTrace {
17351735
/**
17361736
* Returns a StackFrame at a particular index.
17371737
*/
1738-
Local<StackFrame> GetFrame(uint32_t index) const;
1738+
V8_DEPRECATE_SOON("Use Isolate version",
1739+
Local<StackFrame> GetFrame(uint32_t index) const);
1740+
Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
17391741

17401742
/**
17411743
* Returns the number of StackFrames.

deps/v8/src/api.cc

+8-3
Original file line numberDiff line numberDiff line change
@@ -3015,15 +3015,20 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
30153015

30163016
// --- S t a c k T r a c e ---
30173017

3018-
Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
3019-
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3018+
Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
3019+
uint32_t index) const {
3020+
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
30203021
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
3021-
EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate));
3022+
EscapableHandleScope scope(v8_isolate);
30223023
auto obj = handle(Utils::OpenHandle(this)->get(index), isolate);
30233024
auto info = i::Handle<i::StackFrameInfo>::cast(obj);
30243025
return scope.Escape(Utils::StackFrameToLocal(info));
30253026
}
30263027

3028+
Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
3029+
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3030+
return GetFrame(reinterpret_cast<Isolate*>(isolate), index);
3031+
}
30273032

30283033
int StackTrace::GetFrameCount() const {
30293034
return Utils::OpenHandle(this)->length();

0 commit comments

Comments
 (0)