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

Unified Diff: runtime/vm/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
« runtime/vm/kernel_isolate.cc ('K') | « runtime/vm/snapshot.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 97f0d847dcd9e5a7d89a2614a1cbcede2bab1937..5eddb352d215ad7181971cce4d986141d86fd26f 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -513,7 +513,7 @@ RawObject* SnapshotReader::ReadInstance(intptr_t object_id,
pobj_ = ReadObjectImpl(read_as_reference);
result->SetFieldAtOffset(offset, pobj_);
if ((offset != type_argument_field_offset) &&
- (kind_ == Snapshot::kMessage) && FLAG_use_field_guards) {
+ (kind_ == Snapshot::kMessage) && isolate()->use_field_guards()) {
// TODO(fschneider): Consider hoisting these lookups out of the loop.
// This would involve creating a handle, since cls_ can't be reused
// across the call to ReadObjectImpl.
@@ -580,7 +580,7 @@ RawObject* SnapshotReader::ReadScriptSnapshot() {
ASSERT(kind_ == Snapshot::kScript);
// First read the version string, and check that it matches.
- RawApiError* error = VerifyVersionAndFeatures();
+ RawApiError* error = VerifyVersionAndFeatures(Isolate::Current());
if (error != ApiError::null()) {
return error;
}
@@ -602,7 +602,7 @@ RawObject* SnapshotReader::ReadScriptSnapshot() {
}
-RawApiError* SnapshotReader::VerifyVersionAndFeatures() {
+RawApiError* SnapshotReader::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.
@@ -639,7 +639,7 @@ RawApiError* SnapshotReader::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);
@@ -1842,7 +1842,8 @@ void SnapshotWriter::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),
« runtime/vm/kernel_isolate.cc ('K') | « runtime/vm/snapshot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698