OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |