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

Unified Diff: runtime/vm/stack_frame.h

Issue 2845053003: Fix asserts in StackFrameIterator which were effectively disabled (Closed)
Patch Set: Add StackFrameIterator::{ValidationPolicy,CrossThreadPolicy} enums Created 3 years, 8 months 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/simulator_mips.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.h
diff --git a/runtime/vm/stack_frame.h b/runtime/vm/stack_frame.h
index 1d5c6100518347c0190b12e5511be46f17e43b6a..37f1a33b2372536bfc089f9d4f008cb0729a2d15 100644
--- a/runtime/vm/stack_frame.h
+++ b/runtime/vm/stack_frame.h
@@ -206,16 +206,24 @@ class EntryFrame : public StackFrame {
// concurrently.
class StackFrameIterator : public ValueObject {
public:
- static const bool kValidateFrames = true;
- static const bool kDontValidateFrames = false;
+ enum ValidationPolicy {
+ kValidateFrames = 0,
+ kDontValidateFrames = 1,
+ };
+ enum CrossThreadPolicy {
+ kNoCrossThreadIteration = 0,
+ kAllowCrossThreadIteration = 1,
+ };
// Iterators for iterating over all frames from the last ExitFrame to the
// first EntryFrame.
- explicit StackFrameIterator(bool validate,
- Thread* thread = Thread::Current());
+ explicit StackFrameIterator(ValidationPolicy validation_policy,
+ Thread* thread,
+ CrossThreadPolicy cross_thread_policy);
StackFrameIterator(uword last_fp,
- bool validate,
- Thread* thread = Thread::Current());
+ ValidationPolicy validation_policy,
+ Thread* thread,
+ CrossThreadPolicy cross_thread_policy);
#if !defined(TARGET_ARCH_DBC)
// Iterator for iterating over all frames from the current frame (given by its
@@ -223,8 +231,9 @@ class StackFrameIterator : public ValueObject {
StackFrameIterator(uword fp,
uword sp,
uword pc,
- bool validate,
- Thread* thread = Thread::Current());
+ ValidationPolicy validation_policy,
+ Thread* thread,
+ CrossThreadPolicy cross_thread_policy);
#endif
// Checks if a next frame exists.
@@ -302,17 +311,33 @@ class StackFrameIterator : public ValueObject {
// isolate given is not running concurrently on another thread.
class DartFrameIterator : public ValueObject {
public:
- explicit DartFrameIterator(Thread* thread = Thread::Current())
- : frames_(StackFrameIterator::kDontValidateFrames, thread) {}
- explicit DartFrameIterator(uword last_fp, Thread* thread = Thread::Current())
- : frames_(last_fp, StackFrameIterator::kDontValidateFrames, thread) {}
+ explicit DartFrameIterator(
+ Thread* thread,
+ StackFrameIterator::CrossThreadPolicy cross_thread_policy)
+ : frames_(StackFrameIterator::kDontValidateFrames,
+ thread,
+ cross_thread_policy) {}
+ explicit DartFrameIterator(
+ uword last_fp,
+ Thread* thread,
+ StackFrameIterator::CrossThreadPolicy cross_thread_policy)
+ : frames_(last_fp,
+ StackFrameIterator::kDontValidateFrames,
+ thread,
+ cross_thread_policy) {}
#if !defined(TARGET_ARCH_DBC)
DartFrameIterator(uword fp,
uword sp,
uword pc,
- Thread* thread = Thread::Current())
- : frames_(fp, sp, pc, StackFrameIterator::kDontValidateFrames, thread) {}
+ Thread* thread,
+ StackFrameIterator::CrossThreadPolicy cross_thread_policy)
+ : frames_(fp,
+ sp,
+ pc,
+ StackFrameIterator::kDontValidateFrames,
+ thread,
+ cross_thread_policy) {}
#endif
// Get next dart frame.
« no previous file with comments | « runtime/vm/simulator_mips.cc ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698