OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/stack_frame.h" | 5 #include "vm/stack_frame.h" |
6 | 6 |
7 #include "platform/memory_sanitizer.h" | 7 #include "platform/memory_sanitizer.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/deopt_instructions.h" | 9 #include "vm/deopt_instructions.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 ASSERT(pc_marker != 0); | 243 ASSERT(pc_marker != 0); |
244 ASSERT(reinterpret_cast<RawObject*>(pc_marker)->GetClassId() == kCodeCid || | 244 ASSERT(reinterpret_cast<RawObject*>(pc_marker)->GetClassId() == kCodeCid || |
245 reinterpret_cast<RawObject*>(pc_marker) == Object::null()); | 245 reinterpret_cast<RawObject*>(pc_marker) == Object::null()); |
246 return reinterpret_cast<RawCode*>(pc_marker); | 246 return reinterpret_cast<RawCode*>(pc_marker); |
247 } | 247 } |
248 | 248 |
249 | 249 |
250 bool StackFrame::FindExceptionHandler(Thread* thread, | 250 bool StackFrame::FindExceptionHandler(Thread* thread, |
251 uword* handler_pc, | 251 uword* handler_pc, |
252 bool* needs_stacktrace, | 252 bool* needs_stacktrace, |
253 bool* has_catch_all, | 253 bool* has_catch_all) const { |
254 bool* is_optimized) const { | |
255 REUSABLE_CODE_HANDLESCOPE(thread); | 254 REUSABLE_CODE_HANDLESCOPE(thread); |
256 Code& code = reused_code_handle.Handle(); | 255 Code& code = reused_code_handle.Handle(); |
257 code = LookupDartCode(); | 256 code = LookupDartCode(); |
258 if (code.IsNull()) { | 257 if (code.IsNull()) { |
259 return false; // Stub frames do not have exception handlers. | 258 return false; // Stub frames do not have exception handlers. |
260 } | 259 } |
261 *is_optimized = code.is_optimized(); | |
262 HandlerInfoCache* cache = thread->isolate()->handler_info_cache(); | 260 HandlerInfoCache* cache = thread->isolate()->handler_info_cache(); |
263 ExceptionHandlerInfo* info = cache->Lookup(pc()); | 261 ExceptionHandlerInfo* info = cache->Lookup(pc()); |
264 if (info != NULL) { | 262 if (info != NULL) { |
265 *handler_pc = code.PayloadStart() + info->handler_pc_offset; | 263 *handler_pc = code.PayloadStart() + info->handler_pc_offset; |
266 *needs_stacktrace = info->needs_stacktrace; | 264 *needs_stacktrace = info->needs_stacktrace; |
267 *has_catch_all = info->has_catch_all; | 265 *has_catch_all = info->has_catch_all; |
268 return true; | 266 return true; |
269 } | 267 } |
270 uword pc_offset = pc() - code.PayloadStart(); | 268 uword pc_offset = pc() - code.PayloadStart(); |
271 | 269 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 StackFrameIterator frames(StackFrameIterator::kValidateFrames); | 581 StackFrameIterator frames(StackFrameIterator::kValidateFrames); |
584 StackFrame* frame = frames.NextFrame(); | 582 StackFrame* frame = frames.NextFrame(); |
585 while (frame != NULL) { | 583 while (frame != NULL) { |
586 frame = frames.NextFrame(); | 584 frame = frames.NextFrame(); |
587 } | 585 } |
588 } | 586 } |
589 #endif | 587 #endif |
590 | 588 |
591 | 589 |
592 } // namespace dart | 590 } // namespace dart |
OLD | NEW |