| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
| (...skipping 3473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3484 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { | 3484 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { |
| 3485 DARTSCOPE(Thread::Current()); | 3485 DARTSCOPE(Thread::Current()); |
| 3486 intptr_t class_id = Api::ClassId(typed_data); | 3486 intptr_t class_id = Api::ClassId(typed_data); |
| 3487 if (!RawObject::IsExternalTypedDataClassId(class_id) && | 3487 if (!RawObject::IsExternalTypedDataClassId(class_id) && |
| 3488 !RawObject::IsTypedDataViewClassId(class_id) && | 3488 !RawObject::IsTypedDataViewClassId(class_id) && |
| 3489 !RawObject::IsTypedDataClassId(class_id)) { | 3489 !RawObject::IsTypedDataClassId(class_id)) { |
| 3490 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData'); | 3490 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData'); |
| 3491 } | 3491 } |
| 3492 Object& result = Object::Handle(Z); | 3492 Object& result = Object::Handle(Z); |
| 3493 result = GetByteBufferConstructor(T, | 3493 result = GetByteBufferConstructor(T, |
| 3494 Symbols::_ByteBuffer(), | 3494 Symbols::ByteBuffer(), |
| 3495 Symbols::_ByteBufferDot_New(), | 3495 Symbols::ByteBufferDot_New(), |
| 3496 1); | 3496 1); |
| 3497 ASSERT(!result.IsNull()); | 3497 ASSERT(!result.IsNull()); |
| 3498 ASSERT(result.IsFunction()); | 3498 ASSERT(result.IsFunction()); |
| 3499 const Function& factory = Function::Cast(result); | 3499 const Function& factory = Function::Cast(result); |
| 3500 ASSERT(!factory.IsGenerativeConstructor()); | 3500 ASSERT(!factory.IsGenerativeConstructor()); |
| 3501 | 3501 |
| 3502 // Create the argument list. | 3502 // Create the argument list. |
| 3503 const Array& args = Array::Handle(Z, Array::New(2)); | 3503 const Array& args = Array::Handle(Z, Array::New(2)); |
| 3504 // Factories get type arguments. | 3504 // Factories get type arguments. |
| 3505 args.SetAt(0, Object::null_type_arguments()); | 3505 args.SetAt(0, Object::null_type_arguments()); |
| (...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6223 return Api::Success(); | 6223 return Api::Success(); |
| 6224 } | 6224 } |
| 6225 #endif // DART_PRECOMPILER | 6225 #endif // DART_PRECOMPILER |
| 6226 | 6226 |
| 6227 | 6227 |
| 6228 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { | 6228 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { |
| 6229 return Dart::IsRunningPrecompiledCode(); | 6229 return Dart::IsRunningPrecompiledCode(); |
| 6230 } | 6230 } |
| 6231 | 6231 |
| 6232 } // namespace dart | 6232 } // namespace dart |
| OLD | NEW |