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

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

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-typo Created 4 years, 10 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/object.cc ('k') | runtime/vm/object_id_ring_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/object_graph.h" 6 #include "vm/object_graph.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 20 matching lines...) Expand all
31 int size() const { return size_; } 31 int size() const { return size_; }
32 32
33 private: 33 private:
34 int count_; 34 int count_;
35 intptr_t size_; 35 intptr_t size_;
36 RawObject* skip_; 36 RawObject* skip_;
37 RawObject* expected_parent_; 37 RawObject* expected_parent_;
38 }; 38 };
39 39
40 40
41 TEST_CASE(ObjectGraph) { 41 VM_TEST_CASE(ObjectGraph) {
42 Isolate* isolate = thread->isolate(); 42 Isolate* isolate = thread->isolate();
43 // Create a simple object graph with objects a, b, c, d: 43 // Create a simple object graph with objects a, b, c, d:
44 // a+->b+->c 44 // a+->b+->c
45 // +   + 45 // +   +
46 // |   v 46 // |   v
47 // +-->d 47 // +-->d
48 Array& a = Array::Handle(Array::New(12, Heap::kNew)); 48 Array& a = Array::Handle(Array::New(12, Heap::kNew));
49 Array& b = Array::Handle(Array::New(2, Heap::kOld)); 49 Array& b = Array::Handle(Array::New(2, Heap::kOld));
50 Array& c = Array::Handle(Array::New(0, Heap::kOld)); 50 Array& c = Array::Handle(Array::New(0, Heap::kOld));
51 Array& d = Array::Handle(Array::New(0, Heap::kOld)); 51 Array& d = Array::Handle(Array::New(0, Heap::kOld));
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 Array& expected_a = Array::Handle(); 132 Array& expected_a = Array::Handle();
133 expected_a ^= path.At(4); 133 expected_a ^= path.At(4);
134 EXPECT(expected_c.raw() == c.raw()); 134 EXPECT(expected_c.raw() == c.raw());
135 EXPECT(expected_b.raw() == a.At(10)); 135 EXPECT(expected_b.raw() == a.At(10));
136 EXPECT(expected_a.raw() == a.raw()); 136 EXPECT(expected_a.raw() == a.raw());
137 } 137 }
138 } 138 }
139 } 139 }
140 140
141 } // namespace dart 141 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/object_id_ring_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698