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

Unified Diff: runtime/vm/exceptions.cc

Issue 2845053003: Fix asserts in StackFrameIterator which were effectively disabled (Closed)
Patch Set: remote two assertions which cannot be made 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
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 67afc0ca69098fbc5d2414760bee113f3dfde966..a612921605d444f4d9bbe31bb1f152cd2981e820 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -128,7 +128,8 @@ void PreallocatedStackTraceBuilder::AddFrame(const Code& code,
static void BuildStackTrace(StackTraceBuilder* builder) {
- StackFrameIterator frames(StackFrameIterator::kDontValidateFrames);
+ StackFrameIterator frames(StackFrameIterator::kDontValidateFrames,
+ Thread::Current(), false);
StackFrame* frame = frames.NextFrame();
ASSERT(frame != NULL); // We expect to find a dart invocation frame.
Code& code = Code::Handle();
@@ -169,7 +170,8 @@ class ExceptionHandlerFinder : public StackResource {
// can continue in that frame. Sets 'needs_stacktrace' if there is no
// cath-all handler or if a stack-trace is specified in the catch.
bool Find() {
- StackFrameIterator frames(StackFrameIterator::kDontValidateFrames);
+ StackFrameIterator frames(StackFrameIterator::kDontValidateFrames,
+ Thread::Current(), false);
StackFrame* frame = frames.NextFrame();
if (frame == NULL) return false; // No Dart frame.
handler_pc_set_ = false;
@@ -347,7 +349,8 @@ class ExceptionHandlerFinder : public StackResource {
static void FindErrorHandler(uword* handler_pc,
uword* handler_sp,
uword* handler_fp) {
- StackFrameIterator frames(StackFrameIterator::kDontValidateFrames);
+ StackFrameIterator frames(StackFrameIterator::kDontValidateFrames,
+ Thread::Current(), false);
StackFrame* frame = frames.NextFrame();
ASSERT(frame != NULL);
while (!frame->IsEntryFrame()) {
@@ -400,7 +403,7 @@ static void ClearLazyDeopts(Thread* thread, uword frame_pointer) {
// frames from the pending deopt table, but only after unmarking them so
// any stack walk that happens before the stack is unwound will still work.
{
- DartFrameIterator frames(thread);
+ DartFrameIterator frames(thread, false);
StackFrame* frame = frames.NextFrame();
while ((frame != NULL) && (frame->fp() < frame_pointer)) {
if (frame->IsMarkedForLazyDeopt()) {
@@ -669,7 +672,8 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
const String& dst_name,
const String& bound_error_msg) {
ASSERT(!dst_name.IsNull()); // Pass Symbols::Empty() instead.
- Zone* zone = Thread::Current()->zone();
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
const Array& args = Array::Handle(zone, Array::New(4));
ExceptionType exception_type =
@@ -678,7 +682,7 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
? kCast
: kType;
- DartFrameIterator iterator;
+ DartFrameIterator iterator(thread, false);
const Script& script = Script::Handle(zone, GetCallerScript(&iterator));
intptr_t line = -1;
intptr_t column = -1;

Powered by Google App Engine
This is Rietveld 408576698