OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/benchmark_test.h" | 5 #include "vm/benchmark_test.h" |
6 | 6 |
7 #include "bin/builtin.h" | 7 #include "bin/builtin.h" |
8 #include "bin/file.h" | 8 #include "bin/file.h" |
9 #include "bin/isolate_data.h" | 9 #include "bin/isolate_data.h" |
10 | 10 |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 uint8_t* vm_isolate_snapshot_buffer; | 519 uint8_t* vm_isolate_snapshot_buffer; |
520 uint8_t* isolate_snapshot_buffer; | 520 uint8_t* isolate_snapshot_buffer; |
521 // Need to load the script into the dart: core library due to | 521 // Need to load the script into the dart: core library due to |
522 // the import of dart:_internal. | 522 // the import of dart:_internal. |
523 TestCase::LoadCoreTestScript(kScriptChars, NULL); | 523 TestCase::LoadCoreTestScript(kScriptChars, NULL); |
524 Api::CheckAndFinalizePendingClasses(thread); | 524 Api::CheckAndFinalizePendingClasses(thread); |
525 | 525 |
526 // Write snapshot with object content. | 526 // Write snapshot with object content. |
527 FullSnapshotWriter writer(&vm_isolate_snapshot_buffer, | 527 FullSnapshotWriter writer(&vm_isolate_snapshot_buffer, |
528 &isolate_snapshot_buffer, | 528 &isolate_snapshot_buffer, |
529 NULL, /* instructions_snapshot_buffer */ | |
530 &malloc_allocator, | 529 &malloc_allocator, |
| 530 NULL, /* instructions_writer */ |
531 false, /* snapshot_code */ | 531 false, /* snapshot_code */ |
532 true /* vm_isolate_is_symbolic */); | 532 true /* vm_isolate_is_symbolic */); |
533 writer.WriteFullSnapshot(); | 533 writer.WriteFullSnapshot(); |
534 const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer); | 534 const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer); |
535 ASSERT(snapshot->kind() == Snapshot::kFull); | 535 ASSERT(snapshot->kind() == Snapshot::kFull); |
536 benchmark->set_score(snapshot->length()); | 536 benchmark->set_score(snapshot->length()); |
537 } | 537 } |
538 | 538 |
539 | 539 |
540 BENCHMARK_SIZE(StandaloneSnapshotSize) { | 540 BENCHMARK_SIZE(StandaloneSnapshotSize) { |
(...skipping 15 matching lines...) Expand all Loading... |
556 uint8_t* vm_isolate_snapshot_buffer; | 556 uint8_t* vm_isolate_snapshot_buffer; |
557 uint8_t* isolate_snapshot_buffer; | 557 uint8_t* isolate_snapshot_buffer; |
558 // Need to load the script into the dart: core library due to | 558 // Need to load the script into the dart: core library due to |
559 // the import of dart:_internal. | 559 // the import of dart:_internal. |
560 TestCase::LoadCoreTestScript(kScriptChars, NULL); | 560 TestCase::LoadCoreTestScript(kScriptChars, NULL); |
561 Api::CheckAndFinalizePendingClasses(thread); | 561 Api::CheckAndFinalizePendingClasses(thread); |
562 | 562 |
563 // Write snapshot with object content. | 563 // Write snapshot with object content. |
564 FullSnapshotWriter writer(&vm_isolate_snapshot_buffer, | 564 FullSnapshotWriter writer(&vm_isolate_snapshot_buffer, |
565 &isolate_snapshot_buffer, | 565 &isolate_snapshot_buffer, |
566 NULL, /* instructions_snapshot_buffer */ | |
567 &malloc_allocator, | 566 &malloc_allocator, |
| 567 NULL, /* instructions_writer */ |
568 false, /* snapshot_code */ | 568 false, /* snapshot_code */ |
569 true /* vm_isolate_is_symbolic */); | 569 true /* vm_isolate_is_symbolic */); |
570 writer.WriteFullSnapshot(); | 570 writer.WriteFullSnapshot(); |
571 const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer); | 571 const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer); |
572 ASSERT(snapshot->kind() == Snapshot::kFull); | 572 ASSERT(snapshot->kind() == Snapshot::kFull); |
573 benchmark->set_score(snapshot->length()); | 573 benchmark->set_score(snapshot->length()); |
574 } | 574 } |
575 | 575 |
576 | 576 |
577 BENCHMARK(CreateMirrorSystem) { | 577 BENCHMARK(CreateMirrorSystem) { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 thread); | 725 thread); |
726 reader.ReadObject(); | 726 reader.ReadObject(); |
727 free(buffer); | 727 free(buffer); |
728 } | 728 } |
729 timer.Stop(); | 729 timer.Stop(); |
730 int64_t elapsed_time = timer.TotalElapsedTime(); | 730 int64_t elapsed_time = timer.TotalElapsedTime(); |
731 benchmark->set_score(elapsed_time); | 731 benchmark->set_score(elapsed_time); |
732 } | 732 } |
733 | 733 |
734 } // namespace dart | 734 } // namespace dart |
OLD | NEW |