Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 2571563005: Turn the VM's dart:typed_data into a patch (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698