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

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

Issue 11360033: Inline native String.charCodeAt in optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed a bug in indexed ops and added more tests Created 8 years, 1 month 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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 3860 matching lines...) Expand 10 before | Expand all | Expand 10 after
3871 virtual intptr_t CharSize() const { 3871 virtual intptr_t CharSize() const {
3872 return kTwoByteChar; 3872 return kTwoByteChar;
3873 } 3873 }
3874 3874
3875 RawTwoByteString* EscapeSpecialCharacters(bool raw_str) const; 3875 RawTwoByteString* EscapeSpecialCharacters(bool raw_str) const;
3876 3876
3877 // We use the same maximum elements for all strings. 3877 // We use the same maximum elements for all strings.
3878 static const intptr_t kBytesPerElement = 2; 3878 static const intptr_t kBytesPerElement = 2;
3879 static const intptr_t kMaxElements = String::kMaxElements; 3879 static const intptr_t kMaxElements = String::kMaxElements;
3880 3880
3881 static intptr_t data_offset() { return OFFSET_OF(RawTwoByteString, data_); }
3882
3881 static intptr_t InstanceSize() { 3883 static intptr_t InstanceSize() {
3882 ASSERT(sizeof(RawTwoByteString) == OFFSET_OF(RawTwoByteString, data_)); 3884 ASSERT(sizeof(RawTwoByteString) == OFFSET_OF(RawTwoByteString, data_));
3883 return 0; 3885 return 0;
3884 } 3886 }
3885 3887
3886 static intptr_t InstanceSize(intptr_t len) { 3888 static intptr_t InstanceSize(intptr_t len) {
3887 ASSERT(sizeof(RawTwoByteString) == kSizeofRawString); 3889 ASSERT(sizeof(RawTwoByteString) == kSizeofRawString);
3888 ASSERT(0 <= len && len <= kMaxElements); 3890 ASSERT(0 <= len && len <= kMaxElements);
3889 return RoundedAllocationSize( 3891 return RoundedAllocationSize(
3890 sizeof(RawTwoByteString) + (len * kBytesPerElement)); 3892 sizeof(RawTwoByteString) + (len * kBytesPerElement));
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
5731 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5733 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5732 return false; 5734 return false;
5733 } 5735 }
5734 } 5736 }
5735 return true; 5737 return true;
5736 } 5738 }
5737 5739
5738 } // namespace dart 5740 } // namespace dart
5739 5741
5740 #endif // VM_OBJECT_H_ 5742 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698