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 "vm/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 10142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10153 intptr_t len = Utf8::CodePointCount(utf8_array, array_len, &type); | 10153 intptr_t len = Utf8::CodePointCount(utf8_array, array_len, &type); |
10154 if (type == Utf8::kLatin1) { | 10154 if (type == Utf8::kLatin1) { |
10155 const String& strobj = String::Handle(OneByteString::New(len, space)); | 10155 const String& strobj = String::Handle(OneByteString::New(len, space)); |
10156 if (len > 0) { | 10156 if (len > 0) { |
10157 NoGCScope no_gc; | 10157 NoGCScope no_gc; |
10158 Utf8::DecodeToLatin1(utf8_array, array_len, | 10158 Utf8::DecodeToLatin1(utf8_array, array_len, |
10159 OneByteString::CharAddr(strobj, 0), len); | 10159 OneByteString::CharAddr(strobj, 0), len); |
10160 } | 10160 } |
10161 return strobj.raw(); | 10161 return strobj.raw(); |
10162 } | 10162 } |
10163 ASSERT((type == Utf8::kBMP) || (type == Utf8::kSMP)); | 10163 ASSERT((type == Utf8::kBMP) || (type == Utf8::kSupplementary)); |
10164 const String& strobj = String::Handle(TwoByteString::New(len, space)); | 10164 const String& strobj = String::Handle(TwoByteString::New(len, space)); |
10165 NoGCScope no_gc; | 10165 NoGCScope no_gc; |
10166 Utf8::DecodeToUTF16(utf8_array, array_len, | 10166 Utf8::DecodeToUTF16(utf8_array, array_len, |
10167 TwoByteString::CharAddr(strobj, 0), len); | 10167 TwoByteString::CharAddr(strobj, 0), len); |
10168 return strobj.raw(); | 10168 return strobj.raw(); |
10169 } | 10169 } |
10170 | 10170 |
10171 | 10171 |
10172 RawString* String::New(const uint16_t* utf16_array, | 10172 RawString* String::New(const uint16_t* utf16_array, |
10173 intptr_t array_len, | 10173 intptr_t array_len, |
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12153 } | 12153 } |
12154 return result.raw(); | 12154 return result.raw(); |
12155 } | 12155 } |
12156 | 12156 |
12157 | 12157 |
12158 const char* WeakProperty::ToCString() const { | 12158 const char* WeakProperty::ToCString() const { |
12159 return "_WeakProperty"; | 12159 return "_WeakProperty"; |
12160 } | 12160 } |
12161 | 12161 |
12162 } // namespace dart | 12162 } // namespace dart |
OLD | NEW |