OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1572 | 1572 |
1573 | 1573 |
1574 DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const uint32_t* utf32_array, | 1574 DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const uint32_t* utf32_array, |
1575 intptr_t length) { | 1575 intptr_t length) { |
1576 Isolate* isolate = Isolate::Current(); | 1576 Isolate* isolate = Isolate::Current(); |
1577 DARTSCOPE(isolate); | 1577 DARTSCOPE(isolate); |
1578 if (utf32_array == NULL && length != 0) { | 1578 if (utf32_array == NULL && length != 0) { |
1579 RETURN_NULL_ERROR(utf32_array); | 1579 RETURN_NULL_ERROR(utf32_array); |
1580 } | 1580 } |
1581 CHECK_LENGTH(length, String::kMaxElements); | 1581 CHECK_LENGTH(length, String::kMaxElements); |
1582 return Api::NewHandle( | 1582 return Api::NewHandle(isolate, String::New(utf32_array, length)); |
1583 isolate, | |
1584 String::New(reinterpret_cast<const int32_t*>(utf32_array), length)); | |
1585 } | 1583 } |
1586 | 1584 |
1587 | 1585 |
1588 DART_EXPORT bool Dart_IsExternalString(Dart_Handle object) { | 1586 DART_EXPORT bool Dart_IsExternalString(Dart_Handle object) { |
1589 return RawObject::IsExternalStringClassId(Api::ClassId(object)); | 1587 return RawObject::IsExternalStringClassId(Api::ClassId(object)); |
1590 } | 1588 } |
1591 | 1589 |
1592 | 1590 |
1593 DART_EXPORT Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle object, | 1591 DART_EXPORT Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle object, |
1594 void** peer) { | 1592 void** peer) { |
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4494 } | 4492 } |
4495 { | 4493 { |
4496 NoGCScope no_gc; | 4494 NoGCScope no_gc; |
4497 RawObject* raw_obj = obj.raw(); | 4495 RawObject* raw_obj = obj.raw(); |
4498 isolate->heap()->SetPeer(raw_obj, peer); | 4496 isolate->heap()->SetPeer(raw_obj, peer); |
4499 } | 4497 } |
4500 return Api::Success(isolate); | 4498 return Api::Success(isolate); |
4501 } | 4499 } |
4502 | 4500 |
4503 } // namespace dart | 4501 } // namespace dart |
OLD | NEW |