Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: runtime/vm/object.cc

Issue 666993002: Fix test timeout; faster DEBUG String::CharAt by not using mutable accessor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 17022 matching lines...) Expand 10 before | Expand all | Expand 10 after
17033 17033
17034 17034
17035 intptr_t String::Hash(const int32_t* characters, intptr_t len) { 17035 intptr_t String::Hash(const int32_t* characters, intptr_t len) {
17036 return HashImpl(characters, len); 17036 return HashImpl(characters, len);
17037 } 17037 }
17038 17038
17039 17039
17040 uint16_t String::CharAt(intptr_t index) const { 17040 uint16_t String::CharAt(intptr_t index) const {
17041 intptr_t class_id = raw()->GetClassId(); 17041 intptr_t class_id = raw()->GetClassId();
17042 ASSERT(RawObject::IsStringClassId(class_id)); 17042 ASSERT(RawObject::IsStringClassId(class_id));
17043 NoGCScope no_gc;
17044 if (class_id == kOneByteStringCid) { 17043 if (class_id == kOneByteStringCid) {
17045 return *OneByteString::CharAddr(*this, index); 17044 return OneByteString::CharAt(*this, index);
17046 } 17045 }
17047 if (class_id == kTwoByteStringCid) { 17046 if (class_id == kTwoByteStringCid) {
17048 return *TwoByteString::CharAddr(*this, index); 17047 return TwoByteString::CharAt(*this, index);
17049 } 17048 }
17050 if (class_id == kExternalOneByteStringCid) { 17049 if (class_id == kExternalOneByteStringCid) {
17051 return *ExternalOneByteString::CharAddr(*this, index); 17050 return ExternalOneByteString::CharAt(*this, index);
17052 } 17051 }
17053 ASSERT(class_id == kExternalTwoByteStringCid); 17052 ASSERT(class_id == kExternalTwoByteStringCid);
17054 return *ExternalTwoByteString::CharAddr(*this, index); 17053 return ExternalTwoByteString::CharAt(*this, index);
17055 } 17054 }
17056 17055
17057 17056
17058 Scanner::CharAtFunc String::CharAtFunc() const { 17057 Scanner::CharAtFunc String::CharAtFunc() const {
17059 intptr_t class_id = raw()->GetClassId(); 17058 intptr_t class_id = raw()->GetClassId();
17060 ASSERT(RawObject::IsStringClassId(class_id)); 17059 ASSERT(RawObject::IsStringClassId(class_id));
17061 if (class_id == kOneByteStringCid) { 17060 if (class_id == kOneByteStringCid) {
17062 return &OneByteString::CharAt; 17061 return &OneByteString::CharAt;
17063 } 17062 }
17064 if (class_id == kTwoByteStringCid) { 17063 if (class_id == kTwoByteStringCid) {
(...skipping 3253 matching lines...) Expand 10 before | Expand all | Expand 10 after
20318 return tag_label.ToCString(); 20317 return tag_label.ToCString();
20319 } 20318 }
20320 20319
20321 20320
20322 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20321 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20323 Instance::PrintJSONImpl(stream, ref); 20322 Instance::PrintJSONImpl(stream, ref);
20324 } 20323 }
20325 20324
20326 20325
20327 } // namespace dart 20326 } // namespace dart
OLDNEW
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698