Chromium Code Reviews| 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 "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "lib/mirrors.h" | 10 #include "lib/mirrors.h" |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 997 } | 997 } |
| 998 { | 998 { |
| 999 JSONArray features_array(&jsobj, "features"); | 999 JSONArray features_array(&jsobj, "features"); |
| 1000 if (is_io_enabled) { | 1000 if (is_io_enabled) { |
| 1001 features_array.AddValue("io"); | 1001 features_array.AddValue("io"); |
| 1002 } | 1002 } |
| 1003 } | 1003 } |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 | 1006 |
| 1007 void Isolate::ProfileInterrupt() { | 1007 intptr_t Isolate::ProfileInterrupt() { |
|
Ivan Posva
2014/05/25 12:25:16
What other values besides true/false do you expect
Cutch
2014/05/26 06:59:35
I've switched this to return true / false.
| |
| 1008 if (profiler_data() == NULL) { | |
| 1009 // Profiler not setup for isolate. | |
| 1010 return 0; | |
|
Anders Johnsen
2014/05/25 18:36:34
These should probably be enum values, if more than
| |
| 1011 } | |
| 1012 if (profiler_data()->blocked()) { | |
| 1013 // Profiler blocked for this isolate. | |
| 1014 return 0; | |
| 1015 } | |
| 1008 InterruptableThreadState* state = thread_state(); | 1016 InterruptableThreadState* state = thread_state(); |
| 1009 if (state == NULL) { | 1017 if (state == NULL) { |
| 1010 // Isolate is not scheduled on a thread. | 1018 // Isolate is not scheduled on a thread. |
| 1011 ProfileIdle(); | 1019 ProfileIdle(); |
| 1012 return; | 1020 return 1; |
| 1013 } | 1021 } |
| 1014 ASSERT(state->id != Thread::kInvalidThreadId); | 1022 ASSERT(state->id != Thread::kInvalidThreadId); |
| 1015 ThreadInterrupter::InterruptThread(state); | 1023 ThreadInterrupter::InterruptThread(state); |
| 1024 return 1; | |
| 1016 } | 1025 } |
| 1017 | 1026 |
| 1018 | 1027 |
| 1019 void Isolate::ProfileIdle() { | 1028 void Isolate::ProfileIdle() { |
| 1020 vm_tag_counters_.Increment(vm_tag()); | 1029 vm_tag_counters_.Increment(vm_tag()); |
| 1021 } | 1030 } |
| 1022 | 1031 |
| 1023 | 1032 |
| 1024 void Isolate::set_tag_table(const GrowableObjectArray& value) { | 1033 void Isolate::set_tag_table(const GrowableObjectArray& value) { |
| 1025 tag_table_ = value.raw(); | 1034 tag_table_ = value.raw(); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1195 return func.raw(); | 1204 return func.raw(); |
| 1196 } | 1205 } |
| 1197 | 1206 |
| 1198 | 1207 |
| 1199 void IsolateSpawnState::Cleanup() { | 1208 void IsolateSpawnState::Cleanup() { |
| 1200 SwitchIsolateScope switch_scope(isolate()); | 1209 SwitchIsolateScope switch_scope(isolate()); |
| 1201 Dart::ShutdownIsolate(); | 1210 Dart::ShutdownIsolate(); |
| 1202 } | 1211 } |
| 1203 | 1212 |
| 1204 } // namespace dart | 1213 } // namespace dart |
| OLD | NEW |