| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 static intptr_t ClassId(Dart_Handle handle) { | 128 static intptr_t ClassId(Dart_Handle handle) { |
| 129 // TODO(turnidge): Assumes RawObject* is at offset zero. Fix. | 129 // TODO(turnidge): Assumes RawObject* is at offset zero. Fix. |
| 130 RawObject* raw = *(reinterpret_cast<RawObject**>(handle)); | 130 RawObject* raw = *(reinterpret_cast<RawObject**>(handle)); |
| 131 if (!raw->IsHeapObject()) { | 131 if (!raw->IsHeapObject()) { |
| 132 return kSmiCid; | 132 return kSmiCid; |
| 133 } | 133 } |
| 134 return raw->GetClassId(); | 134 return raw->GetClassId(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 // Generates a handle used to designate an error return. | 137 // Generates a handle used to designate an error return. |
| 138 static Dart_Handle NewError(const char* format, ...); | 138 static Dart_Handle NewError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); |
| 139 | 139 |
| 140 // Gets a handle to Null. | 140 // Gets a handle to Null. |
| 141 static Dart_Handle Null(Isolate* isolate); | 141 static Dart_Handle Null(Isolate* isolate); |
| 142 | 142 |
| 143 // Gets a handle to True. | 143 // Gets a handle to True. |
| 144 static Dart_Handle True(Isolate* isolate); | 144 static Dart_Handle True(Isolate* isolate); |
| 145 | 145 |
| 146 // Gets a handle to False | 146 // Gets a handle to False |
| 147 static Dart_Handle False(Isolate* isolate); | 147 static Dart_Handle False(Isolate* isolate); |
| 148 | 148 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 173 } | 173 } |
| 174 private: | 174 private: |
| 175 Isolate* saved_isolate_; | 175 Isolate* saved_isolate_; |
| 176 | 176 |
| 177 DISALLOW_COPY_AND_ASSIGN(IsolateSaver); | 177 DISALLOW_COPY_AND_ASSIGN(IsolateSaver); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 } // namespace dart. | 180 } // namespace dart. |
| 181 | 181 |
| 182 #endif // VM_DART_API_IMPL_H_ | 182 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |