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 3521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3532 | 3532 |
3533 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { | 3533 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) { |
3534 DARTSCOPE(Thread::Current()); | 3534 DARTSCOPE(Thread::Current()); |
3535 intptr_t class_id = Api::ClassId(typed_data); | 3535 intptr_t class_id = Api::ClassId(typed_data); |
3536 if (!RawObject::IsExternalTypedDataClassId(class_id) && | 3536 if (!RawObject::IsExternalTypedDataClassId(class_id) && |
3537 !RawObject::IsTypedDataViewClassId(class_id) && | 3537 !RawObject::IsTypedDataViewClassId(class_id) && |
3538 !RawObject::IsTypedDataClassId(class_id)) { | 3538 !RawObject::IsTypedDataClassId(class_id)) { |
3539 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData'); | 3539 RETURN_TYPE_ERROR(Z, typed_data, 'TypedData'); |
3540 } | 3540 } |
3541 Object& result = Object::Handle(Z); | 3541 Object& result = Object::Handle(Z); |
3542 result = GetByteBufferConstructor(T, Symbols::ByteBuffer(), | 3542 result = GetByteBufferConstructor(T, Symbols::_ByteBuffer(), |
3543 Symbols::ByteBufferDot_New(), 1); | 3543 Symbols::_ByteBufferDot_New(), 1); |
3544 ASSERT(!result.IsNull()); | 3544 ASSERT(!result.IsNull()); |
3545 ASSERT(result.IsFunction()); | 3545 ASSERT(result.IsFunction()); |
3546 const Function& factory = Function::Cast(result); | 3546 const Function& factory = Function::Cast(result); |
3547 ASSERT(!factory.IsGenerativeConstructor()); | 3547 ASSERT(!factory.IsGenerativeConstructor()); |
3548 | 3548 |
3549 // Create the argument list. | 3549 // Create the argument list. |
3550 const Array& args = Array::Handle(Z, Array::New(2)); | 3550 const Array& args = Array::Handle(Z, Array::New(2)); |
3551 // Factories get type arguments. | 3551 // Factories get type arguments. |
3552 args.SetAt(0, Object::null_type_arguments()); | 3552 args.SetAt(0, Object::null_type_arguments()); |
3553 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(typed_data)); | 3553 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(typed_data)); |
(...skipping 3261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6815 } | 6815 } |
6816 | 6816 |
6817 | 6817 |
6818 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { | 6818 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { |
6819 #ifndef PRODUCT | 6819 #ifndef PRODUCT |
6820 Profiler::DumpStackTrace(context); | 6820 Profiler::DumpStackTrace(context); |
6821 #endif | 6821 #endif |
6822 } | 6822 } |
6823 | 6823 |
6824 } // namespace dart | 6824 } // namespace dart |
OLD | NEW |