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

Side by Side Diff: runtime/vm/clustered_snapshot.cc

Issue 2669543003: Use the app snapshot when testing with -cdartk. (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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/dart.h » ('j') | tools/testing/dart/compiler_configuration.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/clustered_snapshot.h" 5 #include "vm/clustered_snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 4629 matching lines...) Expand 10 before | Expand all | Expand 10 after
4640 cluster->Trace(this, object); 4640 cluster->Trace(this, object);
4641 } 4641 }
4642 4642
4643 4643
4644 void Serializer::WriteVersionAndFeatures() { 4644 void Serializer::WriteVersionAndFeatures() {
4645 const char* expected_version = Version::SnapshotString(); 4645 const char* expected_version = Version::SnapshotString();
4646 ASSERT(expected_version != NULL); 4646 ASSERT(expected_version != NULL);
4647 const intptr_t version_len = strlen(expected_version); 4647 const intptr_t version_len = strlen(expected_version);
4648 WriteBytes(reinterpret_cast<const uint8_t*>(expected_version), version_len); 4648 WriteBytes(reinterpret_cast<const uint8_t*>(expected_version), version_len);
4649 4649
4650 const char* expected_features = Dart::FeaturesString(kind_); 4650 const char* expected_features = Snapshot::FeaturesString(kind_);
4651 ASSERT(expected_features != NULL); 4651 ASSERT(expected_features != NULL);
4652 const intptr_t features_len = strlen(expected_features); 4652 const intptr_t features_len = strlen(expected_features);
4653 WriteBytes(reinterpret_cast<const uint8_t*>(expected_features), 4653 WriteBytes(reinterpret_cast<const uint8_t*>(expected_features),
4654 features_len + 1); 4654 features_len + 1);
4655 free(const_cast<char*>(expected_features)); 4655 free(const_cast<char*>(expected_features));
4656 } 4656 }
4657 4657
4658 4658
4659 #if defined(DEBUG) 4659 #if defined(DEBUG)
4660 static const int32_t kSectionMarker = 0xABAB; 4660 static const int32_t kSectionMarker = 0xABAB;
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
5014 (Snapshot::IsFull(kind_)) ? "full" : "script", expected_version, 5014 (Snapshot::IsFull(kind_)) ? "full" : "script", expected_version,
5015 actual_version); 5015 actual_version);
5016 free(actual_version); 5016 free(actual_version);
5017 // This can also fail while bringing up the VM isolate, so make sure to 5017 // This can also fail while bringing up the VM isolate, so make sure to
5018 // allocate the error message in old space. 5018 // allocate the error message in old space.
5019 const String& msg = String::Handle(String::New(message_buffer, Heap::kOld)); 5019 const String& msg = String::Handle(String::New(message_buffer, Heap::kOld));
5020 return ApiError::New(msg, Heap::kOld); 5020 return ApiError::New(msg, Heap::kOld);
5021 } 5021 }
5022 Advance(version_len); 5022 Advance(version_len);
5023 5023
5024 const char* expected_features = Dart::FeaturesString(kind_); 5024 const char* expected_features = Snapshot::FeaturesString(kind_);
5025 ASSERT(expected_features != NULL); 5025 ASSERT(expected_features != NULL);
5026 const intptr_t expected_len = strlen(expected_features); 5026 const intptr_t expected_len = strlen(expected_features);
5027 5027
5028 const char* features = reinterpret_cast<const char*>(CurrentBufferAddress()); 5028 const char* features = reinterpret_cast<const char*>(CurrentBufferAddress());
5029 ASSERT(features != NULL); 5029 ASSERT(features != NULL);
5030 intptr_t buffer_len = OS::StrNLen(features, PendingBytes()); 5030 intptr_t buffer_len = OS::StrNLen(features, PendingBytes());
5031 if ((buffer_len != expected_len) || 5031 if ((buffer_len != expected_len) ||
5032 strncmp(features, expected_features, expected_len)) { 5032 strncmp(features, expected_features, expected_len)) {
5033 const intptr_t kMessageBufferSize = 256; 5033 const intptr_t kMessageBufferSize = 256;
5034 char message_buffer[kMessageBufferSize]; 5034 char message_buffer[kMessageBufferSize];
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5510 thread_->isolate()->SetupImagePage(data_buffer_, 5510 thread_->isolate()->SetupImagePage(data_buffer_,
5511 /* is_executable */ false); 5511 /* is_executable */ false);
5512 } 5512 }
5513 5513
5514 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); 5514 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store());
5515 5515
5516 return ApiError::null(); 5516 return ApiError::null();
5517 } 5517 }
5518 5518
5519 } // namespace dart 5519 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart.h » ('j') | tools/testing/dart/compiler_configuration.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698