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

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

Issue 10871005: Make ClassFinalizer indifferent on whether we are generating a snapshot or not. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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 "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_api_message.h" 10 #include "vm/dart_api_message.h"
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 timer1.Start(); 885 timer1.Start();
886 { 886 {
887 TestIsolateScope __test_isolate__; 887 TestIsolateScope __test_isolate__;
888 888
889 Isolate* isolate = Isolate::Current(); 889 Isolate* isolate = Isolate::Current();
890 Zone zone(isolate); 890 Zone zone(isolate);
891 HandleScope scope(isolate); 891 HandleScope scope(isolate);
892 892
893 // Create a test library and Load up a test script in it. 893 // Create a test library and Load up a test script in it.
894 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); 894 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
895 ClassFinalizer::FinalizePendingClasses(); 895 ClassFinalizer::FinalizeAllClasses();
896 timer1.Stop(); 896 timer1.Stop();
897 OS::PrintErr("Without Snapshot: %dus\n", timer1.TotalElapsedTime()); 897 OS::PrintErr("Without Snapshot: %dus\n", timer1.TotalElapsedTime());
898 898
899 // Write snapshot with object content. 899 // Write snapshot with object content.
900 SnapshotWriter writer(Snapshot::kFull, &buffer, &malloc_allocator); 900 SnapshotWriter writer(Snapshot::kFull, &buffer, &malloc_allocator);
901 writer.WriteFullSnapshot(); 901 writer.WriteFullSnapshot();
902 902
903 // Invoke a function which returns an object. 903 // Invoke a function which returns an object.
904 Dart_Handle cls = Dart_GetClass(lib, Dart_NewString("FieldsTest")); 904 Dart_Handle cls = Dart_GetClass(lib, Dart_NewString("FieldsTest"));
905 Dart_Handle result = Dart_Invoke(cls, Dart_NewString("testMain"), 0, NULL); 905 Dart_Handle result = Dart_Invoke(cls, Dart_NewString("testMain"), 0, NULL);
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 EXPECT(Dart_ErrorHasException(result)); 1562 EXPECT(Dart_ErrorHasException(result));
1563 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", 1563 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n",
1564 Dart_GetError(result)); 1564 Dart_GetError(result));
1565 1565
1566 Dart_ExitScope(); 1566 Dart_ExitScope();
1567 } 1567 }
1568 1568
1569 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 1569 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
1570 1570
1571 } // namespace dart 1571 } // namespace dart
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/resolver_test.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698