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

Side by Side Diff: runtime/vm/unit_test.h

Issue 2622053002: Refactor snapshots pieces to include a section for loading instructions into the heap of a regular … (Closed)
Patch Set: Restore --print-snapshot-sizes Created 3 years, 11 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef RUNTIME_VM_UNIT_TEST_H_ 5 #ifndef RUNTIME_VM_UNIT_TEST_H_
6 #define RUNTIME_VM_UNIT_TEST_H_ 6 #define RUNTIME_VM_UNIT_TEST_H_
7 7
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 9
10 #include "platform/globals.h" 10 #include "platform/globals.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 namespace dart { 235 namespace dart {
236 236
237 // Forward declarations. 237 // Forward declarations.
238 class Assembler; 238 class Assembler;
239 class CodeGenerator; 239 class CodeGenerator;
240 class VirtualMemory; 240 class VirtualMemory;
241 241
242 242
243 namespace bin { 243 namespace bin {
244 // vm_isolate_snapshot_buffer points to a snapshot for the vm isolate if we 244 // Snapshot pieces if we link in a snapshot, otherwise initialized to NULL.
245 // link in a snapshot otherwise it is initialized to NULL. 245 extern const uint8_t* vm_snapshot_data;
246 extern const uint8_t* vm_isolate_snapshot_buffer; 246 extern const uint8_t* vm_snapshot_instructions;
247 247 extern const uint8_t* core_isolate_snapshot_data;
248 // isolate_snapshot_buffer points to a snapshot for an isolate if we link in a 248 extern const uint8_t* core_isolate_snapshot_instructions;
249 // snapshot otherwise it is initialized to NULL.
250 extern const uint8_t* core_isolate_snapshot_buffer;
251 } 249 }
252 250
253 251
254 class TestCaseBase { 252 class TestCaseBase {
255 public: 253 public:
256 explicit TestCaseBase(const char* name); 254 explicit TestCaseBase(const char* name);
257 virtual ~TestCaseBase() {} 255 virtual ~TestCaseBase() {}
258 256
259 const char* name() const { return name_; } 257 const char* name() const { return name_; }
260 258
(...skipping 27 matching lines...) Expand all
288 bool finalize = true); 286 bool finalize = true);
289 static Dart_Handle LoadCoreTestScript(const char* script, 287 static Dart_Handle LoadCoreTestScript(const char* script,
290 Dart_NativeEntryResolver resolver); 288 Dart_NativeEntryResolver resolver);
291 static Dart_Handle lib(); 289 static Dart_Handle lib();
292 static const char* url() { return USER_TEST_URI; } 290 static const char* url() { return USER_TEST_URI; }
293 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer, 291 static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer,
294 const char* name = NULL) { 292 const char* name = NULL) {
295 return CreateIsolate(buffer, name); 293 return CreateIsolate(buffer, name);
296 } 294 }
297 static Dart_Isolate CreateTestIsolate(const char* name = NULL) { 295 static Dart_Isolate CreateTestIsolate(const char* name = NULL) {
298 return CreateIsolate(bin::core_isolate_snapshot_buffer, name); 296 return CreateIsolate(bin::core_isolate_snapshot_data, name);
299 } 297 }
300 static Dart_Handle library_handler(Dart_LibraryTag tag, 298 static Dart_Handle library_handler(Dart_LibraryTag tag,
301 Dart_Handle library, 299 Dart_Handle library,
302 Dart_Handle url); 300 Dart_Handle url);
303 static char* BigintToHexValue(Dart_CObject* bigint); 301 static char* BigintToHexValue(Dart_CObject* bigint);
304 302
305 virtual void Run(); 303 virtual void Run();
306 304
307 // Sets |script| to be the source used at next reload. 305 // Sets |script| to be the source used at next reload.
308 static void SetReloadTestScript(const char* script); 306 static void SetReloadTestScript(const char* script);
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 ~SetFlagScope() { *flag_ = original_value_; } 606 ~SetFlagScope() { *flag_ = original_value_; }
609 607
610 private: 608 private:
611 T* flag_; 609 T* flag_;
612 T original_value_; 610 T original_value_;
613 }; 611 };
614 612
615 } // namespace dart 613 } // namespace dart
616 614
617 #endif // RUNTIME_VM_UNIT_TEST_H_ 615 #endif // RUNTIME_VM_UNIT_TEST_H_
OLDNEW
« runtime/vm/snapshot.cc ('K') | « runtime/vm/thread_test.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698