| 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 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2009 | 2009 |
| 2010 | 2010 |
| 2011 void Isolate::set_registered_service_extension_handlers( | 2011 void Isolate::set_registered_service_extension_handlers( |
| 2012 const GrowableObjectArray& value) { | 2012 const GrowableObjectArray& value) { |
| 2013 registered_service_extension_handlers_ = value.raw(); | 2013 registered_service_extension_handlers_ = value.raw(); |
| 2014 } | 2014 } |
| 2015 | 2015 |
| 2016 | 2016 |
| 2017 void Isolate::AddDeoptimizingBoxedField(const Field& field) { | 2017 void Isolate::AddDeoptimizingBoxedField(const Field& field) { |
| 2018 ASSERT(Compiler::IsBackgroundCompilation()); | 2018 ASSERT(Compiler::IsBackgroundCompilation()); |
| 2019 ASSERT(field.IsOriginal()); | 2019 ASSERT(!field.IsOriginal()); |
| 2020 // The enclosed code allocates objects and can potentially trigger a GC, | 2020 // The enclosed code allocates objects and can potentially trigger a GC, |
| 2021 // ensure that we account for safepoints when grabbing the lock. | 2021 // ensure that we account for safepoints when grabbing the lock. |
| 2022 SafepointMutexLocker ml(field_list_mutex_); | 2022 SafepointMutexLocker ml(field_list_mutex_); |
| 2023 if (boxed_field_list_ == GrowableObjectArray::null()) { | 2023 if (boxed_field_list_ == GrowableObjectArray::null()) { |
| 2024 boxed_field_list_ = GrowableObjectArray::New(Heap::kOld); | 2024 boxed_field_list_ = GrowableObjectArray::New(Heap::kOld); |
| 2025 } | 2025 } |
| 2026 const GrowableObjectArray& array = | 2026 const GrowableObjectArray& array = |
| 2027 GrowableObjectArray::Handle(boxed_field_list_); | 2027 GrowableObjectArray::Handle(boxed_field_list_); |
| 2028 array.Add(field, Heap::kOld); | 2028 array.Add(Field::Handle(field.Original()), Heap::kOld); |
| 2029 } | 2029 } |
| 2030 | 2030 |
| 2031 | 2031 |
| 2032 RawField* Isolate::GetDeoptimizingBoxedField() { | 2032 RawField* Isolate::GetDeoptimizingBoxedField() { |
| 2033 ASSERT(Thread::Current()->IsMutatorThread()); | 2033 ASSERT(Thread::Current()->IsMutatorThread()); |
| 2034 MutexLocker ml(field_list_mutex_); | 2034 MutexLocker ml(field_list_mutex_); |
| 2035 if (boxed_field_list_ == GrowableObjectArray::null()) { | 2035 if (boxed_field_list_ == GrowableObjectArray::null()) { |
| 2036 return Field::null(); | 2036 return Field::null(); |
| 2037 } | 2037 } |
| 2038 const GrowableObjectArray& array = | 2038 const GrowableObjectArray& array = |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2792 void IsolateSpawnState::DecrementSpawnCount() { | 2792 void IsolateSpawnState::DecrementSpawnCount() { |
| 2793 ASSERT(spawn_count_monitor_ != NULL); | 2793 ASSERT(spawn_count_monitor_ != NULL); |
| 2794 ASSERT(spawn_count_ != NULL); | 2794 ASSERT(spawn_count_ != NULL); |
| 2795 MonitorLocker ml(spawn_count_monitor_); | 2795 MonitorLocker ml(spawn_count_monitor_); |
| 2796 ASSERT(*spawn_count_ > 0); | 2796 ASSERT(*spawn_count_ > 0); |
| 2797 *spawn_count_ = *spawn_count_ - 1; | 2797 *spawn_count_ = *spawn_count_ - 1; |
| 2798 ml.Notify(); | 2798 ml.Notify(); |
| 2799 } | 2799 } |
| 2800 | 2800 |
| 2801 } // namespace dart | 2801 } // namespace dart |
| OLD | NEW |