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

Side by Side Diff: runtime/vm/allocation.h

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 | « no previous file | runtime/vm/allocation_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #ifndef VM_ALLOCATION_H_ 5 #ifndef VM_ALLOCATION_H_
6 #define VM_ALLOCATION_H_ 6 #define VM_ALLOCATION_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/base_isolate.h" 9 #include "vm/base_isolate.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 19 matching lines...) Expand all
30 }; 30 };
31 31
32 32
33 // Stack resources subclass from this base class. The VM will ensure that the 33 // Stack resources subclass from this base class. The VM will ensure that the
34 // destructors of these objects are called before the stack is unwound past the 34 // destructors of these objects are called before the stack is unwound past the
35 // objects location on the stack. Use stack resource objects if objects 35 // objects location on the stack. Use stack resource objects if objects
36 // need to be destroyed even in the case of exceptions when a Longjump is done 36 // need to be destroyed even in the case of exceptions when a Longjump is done
37 // to a stack frame above the frame where these objects were allocated. 37 // to a stack frame above the frame where these objects were allocated.
38 class StackResource { 38 class StackResource {
39 public: 39 public:
40 // DEPRECATED: Use Thread-based interface. During migration, this defaults
41 // to using the mutator thread (which must also be the current thread).
42 explicit StackResource(Isolate* isolate) : thread_(NULL), previous_(NULL) {
43 Init((isolate == NULL) ?
44 NULL : reinterpret_cast<BaseIsolate*>(isolate)->mutator_thread_);
45 }
46
47 explicit StackResource(Thread* thread) : thread_(NULL), previous_(NULL) { 40 explicit StackResource(Thread* thread) : thread_(NULL), previous_(NULL) {
48 Init(thread); 41 Init(thread);
49 } 42 }
50 43
51 virtual ~StackResource(); 44 virtual ~StackResource();
52 45
53 // Convenient access to the isolate of the thread of this resource. 46 // Convenient access to the isolate of the thread of this resource.
54 Isolate* isolate() const; 47 Isolate* isolate() const;
55 48
56 // The thread that owns this resource. 49 // The thread that owns this resource.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 public: 118 public:
126 NoSafepointScope() {} 119 NoSafepointScope() {}
127 private: 120 private:
128 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope); 121 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
129 }; 122 };
130 #endif // defined(DEBUG) 123 #endif // defined(DEBUG)
131 124
132 } // namespace dart 125 } // namespace dart
133 126
134 #endif // VM_ALLOCATION_H_ 127 #endif // VM_ALLOCATION_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/allocation_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698