Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Side by Side Diff: runtime/vm/isolate_test.cc

Issue 2622053002: Refactor snapshots pieces to include a section for loading instructions into the heap of a regular … (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/metrics_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "vm/thread_pool.h" 11 #include "vm/thread_pool.h"
12 #include "vm/unit_test.h" 12 #include "vm/unit_test.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 UNIT_TEST_CASE(IsolateCurrent) { 16 UNIT_TEST_CASE(IsolateCurrent) {
17 Dart_Isolate isolate = Dart_CreateIsolate( 17 Dart_Isolate isolate = Dart_CreateIsolate(
18 NULL, NULL, bin::core_isolate_snapshot_buffer, NULL, NULL, NULL); 18 NULL, NULL, bin::core_isolate_snapshot_data,
19 bin::core_isolate_snapshot_instructions, NULL, NULL, NULL);
19 EXPECT_EQ(isolate, Dart_CurrentIsolate()); 20 EXPECT_EQ(isolate, Dart_CurrentIsolate());
20 Dart_ShutdownIsolate(); 21 Dart_ShutdownIsolate();
21 EXPECT_EQ(reinterpret_cast<Dart_Isolate>(NULL), Dart_CurrentIsolate()); 22 EXPECT_EQ(reinterpret_cast<Dart_Isolate>(NULL), Dart_CurrentIsolate());
22 } 23 }
23 24
24 25
25 // Test to ensure that an exception is thrown if no isolate creation 26 // Test to ensure that an exception is thrown if no isolate creation
26 // callback has been set by the embedder when an isolate is spawned. 27 // callback has been set by the embedder when an isolate is spawned.
27 TEST_CASE(IsolateSpawn) { 28 TEST_CASE(IsolateSpawn) {
28 const char* kScriptChars = 29 const char* kScriptChars =
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // Restore, then clear interrupts. The world is as it was. 241 // Restore, then clear interrupts. The world is as it was.
241 interrupt_bits = thread->GetAndClearInterrupts(); 242 interrupt_bits = thread->GetAndClearInterrupts();
242 EXPECT_EQ(kMessageInterrupt, interrupt_bits); 243 EXPECT_EQ(kMessageInterrupt, interrupt_bits);
243 EXPECT_EQ(IsolateTestHelper::GetStackLimit(thread), 244 EXPECT_EQ(IsolateTestHelper::GetStackLimit(thread),
244 IsolateTestHelper::GetSavedStackLimit(thread)); 245 IsolateTestHelper::GetSavedStackLimit(thread));
245 EXPECT_EQ(kZero, IsolateTestHelper::GetDeferredInterruptsMask(thread)); 246 EXPECT_EQ(kZero, IsolateTestHelper::GetDeferredInterruptsMask(thread));
246 EXPECT_EQ(kZero, IsolateTestHelper::GetDeferredInterrupts(thread)); 247 EXPECT_EQ(kZero, IsolateTestHelper::GetDeferredInterrupts(thread));
247 } 248 }
248 249
249 } // namespace dart 250 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/metrics_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698