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

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2062983002: Revert "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
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_reload.cc
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index 9a3a7bc7fe7e4dd29098be852c26e61139310855..2fc607f98913480c54996e5a39b3482511fea1fb 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -881,6 +881,46 @@ 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();
@@ -895,10 +935,10 @@ void IsolateReloadContext::ResetUnoptimizedICsOnStack() {
function = code.function();
code = function.unoptimized_code();
ASSERT(!code.IsNull());
- code.ResetICDatas(function);
+ ResetICs(function, code);
} else {
function = code.function();
- code.ResetICDatas(function);
+ ResetICs(function, code);
}
frame = iterator.NextFrame();
}
@@ -975,7 +1015,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(func);
+ func.FillICDataWithSentinels(code_);
}
bool IsFromDirtyLibrary(const Function& func) {
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698