| 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 // TODO(zra): Remove when tests are ready to enable. | 5 // TODO(zra): Remove when tests are ready to enable. |
| 6 #include "platform/globals.h" | 6 #include "platform/globals.h" |
| 7 #if !defined(TARGET_ARCH_ARM64) | 7 #if !defined(TARGET_ARCH_ARM64) |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
| (...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2368 weak = Dart_NewWeakPersistentHandle(dead, | 2368 weak = Dart_NewWeakPersistentHandle(dead, |
| 2369 NULL, | 2369 NULL, |
| 2370 kSmallExternalSize, | 2370 kSmallExternalSize, |
| 2371 NopCallback); | 2371 NopCallback); |
| 2372 EXPECT_VALID(AsHandle(weak)); | 2372 EXPECT_VALID(AsHandle(weak)); |
| 2373 Dart_ExitScope(); | 2373 Dart_ExitScope(); |
| 2374 } | 2374 } |
| 2375 EXPECT_EQ(kSmallExternalSize, | 2375 EXPECT_EQ(kSmallExternalSize, |
| 2376 isolate->heap()->ExternalInWords(Heap::kOld) * kWordSize); | 2376 isolate->heap()->ExternalInWords(Heap::kOld) * kWordSize); |
| 2377 // Large enough to trigger GC in old space. Not actually allocated. | 2377 // Large enough to trigger GC in old space. Not actually allocated. |
| 2378 const intptr_t kHugeExternalSize = 1000 * MB; | 2378 const intptr_t kHugeExternalSize = Heap::kHeapSizeInMB * MB; |
| 2379 Dart_NewWeakPersistentHandle(live, | 2379 Dart_NewWeakPersistentHandle(live, |
| 2380 NULL, | 2380 NULL, |
| 2381 kHugeExternalSize, | 2381 kHugeExternalSize, |
| 2382 NopCallback); | 2382 NopCallback); |
| 2383 // Expect small garbage to be collected. | 2383 // Expect small garbage to be collected. |
| 2384 EXPECT_EQ(kHugeExternalSize, | 2384 EXPECT_EQ(kHugeExternalSize, |
| 2385 isolate->heap()->ExternalInWords(Heap::kOld) * kWordSize); | 2385 isolate->heap()->ExternalInWords(Heap::kOld) * kWordSize); |
| 2386 Dart_DeleteWeakPersistentHandle(reinterpret_cast<Dart_Isolate>(isolate), | 2386 Dart_DeleteWeakPersistentHandle(reinterpret_cast<Dart_Isolate>(isolate), |
| 2387 weak); | 2387 weak); |
| 2388 Dart_ExitScope(); | 2388 Dart_ExitScope(); |
| (...skipping 5748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8137 dart_args); | 8137 dart_args); |
| 8138 int64_t value = 0; | 8138 int64_t value = 0; |
| 8139 result = Dart_IntegerToInt64(result, &value); | 8139 result = Dart_IntegerToInt64(result, &value); |
| 8140 EXPECT_VALID(result); | 8140 EXPECT_VALID(result); |
| 8141 EXPECT_EQ(6, value); | 8141 EXPECT_EQ(6, value); |
| 8142 } | 8142 } |
| 8143 | 8143 |
| 8144 } // namespace dart | 8144 } // namespace dart |
| 8145 | 8145 |
| 8146 #endif // !defined(TARGET_ARCH_ARM64) | 8146 #endif // !defined(TARGET_ARCH_ARM64) |
| OLD | NEW |