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

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

Issue 1961393002: VM: Optimized code for all of [External]{One|Two}ByteString::codeUnitAt. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comment Created 4 years, 7 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
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15513 matching lines...) Expand 10 before | Expand all | Expand 10 after
15524 case kExternalTwoByteStringCid: 15524 case kExternalTwoByteStringCid:
15525 return ExternalTwoByteString::kBytesPerElement; 15525 return ExternalTwoByteString::kBytesPerElement;
15526 default: 15526 default:
15527 UNIMPLEMENTED(); 15527 UNIMPLEMENTED();
15528 return 0; 15528 return 0;
15529 } 15529 }
15530 } 15530 }
15531 15531
15532 15532
15533 intptr_t Instance::DataOffsetFor(intptr_t cid) { 15533 intptr_t Instance::DataOffsetFor(intptr_t cid) {
15534 if (RawObject::IsExternalTypedDataClassId(cid)) { 15534 if (RawObject::IsExternalTypedDataClassId(cid) ||
15535 RawObject::IsExternalStringClassId(cid)) {
15535 // Elements start at offset 0 of the external data. 15536 // Elements start at offset 0 of the external data.
15536 return 0; 15537 return 0;
15537 } 15538 }
15538 if (RawObject::IsTypedDataClassId(cid)) { 15539 if (RawObject::IsTypedDataClassId(cid)) {
15539 return TypedData::data_offset(); 15540 return TypedData::data_offset();
15540 } 15541 }
15541 switch (cid) { 15542 switch (cid) {
15542 case kArrayCid: 15543 case kArrayCid:
15543 case kImmutableArrayCid: 15544 case kImmutableArrayCid:
15544 return Array::data_offset(); 15545 return Array::data_offset();
(...skipping 6907 matching lines...) Expand 10 before | Expand all | Expand 10 after
22452 return UserTag::null(); 22453 return UserTag::null();
22453 } 22454 }
22454 22455
22455 22456
22456 const char* UserTag::ToCString() const { 22457 const char* UserTag::ToCString() const {
22457 const String& tag_label = String::Handle(label()); 22458 const String& tag_label = String::Handle(label());
22458 return tag_label.ToCString(); 22459 return tag_label.ToCString();
22459 } 22460 }
22460 22461
22461 } // namespace dart 22462 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698