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

Unified Diff: runtime/vm/clustered_snapshot.cc

Issue 2715213008: VM: Allow configuring use_field_guards on the per-isolate basis and include it into snapshot featur… (Closed)
Patch Set: Created 3 years, 10 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/clustered_snapshot.cc
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index 1735bdcbad7db55aac460754a8dbcc4a890e6995..3bd1c6ce9d3db287e5abbea9015a6f77f32c8da4 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -1093,7 +1093,7 @@ class FieldDeserializationCluster : public DeserializationCluster {
Thread::Current(), Timeline::GetIsolateStream(), "PostLoadField"));
Field& field = Field::Handle(zone);
- if (!FLAG_use_field_guards) {
+ if (!Isolate::Current()->use_field_guards()) {
for (intptr_t i = start_index_; i < stop_index_; i++) {
field ^= refs.At(i);
field.set_guarded_cid(kDynamicCid);
@@ -4648,7 +4648,8 @@ void Serializer::WriteVersionAndFeatures() {
const intptr_t version_len = strlen(expected_version);
WriteBytes(reinterpret_cast<const uint8_t*>(expected_version), version_len);
- const char* expected_features = Dart::FeaturesString(kind_);
+ const char* expected_features =
+ Dart::FeaturesString(Isolate::Current(), kind_);
ASSERT(expected_features != NULL);
const intptr_t features_len = strlen(expected_features);
WriteBytes(reinterpret_cast<const uint8_t*>(expected_features),
@@ -4986,7 +4987,7 @@ DeserializationCluster* Deserializer::ReadCluster() {
}
-RawApiError* Deserializer::VerifyVersionAndFeatures() {
+RawApiError* Deserializer::VerifyVersionAndFeatures(Isolate* isolate) {
// If the version string doesn't match, return an error.
// Note: New things are allocated only if we're going to return an error.
@@ -5023,7 +5024,7 @@ RawApiError* Deserializer::VerifyVersionAndFeatures() {
}
Advance(version_len);
- const char* expected_features = Dart::FeaturesString(kind_);
+ const char* expected_features = Dart::FeaturesString(isolate, kind_);
ASSERT(expected_features != NULL);
const intptr_t expected_len = strlen(expected_features);
@@ -5475,7 +5476,7 @@ RawApiError* FullSnapshotReader::ReadVMSnapshot() {
Deserializer deserializer(thread_, kind_, buffer_, size_,
instructions_buffer_, data_buffer_);
- RawApiError* error = deserializer.VerifyVersionAndFeatures();
+ RawApiError* error = deserializer.VerifyVersionAndFeatures(/*isolate=*/NULL);
if (error != ApiError::null()) {
return error;
}
@@ -5499,7 +5500,8 @@ RawApiError* FullSnapshotReader::ReadIsolateSnapshot() {
Deserializer deserializer(thread_, kind_, buffer_, size_,
instructions_buffer_, data_buffer_);
- RawApiError* error = deserializer.VerifyVersionAndFeatures();
+ RawApiError* error =
+ deserializer.VerifyVersionAndFeatures(thread_->isolate());
if (error != ApiError::null()) {
return error;
}
« no previous file with comments | « runtime/vm/clustered_snapshot.h ('k') | runtime/vm/dart.h » ('j') | runtime/vm/kernel_isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698