| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "lib/stacktrace.h" | 5 #include "lib/stacktrace.h" |
| 6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
| 7 #include "vm/debugger.h" | 7 #include "vm/debugger.h" |
| 8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
| 9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 DEFINE_NATIVE_ENTRY(StackTrace_current, 0) { | 105 DEFINE_NATIVE_ENTRY(StackTrace_current, 0) { |
| 106 return CurrentStackTrace(thread, false); | 106 return CurrentStackTrace(thread, false); |
| 107 } | 107 } |
| 108 | 108 |
| 109 DEFINE_NATIVE_ENTRY(StackTrace_asyncStackTraceHelper, 1) { | 109 DEFINE_NATIVE_ENTRY(StackTrace_asyncStackTraceHelper, 1) { |
| 110 if (!FLAG_causal_async_stacks) { | 110 if (!FLAG_causal_async_stacks) { |
| 111 return Object::null(); | 111 return Object::null(); |
| 112 } | 112 } |
| 113 | 113 #if !defined(PRODUCT) |
| 114 GET_NATIVE_ARGUMENT(Closure, async_op, arguments->NativeArgAt(0)); | 114 GET_NATIVE_ARGUMENT(Closure, async_op, arguments->NativeArgAt(0)); |
| 115 if (FLAG_support_debugger) { | 115 if (FLAG_support_debugger) { |
| 116 Debugger* debugger = isolate->debugger(); | 116 Debugger* debugger = isolate->debugger(); |
| 117 if (debugger != NULL) { | 117 if (debugger != NULL) { |
| 118 debugger->MaybeAsyncStepInto(async_op); | 118 debugger->MaybeAsyncStepInto(async_op); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 #endif |
| 121 return CurrentStackTrace(thread, true); | 122 return CurrentStackTrace(thread, true); |
| 122 } | 123 } |
| 123 | 124 |
| 124 DEFINE_NATIVE_ENTRY(StackTrace_clearAsyncThreadStackTrace, 0) { | 125 DEFINE_NATIVE_ENTRY(StackTrace_clearAsyncThreadStackTrace, 0) { |
| 125 thread->clear_async_stack_trace(); | 126 thread->clear_async_stack_trace(); |
| 126 return Object::null(); | 127 return Object::null(); |
| 127 } | 128 } |
| 128 | 129 |
| 129 DEFINE_NATIVE_ENTRY(StackTrace_setAsyncThreadStackTrace, 1) { | 130 DEFINE_NATIVE_ENTRY(StackTrace_setAsyncThreadStackTrace, 1) { |
| 130 if (!FLAG_causal_async_stacks) { | 131 if (!FLAG_causal_async_stacks) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 AppendFrames(code_list, pc_offset_list, skip_frames); | 174 AppendFrames(code_list, pc_offset_list, skip_frames); |
| 174 const Array& code_array = Array::Handle(Array::MakeFixedLength(code_list)); | 175 const Array& code_array = Array::Handle(Array::MakeFixedLength(code_list)); |
| 175 const Array& pc_offset_array = | 176 const Array& pc_offset_array = |
| 176 Array::Handle(Array::MakeFixedLength(pc_offset_list)); | 177 Array::Handle(Array::MakeFixedLength(pc_offset_list)); |
| 177 const StackTrace& stacktrace = | 178 const StackTrace& stacktrace = |
| 178 StackTrace::Handle(StackTrace::New(code_array, pc_offset_array)); | 179 StackTrace::Handle(StackTrace::New(code_array, pc_offset_array)); |
| 179 return stacktrace; | 180 return stacktrace; |
| 180 } | 181 } |
| 181 | 182 |
| 182 } // namespace dart | 183 } // namespace dart |
| OLD | NEW |