| 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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 tag_table_(GrowableObjectArray::null()), | 821 tag_table_(GrowableObjectArray::null()), |
| 822 deoptimized_code_array_(GrowableObjectArray::null()), | 822 deoptimized_code_array_(GrowableObjectArray::null()), |
| 823 sticky_error_(Error::null()), | 823 sticky_error_(Error::null()), |
| 824 background_compiler_(NULL), | 824 background_compiler_(NULL), |
| 825 background_compiler_disabled_depth_(0), | 825 background_compiler_disabled_depth_(0), |
| 826 pending_service_extension_calls_(GrowableObjectArray::null()), | 826 pending_service_extension_calls_(GrowableObjectArray::null()), |
| 827 registered_service_extension_handlers_(GrowableObjectArray::null()), | 827 registered_service_extension_handlers_(GrowableObjectArray::null()), |
| 828 metrics_list_head_(NULL), | 828 metrics_list_head_(NULL), |
| 829 compilation_allowed_(true), | 829 compilation_allowed_(true), |
| 830 all_classes_finalized_(false), | 830 all_classes_finalized_(false), |
| 831 remapping_cids_(false), |
| 831 next_(NULL), | 832 next_(NULL), |
| 832 pause_loop_monitor_(NULL), | 833 pause_loop_monitor_(NULL), |
| 833 loading_invalidation_gen_(kInvalidGen), | 834 loading_invalidation_gen_(kInvalidGen), |
| 834 top_level_parsing_count_(0), | 835 top_level_parsing_count_(0), |
| 835 field_list_mutex_(new Mutex()), | 836 field_list_mutex_(new Mutex()), |
| 836 boxed_field_list_(GrowableObjectArray::null()), | 837 boxed_field_list_(GrowableObjectArray::null()), |
| 837 spawn_count_monitor_(new Monitor()), | 838 spawn_count_monitor_(new Monitor()), |
| 838 spawn_count_(0), | 839 spawn_count_(0), |
| 839 #define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit) \ | 840 #define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit) \ |
| 840 metric_##variable##_(), | 841 metric_##variable##_(), |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1902 #ifndef PRODUCT | 1903 #ifndef PRODUCT |
| 1903 if (IsReloading()) { | 1904 if (IsReloading()) { |
| 1904 raw_class = reload_context()->GetClassForHeapWalkAt(cid); | 1905 raw_class = reload_context()->GetClassForHeapWalkAt(cid); |
| 1905 } else { | 1906 } else { |
| 1906 raw_class = class_table()->At(cid); | 1907 raw_class = class_table()->At(cid); |
| 1907 } | 1908 } |
| 1908 #else | 1909 #else |
| 1909 raw_class = class_table()->At(cid); | 1910 raw_class = class_table()->At(cid); |
| 1910 #endif // !PRODUCT | 1911 #endif // !PRODUCT |
| 1911 ASSERT(raw_class != NULL); | 1912 ASSERT(raw_class != NULL); |
| 1912 #if !defined(DART_PRECOMPILER) | 1913 ASSERT(remapping_cids_ || raw_class->ptr()->id_ == cid); |
| 1913 // This is temporarily untrue during a class id remap. | |
| 1914 ASSERT(raw_class->ptr()->id_ == cid); | |
| 1915 #endif | |
| 1916 return raw_class; | 1914 return raw_class; |
| 1917 } | 1915 } |
| 1918 | 1916 |
| 1919 | 1917 |
| 1920 void Isolate::AddPendingDeopt(uword fp, uword pc) { | 1918 void Isolate::AddPendingDeopt(uword fp, uword pc) { |
| 1921 // GrowableArray::Add is not atomic and may be interrupt by a profiler | 1919 // GrowableArray::Add is not atomic and may be interrupt by a profiler |
| 1922 // stack walk. | 1920 // stack walk. |
| 1923 MallocGrowableArray<PendingLazyDeopt>* old_pending_deopts = pending_deopts_; | 1921 MallocGrowableArray<PendingLazyDeopt>* old_pending_deopts = pending_deopts_; |
| 1924 MallocGrowableArray<PendingLazyDeopt>* new_pending_deopts = | 1922 MallocGrowableArray<PendingLazyDeopt>* new_pending_deopts = |
| 1925 new MallocGrowableArray<PendingLazyDeopt>(old_pending_deopts->length() + | 1923 new MallocGrowableArray<PendingLazyDeopt>(old_pending_deopts->length() + |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2946 void IsolateSpawnState::DecrementSpawnCount() { | 2944 void IsolateSpawnState::DecrementSpawnCount() { |
| 2947 ASSERT(spawn_count_monitor_ != NULL); | 2945 ASSERT(spawn_count_monitor_ != NULL); |
| 2948 ASSERT(spawn_count_ != NULL); | 2946 ASSERT(spawn_count_ != NULL); |
| 2949 MonitorLocker ml(spawn_count_monitor_); | 2947 MonitorLocker ml(spawn_count_monitor_); |
| 2950 ASSERT(*spawn_count_ > 0); | 2948 ASSERT(*spawn_count_ > 0); |
| 2951 *spawn_count_ = *spawn_count_ - 1; | 2949 *spawn_count_ = *spawn_count_ - 1; |
| 2952 ml.Notify(); | 2950 ml.Notify(); |
| 2953 } | 2951 } |
| 2954 | 2952 |
| 2955 } // namespace dart | 2953 } // namespace dart |
| OLD | NEW |