| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "platform/json.h" | 7 #include "platform/json.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 | 1296 |
| 1297 | 1297 |
| 1298 // Helper class to ensure new gen GC is triggered without any side effects. | 1298 // Helper class to ensure new gen GC is triggered without any side effects. |
| 1299 // The normal call to CollectGarbage(Heap::kNew) could potentially trigger | 1299 // The normal call to CollectGarbage(Heap::kNew) could potentially trigger |
| 1300 // an old gen collection if there is a promotion failure and this could | 1300 // an old gen collection if there is a promotion failure and this could |
| 1301 // perturb the test. | 1301 // perturb the test. |
| 1302 class GCTestHelper : public AllStatic { | 1302 class GCTestHelper : public AllStatic { |
| 1303 public: | 1303 public: |
| 1304 static void CollectNewSpace(Heap::ApiCallbacks api_callbacks) { | 1304 static void CollectNewSpace(Heap::ApiCallbacks api_callbacks) { |
| 1305 bool invoke_api_callbacks = (api_callbacks == Heap::kInvokeApiCallbacks); | 1305 bool invoke_api_callbacks = (api_callbacks == Heap::kInvokeApiCallbacks); |
| 1306 Isolate::Current()->heap()->new_space_->Scavenge(invoke_api_callbacks); | 1306 Isolate::Current()->heap()->new_space_->Scavenge(invoke_api_callbacks, |
| 1307 "test case"); |
| 1307 } | 1308 } |
| 1308 }; | 1309 }; |
| 1309 | 1310 |
| 1310 | 1311 |
| 1311 // Only ia32 and x64 can run execution tests. | 1312 // Only ia32 and x64 can run execution tests. |
| 1312 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 1313 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 1313 | 1314 |
| 1314 TEST_CASE(WeakPersistentHandle) { | 1315 TEST_CASE(WeakPersistentHandle) { |
| 1315 Dart_Handle weak_new_ref = Dart_Null(); | 1316 Dart_Handle weak_new_ref = Dart_Null(); |
| 1316 EXPECT(Dart_IsNull(weak_new_ref)); | 1317 EXPECT(Dart_IsNull(weak_new_ref)); |
| (...skipping 5205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6522 EXPECT(Dart_IsString(str)); | 6523 EXPECT(Dart_IsString(str)); |
| 6523 len = -1; | 6524 len = -1; |
| 6524 EXPECT_VALID(Dart_StringLength(str, &len)); | 6525 EXPECT_VALID(Dart_StringLength(str, &len)); |
| 6525 EXPECT_EQ(0, len); | 6526 EXPECT_EQ(0, len); |
| 6526 } | 6527 } |
| 6527 | 6528 |
| 6528 | 6529 |
| 6529 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 6530 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 6530 | 6531 |
| 6531 } // namespace dart | 6532 } // namespace dart |
| OLD | NEW |