| 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/isolate.h" | 5 #include "vm/isolate.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/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
| (...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 if (event != NULL) { | 1180 if (event != NULL) { |
| 1181 event->Instant("Runnable"); | 1181 event->Instant("Runnable"); |
| 1182 event->Complete(); | 1182 event->Complete(); |
| 1183 } | 1183 } |
| 1184 } | 1184 } |
| 1185 if (FLAG_support_service && Service::isolate_stream.enabled()) { | 1185 if (FLAG_support_service && Service::isolate_stream.enabled()) { |
| 1186 ServiceEvent runnableEvent(this, ServiceEvent::kIsolateRunnable); | 1186 ServiceEvent runnableEvent(this, ServiceEvent::kIsolateRunnable); |
| 1187 Service::HandleEvent(&runnableEvent); | 1187 Service::HandleEvent(&runnableEvent); |
| 1188 } | 1188 } |
| 1189 #endif // !PRODUCT | 1189 #endif // !PRODUCT |
| 1190 GetRunnableLatencyMetric()->set_value(UptimeMicros()); |
| 1191 if (FLAG_print_benchmarking_metrics) { |
| 1192 { |
| 1193 StartIsolateScope scope(this); |
| 1194 heap()->CollectAllGarbage(); |
| 1195 } |
| 1196 int64_t heap_size = (heap()->UsedInWords(Heap::kNew) * kWordSize) + |
| 1197 (heap()->UsedInWords(Heap::kOld) * kWordSize); |
| 1198 GetRunnableHeapSizeMetric()->set_value(heap_size); |
| 1199 } |
| 1190 return true; | 1200 return true; |
| 1191 } | 1201 } |
| 1192 | 1202 |
| 1193 | 1203 |
| 1194 bool Isolate::VerifyPauseCapability(const Object& capability) const { | 1204 bool Isolate::VerifyPauseCapability(const Object& capability) const { |
| 1195 return !capability.IsNull() && capability.IsCapability() && | 1205 return !capability.IsNull() && capability.IsCapability() && |
| 1196 (pause_capability() == Capability::Cast(capability).Id()); | 1206 (pause_capability() == Capability::Cast(capability).Id()); |
| 1197 } | 1207 } |
| 1198 | 1208 |
| 1199 | 1209 |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 MegamorphicCacheTable::PrintSizes(this); | 1685 MegamorphicCacheTable::PrintSizes(this); |
| 1676 } | 1686 } |
| 1677 if (FLAG_trace_isolates) { | 1687 if (FLAG_trace_isolates) { |
| 1678 heap()->PrintSizes(); | 1688 heap()->PrintSizes(); |
| 1679 Symbols::DumpStats(); | 1689 Symbols::DumpStats(); |
| 1680 OS::Print( | 1690 OS::Print( |
| 1681 "[-] Stopping isolate:\n" | 1691 "[-] Stopping isolate:\n" |
| 1682 "\tisolate: %s\n", | 1692 "\tisolate: %s\n", |
| 1683 name()); | 1693 name()); |
| 1684 } | 1694 } |
| 1685 if (FLAG_print_metrics) { | 1695 if (FLAG_print_metrics || FLAG_print_benchmarking_metrics) { |
| 1686 LogBlock lb; | 1696 LogBlock lb; |
| 1687 OS::PrintErr("Printing metrics for %s\n", name()); | 1697 OS::PrintErr("Printing metrics for %s\n", name()); |
| 1688 #define ISOLATE_METRIC_PRINT(type, variable, name, unit) \ | 1698 #define ISOLATE_METRIC_PRINT(type, variable, name, unit) \ |
| 1689 OS::PrintErr("%s\n", metric_##variable##_.ToString()); | 1699 OS::PrintErr("%s\n", metric_##variable##_.ToString()); |
| 1690 | 1700 ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT) |
| 1691 ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT); | |
| 1692 #undef ISOLATE_METRIC_PRINT | 1701 #undef ISOLATE_METRIC_PRINT |
| 1693 OS::PrintErr("\n"); | 1702 OS::PrintErr("\n"); |
| 1694 } | 1703 } |
| 1695 } | 1704 } |
| 1696 | 1705 |
| 1697 | 1706 |
| 1698 void Isolate::StopBackgroundCompiler() { | 1707 void Isolate::StopBackgroundCompiler() { |
| 1699 // Wait until all background compilation has finished. | 1708 // Wait until all background compilation has finished. |
| 1700 if (background_compiler_ != NULL) { | 1709 if (background_compiler_ != NULL) { |
| 1701 BackgroundCompiler::Stop(this); | 1710 BackgroundCompiler::Stop(this); |
| (...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 void IsolateSpawnState::DecrementSpawnCount() { | 2957 void IsolateSpawnState::DecrementSpawnCount() { |
| 2949 ASSERT(spawn_count_monitor_ != NULL); | 2958 ASSERT(spawn_count_monitor_ != NULL); |
| 2950 ASSERT(spawn_count_ != NULL); | 2959 ASSERT(spawn_count_ != NULL); |
| 2951 MonitorLocker ml(spawn_count_monitor_); | 2960 MonitorLocker ml(spawn_count_monitor_); |
| 2952 ASSERT(*spawn_count_ > 0); | 2961 ASSERT(*spawn_count_ > 0); |
| 2953 *spawn_count_ = *spawn_count_ - 1; | 2962 *spawn_count_ = *spawn_count_ - 1; |
| 2954 ml.Notify(); | 2963 ml.Notify(); |
| 2955 } | 2964 } |
| 2956 | 2965 |
| 2957 } // namespace dart | 2966 } // namespace dart |
| OLD | NEW |