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 7254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7265 const Library& library = Library::Handle(cls.library()); | 7265 const Library& library = Library::Handle(cls.library()); |
7266 jsobj.AddProperty("owner", library); | 7266 jsobj.AddProperty("owner", library); |
7267 } else { | 7267 } else { |
7268 jsobj.AddProperty("owner", cls); | 7268 jsobj.AddProperty("owner", cls); |
7269 } | 7269 } |
7270 | 7270 |
7271 const char* kind_string = Function::KindToCString(kind()); | 7271 const char* kind_string = Function::KindToCString(kind()); |
7272 jsobj.AddProperty("_kind", kind_string); | 7272 jsobj.AddProperty("_kind", kind_string); |
7273 jsobj.AddProperty("static", is_static()); | 7273 jsobj.AddProperty("static", is_static()); |
7274 jsobj.AddProperty("const", is_const()); | 7274 jsobj.AddProperty("const", is_const()); |
| 7275 jsobj.AddProperty("_intrinsic", is_intrinsic()); |
| 7276 jsobj.AddProperty("_native", is_native()); |
7275 if (ref) { | 7277 if (ref) { |
7276 return; | 7278 return; |
7277 } | 7279 } |
7278 Code& code = Code::Handle(CurrentCode()); | 7280 Code& code = Code::Handle(CurrentCode()); |
7279 if (!code.IsNull()) { | 7281 if (!code.IsNull()) { |
7280 jsobj.AddProperty("code", code); | 7282 jsobj.AddProperty("code", code); |
7281 } | 7283 } |
7282 Array& ics = Array::Handle(ic_data_array()); | 7284 Array& ics = Array::Handle(ic_data_array()); |
7283 if (!ics.IsNull()) { | 7285 if (!ics.IsNull()) { |
7284 jsobj.AddProperty("_icDataArray", ics); | 7286 jsobj.AddProperty("_icDataArray", ics); |
7285 } | 7287 } |
7286 jsobj.AddProperty("_optimizable", is_optimizable()); | 7288 jsobj.AddProperty("_optimizable", is_optimizable()); |
7287 jsobj.AddProperty("_inlinable", is_inlinable()); | 7289 jsobj.AddProperty("_inlinable", is_inlinable()); |
| 7290 jsobj.AddProperty("_recognized", IsRecognized()); |
7288 code = unoptimized_code(); | 7291 code = unoptimized_code(); |
7289 if (!code.IsNull()) { | 7292 if (!code.IsNull()) { |
7290 jsobj.AddProperty("_unoptimizedCode", code); | 7293 jsobj.AddProperty("_unoptimizedCode", code); |
7291 } | 7294 } |
7292 jsobj.AddProperty("_usageCounter", usage_counter()); | 7295 jsobj.AddProperty("_usageCounter", usage_counter()); |
7293 jsobj.AddProperty("_optimizedCallSiteCount", optimized_call_site_count()); | 7296 jsobj.AddProperty("_optimizedCallSiteCount", optimized_call_site_count()); |
7294 jsobj.AddProperty("_deoptimizations", | 7297 jsobj.AddProperty("_deoptimizations", |
7295 static_cast<intptr_t>(deoptimization_counter())); | 7298 static_cast<intptr_t>(deoptimization_counter())); |
7296 if ((kind() == RawFunction::kImplicitGetter) || | 7299 if ((kind() == RawFunction::kImplicitGetter) || |
7297 (kind() == RawFunction::kImplicitSetter) || | 7300 (kind() == RawFunction::kImplicitSetter) || |
(...skipping 6282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13580 const String& user_name = String::Handle(PrettyName()); | 13583 const String& user_name = String::Handle(PrettyName()); |
13581 const String& vm_name = String::Handle(Name()); | 13584 const String& vm_name = String::Handle(Name()); |
13582 AddNameProperties(&jsobj, user_name, vm_name); | 13585 AddNameProperties(&jsobj, user_name, vm_name); |
13583 const bool is_stub = IsStubCode() || IsAllocationStubCode(); | 13586 const bool is_stub = IsStubCode() || IsAllocationStubCode(); |
13584 if (is_stub) { | 13587 if (is_stub) { |
13585 jsobj.AddProperty("kind", "Stub"); | 13588 jsobj.AddProperty("kind", "Stub"); |
13586 } else { | 13589 } else { |
13587 jsobj.AddProperty("kind", "Dart"); | 13590 jsobj.AddProperty("kind", "Dart"); |
13588 } | 13591 } |
13589 jsobj.AddProperty("_optimized", is_optimized()); | 13592 jsobj.AddProperty("_optimized", is_optimized()); |
| 13593 const Object& obj = Object::Handle(owner()); |
| 13594 if (obj.IsFunction()) { |
| 13595 const Function& func = Function::Cast(obj); |
| 13596 jsobj.AddProperty("_intrinsic", func.is_intrinsic()); |
| 13597 jsobj.AddProperty("_native", func.is_native()); |
| 13598 } else { |
| 13599 jsobj.AddProperty("_intrinsic", false); |
| 13600 jsobj.AddProperty("_native", false); |
| 13601 } |
13590 if (ref) { | 13602 if (ref) { |
13591 return; | 13603 return; |
13592 } | 13604 } |
13593 const Object& obj = Object::Handle(owner()); | |
13594 if (obj.IsFunction()) { | 13605 if (obj.IsFunction()) { |
13595 jsobj.AddProperty("function", obj); | 13606 jsobj.AddProperty("function", obj); |
13596 } else { | 13607 } else { |
13597 // Generate a fake function reference. | 13608 // Generate a fake function reference. |
13598 JSONObject func(&jsobj, "function"); | 13609 JSONObject func(&jsobj, "function"); |
13599 func.AddProperty("type", "@Function"); | 13610 func.AddProperty("type", "@Function"); |
13600 func.AddProperty("_kind", "Stub"); | 13611 func.AddProperty("_kind", "Stub"); |
13601 func.AddProperty("name", user_name.ToCString()); | 13612 func.AddProperty("name", user_name.ToCString()); |
13602 AddNameProperties(&func, user_name, vm_name); | 13613 AddNameProperties(&func, user_name, vm_name); |
13603 } | 13614 } |
(...skipping 8277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21881 return tag_label.ToCString(); | 21892 return tag_label.ToCString(); |
21882 } | 21893 } |
21883 | 21894 |
21884 | 21895 |
21885 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21896 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21886 Instance::PrintJSONImpl(stream, ref); | 21897 Instance::PrintJSONImpl(stream, ref); |
21887 } | 21898 } |
21888 | 21899 |
21889 | 21900 |
21890 } // namespace dart | 21901 } // namespace dart |
OLD | NEW |