summaryrefslogtreecommitdiff
path: root/chromium/v8/src/execution/thread-local-top.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/src/execution/thread-local-top.h')
-rw-r--r--chromium/v8/src/execution/thread-local-top.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/chromium/v8/src/execution/thread-local-top.h b/chromium/v8/src/execution/thread-local-top.h
index 625fcc41ddc..57166299c56 100644
--- a/chromium/v8/src/execution/thread-local-top.h
+++ b/chromium/v8/src/execution/thread-local-top.h
@@ -8,6 +8,7 @@
#include "src/common/globals.h"
#include "src/execution/thread-id.h"
#include "src/objects/contexts.h"
+#include "src/utils/utils.h"
namespace v8 {
@@ -25,7 +26,7 @@ class ThreadLocalTop {
// TODO(all): This is not particularly beautiful. We should probably
// refactor this to really consist of just Addresses and 32-bit
// integer fields.
- static constexpr uint32_t kSizeInBytes = 23 * kSystemPointerSize;
+ static constexpr uint32_t kSizeInBytes = 24 * kSystemPointerSize;
// Does early low-level initialization that does not depend on the
// isolate being present.
@@ -56,6 +57,31 @@ class ThreadLocalTop {
v8::TryCatch::JSStackComparableAddress(try_catch_handler_));
}
+ // Call depth represents nested v8 api calls. Instead of storing the nesting
+ // level as an integer, we store the stack height of the last API entry. This
+ // additional information is used when we decide whether to trigger a debug
+ // break at a function entry.
+ template <typename Scope>
+ void IncrementCallDepth(Scope* stack_allocated_scope) {
+ stack_allocated_scope->previous_stack_height_ = last_api_entry_;
+#if defined(USE_SIMULATOR) || defined(V8_USE_ADDRESS_SANITIZER)
+ StoreCurrentStackPosition();
+#else
+ last_api_entry_ = reinterpret_cast<i::Address>(stack_allocated_scope);
+#endif
+ }
+
+#if defined(USE_SIMULATOR) || defined(V8_USE_ADDRESS_SANITIZER)
+ void StoreCurrentStackPosition();
+#endif
+
+ template <typename Scope>
+ void DecrementCallDepth(Scope* stack_allocated_scope) {
+ last_api_entry_ = stack_allocated_scope->previous_stack_height_;
+ }
+
+ bool CallDepthIsZero() const { return last_api_entry_ == kNullAddress; }
+
void Free();
Isolate* isolate_ = nullptr;
@@ -77,6 +103,8 @@ class ThreadLocalTop {
Address pending_handler_fp_ = kNullAddress;
Address pending_handler_sp_ = kNullAddress;
+ Address last_api_entry_ = kNullAddress;
+
// Communication channel between Isolate::Throw and message consumers.
Object pending_message_obj_;
bool rethrowing_message_ = false;