| 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/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 16975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16986 memmove(array, | 16986 memmove(array, |
| 16987 TwoByteString::CharAddr(*this, 0), | 16987 TwoByteString::CharAddr(*this, 0), |
| 16988 (str_length * kTwoByteChar)); | 16988 (str_length * kTwoByteChar)); |
| 16989 } | 16989 } |
| 16990 | 16990 |
| 16991 // Update the class information of the object. | 16991 // Update the class information of the object. |
| 16992 const intptr_t class_id = kExternalTwoByteStringCid; | 16992 const intptr_t class_id = kExternalTwoByteStringCid; |
| 16993 tags = RawObject::SizeTag::update(used_size, tags); | 16993 tags = RawObject::SizeTag::update(used_size, tags); |
| 16994 tags = RawObject::ClassIdTag::update(class_id, tags); | 16994 tags = RawObject::ClassIdTag::update(class_id, tags); |
| 16995 raw_ptr()->tags_ = tags; | 16995 raw_ptr()->tags_ = tags; |
| 16996 const String& result = String::Handle(this->raw()); | 16996 result = this->raw(); |
| 16997 ExternalStringData<uint16_t>* ext_data = new ExternalStringData<uint16_t>( | 16997 ExternalStringData<uint16_t>* ext_data = new ExternalStringData<uint16_t>( |
| 16998 reinterpret_cast<const uint16_t*>(array), peer, cback); | 16998 reinterpret_cast<const uint16_t*>(array), peer, cback); |
| 16999 result.SetLength(str_length); | 16999 result.SetLength(str_length); |
| 17000 result.SetHash(0); | 17000 result.SetHash(0); |
| 17001 ExternalTwoByteString::SetExternalData(result, ext_data); | 17001 ExternalTwoByteString::SetExternalData(result, ext_data); |
| 17002 external_data = ext_data; | 17002 external_data = ext_data; |
| 17003 finalizer = ExternalTwoByteString::Finalize; | 17003 finalizer = ExternalTwoByteString::Finalize; |
| 17004 } | 17004 } |
| 17005 | 17005 |
| 17006 // If there is any left over space fill it with either an Array object or | 17006 // If there is any left over space fill it with either an Array object or |
| (...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19165 return tag_label.ToCString(); | 19165 return tag_label.ToCString(); |
| 19166 } | 19166 } |
| 19167 | 19167 |
| 19168 | 19168 |
| 19169 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19169 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 19170 Instance::PrintJSONImpl(stream, ref); | 19170 Instance::PrintJSONImpl(stream, ref); |
| 19171 } | 19171 } |
| 19172 | 19172 |
| 19173 | 19173 |
| 19174 } // namespace dart | 19174 } // namespace dart |
| OLD | NEW |