| 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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
| 6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
| 7 #include "include/dart_mirrors_api.h" | 7 #include "include/dart_mirrors_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "include/dart_tools_api.h" | 9 #include "include/dart_tools_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2487 | 2487 |
| 2488 | 2488 |
| 2489 // Helper class to ensure new gen GC is triggered without any side effects. | 2489 // Helper class to ensure new gen GC is triggered without any side effects. |
| 2490 // The normal call to CollectGarbage(Heap::kNew) could potentially trigger | 2490 // The normal call to CollectGarbage(Heap::kNew) could potentially trigger |
| 2491 // an old gen collection if there is a promotion failure and this could | 2491 // an old gen collection if there is a promotion failure and this could |
| 2492 // perturb the test. | 2492 // perturb the test. |
| 2493 class GCTestHelper : public AllStatic { | 2493 class GCTestHelper : public AllStatic { |
| 2494 public: | 2494 public: |
| 2495 static void CollectNewSpace(Heap::ApiCallbacks api_callbacks) { | 2495 static void CollectNewSpace(Heap::ApiCallbacks api_callbacks) { |
| 2496 bool invoke_api_callbacks = (api_callbacks == Heap::kInvokeApiCallbacks); | 2496 bool invoke_api_callbacks = (api_callbacks == Heap::kInvokeApiCallbacks); |
| 2497 Isolate::Current()->heap()->new_space_->Scavenge(invoke_api_callbacks); | 2497 Isolate::Current()->heap()->new_space()->Scavenge(invoke_api_callbacks); |
| 2498 } | 2498 } |
| 2499 }; | 2499 }; |
| 2500 | 2500 |
| 2501 | 2501 |
| 2502 static Dart_Handle AsHandle(Dart_PersistentHandle weak) { | 2502 static Dart_Handle AsHandle(Dart_PersistentHandle weak) { |
| 2503 return Dart_HandleFromPersistent(weak); | 2503 return Dart_HandleFromPersistent(weak); |
| 2504 } | 2504 } |
| 2505 | 2505 |
| 2506 | 2506 |
| 2507 static Dart_Handle AsHandle(Dart_WeakPersistentHandle weak) { | 2507 static Dart_Handle AsHandle(Dart_WeakPersistentHandle weak) { |
| (...skipping 6764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9272 Dart_TimelineAsyncEnd("testAsyncEvent", async_id); | 9272 Dart_TimelineAsyncEnd("testAsyncEvent", async_id); |
| 9273 | 9273 |
| 9274 // Check that it is in the output. | 9274 // Check that it is in the output. |
| 9275 TimelineEventRecorder* recorder = isolate->timeline_event_recorder(); | 9275 TimelineEventRecorder* recorder = isolate->timeline_event_recorder(); |
| 9276 JSONStream js; | 9276 JSONStream js; |
| 9277 recorder->PrintJSON(&js); | 9277 recorder->PrintJSON(&js); |
| 9278 EXPECT_SUBSTRING("testAsyncEvent", js.ToCString()); | 9278 EXPECT_SUBSTRING("testAsyncEvent", js.ToCString()); |
| 9279 } | 9279 } |
| 9280 | 9280 |
| 9281 } // namespace dart | 9281 } // namespace dart |
| OLD | NEW |