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

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

Issue 2715463003: Add option to gen_snapshot for creating a Makefile describing a snapshot's dependencies. (Closed)
Patch Set: . Created 3 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/platform/platform_headers.gypi ('k') | runtime/vm/dart_api_state.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) 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 RUNTIME_VM_ALLOCATION_H_ 5 #ifndef RUNTIME_VM_ALLOCATION_H_
6 #define RUNTIME_VM_ALLOCATION_H_ 6 #define RUNTIME_VM_ALLOCATION_H_
7 7
8 #include "platform/allocation.h"
8 #include "platform/assert.h" 9 #include "platform/assert.h"
9 #include "vm/base_isolate.h" 10 #include "vm/base_isolate.h"
10 #include "vm/globals.h" 11 #include "vm/globals.h"
11 12
12 namespace dart { 13 namespace dart {
13 14
14 // Forward declarations. 15 // Forward declarations.
15 class Isolate; 16 class Isolate;
16 class Thread; 17 class Thread;
17 18
18 // Stack allocated objects subclass from this base class. Objects of this type
19 // cannot be allocated on either the C or object heaps. Destructors for objects
20 // of this type will not be run unless the stack is unwound through normal
21 // program control flow.
22 class ValueObject {
23 public:
24 ValueObject() {}
25 ~ValueObject() {}
26
27 private:
28 DISALLOW_ALLOCATION();
29 DISALLOW_COPY_AND_ASSIGN(ValueObject);
30 };
31
32
33 // Stack resources subclass from this base class. The VM will ensure that the 19 // 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 20 // 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 21 // 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 22 // 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. 23 // to a stack frame above the frame where these objects were allocated.
38 class StackResource { 24 class StackResource {
39 public: 25 public:
40 explicit StackResource(Thread* thread) : thread_(NULL), previous_(NULL) { 26 explicit StackResource(Thread* thread) : thread_(NULL), previous_(NULL) {
41 Init(thread); 27 Init(thread);
42 } 28 }
(...skipping 15 matching lines...) Expand all
58 void Init(Thread* thread); 44 void Init(Thread* thread);
59 45
60 Thread* thread_; 46 Thread* thread_;
61 StackResource* previous_; 47 StackResource* previous_;
62 48
63 DISALLOW_ALLOCATION(); 49 DISALLOW_ALLOCATION();
64 DISALLOW_IMPLICIT_CONSTRUCTORS(StackResource); 50 DISALLOW_IMPLICIT_CONSTRUCTORS(StackResource);
65 }; 51 };
66 52
67 53
68 // Static allocated classes only contain static members and can never
69 // be instantiated in the heap or on the stack.
70 class AllStatic {
71 private:
72 DISALLOW_ALLOCATION();
73 DISALLOW_IMPLICIT_CONSTRUCTORS(AllStatic);
74 };
75
76
77 // Zone allocated objects cannot be individually deallocated, but have 54 // Zone allocated objects cannot be individually deallocated, but have
78 // to rely on the destructor of Zone which is called when the Zone 55 // to rely on the destructor of Zone which is called when the Zone
79 // goes out of scope to reclaim memory. 56 // goes out of scope to reclaim memory.
80 class ZoneAllocated { 57 class ZoneAllocated {
81 public: 58 public:
82 ZoneAllocated() {} 59 ZoneAllocated() {}
83 60
84 // Implicitly allocate the object in the current zone. 61 // Implicitly allocate the object in the current zone.
85 void* operator new(uword size); 62 void* operator new(uword size);
86 63
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 NoSafepointScope() {} 96 NoSafepointScope() {}
120 97
121 private: 98 private:
122 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope); 99 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
123 }; 100 };
124 #endif // defined(DEBUG) 101 #endif // defined(DEBUG)
125 102
126 } // namespace dart 103 } // namespace dart
127 104
128 #endif // RUNTIME_VM_ALLOCATION_H_ 105 #endif // RUNTIME_VM_ALLOCATION_H_
OLDNEW
« no previous file with comments | « runtime/platform/platform_headers.gypi ('k') | runtime/vm/dart_api_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698