| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 Profiler::EndExecution(old_current); | 376 Profiler::EndExecution(old_current); |
| 377 } | 377 } |
| 378 Thread::SetThreadLocal(isolate_key, reinterpret_cast<uword>(current)); | 378 Thread::SetThreadLocal(isolate_key, reinterpret_cast<uword>(current)); |
| 379 if (current != NULL) { | 379 if (current != NULL) { |
| 380 ASSERT(current->thread_state() == NULL); | 380 ASSERT(current->thread_state() == NULL); |
| 381 InterruptableThreadState* thread_state = | 381 InterruptableThreadState* thread_state = |
| 382 ThreadInterrupter::GetCurrentThreadState(); | 382 ThreadInterrupter::GetCurrentThreadState(); |
| 383 #if defined(DEBUG) | 383 #if defined(DEBUG) |
| 384 CheckForDuplicateThreadState(thread_state); | 384 CheckForDuplicateThreadState(thread_state); |
| 385 #endif | 385 #endif |
| 386 ASSERT(thread_state != NULL); |
| 386 Profiler::BeginExecution(current); | 387 Profiler::BeginExecution(current); |
| 387 current->set_thread_state(thread_state); | 388 current->set_thread_state(thread_state); |
| 388 current->set_vm_tag(VMTag::kVMTagId); | 389 current->set_vm_tag(VMTag::kVMTagId); |
| 389 } | 390 } |
| 390 } | 391 } |
| 391 | 392 |
| 392 | 393 |
| 393 // The single thread local key which stores all the thread local data | 394 // The single thread local key which stores all the thread local data |
| 394 // for a thread. Since an Isolate is the central repository for | 395 // for a thread. Since an Isolate is the central repository for |
| 395 // storing all isolate specific information a single thread local key | 396 // storing all isolate specific information a single thread local key |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 return func.raw(); | 1168 return func.raw(); |
| 1168 } | 1169 } |
| 1169 | 1170 |
| 1170 | 1171 |
| 1171 void IsolateSpawnState::Cleanup() { | 1172 void IsolateSpawnState::Cleanup() { |
| 1172 SwitchIsolateScope switch_scope(isolate()); | 1173 SwitchIsolateScope switch_scope(isolate()); |
| 1173 Dart::ShutdownIsolate(); | 1174 Dart::ShutdownIsolate(); |
| 1174 } | 1175 } |
| 1175 | 1176 |
| 1176 } // namespace dart | 1177 } // namespace dart |
| OLD | NEW |