| 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 #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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, | 1150 DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, |
| 1151 int index) { | 1151 int index) { |
| 1152 Zone zone; // Setup a VM zone as we are creating some handles. | 1152 Zone zone; // Setup a VM zone as we are creating some handles. |
| 1153 HandleScope scope; // Setup a VM handle scope. | 1153 HandleScope scope; // Setup a VM handle scope. |
| 1154 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 1154 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 1155 const Object& obj = Object::Handle(arguments->At(index)); | 1155 const Object& obj = Object::Handle(arguments->At(index)); |
| 1156 return Api::NewLocalHandle(obj); | 1156 return Api::NewLocalHandle(obj); |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 | 1159 |
| 1160 DART_EXPORT int Dart_GetNativeArgumentCount(Dart_NativeArguments args) { |
| 1161 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 1162 return arguments->Count(); |
| 1163 } |
| 1164 |
| 1165 |
| 1160 DART_EXPORT void Dart_SetReturnValue(Dart_NativeArguments args, | 1166 DART_EXPORT void Dart_SetReturnValue(Dart_NativeArguments args, |
| 1161 Dart_Handle retval) { | 1167 Dart_Handle retval) { |
| 1162 Zone zone; // Setup a VM zone as we are creating some handles. | 1168 Zone zone; // Setup a VM zone as we are creating some handles. |
| 1163 HandleScope scope; // Setup a VM handle scope. | 1169 HandleScope scope; // Setup a VM handle scope. |
| 1164 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 1170 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 1165 arguments->SetReturn(Object::Handle(Api::UnwrapHandle(retval))); | 1171 arguments->SetReturn(Object::Handle(Api::UnwrapHandle(retval))); |
| 1166 } | 1172 } |
| 1167 | 1173 |
| 1168 | 1174 |
| 1169 DART_EXPORT bool Dart_ExceptionOccurred(Dart_Handle result) { | 1175 DART_EXPORT bool Dart_ExceptionOccurred(Dart_Handle result) { |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 ASSERT(isolate != NULL); | 1727 ASSERT(isolate != NULL); |
| 1722 ApiState* state = isolate->api_state(); | 1728 ApiState* state = isolate->api_state(); |
| 1723 ASSERT(state != NULL); | 1729 ASSERT(state != NULL); |
| 1724 ApiLocalScope* scope = state->top_scope(); | 1730 ApiLocalScope* scope = state->top_scope(); |
| 1725 ASSERT(scope != NULL); | 1731 ASSERT(scope != NULL); |
| 1726 return scope->zone().Reallocate(ptr, old_size, new_size); | 1732 return scope->zone().Reallocate(ptr, old_size, new_size); |
| 1727 } | 1733 } |
| 1728 | 1734 |
| 1729 | 1735 |
| 1730 } // namespace dart | 1736 } // namespace dart |
| OLD | NEW |