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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 RawCode* StackFrame::GetCodeObject() const { | 196 RawCode* StackFrame::GetCodeObject() const { |
197 const uword pc_marker = | 197 const uword pc_marker = |
198 *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize))); | 198 *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize))); |
199 ASSERT(pc_marker != 0); | 199 ASSERT(pc_marker != 0); |
200 ASSERT(reinterpret_cast<RawObject*>(pc_marker)->GetClassId() == kCodeCid || | 200 ASSERT(reinterpret_cast<RawObject*>(pc_marker)->GetClassId() == kCodeCid || |
201 reinterpret_cast<RawObject*>(pc_marker) == Object::null()); | 201 reinterpret_cast<RawObject*>(pc_marker) == Object::null()); |
202 return reinterpret_cast<RawCode*>(pc_marker); | 202 return reinterpret_cast<RawCode*>(pc_marker); |
203 } | 203 } |
204 | 204 |
205 | 205 |
206 bool StackFrame::FindExceptionHandler(Isolate* isolate, | 206 bool StackFrame::FindExceptionHandler(Thread* thread, |
207 uword* handler_pc, | 207 uword* handler_pc, |
208 bool* needs_stacktrace, | 208 bool* needs_stacktrace, |
209 bool* has_catch_all) const { | 209 bool* has_catch_all) const { |
| 210 Isolate* isolate = thread->isolate(); |
210 REUSABLE_CODE_HANDLESCOPE(isolate); | 211 REUSABLE_CODE_HANDLESCOPE(isolate); |
211 Code& code = reused_code_handle.Handle(); | 212 Code& code = reused_code_handle.Handle(); |
212 code = LookupDartCode(); | 213 code = LookupDartCode(); |
213 if (code.IsNull()) { | 214 if (code.IsNull()) { |
214 return false; // Stub frames do not have exception handlers. | 215 return false; // Stub frames do not have exception handlers. |
215 } | 216 } |
216 uword pc_offset = pc() - code.EntryPoint(); | 217 uword pc_offset = pc() - code.EntryPoint(); |
217 | 218 |
218 REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(isolate); | 219 REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(isolate); |
219 ExceptionHandlers& handlers = reused_exception_handlers_handle.Handle(); | 220 ExceptionHandlers& handlers = reused_exception_handlers_handle.Handle(); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 497 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
497 return (index - num_materializations_); | 498 return (index - num_materializations_); |
498 } | 499 } |
499 } | 500 } |
500 UNREACHABLE(); | 501 UNREACHABLE(); |
501 return 0; | 502 return 0; |
502 } | 503 } |
503 | 504 |
504 | 505 |
505 } // namespace dart | 506 } // namespace dart |
OLD | NEW |