| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 7260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7271 const Library& library = Library::Handle(cls.library()); | 7271 const Library& library = Library::Handle(cls.library()); |
| 7272 jsobj.AddProperty("owner", library); | 7272 jsobj.AddProperty("owner", library); |
| 7273 } else { | 7273 } else { |
| 7274 jsobj.AddProperty("owner", cls); | 7274 jsobj.AddProperty("owner", cls); |
| 7275 } | 7275 } |
| 7276 | 7276 |
| 7277 const char* kind_string = Function::KindToCString(kind()); | 7277 const char* kind_string = Function::KindToCString(kind()); |
| 7278 jsobj.AddProperty("_kind", kind_string); | 7278 jsobj.AddProperty("_kind", kind_string); |
| 7279 jsobj.AddProperty("static", is_static()); | 7279 jsobj.AddProperty("static", is_static()); |
| 7280 jsobj.AddProperty("const", is_const()); | 7280 jsobj.AddProperty("const", is_const()); |
| 7281 jsobj.AddProperty("_intrinsic", is_intrinsic()); |
| 7282 jsobj.AddProperty("_native", is_native()); |
| 7281 if (ref) { | 7283 if (ref) { |
| 7282 return; | 7284 return; |
| 7283 } | 7285 } |
| 7284 Code& code = Code::Handle(CurrentCode()); | 7286 Code& code = Code::Handle(CurrentCode()); |
| 7285 if (!code.IsNull()) { | 7287 if (!code.IsNull()) { |
| 7286 jsobj.AddProperty("code", code); | 7288 jsobj.AddProperty("code", code); |
| 7287 } | 7289 } |
| 7288 Array& ics = Array::Handle(ic_data_array()); | 7290 Array& ics = Array::Handle(ic_data_array()); |
| 7289 if (!ics.IsNull()) { | 7291 if (!ics.IsNull()) { |
| 7290 jsobj.AddProperty("_icDataArray", ics); | 7292 jsobj.AddProperty("_icDataArray", ics); |
| 7291 } | 7293 } |
| 7292 jsobj.AddProperty("_optimizable", is_optimizable()); | 7294 jsobj.AddProperty("_optimizable", is_optimizable()); |
| 7293 jsobj.AddProperty("_inlinable", is_inlinable()); | 7295 jsobj.AddProperty("_inlinable", is_inlinable()); |
| 7296 jsobj.AddProperty("_recognized", IsRecognized()); |
| 7294 code = unoptimized_code(); | 7297 code = unoptimized_code(); |
| 7295 if (!code.IsNull()) { | 7298 if (!code.IsNull()) { |
| 7296 jsobj.AddProperty("_unoptimizedCode", code); | 7299 jsobj.AddProperty("_unoptimizedCode", code); |
| 7297 } | 7300 } |
| 7298 jsobj.AddProperty("_usageCounter", usage_counter()); | 7301 jsobj.AddProperty("_usageCounter", usage_counter()); |
| 7299 jsobj.AddProperty("_optimizedCallSiteCount", optimized_call_site_count()); | 7302 jsobj.AddProperty("_optimizedCallSiteCount", optimized_call_site_count()); |
| 7300 jsobj.AddProperty("_deoptimizations", | 7303 jsobj.AddProperty("_deoptimizations", |
| 7301 static_cast<intptr_t>(deoptimization_counter())); | 7304 static_cast<intptr_t>(deoptimization_counter())); |
| 7302 | 7305 |
| 7303 const Script& script = Script::Handle(this->script()); | 7306 const Script& script = Script::Handle(this->script()); |
| (...skipping 6292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13596 const String& user_name = String::Handle(PrettyName()); | 13599 const String& user_name = String::Handle(PrettyName()); |
| 13597 const String& vm_name = String::Handle(Name()); | 13600 const String& vm_name = String::Handle(Name()); |
| 13598 AddNameProperties(&jsobj, user_name, vm_name); | 13601 AddNameProperties(&jsobj, user_name, vm_name); |
| 13599 const bool is_stub = IsStubCode() || IsAllocationStubCode(); | 13602 const bool is_stub = IsStubCode() || IsAllocationStubCode(); |
| 13600 if (is_stub) { | 13603 if (is_stub) { |
| 13601 jsobj.AddProperty("kind", "Stub"); | 13604 jsobj.AddProperty("kind", "Stub"); |
| 13602 } else { | 13605 } else { |
| 13603 jsobj.AddProperty("kind", "Dart"); | 13606 jsobj.AddProperty("kind", "Dart"); |
| 13604 } | 13607 } |
| 13605 jsobj.AddProperty("_optimized", is_optimized()); | 13608 jsobj.AddProperty("_optimized", is_optimized()); |
| 13609 const Object& obj = Object::Handle(owner()); |
| 13610 if (obj.IsFunction()) { |
| 13611 const Function& func = Function::Cast(obj); |
| 13612 jsobj.AddProperty("_intrinsic", func.is_intrinsic()); |
| 13613 jsobj.AddProperty("_native", func.is_native()); |
| 13614 } else { |
| 13615 jsobj.AddProperty("_intrinsic", false); |
| 13616 jsobj.AddProperty("_native", false); |
| 13617 } |
| 13606 if (ref) { | 13618 if (ref) { |
| 13607 return; | 13619 return; |
| 13608 } | 13620 } |
| 13609 const Object& obj = Object::Handle(owner()); | |
| 13610 if (obj.IsFunction()) { | 13621 if (obj.IsFunction()) { |
| 13611 jsobj.AddProperty("function", obj); | 13622 jsobj.AddProperty("function", obj); |
| 13612 } else { | 13623 } else { |
| 13613 // Generate a fake function reference. | 13624 // Generate a fake function reference. |
| 13614 JSONObject func(&jsobj, "function"); | 13625 JSONObject func(&jsobj, "function"); |
| 13615 func.AddProperty("type", "@Function"); | 13626 func.AddProperty("type", "@Function"); |
| 13616 func.AddProperty("_kind", "Stub"); | 13627 func.AddProperty("_kind", "Stub"); |
| 13617 func.AddProperty("name", user_name.ToCString()); | 13628 func.AddProperty("name", user_name.ToCString()); |
| 13618 AddNameProperties(&func, user_name, vm_name); | 13629 AddNameProperties(&func, user_name, vm_name); |
| 13619 } | 13630 } |
| (...skipping 8277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21897 return tag_label.ToCString(); | 21908 return tag_label.ToCString(); |
| 21898 } | 21909 } |
| 21899 | 21910 |
| 21900 | 21911 |
| 21901 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21912 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21902 Instance::PrintJSONImpl(stream, ref); | 21913 Instance::PrintJSONImpl(stream, ref); |
| 21903 } | 21914 } |
| 21904 | 21915 |
| 21905 | 21916 |
| 21906 } // namespace dart | 21917 } // namespace dart |
| OLD | NEW |