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

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

Issue 11416270: Implement faster splitting with empty string as pattern. Add special native for computing substring… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | « runtime/vm/object.h ('k') | no next file » | 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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 10763 matching lines...) Expand 10 before | Expand all | Expand 10 after
10774 10774
10775 RawOneByteString* OneByteString::New(const String& str, 10775 RawOneByteString* OneByteString::New(const String& str,
10776 Heap::Space space) { 10776 Heap::Space space) {
10777 intptr_t len = str.Length(); 10777 intptr_t len = str.Length();
10778 const String& result = String::Handle(OneByteString::New(len, space)); 10778 const String& result = String::Handle(OneByteString::New(len, space));
10779 String::Copy(result, 0, str, 0, len); 10779 String::Copy(result, 0, str, 0, len);
10780 return OneByteString::raw(result); 10780 return OneByteString::raw(result);
10781 } 10781 }
10782 10782
10783 10783
10784 RawOneByteString* OneByteString::New(const String& other_one_byte_string,
10785 intptr_t other_start_index,
10786 intptr_t other_len,
10787 Heap::Space space) {
10788 const String& result = String::Handle(OneByteString::New(other_len, space));
10789 ASSERT(other_one_byte_string.IsOneByteString());
10790 if (other_len > 0) {
10791 NoGCScope no_gc;
10792 memmove(OneByteString::CharAddr(result, 0),
10793 OneByteString::CharAddr(other_one_byte_string, other_start_index),
10794 other_len);
10795 }
10796 return OneByteString::raw(result);
10797 }
10798
10799
10784 RawOneByteString* OneByteString::Concat(const String& str1, 10800 RawOneByteString* OneByteString::Concat(const String& str1,
10785 const String& str2, 10801 const String& str2,
10786 Heap::Space space) { 10802 Heap::Space space) {
10787 intptr_t len1 = str1.Length(); 10803 intptr_t len1 = str1.Length();
10788 intptr_t len2 = str2.Length(); 10804 intptr_t len2 = str2.Length();
10789 intptr_t len = len1 + len2; 10805 intptr_t len = len1 + len2;
10790 const String& result = String::Handle(OneByteString::New(len, space)); 10806 const String& result = String::Handle(OneByteString::New(len, space));
10791 String::Copy(result, 0, str1, 0, len1); 10807 String::Copy(result, 0, str1, 0, len1);
10792 String::Copy(result, len1, str2, 0, len2); 10808 String::Copy(result, len1, str2, 0, len2);
10793 return OneByteString::raw(result); 10809 return OneByteString::raw(result);
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
12173 } 12189 }
12174 return result.raw(); 12190 return result.raw();
12175 } 12191 }
12176 12192
12177 12193
12178 const char* WeakProperty::ToCString() const { 12194 const char* WeakProperty::ToCString() const {
12179 return "_WeakProperty"; 12195 return "_WeakProperty";
12180 } 12196 }
12181 12197
12182 } // namespace dart 12198 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698