Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Unified Diff: runtime/vm/thread.h

Issue 1425093006: Revert "Switch profiler from isolates to threads" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 9bba418a5d6d8998bcfc8619c2256641a25085e6..c5f095c3a62300880d273c314d542bd036c4958e 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -92,6 +92,7 @@ class Zone;
CACHED_ADDRESSES_LIST(V) \
struct InterruptedThreadState {
+ ThreadId tid;
uintptr_t pc;
uintptr_t csp;
uintptr_t dsp;
@@ -108,8 +109,8 @@ struct InterruptedThreadState {
// * Allocating memory -- Because this takes locks which may already be held,
// resulting in a dead lock.
// * Taking a lock -- See above.
-typedef void (*ThreadInterruptCallback)(Thread* thread,
- const InterruptedThreadState& state);
+typedef void (*ThreadInterruptCallback)(const InterruptedThreadState& state,
+ void* data);
// A VM thread; may be executing Dart code or performing helper tasks like
// garbage collection or compilation. The Thread structure associated with
@@ -162,12 +163,6 @@ class Thread {
}
bool IsMutatorThread() const;
- // Is |this| executing Dart code?
- bool IsExecutingDartCode() const;
-
- // Has |this| exited Dart code?
- bool HasExitedDartCode() const;
-
// The (topmost) CHA for the compilation in this thread.
CHA* cha() const;
void set_cha(CHA* value);
@@ -382,10 +377,10 @@ LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
return join_id_;
}
- // Used to temporarily disable or enable thread interrupts.
- void DisableThreadInterrupts();
- void EnableThreadInterrupts();
- bool ThreadInterruptsEnabled();
+ void SetThreadInterrupter(ThreadInterruptCallback callback, void* data);
+
+ bool IsThreadInterrupterEnabled(ThreadInterruptCallback* callback,
+ void** data) const;
#if defined(DEBUG)
#define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \
@@ -429,7 +424,8 @@ LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD)
const ThreadId id_;
const ThreadId join_id_;
- uintptr_t thread_interrupt_disabled_;
+ ThreadInterruptCallback thread_interrupt_callback_;
+ void* thread_interrupt_data_;
Isolate* isolate_;
Heap* heap_;
State state_;
@@ -546,14 +542,6 @@ class ThreadIterator : public ValueObject {
void WindowsThreadCleanUp();
#endif
-
-// Disable thread interrupts.
-class DisableThreadInterruptsScope : public StackResource {
- public:
- explicit DisableThreadInterruptsScope(Thread* thread);
- ~DisableThreadInterruptsScope();
-};
-
} // namespace dart
#endif // VM_THREAD_H_
« no previous file with comments | « runtime/vm/stub_code.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698