| 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 "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/globals.h" | 6 #include "vm/globals.h" |
| 7 #include "vm/heap.h" | 7 #include "vm/heap.h" |
| 8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 #if defined(TARGET_ARCH_IA32) || \ | |
| 13 defined(TARGET_ARCH_X64) || \ | |
| 14 defined(TARGET_ARCH_ARM) | |
| 15 | |
| 16 TEST_CASE(OldGC) { | 12 TEST_CASE(OldGC) { |
| 17 const char* kScriptChars = | 13 const char* kScriptChars = |
| 18 "main() {\n" | 14 "main() {\n" |
| 19 " return [1, 2, 3];\n" | 15 " return [1, 2, 3];\n" |
| 20 "}\n"; | 16 "}\n"; |
| 21 FLAG_verbose_gc = true; | 17 FLAG_verbose_gc = true; |
| 22 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); | 18 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
| 23 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 19 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
| 24 | 20 |
| 25 EXPECT_VALID(result); | 21 EXPECT_VALID(result); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 | 39 |
| 44 EXPECT_VALID(result); | 40 EXPECT_VALID(result); |
| 45 EXPECT(!Dart_IsNull(result)); | 41 EXPECT(!Dart_IsNull(result)); |
| 46 EXPECT(Dart_IsList(result)); | 42 EXPECT(Dart_IsList(result)); |
| 47 Isolate* isolate = Isolate::Current(); | 43 Isolate* isolate = Isolate::Current(); |
| 48 Heap* heap = isolate->heap(); | 44 Heap* heap = isolate->heap(); |
| 49 heap->CollectGarbage(Heap::kOld); | 45 heap->CollectGarbage(Heap::kOld); |
| 50 Dart_ExitScope(); | 46 Dart_ExitScope(); |
| 51 heap->CollectGarbage(Heap::kOld); | 47 heap->CollectGarbage(Heap::kOld); |
| 52 } | 48 } |
| 53 | |
| 54 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM | |
| 55 } | 49 } |
| OLD | NEW |