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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 | 1509 |
1510 | 1510 |
1511 // --- Strings --- | 1511 // --- Strings --- |
1512 | 1512 |
1513 | 1513 |
1514 DART_EXPORT bool Dart_IsString(Dart_Handle object) { | 1514 DART_EXPORT bool Dart_IsString(Dart_Handle object) { |
1515 return RawObject::IsStringClassId(Api::ClassId(object)); | 1515 return RawObject::IsStringClassId(Api::ClassId(object)); |
1516 } | 1516 } |
1517 | 1517 |
1518 | 1518 |
1519 DART_EXPORT bool Dart_IsAsciiString(Dart_Handle object) { | 1519 DART_EXPORT bool Dart_IsStringLatin1(Dart_Handle object) { |
1520 return RawObject::IsOneByteStringClassId(Api::ClassId(object)); | 1520 return RawObject::IsOneByteStringClassId(Api::ClassId(object)); |
1521 } | 1521 } |
1522 | 1522 |
1523 | 1523 |
1524 DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* len) { | 1524 DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* len) { |
1525 Isolate* isolate = Isolate::Current(); | 1525 Isolate* isolate = Isolate::Current(); |
1526 DARTSCOPE(isolate); | 1526 DARTSCOPE(isolate); |
1527 const String& str_obj = Api::UnwrapStringHandle(isolate, str); | 1527 const String& str_obj = Api::UnwrapStringHandle(isolate, str); |
1528 if (str_obj.IsNull()) { | 1528 if (str_obj.IsNull()) { |
1529 RETURN_TYPE_ERROR(isolate, str, String); | 1529 RETURN_TYPE_ERROR(isolate, str, String); |
(...skipping 2960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4490 } | 4490 } |
4491 { | 4491 { |
4492 NoGCScope no_gc; | 4492 NoGCScope no_gc; |
4493 RawObject* raw_obj = obj.raw(); | 4493 RawObject* raw_obj = obj.raw(); |
4494 isolate->heap()->SetPeer(raw_obj, peer); | 4494 isolate->heap()->SetPeer(raw_obj, peer); |
4495 } | 4495 } |
4496 return Api::Success(isolate); | 4496 return Api::Success(isolate); |
4497 } | 4497 } |
4498 | 4498 |
4499 } // namespace dart | 4499 } // namespace dart |
OLD | NEW |