| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Add an empty slot to indicate the overflow so that the toString | 104 // Add an empty slot to indicate the overflow so that the toString |
| 105 // method can account for the overflow. | 105 // method can account for the overflow. |
| 106 if (stacktrace_.CodeAtFrame(null_slot) != Code::null()) { | 106 if (stacktrace_.CodeAtFrame(null_slot) != Code::null()) { |
| 107 stacktrace_.SetCodeAtFrame(null_slot, frame_code); | 107 stacktrace_.SetCodeAtFrame(null_slot, frame_code); |
| 108 // We drop an extra frame here too. | 108 // We drop an extra frame here too. |
| 109 dropped_frames_++; | 109 dropped_frames_++; |
| 110 } | 110 } |
| 111 // Encode the number of dropped frames into the pc offset. | 111 // Encode the number of dropped frames into the pc offset. |
| 112 frame_offset ^= Smi::New(dropped_frames_); | 112 frame_offset ^= Smi::New(dropped_frames_); |
| 113 stacktrace_.SetPcOffsetAtFrame(null_slot, frame_offset); | 113 stacktrace_.SetPcOffsetAtFrame(null_slot, frame_offset); |
| 114 // Move frames one slot down so that we can accomodate the new frame. | 114 // Move frames one slot down so that we can accommodate the new frame. |
| 115 for (intptr_t i = start; i < StackTrace::kPreallocatedStackdepth; i++) { | 115 for (intptr_t i = start; i < StackTrace::kPreallocatedStackdepth; i++) { |
| 116 intptr_t prev = (i - 1); | 116 intptr_t prev = (i - 1); |
| 117 frame_code = stacktrace_.CodeAtFrame(i); | 117 frame_code = stacktrace_.CodeAtFrame(i); |
| 118 frame_offset = stacktrace_.PcOffsetAtFrame(i); | 118 frame_offset = stacktrace_.PcOffsetAtFrame(i); |
| 119 stacktrace_.SetCodeAtFrame(prev, frame_code); | 119 stacktrace_.SetCodeAtFrame(prev, frame_code); |
| 120 stacktrace_.SetPcOffsetAtFrame(prev, frame_offset); | 120 stacktrace_.SetPcOffsetAtFrame(prev, frame_offset); |
| 121 } | 121 } |
| 122 cur_index_ = (StackTrace::kPreallocatedStackdepth - 1); | 122 cur_index_ = (StackTrace::kPreallocatedStackdepth - 1); |
| 123 } | 123 } |
| 124 stacktrace_.SetCodeAtFrame(cur_index_, code); | 124 stacktrace_.SetCodeAtFrame(cur_index_, code); |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 } | 974 } |
| 975 | 975 |
| 976 Thread* thread = Thread::Current(); | 976 Thread* thread = Thread::Current(); |
| 977 NoReloadScope no_reload_scope(thread->isolate(), thread); | 977 NoReloadScope no_reload_scope(thread->isolate(), thread); |
| 978 return DartLibraryCalls::InstanceCreate(library, *class_name, | 978 return DartLibraryCalls::InstanceCreate(library, *class_name, |
| 979 *constructor_name, arguments); | 979 *constructor_name, arguments); |
| 980 } | 980 } |
| 981 | 981 |
| 982 | 982 |
| 983 } // namespace dart | 983 } // namespace dart |
| OLD | NEW |