Chromium Code Reviews| Index: runtime/vm/isolate.cc |
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
| index 3214d5f048da92426e00d18bc2d9105b86759acf..67989928418c935825643bbfca1f086d9f3ab987 100644 |
| --- a/runtime/vm/isolate.cc |
| +++ b/runtime/vm/isolate.cc |
| @@ -831,6 +831,8 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags) |
| cha_invalidation_gen_(kInvalidGen), |
| field_invalidation_gen_(kInvalidGen), |
| prefix_invalidation_gen_(kInvalidGen), |
| + boxed_field_list_monitor_(new Monitor()), |
| + boxed_field_list_(GrowableObjectArray::null()), |
| spawn_count_monitor_(new Monitor()), |
| spawn_count_(0) { |
| flags_.CopyFrom(api_flags); |
| @@ -868,6 +870,8 @@ Isolate::~Isolate() { |
| object_id_ring_ = NULL; |
| delete pause_loop_monitor_; |
| pause_loop_monitor_ = NULL; |
| + delete boxed_field_list_monitor_; |
| + boxed_field_list_monitor_ = NULL; |
| ASSERT(spawn_count_ == 0); |
| delete spawn_count_monitor_; |
|
siva
2016/02/10 17:57:35
We seem to have added a number of monitors to the
srdjan
2016/02/10 19:18:51
Added a TODO at Isolate constructor:
TODO(srdjan)
|
| if (compiler_stats_ != NULL) { |
| @@ -1846,6 +1850,9 @@ void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, |
| visitor->VisitPointer( |
| reinterpret_cast<RawObject**>(®istered_service_extension_handlers_)); |
| + // Visit the boxed_field_list. |
| + visitor->VisitPointer(reinterpret_cast<RawObject**>(&boxed_field_list_)); |
|
siva
2016/02/10 17:57:35
This will work only if the visitor is at a safepoi
srdjan
2016/02/10 19:18:51
// 'boxed_field_list_' access via mutator and back
|
| + |
| // Visit objects in the debugger. |
| if (FLAG_support_debugger) { |
| debugger()->VisitObjectPointers(visitor); |
| @@ -2050,6 +2057,31 @@ void Isolate::set_registered_service_extension_handlers( |
| } |
| +void Isolate::AddDeoptimizingBoxedField(const Field& field) { |
| + MonitorLocker ml(boxed_field_list_monitor_); |
| + if (boxed_field_list_ == GrowableObjectArray::null()) { |
| + boxed_field_list_ = GrowableObjectArray::New(Heap::kOld); |
| + } |
| + const GrowableObjectArray& array = |
| + GrowableObjectArray::Handle(boxed_field_list_); |
| + array.Add(field, Heap::kOld); |
| +} |
| + |
| + |
| +RawField* Isolate::GetDeoptimizingBoxedField() { |
| + MonitorLocker ml(boxed_field_list_monitor_); |
| + if (boxed_field_list_ == GrowableObjectArray::null()) { |
| + return Field::null(); |
| + } |
| + const GrowableObjectArray& array = |
| + GrowableObjectArray::Handle(boxed_field_list_); |
| + if (array.Length() == 0) { |
| + return Field::null(); |
| + } |
| + return Field::RawCast(array.RemoveLast()); |
| +} |
| + |
| + |
| RawObject* Isolate::InvokePendingServiceExtensionCalls() { |
| if (!FLAG_support_service) { |
| return Object::null(); |