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 "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2590 | 2590 |
2591 | 2591 |
2592 static Dart_Handle NewExternalByteData( | 2592 static Dart_Handle NewExternalByteData( |
2593 Isolate* isolate, void* data, intptr_t length) { | 2593 Isolate* isolate, void* data, intptr_t length) { |
2594 Dart_Handle ext_data = NewExternalTypedData( | 2594 Dart_Handle ext_data = NewExternalTypedData( |
2595 isolate, kExternalTypedDataUint8ArrayCid, data, length); | 2595 isolate, kExternalTypedDataUint8ArrayCid, data, length); |
2596 if (::Dart_IsError(ext_data)) { | 2596 if (::Dart_IsError(ext_data)) { |
2597 return ext_data; | 2597 return ext_data; |
2598 } | 2598 } |
2599 Object& result = Object::Handle(isolate); | 2599 Object& result = Object::Handle(isolate); |
2600 result = GetByteDataConstructor(isolate, Symbols::ByteDataDotview(), 3); | 2600 result = GetByteDataConstructor(isolate, Symbols::ByteDataDot_view(), 3); |
Lasse Reichstein Nielsen
2014/01/14 11:06:47
Would it be better to get the _ByteDataView constr
| |
2601 ASSERT(!result.IsNull()); | 2601 ASSERT(!result.IsNull()); |
2602 ASSERT(result.IsFunction()); | 2602 ASSERT(result.IsFunction()); |
2603 const Function& factory = Function::Cast(result); | 2603 const Function& factory = Function::Cast(result); |
2604 ASSERT(!factory.IsConstructor()); | 2604 ASSERT(!factory.IsConstructor()); |
2605 | 2605 |
2606 // Create the argument list. | 2606 // Create the argument list. |
2607 const intptr_t num_args = 3; | 2607 const intptr_t num_args = 3; |
2608 const Array& args = Array::Handle(isolate, Array::New(num_args + 1)); | 2608 const Array& args = Array::Handle(isolate, Array::New(num_args + 1)); |
2609 // Factories get type arguments. | 2609 // Factories get type arguments. |
2610 args.SetAt(0, TypeArguments::Handle(isolate)); | 2610 args.SetAt(0, TypeArguments::Handle(isolate)); |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4489 } | 4489 } |
4490 { | 4490 { |
4491 NoGCScope no_gc; | 4491 NoGCScope no_gc; |
4492 RawObject* raw_obj = obj.raw(); | 4492 RawObject* raw_obj = obj.raw(); |
4493 isolate->heap()->SetPeer(raw_obj, peer); | 4493 isolate->heap()->SetPeer(raw_obj, peer); |
4494 } | 4494 } |
4495 return Api::Success(); | 4495 return Api::Success(); |
4496 } | 4496 } |
4497 | 4497 |
4498 } // namespace dart | 4498 } // namespace dart |
OLD | NEW |