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

Side by Side Diff: runtime/lib/string_patch.dart

Issue 14917020: Inline _OneByteString._setAt. The key knowledge is that _setAt is an internal method that has to be… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')
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 patch class String { 5 patch class String {
6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) { 6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) {
7 return _StringBase.createFromCharCodes(charCodes); 7 return _StringBase.createFromCharCodes(charCodes);
8 } 8 }
9 } 9 }
10 10
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 if ((pattern is _OneByteString) && (pattern.length == 1)) { 483 if ((pattern is _OneByteString) && (pattern.length == 1)) {
484 return _splitWithCharCode(pattern.codeUnitAt(0)); 484 return _splitWithCharCode(pattern.codeUnitAt(0));
485 } 485 }
486 return super.split(pattern); 486 return super.split(pattern);
487 } 487 }
488 488
489 // Allocates a string of given length, expecting its content to be 489 // Allocates a string of given length, expecting its content to be
490 // set using _setAt. 490 // set using _setAt.
491 static _OneByteString _allocate(int length) native "OneByteString_allocate"; 491 static _OneByteString _allocate(int length) native "OneByteString_allocate";
492 492
493 // Code point value must be a valid Latin1 (0..0xFF). Index must be valid. 493 // This is internal helper method. Code point value must be a valid
494 // Latin1 value (0..0xFF), index must be valid.
494 void _setAt(int index, int codePoint) native "OneByteString_setAt"; 495 void _setAt(int index, int codePoint) native "OneByteString_setAt";
495 } 496 }
496 497
497 498
498 class _TwoByteString extends _StringBase implements String { 499 class _TwoByteString extends _StringBase implements String {
499 factory _TwoByteString._uninstantiable() { 500 factory _TwoByteString._uninstantiable() {
500 throw new UnsupportedError( 501 throw new UnsupportedError(
501 "_TwoByteString can only be allocated by the VM"); 502 "_TwoByteString can only be allocated by the VM");
502 } 503 }
503 504
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 class _CodeUnits extends Object with ListMixin<int>, 616 class _CodeUnits extends Object with ListMixin<int>,
616 UnmodifiableListMixin<int> { 617 UnmodifiableListMixin<int> {
617 /** The string that this is the code units of. */ 618 /** The string that this is the code units of. */
618 String _string; 619 String _string;
619 620
620 _CodeUnits(this._string); 621 _CodeUnits(this._string);
621 622
622 int get length => _string.length; 623 int get length => _string.length;
623 int operator[](int i) => _string.codeUnitAt(i); 624 int operator[](int i) => _string.codeUnitAt(i);
624 } 625 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698