| 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 3540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3551 | 3551 |
| 3552 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { | 3552 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { |
| 3553 DARTSCOPE(Thread::Current()); | 3553 DARTSCOPE(Thread::Current()); |
| 3554 intptr_t class_id = Api::ClassId(typed_data); | 3554 intptr_t class_id = Api::ClassId(typed_data); |
| 3555 if (!RawObject::IsExternalTypedDataClassId(class_id) && | 3555 if (!RawObject::IsExternalTypedDataClassId(class_id) && |
| 3556 !RawObject::IsTypedDataViewClassId(class_id) && | 3556 !RawObject::IsTypedDataViewClassId(class_id) && |
| 3557 !RawObject::IsTypedDataClassId(class_id)) { | 3557 !RawObject::IsTypedDataClassId(class_id)) { |
| 3558 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData'); | 3558 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData'); |
| 3559 } | 3559 } |
| 3560 Object& result = Object::Handle(Z); | 3560 Object& result = Object::Handle(Z); |
| 3561 result = GetByteBufferConstructor(T, Symbols::ByteBuffer(), | 3561 result = GetByteBufferConstructor(T, Symbols::_ByteBuffer(), |
| 3562 Symbols::ByteBufferDot_New(), 1); | 3562 Symbols::_ByteBufferDot_New(), 1); |
| 3563 ASSERT(!result.IsNull()); | 3563 ASSERT(!result.IsNull()); |
| 3564 ASSERT(result.IsFunction()); | 3564 ASSERT(result.IsFunction()); |
| 3565 const Function& factory = Function::Cast(result); | 3565 const Function& factory = Function::Cast(result); |
| 3566 ASSERT(!factory.IsGenerativeConstructor()); | 3566 ASSERT(!factory.IsGenerativeConstructor()); |
| 3567 | 3567 |
| 3568 // Create the argument list. | 3568 // Create the argument list. |
| 3569 const Array& args = Array::Handle(Z, Array::New(2)); | 3569 const Array& args = Array::Handle(Z, Array::New(2)); |
| 3570 // Factories get type arguments. | 3570 // Factories get type arguments. |
| 3571 args.SetAt(0, Object::null_type_arguments()); | 3571 args.SetAt(0, Object::null_type_arguments()); |
| 3572 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(typed_data)); | 3572 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(typed_data)); |
| (...skipping 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6711 } | 6711 } |
| 6712 | 6712 |
| 6713 | 6713 |
| 6714 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { | 6714 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { |
| 6715 #ifndef PRODUCT | 6715 #ifndef PRODUCT |
| 6716 Profiler::DumpStackTrace(context); | 6716 Profiler::DumpStackTrace(context); |
| 6717 #endif | 6717 #endif |
| 6718 } | 6718 } |
| 6719 | 6719 |
| 6720 } // namespace dart | 6720 } // namespace dart |
| OLD | NEW |