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

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

Issue 1410643008: Get rid of deprecated methods accessing mutator_thread_ instead of current thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/allocation.h ('k') | runtime/vm/base_isolate.h » ('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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/allocation.h" 6 #include "vm/allocation.h"
7 #include "vm/longjump.h" 7 #include "vm/longjump.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 14 matching lines...) Expand all
25 virtual int GetId() const { return 3; } 25 virtual int GetId() const { return 3; }
26 26
27 private: 27 private:
28 int* ptr_; 28 int* ptr_;
29 }; 29 };
30 30
31 31
32 class TestStackResource : public StackResource { 32 class TestStackResource : public StackResource {
33 public: 33 public:
34 explicit TestStackResource(int* ptr) 34 explicit TestStackResource(int* ptr)
35 : StackResource(Isolate::Current()), ptr_(ptr) { 35 : StackResource(Thread::Current()), ptr_(ptr) {
36 EXPECT_EQ(1, *ptr_); 36 EXPECT_EQ(1, *ptr_);
37 *ptr_ = 2; 37 *ptr_ = 2;
38 } 38 }
39 39
40 ~TestStackResource() { 40 ~TestStackResource() {
41 EXPECT_EQ(6, *ptr_); 41 EXPECT_EQ(6, *ptr_);
42 *ptr_ = 7; 42 *ptr_ = 7;
43 } 43 }
44 44
45 int value() const { return *ptr_; } 45 int value() const { return *ptr_; }
46 virtual int GetId() const { return 3; } 46 virtual int GetId() const { return 3; }
47 47
48 private: 48 private:
49 int* ptr_; 49 int* ptr_;
50 }; 50 };
51 51
52 52
53 class TestStackedStackResource : public StackResource { 53 class TestStackedStackResource : public StackResource {
54 public: 54 public:
55 explicit TestStackedStackResource(int* ptr) 55 explicit TestStackedStackResource(int* ptr)
56 : StackResource(Isolate::Current()), ptr_(ptr) { 56 : StackResource(Thread::Current()), ptr_(ptr) {
57 EXPECT_EQ(3, *ptr_); 57 EXPECT_EQ(3, *ptr_);
58 *ptr_ = 4; 58 *ptr_ = 4;
59 } 59 }
60 60
61 ~TestStackedStackResource() { 61 ~TestStackedStackResource() {
62 EXPECT_EQ(5, *ptr_); 62 EXPECT_EQ(5, *ptr_);
63 *ptr_ = 6; 63 *ptr_ = 6;
64 } 64 }
65 65
66 int value() const { return *ptr_; } 66 int value() const { return *ptr_; }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (setjmp(*jump.Set()) == 0) { 160 if (setjmp(*jump.Set()) == 0) {
161 StackResourceLongJumpHelper(&data, &jump); 161 StackResourceLongJumpHelper(&data, &jump);
162 UNREACHABLE(); 162 UNREACHABLE();
163 } 163 }
164 EXPECT_EQ(7, data); 164 EXPECT_EQ(7, data);
165 } 165 }
166 ASSERT(base == Thread::Current()->long_jump_base()); 166 ASSERT(base == Thread::Current()->long_jump_base());
167 } 167 }
168 168
169 } // namespace dart 169 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/allocation.h ('k') | runtime/vm/base_isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698