Index: runtime/vm/isolate_reload.cc |
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc |
index 8d78d01a59ac7bb39e60505c42e3136ccf3646b3..0957f6fa388e471ee16abfaef84d7da022d02434 100644 |
--- a/runtime/vm/isolate_reload.cc |
+++ b/runtime/vm/isolate_reload.cc |
@@ -1366,8 +1366,12 @@ ObjectStore* IsolateReloadContext::object_store() { |
void IsolateReloadContext::ResetUnoptimizedICsOnStack() { |
- Code& code = Code::Handle(); |
- Function& function = Function::Handle(); |
+ Thread* thread = Thread::Current(); |
+ StackZone stack_zone(thread); |
+ Zone* zone = stack_zone.GetZone(); |
+ |
+ Code& code = Code::Handle(zone); |
+ Function& function = Function::Handle(zone); |
DartFrameIterator iterator; |
StackFrame* frame = iterator.NextFrame(); |
while (frame != NULL) { |
@@ -1379,9 +1383,9 @@ void IsolateReloadContext::ResetUnoptimizedICsOnStack() { |
function = code.function(); |
code = function.unoptimized_code(); |
ASSERT(!code.IsNull()); |
- code.ResetICDatas(); |
+ code.ResetICDatas(zone); |
} else { |
- code.ResetICDatas(); |
+ code.ResetICDatas(zone); |
} |
frame = iterator.NextFrame(); |
} |
@@ -1400,13 +1404,15 @@ void IsolateReloadContext::ResetMegamorphicCaches() { |
class MarkFunctionsForRecompilation : public ObjectVisitor { |
public: |
MarkFunctionsForRecompilation(Isolate* isolate, |
- IsolateReloadContext* reload_context) |
+ IsolateReloadContext* reload_context, |
+ Zone* zone) |
: ObjectVisitor(), |
- handle_(Object::Handle()), |
- owning_class_(Class::Handle()), |
- owning_lib_(Library::Handle()), |
- code_(Code::Handle()), |
- reload_context_(reload_context) { |
+ handle_(Object::Handle(zone)), |
+ owning_class_(Class::Handle(zone)), |
+ owning_lib_(Library::Handle(zone)), |
+ code_(Code::Handle(zone)), |
+ reload_context_(reload_context), |
+ zone_(zone) { |
} |
virtual void VisitObject(RawObject* obj) { |
@@ -1460,7 +1466,7 @@ class MarkFunctionsForRecompilation : public ObjectVisitor { |
ASSERT(!code_.IsNull()); |
// We are preserving the unoptimized code, fill all ICData arrays with |
// the sentinel values so that we have no stale type feedback. |
- code_.ResetICDatas(); |
+ code_.ResetICDatas(zone_); |
} |
bool IsFromDirtyLibrary(const Function& func) { |
@@ -1474,15 +1480,19 @@ class MarkFunctionsForRecompilation : public ObjectVisitor { |
Library& owning_lib_; |
Code& code_; |
IsolateReloadContext* reload_context_; |
+ Zone* zone_; |
}; |
void IsolateReloadContext::MarkAllFunctionsForRecompilation() { |
TIMELINE_SCOPE(MarkAllFunctionsForRecompilation); |
TIR_Print("---- MARKING ALL FUNCTIONS FOR RECOMPILATION\n"); |
+ Thread* thread = Thread::Current(); |
+ StackZone stack_zone(thread); |
+ Zone* zone = stack_zone.GetZone(); |
NoSafepointScope no_safepoint; |
HeapIterationScope heap_iteration_scope; |
- MarkFunctionsForRecompilation visitor(isolate_, this); |
+ MarkFunctionsForRecompilation visitor(isolate_, this, zone); |
isolate_->heap()->VisitObjects(&visitor); |
} |