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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 *handler_pc = code.EntryPoint() + handler_info.handler_pc_offset; | 233 *handler_pc = code.EntryPoint() + handler_info.handler_pc_offset; |
234 *needs_stacktrace = handler_info.needs_stacktrace; | 234 *needs_stacktrace = handler_info.needs_stacktrace; |
235 *has_catch_all = handler_info.has_catch_all; | 235 *has_catch_all = handler_info.has_catch_all; |
236 return true; | 236 return true; |
237 } | 237 } |
238 } | 238 } |
239 return false; | 239 return false; |
240 } | 240 } |
241 | 241 |
242 | 242 |
243 intptr_t StackFrame::GetTokenPos() const { | 243 TokenPosition StackFrame::GetTokenPos() const { |
244 const Code& code = Code::Handle(LookupDartCode()); | 244 const Code& code = Code::Handle(LookupDartCode()); |
245 if (code.IsNull()) { | 245 if (code.IsNull()) { |
246 return -1; // Stub frames do not have token_pos. | 246 return TokenPosition::kNoSource; // Stub frames do not have token_pos. |
247 } | 247 } |
248 uword pc_offset = pc() - code.EntryPoint(); | 248 uword pc_offset = pc() - code.EntryPoint(); |
249 const PcDescriptors& descriptors = | 249 const PcDescriptors& descriptors = |
250 PcDescriptors::Handle(code.pc_descriptors()); | 250 PcDescriptors::Handle(code.pc_descriptors()); |
251 ASSERT(!descriptors.IsNull()); | 251 ASSERT(!descriptors.IsNull()); |
252 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); | 252 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); |
253 while (iter.MoveNext()) { | 253 while (iter.MoveNext()) { |
254 if (iter.PcOffset() == pc_offset) { | 254 if (iter.PcOffset() == pc_offset) { |
255 return iter.TokenPos(); | 255 return TokenPosition(iter.TokenPos()); |
256 } | 256 } |
257 } | 257 } |
258 return -1; | 258 return TokenPosition::kNoSource; |
259 } | 259 } |
260 | 260 |
261 | 261 |
262 bool StackFrame::IsValid() const { | 262 bool StackFrame::IsValid() const { |
263 if (IsEntryFrame() || IsExitFrame() || IsStubFrame()) { | 263 if (IsEntryFrame() || IsExitFrame() || IsStubFrame()) { |
264 return true; | 264 return true; |
265 } | 265 } |
266 return (LookupDartCode() != Code::null()); | 266 return (LookupDartCode() != Code::null()); |
267 } | 267 } |
268 | 268 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 494 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
495 return (index - num_materializations_); | 495 return (index - num_materializations_); |
496 } | 496 } |
497 } | 497 } |
498 UNREACHABLE(); | 498 UNREACHABLE(); |
499 return 0; | 499 return 0; |
500 } | 500 } |
501 | 501 |
502 | 502 |
503 } // namespace dart | 503 } // namespace dart |
OLD | NEW |