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

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

Issue 2686813006: Reapply "Use CodeSourceMap for stack traces (still JIT only)." (Closed)
Patch Set: Created 3 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
« no previous file with comments | « runtime/vm/disassembler.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "platform/address_sanitizer.h" 7 #include "platform/address_sanitizer.h"
8 8
9 #include "lib/stacktrace.h" 9 #include "lib/stacktrace.h"
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (cur_index_ >= StackTrace::kPreallocatedStackdepth) { 94 if (cur_index_ >= StackTrace::kPreallocatedStackdepth) {
95 // The number of frames is overflowing the preallocated stack trace object. 95 // The number of frames is overflowing the preallocated stack trace object.
96 Code& frame_code = Code::Handle(); 96 Code& frame_code = Code::Handle();
97 Smi& frame_offset = Smi::Handle(); 97 Smi& frame_offset = Smi::Handle();
98 intptr_t start = StackTrace::kPreallocatedStackdepth - (kNumTopframes - 1); 98 intptr_t start = StackTrace::kPreallocatedStackdepth - (kNumTopframes - 1);
99 intptr_t null_slot = start - 2; 99 intptr_t null_slot = start - 2;
100 // We are going to drop one frame. 100 // We are going to drop one frame.
101 dropped_frames_++; 101 dropped_frames_++;
102 // Add an empty slot to indicate the overflow so that the toString 102 // Add an empty slot to indicate the overflow so that the toString
103 // method can account for the overflow. 103 // method can account for the overflow.
104 if (stacktrace_.FunctionAtFrame(null_slot) != Function::null()) { 104 if (stacktrace_.CodeAtFrame(null_slot) != Code::null()) {
105 stacktrace_.SetCodeAtFrame(null_slot, frame_code); 105 stacktrace_.SetCodeAtFrame(null_slot, frame_code);
106 // We drop an extra frame here too. 106 // We drop an extra frame here too.
107 dropped_frames_++; 107 dropped_frames_++;
108 } 108 }
109 // Encode the number of dropped frames into the pc offset. 109 // Encode the number of dropped frames into the pc offset.
110 frame_offset ^= Smi::New(dropped_frames_); 110 frame_offset ^= Smi::New(dropped_frames_);
111 stacktrace_.SetPcOffsetAtFrame(null_slot, frame_offset); 111 stacktrace_.SetPcOffsetAtFrame(null_slot, frame_offset);
112 // Move frames one slot down so that we can accomodate the new frame. 112 // Move frames one slot down so that we can accomodate the new frame.
113 for (intptr_t i = start; i < StackTrace::kPreallocatedStackdepth; i++) { 113 for (intptr_t i = start; i < StackTrace::kPreallocatedStackdepth; i++) {
114 intptr_t prev = (i - 1); 114 intptr_t prev = (i - 1);
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 class_name = &Symbols::_CompileTimeError(); 805 class_name = &Symbols::_CompileTimeError();
806 break; 806 break;
807 } 807 }
808 808
809 return DartLibraryCalls::InstanceCreate(library, *class_name, 809 return DartLibraryCalls::InstanceCreate(library, *class_name,
810 *constructor_name, arguments); 810 *constructor_name, arguments);
811 } 811 }
812 812
813 813
814 } // namespace dart 814 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/disassembler.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698