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

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

Issue 12335138: Intrinsify OnebyteString's hashcode. Next step is to inline it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/intrinsifier.h » ('j') | 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 /** 5 /**
6 * [_StringBase] contains common methods used by concrete String 6 * [_StringBase] contains common methods used by concrete String
7 * implementations, e.g., _OneByteString. 7 * implementations, e.g., _OneByteString.
8 */ 8 */
9 class _StringBase { 9 class _StringBase {
10 10
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 native "Strings_concatAll"; 465 native "Strings_concatAll";
466 } 466 }
467 467
468 468
469 class _OneByteString extends _StringBase implements String { 469 class _OneByteString extends _StringBase implements String {
470 factory _OneByteString._uninstantiable() { 470 factory _OneByteString._uninstantiable() {
471 throw new UnsupportedError( 471 throw new UnsupportedError(
472 "_OneByteString can only be allocated by the VM"); 472 "_OneByteString can only be allocated by the VM");
473 } 473 }
474 474
475 int get hashCode native "String_getHashCode";
476
475 // Checks for one-byte whitespaces only. 477 // Checks for one-byte whitespaces only.
476 // TODO(srdjan): Investigate if 0x85 (NEL) and 0xA0 (NBSP) are valid 478 // TODO(srdjan): Investigate if 0x85 (NEL) and 0xA0 (NBSP) are valid
477 // whitespaces for one byte strings. 479 // whitespaces for one byte strings.
478 bool _isWhitespace(int codePoint) { 480 bool _isWhitespace(int codePoint) {
479 return 481 return
480 (codePoint == 32) || // Space. 482 (codePoint == 32) || // Space.
481 ((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc. 483 ((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc.
482 } 484 }
483 485
484 String _substringUncheckedNative(int startIndex, int endIndex) 486 String _substringUncheckedNative(int startIndex, int endIndex)
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 for (int g in groups) { 604 for (int g in groups) {
603 result.add(group(g)); 605 result.add(group(g));
604 } 606 }
605 return result; 607 return result;
606 } 608 }
607 609
608 final int start; 610 final int start;
609 final String str; 611 final String str;
610 final String pattern; 612 final String pattern;
611 } 613 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intrinsifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698