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

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

Issue 25087006: Improve performance of string buffer by modifying concatAll native to allow growable array and an i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
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 4756 matching lines...) Expand 10 before | Expand all | Expand 10 after
4767 intptr_t src_offset, 4767 intptr_t src_offset,
4768 intptr_t len); 4768 intptr_t len);
4769 4769
4770 static RawString* EscapeSpecialCharacters(const String& str); 4770 static RawString* EscapeSpecialCharacters(const String& str);
4771 4771
4772 static RawString* Concat(const String& str1, 4772 static RawString* Concat(const String& str1,
4773 const String& str2, 4773 const String& str2,
4774 Heap::Space space = Heap::kNew); 4774 Heap::Space space = Heap::kNew);
4775 static RawString* ConcatAll(const Array& strings, 4775 static RawString* ConcatAll(const Array& strings,
4776 Heap::Space space = Heap::kNew); 4776 Heap::Space space = Heap::kNew);
4777 // Concat all strings in 'strings' from 'start' to 'end' (excluding).
4778 static RawString* ConcatAllRange(const Array& strings,
4779 intptr_t start,
4780 intptr_t end,
4781 Heap::Space space = Heap::kNew);
4777 4782
4778 static RawString* SubString(const String& str, 4783 static RawString* SubString(const String& str,
4779 intptr_t begin_index, 4784 intptr_t begin_index,
4780 Heap::Space space = Heap::kNew); 4785 Heap::Space space = Heap::kNew);
4781 static RawString* SubString(const String& str, 4786 static RawString* SubString(const String& str,
4782 intptr_t begin_index, 4787 intptr_t begin_index,
4783 intptr_t length, 4788 intptr_t length,
4784 Heap::Space space = Heap::kNew); 4789 Heap::Space space = Heap::kNew);
4785 4790
4786 static RawString* Transform(int32_t (*mapping)(int32_t ch), 4791 static RawString* Transform(int32_t (*mapping)(int32_t ch),
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
4887 // 'other' must be OneByteString. 4892 // 'other' must be OneByteString.
4888 static RawOneByteString* New(const String& other_one_byte_string, 4893 static RawOneByteString* New(const String& other_one_byte_string,
4889 intptr_t other_start_index, 4894 intptr_t other_start_index,
4890 intptr_t other_len, 4895 intptr_t other_len,
4891 Heap::Space space); 4896 Heap::Space space);
4892 4897
4893 static RawOneByteString* Concat(const String& str1, 4898 static RawOneByteString* Concat(const String& str1,
4894 const String& str2, 4899 const String& str2,
4895 Heap::Space space); 4900 Heap::Space space);
4896 static RawOneByteString* ConcatAll(const Array& strings, 4901 static RawOneByteString* ConcatAll(const Array& strings,
4902 intptr_t start,
4903 intptr_t end,
4897 intptr_t len, 4904 intptr_t len,
4898 Heap::Space space); 4905 Heap::Space space);
4899 4906
4900 static RawOneByteString* Transform(int32_t (*mapping)(int32_t ch), 4907 static RawOneByteString* Transform(int32_t (*mapping)(int32_t ch),
4901 const String& str, 4908 const String& str,
4902 Heap::Space space); 4909 Heap::Space space);
4903 4910
4904 // High performance version of substring for one-byte strings. 4911 // High performance version of substring for one-byte strings.
4905 // "str" must be OneByteString. 4912 // "str" must be OneByteString.
4906 static RawOneByteString* SubStringUnchecked(const String& str, 4913 static RawOneByteString* SubStringUnchecked(const String& str,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
4982 const int32_t* characters, 4989 const int32_t* characters,
4983 intptr_t len, 4990 intptr_t len,
4984 Heap::Space space); 4991 Heap::Space space);
4985 static RawTwoByteString* New(const String& str, 4992 static RawTwoByteString* New(const String& str,
4986 Heap::Space space); 4993 Heap::Space space);
4987 4994
4988 static RawTwoByteString* Concat(const String& str1, 4995 static RawTwoByteString* Concat(const String& str1,
4989 const String& str2, 4996 const String& str2,
4990 Heap::Space space); 4997 Heap::Space space);
4991 static RawTwoByteString* ConcatAll(const Array& strings, 4998 static RawTwoByteString* ConcatAll(const Array& strings,
4999 intptr_t start,
5000 intptr_t end,
4992 intptr_t len, 5001 intptr_t len,
4993 Heap::Space space); 5002 Heap::Space space);
4994 5003
4995 static RawTwoByteString* Transform(int32_t (*mapping)(int32_t ch), 5004 static RawTwoByteString* Transform(int32_t (*mapping)(int32_t ch),
4996 const String& str, 5005 const String& str,
4997 Heap::Space space); 5006 Heap::Space space);
4998 5007
4999 static void SetPeer(const String& str, 5008 static void SetPeer(const String& str,
5000 void* peer, 5009 void* peer,
5001 Dart_PeerFinalizer cback); 5010 Dart_PeerFinalizer cback);
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
6212 6221
6213 6222
6214 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6223 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6215 intptr_t index) { 6224 intptr_t index) {
6216 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6225 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6217 } 6226 }
6218 6227
6219 } // namespace dart 6228 } // namespace dart
6220 6229
6221 #endif // VM_OBJECT_H_ 6230 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698