Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2044423003: Remember inside an ICData if it is for a static call or an instance call (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/isolate_reload.cc
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index cd2935747508072fc21d58510de592fc8f601cb4..453f692ab8c5b2ac79562e62d17dcc3103207273 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -881,46 +881,6 @@ ObjectStore* IsolateReloadContext::object_store() {
}
-static void ResetICs(const Function& function, const Code& code) {
- // TODO(johnmccutchan): Relying on the function's ICData Map can miss ICDatas.
- // Use the code's object pool instead.
- if (function.ic_data_array() == Array::null()) {
- // TODO(johnmccutchan): Even in this case, we need to scan the code's object
- // pool instead.
- return; // Already reset in an earlier round.
- }
-
- Thread* thread = Thread::Current();
- Zone* zone = thread->zone();
-
- ZoneGrowableArray<const ICData*>* ic_data_array =
- new(zone) ZoneGrowableArray<const ICData*>();
- function.RestoreICDataMap(ic_data_array, false /* clone ic-data */);
- const intptr_t ic_data_array_length = ic_data_array->length();
- if (ic_data_array_length == 0) {
- return;
- }
- const PcDescriptors& descriptors =
- PcDescriptors::Handle(code.pc_descriptors());
- PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kIcCall |
- RawPcDescriptors::kUnoptStaticCall);
- while (iter.MoveNext()) {
- const intptr_t index = iter.DeoptId();
- if (index >= ic_data_array_length) {
- // TODO(johnmccutchan): Investigate how this can happen.
- continue;
- }
- const ICData* ic_data = (*ic_data_array)[index];
- if (ic_data == NULL) {
- // TODO(johnmccutchan): Investigate how this can happen.
- continue;
- }
- bool is_static_call = iter.Kind() == RawPcDescriptors::kUnoptStaticCall;
- ic_data->Reset(is_static_call);
- }
-}
-
-
void IsolateReloadContext::ResetUnoptimizedICsOnStack() {
Code& code = Code::Handle();
Function& function = Function::Handle();
@@ -935,10 +895,10 @@ void IsolateReloadContext::ResetUnoptimizedICsOnStack() {
function = code.function();
code = function.unoptimized_code();
ASSERT(!code.IsNull());
- ResetICs(function, code);
+ code.ResetICDatas(function);
} else {
function = code.function();
- ResetICs(function, code);
+ code.ResetICDatas(function);
}
frame = iterator.NextFrame();
}
@@ -1015,7 +975,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.
- func.FillICDataWithSentinels(code_);
+ code_.ResetICDatas(func);
}
bool IsFromDirtyLibrary(const Function& func) {
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698