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) const { | 253 bool* has_catch_all, |
| 254 bool* is_optimized) const { |
254 REUSABLE_CODE_HANDLESCOPE(thread); | 255 REUSABLE_CODE_HANDLESCOPE(thread); |
255 Code& code = reused_code_handle.Handle(); | 256 Code& code = reused_code_handle.Handle(); |
256 code = LookupDartCode(); | 257 code = LookupDartCode(); |
257 if (code.IsNull()) { | 258 if (code.IsNull()) { |
258 return false; // Stub frames do not have exception handlers. | 259 return false; // Stub frames do not have exception handlers. |
259 } | 260 } |
| 261 *is_optimized = code.is_optimized(); |
260 HandlerInfoCache* cache = thread->isolate()->handler_info_cache(); | 262 HandlerInfoCache* cache = thread->isolate()->handler_info_cache(); |
261 ExceptionHandlerInfo* info = cache->Lookup(pc()); | 263 ExceptionHandlerInfo* info = cache->Lookup(pc()); |
262 if (info != NULL) { | 264 if (info != NULL) { |
263 *handler_pc = code.PayloadStart() + info->handler_pc_offset; | 265 *handler_pc = code.PayloadStart() + info->handler_pc_offset; |
264 *needs_stacktrace = info->needs_stacktrace; | 266 *needs_stacktrace = info->needs_stacktrace; |
265 *has_catch_all = info->has_catch_all; | 267 *has_catch_all = info->has_catch_all; |
266 return true; | 268 return true; |
267 } | 269 } |
268 uword pc_offset = pc() - code.PayloadStart(); | 270 uword pc_offset = pc() - code.PayloadStart(); |
269 | 271 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 StackFrameIterator frames(StackFrameIterator::kValidateFrames); | 583 StackFrameIterator frames(StackFrameIterator::kValidateFrames); |
582 StackFrame* frame = frames.NextFrame(); | 584 StackFrame* frame = frames.NextFrame(); |
583 while (frame != NULL) { | 585 while (frame != NULL) { |
584 frame = frames.NextFrame(); | 586 frame = frames.NextFrame(); |
585 } | 587 } |
586 } | 588 } |
587 #endif | 589 #endif |
588 | 590 |
589 | 591 |
590 } // namespace dart | 592 } // namespace dart |
OLD | NEW |