| 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 "vm/globals.h" | 7 #include "vm/globals.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/lockers.h" | 9 #include "vm/lockers.h" |
| 10 #include "vm/thread_barrier.h" | 10 #include "vm/thread_barrier.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 Dart_Handle async_lib = Dart_LookupLibrary(url); | 70 Dart_Handle async_lib = Dart_LookupLibrary(url); |
| 71 DART_CHECK_VALID(async_lib); | 71 DART_CHECK_VALID(async_lib); |
| 72 DART_CHECK_VALID(Dart_Invoke( | 72 DART_CHECK_VALID(Dart_Invoke( |
| 73 async_lib, NewString("_setScheduleImmediateClosure"), 1, args)); | 73 async_lib, NewString("_setScheduleImmediateClosure"), 1, args)); |
| 74 | 74 |
| 75 | 75 |
| 76 result = Dart_Invoke(test_lib, NewString("testMain"), 0, NULL); | 76 result = Dart_Invoke(test_lib, NewString("testMain"), 0, NULL); |
| 77 EXPECT(!Dart_IsError(result)); | 77 EXPECT(!Dart_IsError(result)); |
| 78 // Run until all ports to isolate are closed. | 78 // Run until all ports to isolate are closed. |
| 79 result = Dart_RunLoop(); | 79 result = Dart_RunLoop(); |
| 80 EXPECT_ERROR(result, "Null callback specified for isolate creation"); | 80 EXPECT_ERROR(result, |
| 81 "Isolate spawn is not supported by this Dart implementation"); |
| 81 EXPECT(Dart_ErrorHasException(result)); | 82 EXPECT(Dart_ErrorHasException(result)); |
| 82 Dart_Handle exception_result = Dart_ErrorGetException(result); | 83 Dart_Handle exception_result = Dart_ErrorGetException(result); |
| 83 EXPECT_VALID(exception_result); | 84 EXPECT_VALID(exception_result); |
| 84 } | 85 } |
| 85 | 86 |
| 86 | 87 |
| 87 class InterruptChecker : public ThreadPool::Task { | 88 class InterruptChecker : public ThreadPool::Task { |
| 88 public: | 89 public: |
| 89 static const intptr_t kTaskCount; | 90 static const intptr_t kTaskCount; |
| 90 static const intptr_t kIterations; | 91 static const intptr_t kIterations; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Wait for all tasks to observe the interrupt. | 144 // Wait for all tasks to observe the interrupt. |
| 144 barrier.Sync(); | 145 barrier.Sync(); |
| 145 // Continue with next round. | 146 // Continue with next round. |
| 146 uword interrupts = isolate->GetAndClearInterrupts(); | 147 uword interrupts = isolate->GetAndClearInterrupts(); |
| 147 EXPECT((interrupts & Isolate::kVMInterrupt) != 0); | 148 EXPECT((interrupts & Isolate::kVMInterrupt) != 0); |
| 148 } | 149 } |
| 149 barrier.Exit(); | 150 barrier.Exit(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 } // namespace dart | 153 } // namespace dart |
| OLD | NEW |