OLD | NEW |
---|---|
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/debugger.h" | 5 #include "vm/debugger.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "platform/address_sanitizer.h" | 9 #include "platform/address_sanitizer.h" |
10 | 10 |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
923 } | 923 } |
924 return false; | 924 return false; |
925 } | 925 } |
926 | 926 |
927 | 927 |
928 // Get the saved current context of this activation. | 928 // Get the saved current context of this activation. |
929 const Context& ActivationFrame::GetSavedCurrentContext() { | 929 const Context& ActivationFrame::GetSavedCurrentContext() { |
930 if (!ctx_.IsNull()) return ctx_; | 930 if (!ctx_.IsNull()) return ctx_; |
931 GetVarDescriptors(); | 931 GetVarDescriptors(); |
932 intptr_t var_desc_len = var_descriptors_.Length(); | 932 intptr_t var_desc_len = var_descriptors_.Length(); |
933 Object& obj = Object::Handle(); | |
933 for (intptr_t i = 0; i < var_desc_len; i++) { | 934 for (intptr_t i = 0; i < var_desc_len; i++) { |
934 RawLocalVarDescriptors::VarInfo var_info; | 935 RawLocalVarDescriptors::VarInfo var_info; |
935 var_descriptors_.GetInfo(i, &var_info); | 936 var_descriptors_.GetInfo(i, &var_info); |
936 const int8_t kind = var_info.kind(); | 937 const int8_t kind = var_info.kind(); |
937 if (kind == RawLocalVarDescriptors::kSavedCurrentContext) { | 938 if (kind == RawLocalVarDescriptors::kSavedCurrentContext) { |
938 if (FLAG_trace_debugger_stacktrace) { | 939 if (FLAG_trace_debugger_stacktrace) { |
939 OS::PrintErr("\tFound saved current ctx at index %d\n", | 940 OS::PrintErr("\tFound saved current ctx at index %d\n", |
940 var_info.index()); | 941 var_info.index()); |
941 } | 942 } |
942 const Object& obj = Object::Handle(GetStackVar(var_info.index())); | 943 obj = GetStackVar(var_info.index()); |
943 if (obj.IsClosure()) { | 944 if (obj.IsClosure()) { |
944 ASSERT(function().name() == Symbols::Call().raw()); | 945 ASSERT(function().name() == Symbols::Call().raw()); |
945 ASSERT(function().IsInvokeFieldDispatcher()); | 946 ASSERT(function().IsInvokeFieldDispatcher()); |
946 // Closure.call frames. | 947 // Closure.call frames. |
947 ctx_ ^= Closure::Cast(obj).context(); | 948 ctx_ ^= Closure::Cast(obj).context(); |
948 } else if (obj.IsContext()) { | 949 } else if (obj.IsContext()) { |
949 ctx_ ^= Context::Cast(obj).raw(); | 950 ctx_ ^= Context::Cast(obj).raw(); |
950 } else { | 951 } else { |
951 ASSERT(obj.IsNull()); | 952 ASSERT(obj.IsNull()); |
952 } | 953 } |
953 return ctx_; | 954 return ctx_; |
954 } | 955 } |
955 } | 956 } |
957 return ctx_; | |
956 return Context::ZoneHandle(Context::null()); | 958 return Context::ZoneHandle(Context::null()); |
siva
2017/04/13 16:10:28
dead code?
| |
957 } | 959 } |
958 | 960 |
959 | 961 |
960 RawObject* ActivationFrame::GetAsyncOperation() { | 962 RawObject* ActivationFrame::GetAsyncOperation() { |
961 GetVarDescriptors(); | 963 GetVarDescriptors(); |
962 intptr_t var_desc_len = var_descriptors_.Length(); | 964 intptr_t var_desc_len = var_descriptors_.Length(); |
963 for (intptr_t i = 0; i < var_desc_len; i++) { | 965 for (intptr_t i = 0; i < var_desc_len; i++) { |
964 RawLocalVarDescriptors::VarInfo var_info; | 966 RawLocalVarDescriptors::VarInfo var_info; |
965 var_descriptors_.GetInfo(i, &var_info); | 967 var_descriptors_.GetInfo(i, &var_info); |
966 if (var_descriptors_.GetName(i) == Symbols::AsyncOperation().raw()) { | 968 if (var_descriptors_.GetName(i) == Symbols::AsyncOperation().raw()) { |
(...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4366 | 4368 |
4367 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 4369 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
4368 ASSERT(bpt->next() == NULL); | 4370 ASSERT(bpt->next() == NULL); |
4369 bpt->set_next(code_breakpoints_); | 4371 bpt->set_next(code_breakpoints_); |
4370 code_breakpoints_ = bpt; | 4372 code_breakpoints_ = bpt; |
4371 } | 4373 } |
4372 | 4374 |
4373 #endif // !PRODUCT | 4375 #endif // !PRODUCT |
4374 | 4376 |
4375 } // namespace dart | 4377 } // namespace dart |
OLD | NEW |