| 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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 // running the shutdown callback. | 1487 // running the shutdown callback. |
| 1488 isolate->WaitForOutstandingSpawns(); | 1488 isolate->WaitForOutstandingSpawns(); |
| 1489 { | 1489 { |
| 1490 // Print the error if there is one. This may execute dart code to | 1490 // Print the error if there is one. This may execute dart code to |
| 1491 // print the exception object, so we need to use a StartIsolateScope. | 1491 // print the exception object, so we need to use a StartIsolateScope. |
| 1492 StartIsolateScope start_scope(isolate); | 1492 StartIsolateScope start_scope(isolate); |
| 1493 Thread* thread = Thread::Current(); | 1493 Thread* thread = Thread::Current(); |
| 1494 ASSERT(thread->isolate() == isolate); | 1494 ASSERT(thread->isolate() == isolate); |
| 1495 StackZone zone(thread); | 1495 StackZone zone(thread); |
| 1496 HandleScope handle_scope(thread); | 1496 HandleScope handle_scope(thread); |
| 1497 #if defined(DEBUG) | 1497 // TODO(27003): Enable for precompiled. |
| 1498 #if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME) |
| 1498 if (!isolate->HasAttemptedReload()) { | 1499 if (!isolate->HasAttemptedReload()) { |
| 1499 isolate->heap()->CollectAllGarbage(); | 1500 isolate->heap()->CollectAllGarbage(); |
| 1500 VerifyCanonicalVisitor check_canonical(thread); | 1501 VerifyCanonicalVisitor check_canonical(thread); |
| 1501 isolate->heap()->IterateObjects(&check_canonical); | 1502 isolate->heap()->IterateObjects(&check_canonical); |
| 1502 } | 1503 } |
| 1503 #endif // DEBUG | 1504 #endif // DEBUG |
| 1504 const Error& error = Error::Handle(thread->sticky_error()); | 1505 const Error& error = Error::Handle(thread->sticky_error()); |
| 1505 if (!error.IsNull() && !error.IsUnwindError()) { | 1506 if (!error.IsNull() && !error.IsUnwindError()) { |
| 1506 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); | 1507 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); |
| 1507 } | 1508 } |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2885 void IsolateSpawnState::DecrementSpawnCount() { | 2886 void IsolateSpawnState::DecrementSpawnCount() { |
| 2886 ASSERT(spawn_count_monitor_ != NULL); | 2887 ASSERT(spawn_count_monitor_ != NULL); |
| 2887 ASSERT(spawn_count_ != NULL); | 2888 ASSERT(spawn_count_ != NULL); |
| 2888 MonitorLocker ml(spawn_count_monitor_); | 2889 MonitorLocker ml(spawn_count_monitor_); |
| 2889 ASSERT(*spawn_count_ > 0); | 2890 ASSERT(*spawn_count_ > 0); |
| 2890 *spawn_count_ = *spawn_count_ - 1; | 2891 *spawn_count_ = *spawn_count_ - 1; |
| 2891 ml.Notify(); | 2892 ml.Notify(); |
| 2892 } | 2893 } |
| 2893 | 2894 |
| 2894 } // namespace dart | 2895 } // namespace dart |
| OLD | NEW |