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

Side by Side Diff: runtime/vm/stack_frame.cc

Issue 383523005: Specify descriptor kind to iterate on. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« runtime/vm/raw_object.h ('K') | « runtime/vm/simulator_arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/deopt_instructions.h" 8 #include "vm/deopt_instructions.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 ExceptionHandlers& handlers = reused_exception_handlers_handle.Handle(); 217 ExceptionHandlers& handlers = reused_exception_handlers_handle.Handle();
218 handlers = code.exception_handlers(); 218 handlers = code.exception_handlers();
219 if (handlers.Length() == 0) { 219 if (handlers.Length() == 0) {
220 return false; 220 return false;
221 } 221 }
222 222
223 // Find pc descriptor for the current pc. 223 // Find pc descriptor for the current pc.
224 REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(isolate); 224 REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(isolate);
225 PcDescriptors& descriptors = reused_pc_descriptors_handle.Handle(); 225 PcDescriptors& descriptors = reused_pc_descriptors_handle.Handle();
226 descriptors = code.pc_descriptors(); 226 descriptors = code.pc_descriptors();
227 PcDescriptors::Iterator iter(descriptors); 227 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind);
228 while (iter.HasNext()) { 228 while (iter.HasNext()) {
229 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next(); 229 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next();
230 if ((rec.pc == pc()) && (rec.try_index != -1)) { 230 if ((rec.pc == pc()) && (rec.try_index != -1)) {
231 const intptr_t try_index = rec.try_index; 231 const intptr_t try_index = rec.try_index;
232 RawExceptionHandlers::HandlerInfo handler_info; 232 RawExceptionHandlers::HandlerInfo handler_info;
233 handlers.GetHandlerInfo(try_index, &handler_info); 233 handlers.GetHandlerInfo(try_index, &handler_info);
234 *handler_pc = handler_info.handler_pc; 234 *handler_pc = handler_info.handler_pc;
235 *needs_stacktrace = handler_info.needs_stacktrace; 235 *needs_stacktrace = handler_info.needs_stacktrace;
236 *has_catch_all = handler_info.has_catch_all; 236 *has_catch_all = handler_info.has_catch_all;
237 return true; 237 return true;
238 } 238 }
239 } 239 }
240 return false; 240 return false;
241 } 241 }
242 242
243 243
244 intptr_t StackFrame::GetTokenPos() const { 244 intptr_t StackFrame::GetTokenPos() const {
245 const Code& code = Code::Handle(LookupDartCode()); 245 const Code& code = Code::Handle(LookupDartCode());
246 if (code.IsNull()) { 246 if (code.IsNull()) {
247 return -1; // Stub frames do not have token_pos. 247 return -1; // Stub frames do not have token_pos.
248 } 248 }
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); 252 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind);
253 while (iter.HasNext()) { 253 while (iter.HasNext()) {
254 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next(); 254 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next();
255 if (rec.pc == pc()) { 255 if (rec.pc == pc()) {
256 return rec.token_pos; 256 return rec.token_pos;
257 } 257 }
258 } 258 }
259 return -1; 259 return -1;
260 } 260 }
261 261
262 262
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { 484 if (deopt_instr->kind() == DeoptInstr::kCallerFp) {
485 return (index - num_materializations_); 485 return (index - num_materializations_);
486 } 486 }
487 } 487 }
488 UNREACHABLE(); 488 UNREACHABLE();
489 return 0; 489 return 0;
490 } 490 }
491 491
492 492
493 } // namespace dart 493 } // namespace dart
OLDNEW
« runtime/vm/raw_object.h ('K') | « runtime/vm/simulator_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698