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

Unified Diff: runtime/vm/object.cc

Issue 1414933006: Copy ICData descriptors when starting background compilation, so that they do not change while comp… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 2 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/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 630ffd1ceaede7a6661d47fe4af990282895c967..5088075dfa46b3d75602c5e8e52b9fe41e5f50fa 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -7093,7 +7093,8 @@ void Function::SaveICDataMap(
void Function::RestoreICDataMap(
- ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data) const {
+ ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data,
+ bool clone_descriptors) const {
ASSERT(deopt_id_to_ic_data->is_empty());
Zone* zone = Thread::Current()->zone();
const Array& saved_ic_data = Array::Handle(zone, ic_data_array());
@@ -7112,6 +7113,9 @@ void Function::RestoreICDataMap(
for (intptr_t i = 1; i < saved_length; i++) {
ICData& ic_data = ICData::ZoneHandle(zone);
ic_data ^= saved_ic_data.At(i);
+ if (clone_descriptors) {
+ ic_data = ICData::CloneDescriptor(ic_data);
+ }
(*deopt_id_to_ic_data)[ic_data.deopt_id()] = &ic_data;
}
}
@@ -12725,6 +12729,23 @@ RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) {
}
+RawICData* ICData::CloneDescriptor(const ICData& from) {
+ Zone* zone = Thread::Current()->zone();
+ const ICData& result = ICData::Handle(ICData::NewDescriptor(
+ zone,
+ Function::Handle(zone, from.owner()),
+ String::Handle(zone, from.target_name()),
+ Array::Handle(zone, from.arguments_descriptor()),
+ from.deopt_id(),
+ from.NumArgsTested()));
+ // Preserve entry array.
+ result.set_ic_data_array(Array::Handle(zone, from.ic_data()));
+ // Copy deoptimization reasons.
+ result.SetDeoptReasons(from.DeoptReasons());
+ return result.raw();
+}
+
+
void ICData::PrintJSONImpl(JSONStream* stream, bool ref) const {
JSONObject jsobj(stream);
AddCommonObjectProperties(&jsobj, "Object", ref);
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698