| 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 "platform/address_sanitizer.h" | 5 #include "platform/address_sanitizer.h" |
| 6 #include "platform/memory_sanitizer.h" | 6 #include "platform/memory_sanitizer.h" |
| 7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
| 8 | 8 |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 JSONObject func(&obj, "function"); | 532 JSONObject func(&obj, "function"); |
| 533 func.AddProperty("type", "@Function"); | 533 func.AddProperty("type", "@Function"); |
| 534 func.AddProperty("kind", "Tag"); | 534 func.AddProperty("kind", "Tag"); |
| 535 obj.AddPropertyF("id", "functions/tag-%" Px "", start()); | 535 obj.AddPropertyF("id", "functions/tag-%" Px "", start()); |
| 536 func.AddProperty("name", name()); | 536 func.AddProperty("name", name()); |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 | 539 |
| 540 void PrintToJSONArray(Isolate* isolate, JSONArray* events, bool full) { | 540 void PrintToJSONArray(Isolate* isolate, JSONArray* events, bool full) { |
| 541 JSONObject obj(events); | 541 JSONObject obj(events); |
| 542 obj.AddProperty("type", "CodeRegion"); | |
| 543 obj.AddProperty("kind", KindToCString(kind())); | 542 obj.AddProperty("kind", KindToCString(kind())); |
| 544 obj.AddPropertyF("inclusive_ticks", "%" Pd "", inclusive_ticks()); | 543 obj.AddPropertyF("inclusive_ticks", "%" Pd "", inclusive_ticks()); |
| 545 obj.AddPropertyF("exclusive_ticks", "%" Pd "", exclusive_ticks()); | 544 obj.AddPropertyF("exclusive_ticks", "%" Pd "", exclusive_ticks()); |
| 546 if (kind() == kDartCode) { | 545 if (kind() == kDartCode) { |
| 547 // Look up code in Dart heap. | 546 // Look up code in Dart heap. |
| 548 Code& code = Code::Handle(isolate); | 547 Code& code = Code::Handle(isolate); |
| 549 code ^= Code::LookupCode(start()); | 548 code ^= Code::LookupCode(start()); |
| 550 if (code.IsNull()) { | 549 if (code.IsNull()) { |
| 551 // Code is a stub in the Vm isolate. | 550 // Code is a stub in the Vm isolate. |
| 552 code ^= Code::LookupCodeInVmIsolate(start()); | 551 code ^= Code::LookupCodeInVmIsolate(start()); |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 &tag_code_table); | 1496 &tag_code_table); |
| 1498 { | 1497 { |
| 1499 // Build CodeRegion callers. | 1498 // Build CodeRegion callers. |
| 1500 ScopeStopwatch sw("CodeRegionTableCallersBuilder"); | 1499 ScopeStopwatch sw("CodeRegionTableCallersBuilder"); |
| 1501 build_callers.Build(); | 1500 build_callers.Build(); |
| 1502 } | 1501 } |
| 1503 { | 1502 { |
| 1504 ScopeStopwatch sw("CodeTableStream"); | 1503 ScopeStopwatch sw("CodeTableStream"); |
| 1505 // Serialize to JSON. | 1504 // Serialize to JSON. |
| 1506 JSONObject obj(stream); | 1505 JSONObject obj(stream); |
| 1507 obj.AddProperty("type", "Profile"); | 1506 obj.AddProperty("type", "CpuProfile"); |
| 1508 obj.AddProperty("id", "profile"); | 1507 obj.AddProperty("id", "profile"); |
| 1509 obj.AddProperty("samples", samples); | 1508 obj.AddProperty("samples", samples); |
| 1510 obj.AddProperty("depth", static_cast<intptr_t>(FLAG_profile_depth)); | 1509 obj.AddProperty("depth", static_cast<intptr_t>(FLAG_profile_depth)); |
| 1511 obj.AddProperty("period", static_cast<intptr_t>(FLAG_profile_period)); | 1510 obj.AddProperty("period", static_cast<intptr_t>(FLAG_profile_period)); |
| 1512 obj.AddProperty("timeSpan", | 1511 obj.AddProperty("timeSpan", |
| 1513 MicrosecondsToSeconds(builder.TimeDeltaMicros())); | 1512 MicrosecondsToSeconds(builder.TimeDeltaMicros())); |
| 1514 { | 1513 { |
| 1515 JSONArray exclusive_trie(&obj, "exclusive_trie"); | 1514 JSONArray exclusive_trie(&obj, "exclusive_trie"); |
| 1516 CodeRegionTrieNode* root = build_trie.root(); | 1515 CodeRegionTrieNode* root = build_trie.root(); |
| 1517 ASSERT(root != NULL); | 1516 ASSERT(root != NULL); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2082 state.pc, | 2081 state.pc, |
| 2083 state.fp, | 2082 state.fp, |
| 2084 sp); | 2083 sp); |
| 2085 stackWalker.walk(); | 2084 stackWalker.walk(); |
| 2086 #endif | 2085 #endif |
| 2087 } | 2086 } |
| 2088 } | 2087 } |
| 2089 } | 2088 } |
| 2090 | 2089 |
| 2091 } // namespace dart | 2090 } // namespace dart |
| OLD | NEW |