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

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

Issue 9655011: Implement prologue weak persistent handles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final revision Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_DART_API_IMPL_H_ 5 #ifndef VM_DART_API_IMPL_H_
6 #define VM_DART_API_IMPL_H_ 6 #define VM_DART_API_IMPL_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 class ApiState; 13 class ApiState;
14 class FinalizablePersistentHandle;
14 class LocalHandle; 15 class LocalHandle;
15 class PersistentHandle; 16 class PersistentHandle;
16 class WeakPersistentHandle;
17 17
18 const char* CanonicalFunction(const char* func); 18 const char* CanonicalFunction(const char* func);
19 19
20 #define CURRENT_FUNC CanonicalFunction(__FUNCTION__) 20 #define CURRENT_FUNC CanonicalFunction(__FUNCTION__)
21 21
22 // Checks that the current isolate is not NULL. 22 // Checks that the current isolate is not NULL.
23 #define CHECK_ISOLATE(isolate) \ 23 #define CHECK_ISOLATE(isolate) \
24 do { \ 24 do { \
25 if ((isolate) == NULL) { \ 25 if ((isolate) == NULL) { \
26 FATAL1("%s expects there to be a current isolate. Did you " \ 26 FATAL1("%s expects there to be a current isolate. Did you " \
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // Validates and converts the passed in handle as a local handle. 88 // Validates and converts the passed in handle as a local handle.
89 static LocalHandle* UnwrapAsLocalHandle(const ApiState& state, 89 static LocalHandle* UnwrapAsLocalHandle(const ApiState& state,
90 Dart_Handle object); 90 Dart_Handle object);
91 91
92 // Validates and converts the passed in handle as a persistent handle. 92 // Validates and converts the passed in handle as a persistent handle.
93 static PersistentHandle* UnwrapAsPersistentHandle(const ApiState& state, 93 static PersistentHandle* UnwrapAsPersistentHandle(const ApiState& state,
94 Dart_Handle object); 94 Dart_Handle object);
95 95
96 // Validates and converts the passed in handle as a weak persistent handle. 96 // Validates and converts the passed in handle as a weak persistent handle.
97 static WeakPersistentHandle* UnwrapAsWeakPersistentHandle( 97 static FinalizablePersistentHandle* UnwrapAsWeakPersistentHandle(
98 const ApiState& state, 98 const ApiState& state,
99 Dart_Handle object); 99 Dart_Handle object);
100 100
101 // Validates and converts the passed in handle as a prologue weak
102 // persistent handle.
103 static FinalizablePersistentHandle* UnwrapAsPrologueWeakPersistentHandle(
104 const ApiState& state,
105 Dart_Handle object);
106
101 // Casts the internal Isolate* type to the external Dart_Isolate type. 107 // Casts the internal Isolate* type to the external Dart_Isolate type.
102 static Dart_Isolate CastIsolate(Isolate* isolate); 108 static Dart_Isolate CastIsolate(Isolate* isolate);
103 109
104 // Gets the handle used to designate successful return. 110 // Gets the handle used to designate successful return.
105 static Dart_Handle Success(); 111 static Dart_Handle Success();
106 112
107 // Generates a handle used to designate an error return. 113 // Generates a handle used to designate an error return.
108 static Dart_Handle NewError(const char* format, ...); 114 static Dart_Handle NewError(const char* format, ...);
109 115
110 // Gets a handle to Null. 116 // Gets a handle to Null.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 149 }
144 private: 150 private:
145 Isolate* saved_isolate_; 151 Isolate* saved_isolate_;
146 152
147 DISALLOW_COPY_AND_ASSIGN(IsolateSaver); 153 DISALLOW_COPY_AND_ASSIGN(IsolateSaver);
148 }; 154 };
149 155
150 } // namespace dart. 156 } // namespace dart.
151 157
152 #endif // VM_DART_API_IMPL_H_ 158 #endif // VM_DART_API_IMPL_H_
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698