| 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/json.h" | 10 #include "platform/json.h" |
| (...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 | 1642 |
| 1643 ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT); | 1643 ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT); |
| 1644 #undef ISOLATE_METRIC_PRINT | 1644 #undef ISOLATE_METRIC_PRINT |
| 1645 THR_Print("\n"); | 1645 THR_Print("\n"); |
| 1646 } | 1646 } |
| 1647 } | 1647 } |
| 1648 | 1648 |
| 1649 | 1649 |
| 1650 void Isolate::Shutdown() { | 1650 void Isolate::Shutdown() { |
| 1651 ASSERT(this == Isolate::Current()); | 1651 ASSERT(this == Isolate::Current()); |
| 1652 // Wait until all background compilation has finished. |
| 1653 BackgroundCompiler::Stop(background_compiler_); |
| 1654 |
| 1652 #if defined(DEBUG) | 1655 #if defined(DEBUG) |
| 1653 if (heap_ != NULL) { | 1656 if (heap_ != NULL) { |
| 1654 // The VM isolate keeps all objects marked. | 1657 // The VM isolate keeps all objects marked. |
| 1655 heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked); | 1658 heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked); |
| 1656 } | 1659 } |
| 1657 #endif // DEBUG | 1660 #endif // DEBUG |
| 1658 | 1661 |
| 1659 // Wait until all background compilation has finished. | |
| 1660 BackgroundCompiler::Stop(background_compiler_); | |
| 1661 | |
| 1662 Thread* thread = Thread::Current(); | 1662 Thread* thread = Thread::Current(); |
| 1663 | 1663 |
| 1664 // Don't allow anymore dart code to execution on this isolate. | 1664 // Don't allow anymore dart code to execution on this isolate. |
| 1665 ClearStackLimit(); | 1665 ClearStackLimit(); |
| 1666 | 1666 |
| 1667 // First, perform higher-level cleanup that may need to allocate. | 1667 // First, perform higher-level cleanup that may need to allocate. |
| 1668 { | 1668 { |
| 1669 // Ensure we have a zone and handle scope so that we can call VM functions. | 1669 // Ensure we have a zone and handle scope so that we can call VM functions. |
| 1670 StackZone stack_zone(thread); | 1670 StackZone stack_zone(thread); |
| 1671 HandleScope handle_scope(thread); | 1671 HandleScope handle_scope(thread); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 current_tag_ = tag.raw(); | 1931 current_tag_ = tag.raw(); |
| 1932 } | 1932 } |
| 1933 | 1933 |
| 1934 | 1934 |
| 1935 void Isolate::set_default_tag(const UserTag& tag) { | 1935 void Isolate::set_default_tag(const UserTag& tag) { |
| 1936 default_tag_ = tag.raw(); | 1936 default_tag_ = tag.raw(); |
| 1937 } | 1937 } |
| 1938 | 1938 |
| 1939 | 1939 |
| 1940 void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) { | 1940 void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) { |
| 1941 ASSERT(Thread::Current()->IsMutatorThread()); |
| 1941 deoptimized_code_array_ = value.raw(); | 1942 deoptimized_code_array_ = value.raw(); |
| 1942 } | 1943 } |
| 1943 | 1944 |
| 1944 | 1945 |
| 1945 void Isolate::TrackDeoptimizedCode(const Code& code) { | 1946 void Isolate::TrackDeoptimizedCode(const Code& code) { |
| 1946 ASSERT(!code.IsNull()); | 1947 ASSERT(!code.IsNull()); |
| 1947 const GrowableObjectArray& deoptimized_code = | 1948 const GrowableObjectArray& deoptimized_code = |
| 1948 GrowableObjectArray::Handle(deoptimized_code_array()); | 1949 GrowableObjectArray::Handle(deoptimized_code_array()); |
| 1949 if (deoptimized_code.IsNull()) { | 1950 if (deoptimized_code.IsNull()) { |
| 1950 // Not tracking deoptimized code. | 1951 // Not tracking deoptimized code. |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2536 } | 2537 } |
| 2537 | 2538 |
| 2538 | 2539 |
| 2539 RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) { | 2540 RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) { |
| 2540 return DeserializeObject(thread, | 2541 return DeserializeObject(thread, |
| 2541 serialized_message_, serialized_message_len_); | 2542 serialized_message_, serialized_message_len_); |
| 2542 } | 2543 } |
| 2543 | 2544 |
| 2544 | 2545 |
| 2545 } // namespace dart | 2546 } // namespace dart |
| OLD | NEW |