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

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

Issue 868103002: VM: Use PC offset instead of absolute PC in exception handler info. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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
« no previous file with comments | « runtime/vm/raw_object.h ('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 "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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // Find pc descriptor for the current pc. 221 // Find pc descriptor for the current pc.
222 REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(isolate); 222 REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(isolate);
223 PcDescriptors& descriptors = reused_pc_descriptors_handle.Handle(); 223 PcDescriptors& descriptors = reused_pc_descriptors_handle.Handle();
224 descriptors = code.pc_descriptors(); 224 descriptors = code.pc_descriptors();
225 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); 225 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind);
226 while (iter.MoveNext()) { 226 while (iter.MoveNext()) {
227 const intptr_t current_try_index = iter.TryIndex(); 227 const intptr_t current_try_index = iter.TryIndex();
228 if ((iter.PcOffset() == pc_offset) && (current_try_index != -1)) { 228 if ((iter.PcOffset() == pc_offset) && (current_try_index != -1)) {
229 RawExceptionHandlers::HandlerInfo handler_info; 229 RawExceptionHandlers::HandlerInfo handler_info;
230 handlers.GetHandlerInfo(current_try_index, &handler_info); 230 handlers.GetHandlerInfo(current_try_index, &handler_info);
231 *handler_pc = handler_info.handler_pc; 231 *handler_pc = code.EntryPoint() + handler_info.handler_pc_offset;
232 *needs_stacktrace = handler_info.needs_stacktrace; 232 *needs_stacktrace = handler_info.needs_stacktrace;
233 *has_catch_all = handler_info.has_catch_all; 233 *has_catch_all = handler_info.has_catch_all;
234 return true; 234 return true;
235 } 235 }
236 } 236 }
237 return false; 237 return false;
238 } 238 }
239 239
240 240
241 intptr_t StackFrame::GetTokenPos() const { 241 intptr_t StackFrame::GetTokenPos() const {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { 492 if (deopt_instr->kind() == DeoptInstr::kCallerFp) {
493 return (index - num_materializations_); 493 return (index - num_materializations_);
494 } 494 }
495 } 495 }
496 UNREACHABLE(); 496 UNREACHABLE();
497 return 0; 497 return 0;
498 } 498 }
499 499
500 500
501 } // namespace dart 501 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698