mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
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: https://github.com/v8/v8/commit/8a011b57d8b26e9cfe1c20a2ef26adb14be6ecc2 PR-URL: https://github.com/nodejs/node/pull/22531 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
3 files changed
+12
-5
No files matched your search
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
# Reset this number to 0 on major V8 upgrades.
|
||||
# Increment by one for each non-official patch applied to deps/v8.
|
||||
'v8_embedder_string': '-node.19',
|
||||
'v8_embedder_string': '-node.20',
|
||||
|
||||
# Enable disassembler for `--print-code` v8 options
|
||||
'v8_enable_disassembler': 1,
|
||||
|
||||
Vendored
+3
-1
@@ -1828,7 +1828,9 @@ class V8_EXPORT StackTrace {
|
||||
/**
|
||||
* Returns a StackFrame at a particular index.
|
||||
*/
|
||||
Local<StackFrame> GetFrame(uint32_t index) const;
|
||||
V8_DEPRECATE_SOON("Use Isolate version",
|
||||
Local<StackFrame> GetFrame(uint32_t index) const);
|
||||
Local<StackFrame> GetFrame(Isolate* isolate, uint32_t index) const;
|
||||
|
||||
/**
|
||||
* Returns the number of StackFrames.
|
||||
|
||||
Vendored
+8
-3
@@ -3023,15 +3023,20 @@ void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) {
|
||||
|
||||
// --- S t a c k T r a c e ---
|
||||
|
||||
Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
|
||||
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
|
||||
Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
|
||||
uint32_t index) const {
|
||||
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
|
||||
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
|
||||
EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate));
|
||||
EscapableHandleScope scope(v8_isolate);
|
||||
auto obj = handle(Utils::OpenHandle(this)->get(index), isolate);
|
||||
auto info = i::Handle<i::StackFrameInfo>::cast(obj);
|
||||
return scope.Escape(Utils::StackFrameToLocal(info));
|
||||
}
|
||||
|
||||
Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
|
||||
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
|
||||
return GetFrame(reinterpret_cast<Isolate*>(isolate), index);
|
||||
}
|
||||
|
||||
int StackTrace::GetFrameCount() const {
|
||||
return Utils::OpenHandle(this)->length();
|
||||
|
||||
Reference in new issue
Block a user