OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ApiState* state = isolate->api_state(); | 123 ApiState* state = isolate->api_state(); |
124 ASSERT(state != NULL); | 124 ASSERT(state != NULL); |
125 ASSERT(state->IsValidLocalHandle(object) || | 125 ASSERT(state->IsValidLocalHandle(object) || |
126 state->IsValidPersistentHandle(object) || | 126 state->IsValidPersistentHandle(object) || |
127 state->IsValidWeakPersistentHandle(object) || | 127 state->IsValidWeakPersistentHandle(object) || |
128 state->IsValidPrologueWeakPersistentHandle(object)); | 128 state->IsValidPrologueWeakPersistentHandle(object)); |
129 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 && | 129 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 && |
130 PersistentHandle::raw_offset() == 0 && | 130 PersistentHandle::raw_offset() == 0 && |
131 LocalHandle::raw_offset() == 0); | 131 LocalHandle::raw_offset() == 0); |
132 #endif | 132 #endif |
133 return *(reinterpret_cast<RawObject**>(object)); | 133 return (reinterpret_cast<LocalHandle*>(object))->raw(); |
134 } | 134 } |
135 | 135 |
136 #define DEFINE_UNWRAP(type) \ | 136 #define DEFINE_UNWRAP(type) \ |
137 const type& Api::Unwrap##type##Handle(Isolate* iso, \ | 137 const type& Api::Unwrap##type##Handle(Isolate* iso, \ |
138 Dart_Handle dart_handle) { \ | 138 Dart_Handle dart_handle) { \ |
139 const Object& obj = Object::Handle(iso, Api::UnwrapHandle(dart_handle)); \ | 139 const Object& obj = Object::Handle(iso, Api::UnwrapHandle(dart_handle)); \ |
140 if (obj.Is##type()) { \ | 140 if (obj.Is##type()) { \ |
141 return type::Cast(obj); \ | 141 return type::Cast(obj); \ |
142 } \ | 142 } \ |
143 return type::Handle(iso); \ | 143 return type::Handle(iso); \ |
(...skipping 4042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4186 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { | 4186 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { |
4187 Dart::set_perf_events_writer(function); | 4187 Dart::set_perf_events_writer(function); |
4188 } | 4188 } |
4189 | 4189 |
4190 | 4190 |
4191 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) { | 4191 DART_EXPORT void Dart_InitFlowGraphPrinting(Dart_FileWriterFunction function) { |
4192 Dart::set_flow_graph_writer(function); | 4192 Dart::set_flow_graph_writer(function); |
4193 } | 4193 } |
4194 | 4194 |
4195 } // namespace dart | 4195 } // namespace dart |
OLD | NEW |