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

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

Issue 315303002: Improve scanner performance by remembering string's CharAt function as the string type does not cha… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/object.cc » ('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 #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 5286 matching lines...) Expand 10 before | Expand all | Expand 10 after
5297 } 5297 }
5298 5298
5299 static intptr_t hash_offset() { return OFFSET_OF(RawString, hash_); } 5299 static intptr_t hash_offset() { return OFFSET_OF(RawString, hash_); }
5300 static intptr_t Hash(const String& str, intptr_t begin_index, intptr_t len); 5300 static intptr_t Hash(const String& str, intptr_t begin_index, intptr_t len);
5301 static intptr_t Hash(const uint8_t* characters, intptr_t len); 5301 static intptr_t Hash(const uint8_t* characters, intptr_t len);
5302 static intptr_t Hash(const uint16_t* characters, intptr_t len); 5302 static intptr_t Hash(const uint16_t* characters, intptr_t len);
5303 static intptr_t Hash(const int32_t* characters, intptr_t len); 5303 static intptr_t Hash(const int32_t* characters, intptr_t len);
5304 5304
5305 int32_t CharAt(intptr_t index) const; 5305 int32_t CharAt(intptr_t index) const;
5306 5306
5307 Scanner::CharAtFunc CharAtFunc() const;
5308
5307 intptr_t CharSize() const; 5309 intptr_t CharSize() const;
5308 5310
5309 inline bool Equals(const String& str) const; 5311 inline bool Equals(const String& str) const;
5310 inline bool Equals(const String& str, 5312 inline bool Equals(const String& str,
5311 intptr_t begin_index, // begin index on 'str'. 5313 intptr_t begin_index, // begin index on 'str'.
5312 intptr_t len) const; // len on 'str'. 5314 intptr_t len) const; // len on 'str'.
5313 5315
5314 // Compares to a '\0' terminated array of UTF-8 encoded characters. 5316 // Compares to a '\0' terminated array of UTF-8 encoded characters.
5315 bool Equals(const char* cstr) const; 5317 bool Equals(const char* cstr) const;
5316 5318
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
7106 7108
7107 7109
7108 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7110 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7109 intptr_t index) { 7111 intptr_t index) {
7110 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7112 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7111 } 7113 }
7112 7114
7113 } // namespace dart 7115 } // namespace dart
7114 7116
7115 #endif // VM_OBJECT_H_ 7117 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698