Chromium Code Reviews| 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 "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1010 intptr_t num_variables = desc_indices_.length(); | 1010 intptr_t num_variables = desc_indices_.length(); |
| 1011 String& var_name = String::Handle(); | 1011 String& var_name = String::Handle(); |
| 1012 Instance& value = Instance::Handle(); | 1012 Instance& value = Instance::Handle(); |
| 1013 for (intptr_t i = 0; i < num_variables; i++) { | 1013 for (intptr_t i = 0; i < num_variables; i++) { |
| 1014 intptr_t ignore; | 1014 intptr_t ignore; |
| 1015 VariableAt(i, &var_name, &ignore, &ignore, &value); | 1015 VariableAt(i, &var_name, &ignore, &ignore, &value); |
| 1016 if (var_name.Equals(Symbols::This())) { | 1016 if (var_name.Equals(Symbols::This())) { |
| 1017 return value.raw(); | 1017 return value.raw(); |
| 1018 } | 1018 } |
| 1019 } | 1019 } |
| 1020 return Object::null(); | 1020 return Symbols::OptimizedOut().raw(); |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 | 1023 |
| 1024 bool IsPrivateVariableName(const String& var_name) { | 1024 bool IsPrivateVariableName(const String& var_name) { |
| 1025 return (var_name.Length() >= 1) && (var_name.CharAt(0) == '_'); | 1025 return (var_name.Length() >= 1) && (var_name.CharAt(0) == '_'); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 | 1028 |
| 1029 RawObject* ActivationFrame::Evaluate(const String& expr) { | 1029 RawObject* ActivationFrame::Evaluate(const String& expr) { |
| 1030 GetDescIndices(); | 1030 GetDescIndices(); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 1047 } | 1047 } |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 if (function().is_static()) { | 1050 if (function().is_static()) { |
| 1051 const Class& cls = Class::Handle(function().Owner()); | 1051 const Class& cls = Class::Handle(function().Owner()); |
| 1052 return cls.Evaluate(expr, | 1052 return cls.Evaluate(expr, |
| 1053 Array::Handle(Array::MakeArray(param_names)), | 1053 Array::Handle(Array::MakeArray(param_names)), |
| 1054 Array::Handle(Array::MakeArray(param_values))); | 1054 Array::Handle(Array::MakeArray(param_values))); |
| 1055 } else { | 1055 } else { |
| 1056 const Object& receiver = Object::Handle(GetReceiver()); | 1056 const Object& receiver = Object::Handle(GetReceiver()); |
| 1057 ASSERT(receiver.IsInstance()); | 1057 ASSERT(receiver.IsInstance() || receiver.IsNull()); |
| 1058 if (!receiver.IsInstance()) { | 1058 if (!(receiver.IsInstance() || receiver.IsNull())) { |
|
turnidge
2015/12/17 19:42:25
Should you be checkout for <optimized out> here to
| |
| 1059 return Object::null(); | 1059 return Object::null(); |
| 1060 } | 1060 } |
| 1061 const Instance& inst = Instance::Cast(receiver); | 1061 const Instance& inst = Instance::Cast(receiver); |
| 1062 return inst.Evaluate(expr, | 1062 return inst.Evaluate(expr, |
| 1063 Array::Handle(Array::MakeArray(param_names)), | 1063 Array::Handle(Array::MakeArray(param_names)), |
| 1064 Array::Handle(Array::MakeArray(param_values))); | 1064 Array::Handle(Array::MakeArray(param_values))); |
| 1065 } | 1065 } |
| 1066 UNREACHABLE(); | 1066 UNREACHABLE(); |
| 1067 return Object::null(); | 1067 return Object::null(); |
| 1068 } | 1068 } |
| (...skipping 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3242 } | 3242 } |
| 3243 | 3243 |
| 3244 | 3244 |
| 3245 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3245 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 3246 ASSERT(bpt->next() == NULL); | 3246 ASSERT(bpt->next() == NULL); |
| 3247 bpt->set_next(code_breakpoints_); | 3247 bpt->set_next(code_breakpoints_); |
| 3248 code_breakpoints_ = bpt; | 3248 code_breakpoints_ = bpt; |
| 3249 } | 3249 } |
| 3250 | 3250 |
| 3251 } // namespace dart | 3251 } // namespace dart |
| OLD | NEW |