| Index: runtime/vm/isolate.cc
|
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
|
| index f908b261d6a40c538c4c33220f1f7421669bf78a..f7dab621550c95877871dcc262f69f91f7828545 100644
|
| --- a/runtime/vm/isolate.cc
|
| +++ b/runtime/vm/isolate.cc
|
| @@ -493,6 +493,7 @@ Isolate::Isolate()
|
| tag_table_(GrowableObjectArray::null()),
|
| current_tag_(UserTag::null()),
|
| default_tag_(UserTag::null()),
|
| + deoptimized_code_array_(GrowableObjectArray::null()),
|
| metrics_list_head_(NULL),
|
| next_(NULL),
|
| REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
|
| @@ -1251,6 +1252,10 @@ void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
|
| // Visit the tag table which is stored in the isolate.
|
| visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_));
|
|
|
| + // Visit the deoptimized code array which is stored in the isolate.
|
| + visitor->VisitPointer(
|
| + reinterpret_cast<RawObject**>(&deoptimized_code_array_));
|
| +
|
| // Visit objects in the debugger.
|
| debugger()->VisitObjectPointers(visitor);
|
|
|
| @@ -1448,6 +1453,23 @@ void Isolate::set_default_tag(const UserTag& tag) {
|
| }
|
|
|
|
|
| +void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) {
|
| + deoptimized_code_array_ = value.raw();
|
| +}
|
| +
|
| +
|
| +void Isolate::TrackDeoptimizedCode(const Code& code) {
|
| + ASSERT(!code.IsNull());
|
| + const GrowableObjectArray& deoptimized_code =
|
| + GrowableObjectArray::Handle(deoptimized_code_array());
|
| + if (deoptimized_code.IsNull()) {
|
| + // Not tracking deoptimized code.
|
| + return;
|
| + }
|
| + deoptimized_code.Add(code);
|
| +}
|
| +
|
| +
|
| void Isolate::VisitIsolates(IsolateVisitor* visitor) {
|
| if (visitor == NULL) {
|
| return;
|
|
|