| 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 17151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17162 } | 17162 } |
| 17163 private: | 17163 private: |
| 17164 uint32_t hash_; | 17164 uint32_t hash_; |
| 17165 }; | 17165 }; |
| 17166 | 17166 |
| 17167 | 17167 |
| 17168 void StringHasher::Add(const String& str, intptr_t begin_index, intptr_t len) { | 17168 void StringHasher::Add(const String& str, intptr_t begin_index, intptr_t len) { |
| 17169 ASSERT(begin_index >= 0); | 17169 ASSERT(begin_index >= 0); |
| 17170 ASSERT(len >= 0); | 17170 ASSERT(len >= 0); |
| 17171 ASSERT((begin_index + len) <= str.Length()); | 17171 ASSERT((begin_index + len) <= str.Length()); |
| 17172 if (len == 0) { |
| 17173 return; |
| 17174 } |
| 17172 if (str.IsOneByteString()) { | 17175 if (str.IsOneByteString()) { |
| 17176 NoGCScope no_gc; |
| 17177 uint8_t* str_addr = OneByteString::CharAddr(str, begin_index); |
| 17173 for (intptr_t i = 0; i < len; i++) { | 17178 for (intptr_t i = 0; i < len; i++) { |
| 17174 NoGCScope no_gc; | 17179 Add(*str_addr); |
| 17175 Add(*OneByteString::CharAddr(str, i + begin_index)); | 17180 str_addr++; |
| 17176 } | 17181 } |
| 17177 } else { | 17182 } else { |
| 17178 String::CodePointIterator it(str, begin_index, len); | 17183 String::CodePointIterator it(str, begin_index, len); |
| 17179 while (it.Next()) { | 17184 while (it.Next()) { |
| 17180 Add(it.Current()); | 17185 Add(it.Current()); |
| 17181 } | 17186 } |
| 17182 } | 17187 } |
| 17183 } | 17188 } |
| 17184 | 17189 |
| 17185 | 17190 |
| (...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20560 return tag_label.ToCString(); | 20565 return tag_label.ToCString(); |
| 20561 } | 20566 } |
| 20562 | 20567 |
| 20563 | 20568 |
| 20564 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20569 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20565 Instance::PrintJSONImpl(stream, ref); | 20570 Instance::PrintJSONImpl(stream, ref); |
| 20566 } | 20571 } |
| 20567 | 20572 |
| 20568 | 20573 |
| 20569 } // namespace dart | 20574 } // namespace dart |
| OLD | NEW |