| 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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 | 1379 |
| 1380 void Isolate::Run() { | 1380 void Isolate::Run() { |
| 1381 message_handler()->Run(Dart::thread_pool(), | 1381 message_handler()->Run(Dart::thread_pool(), |
| 1382 RunIsolate, | 1382 RunIsolate, |
| 1383 ShutdownIsolate, | 1383 ShutdownIsolate, |
| 1384 reinterpret_cast<uword>(this)); | 1384 reinterpret_cast<uword>(this)); |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 | 1387 |
| 1388 void Isolate::AddClosureFunction(const Function& function) const { | 1388 void Isolate::AddClosureFunction(const Function& function) const { |
| 1389 ASSERT(!Compiler::IsBackgroundCompilation()); |
| 1389 GrowableObjectArray& closures = | 1390 GrowableObjectArray& closures = |
| 1390 GrowableObjectArray::Handle(object_store()->closure_functions()); | 1391 GrowableObjectArray::Handle(object_store()->closure_functions()); |
| 1391 ASSERT(!closures.IsNull()); | 1392 ASSERT(!closures.IsNull()); |
| 1392 ASSERT(function.IsNonImplicitClosureFunction()); | 1393 ASSERT(function.IsNonImplicitClosureFunction()); |
| 1393 closures.Add(function, Heap::kOld); | 1394 closures.Add(function, Heap::kOld); |
| 1394 } | 1395 } |
| 1395 | 1396 |
| 1396 | 1397 |
| 1397 // If the linear lookup turns out to be too expensive, the list | 1398 // If the linear lookup turns out to be too expensive, the list |
| 1398 // of closures could be maintained in a hash map, with the key | 1399 // of closures could be maintained in a hash map, with the key |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2693 void IsolateSpawnState::DecrementSpawnCount() { | 2694 void IsolateSpawnState::DecrementSpawnCount() { |
| 2694 ASSERT(spawn_count_monitor_ != NULL); | 2695 ASSERT(spawn_count_monitor_ != NULL); |
| 2695 ASSERT(spawn_count_ != NULL); | 2696 ASSERT(spawn_count_ != NULL); |
| 2696 MonitorLocker ml(spawn_count_monitor_); | 2697 MonitorLocker ml(spawn_count_monitor_); |
| 2697 ASSERT(*spawn_count_ > 0); | 2698 ASSERT(*spawn_count_ > 0); |
| 2698 *spawn_count_ = *spawn_count_ - 1; | 2699 *spawn_count_ = *spawn_count_ - 1; |
| 2699 ml.Notify(); | 2700 ml.Notify(); |
| 2700 } | 2701 } |
| 2701 | 2702 |
| 2702 } // namespace dart | 2703 } // namespace dart |
| OLD | NEW |