| 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 "vm/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| (...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2004 JSONArray elements(&jsobj, "elements"); | 2004 JSONArray elements(&jsobj, "elements"); |
| 2005 Object& element = Object::Handle(); | 2005 Object& element = Object::Handle(); |
| 2006 Smi& slot_offset = Smi::Handle(); | 2006 Smi& slot_offset = Smi::Handle(); |
| 2007 Class& element_class = Class::Handle(); | 2007 Class& element_class = Class::Handle(); |
| 2008 Array& element_field_map = Array::Handle(); | 2008 Array& element_field_map = Array::Handle(); |
| 2009 Field& field = Field::Handle(); | 2009 Field& field = Field::Handle(); |
| 2010 limit = Utils::Minimum(limit, length); | 2010 limit = Utils::Minimum(limit, length); |
| 2011 for (intptr_t i = 0; i < limit; ++i) { | 2011 for (intptr_t i = 0; i < limit; ++i) { |
| 2012 JSONObject jselement(&elements); | 2012 JSONObject jselement(&elements); |
| 2013 element = path.At(i * 2); | 2013 element = path.At(i * 2); |
| 2014 jselement.AddProperty("index", i); | |
| 2015 jselement.AddProperty("value", element); | 2014 jselement.AddProperty("value", element); |
| 2016 // Interpret the word offset from parent as list index or instance field. | 2015 // Interpret the word offset from parent as list index or instance field. |
| 2017 // TODO(koda): User-friendly interpretation for map entries. | 2016 // TODO(koda): User-friendly interpretation for map entries. |
| 2018 if (i > 0) { | 2017 if (i > 0) { |
| 2019 slot_offset ^= path.At((i * 2) - 1); | 2018 slot_offset ^= path.At((i * 2) - 1); |
| 2020 if (element.IsArray()) { | 2019 jselement.AddProperty("offset", slot_offset.Value()); |
| 2020 if (element.IsArray() || element.IsGrowableObjectArray()) { |
| 2021 intptr_t element_index = slot_offset.Value() - | 2021 intptr_t element_index = slot_offset.Value() - |
| 2022 (Array::element_offset(0) >> kWordSizeLog2); | 2022 (Array::element_offset(0) >> kWordSizeLog2); |
| 2023 jselement.AddProperty("parentListIndex", element_index); | 2023 jselement.AddProperty("parentListIndex", element_index); |
| 2024 } else if (element.IsInstance()) { | 2024 } else if (element.IsInstance()) { |
| 2025 element_class ^= element.clazz(); | 2025 element_class ^= element.clazz(); |
| 2026 element_field_map = element_class.OffsetToFieldMap(); | 2026 element_field_map = element_class.OffsetToFieldMap(); |
| 2027 intptr_t offset = slot_offset.Value(); | 2027 intptr_t offset = slot_offset.Value(); |
| 2028 if (offset > 0 && offset < element_field_map.Length()) { | 2028 if (offset > 0 && offset < element_field_map.Length()) { |
| 2029 field ^= element_field_map.At(offset); | 2029 field ^= element_field_map.At(offset); |
| 2030 jselement.AddProperty("parentField", field); | 2030 jselement.AddProperty("parentField", field); |
| (...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4124 if (strcmp(method_name, method.name) == 0) { | 4124 if (strcmp(method_name, method.name) == 0) { |
| 4125 return &method; | 4125 return &method; |
| 4126 } | 4126 } |
| 4127 } | 4127 } |
| 4128 return NULL; | 4128 return NULL; |
| 4129 } | 4129 } |
| 4130 | 4130 |
| 4131 #endif // !PRODUCT | 4131 #endif // !PRODUCT |
| 4132 | 4132 |
| 4133 } // namespace dart | 4133 } // namespace dart |
| OLD | NEW |