OLD | NEW |
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 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 // Returns the value of a Smi. | 121 // Returns the value of a Smi. |
122 static intptr_t SmiValue(Dart_Handle handle) { | 122 static intptr_t SmiValue(Dart_Handle handle) { |
123 uword value = *(reinterpret_cast<uword*>(handle)); | 123 uword value = *(reinterpret_cast<uword*>(handle)); |
124 return Smi::ValueFromRaw(value); | 124 return Smi::ValueFromRaw(value); |
125 } | 125 } |
126 | 126 |
127 static intptr_t ClassId(Dart_Handle handle) { | 127 static intptr_t ClassId(Dart_Handle handle) { |
128 RawObject* raw = *(reinterpret_cast<RawObject**>(handle)); | 128 RawObject* raw = *(reinterpret_cast<RawObject**>(handle)); |
129 if (!raw->IsHeapObject()) { | 129 if (!raw->IsHeapObject()) { |
130 return kSmi; | 130 return kSmiCid; |
131 } | 131 } |
132 return raw->GetClassId(); | 132 return raw->GetClassId(); |
133 } | 133 } |
134 | 134 |
135 // Generates a handle used to designate an error return. | 135 // Generates a handle used to designate an error return. |
136 static Dart_Handle NewError(const char* format, ...); | 136 static Dart_Handle NewError(const char* format, ...); |
137 | 137 |
138 // Gets a handle to Null. | 138 // Gets a handle to Null. |
139 static Dart_Handle Null(Isolate* isolate); | 139 static Dart_Handle Null(Isolate* isolate); |
140 | 140 |
(...skipping 27 matching lines...) Expand all Loading... |
168 } | 168 } |
169 private: | 169 private: |
170 Isolate* saved_isolate_; | 170 Isolate* saved_isolate_; |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(IsolateSaver); | 172 DISALLOW_COPY_AND_ASSIGN(IsolateSaver); |
173 }; | 173 }; |
174 | 174 |
175 } // namespace dart. | 175 } // namespace dart. |
176 | 176 |
177 #endif // VM_DART_API_IMPL_H_ | 177 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |