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

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

Issue 11308337: Improve C++ code for string splittig (Dromaeo benchmark). (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/lib/string.cc ('k') | 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 3982 matching lines...) Expand 10 before | Expand all | Expand 10 after
3993 const String& str2, 3993 const String& str2,
3994 Heap::Space space); 3994 Heap::Space space);
3995 static RawOneByteString* ConcatAll(const Array& strings, 3995 static RawOneByteString* ConcatAll(const Array& strings,
3996 intptr_t len, 3996 intptr_t len,
3997 Heap::Space space); 3997 Heap::Space space);
3998 3998
3999 static RawOneByteString* Transform(int32_t (*mapping)(int32_t ch), 3999 static RawOneByteString* Transform(int32_t (*mapping)(int32_t ch),
4000 const String& str, 4000 const String& str,
4001 Heap::Space space); 4001 Heap::Space space);
4002 4002
4003 // High performance version of substring for one-byte strings.
4004 // "str" must be OneByteString.
4005 static RawOneByteString* SubStringUnchecked(const String& str,
4006 intptr_t begin_index,
4007 intptr_t length,
4008 Heap::Space space);
4009
4003 static const ClassId kClassId = kOneByteStringCid; 4010 static const ClassId kClassId = kOneByteStringCid;
4004 4011
4005 static RawOneByteString* null() { 4012 static RawOneByteString* null() {
4006 return reinterpret_cast<RawOneByteString*>(Object::null()); 4013 return reinterpret_cast<RawOneByteString*>(Object::null());
4007 } 4014 }
4008 4015
4009 private: 4016 private:
4010 static RawOneByteString* raw(const String& str) { 4017 static RawOneByteString* raw(const String& str) {
4011 return reinterpret_cast<RawOneByteString*>(str.raw()); 4018 return reinterpret_cast<RawOneByteString*>(str.raw());
4012 } 4019 }
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
4411 return *ObjectAddr(index); 4418 return *ObjectAddr(index);
4412 } 4419 }
4413 void SetAt(intptr_t index, const Object& value) const { 4420 void SetAt(intptr_t index, const Object& value) const {
4414 ASSERT(!IsNull()); 4421 ASSERT(!IsNull());
4415 ASSERT(index < Length()); 4422 ASSERT(index < Length());
4416 const Array& arr = Array::Handle(data()); 4423 const Array& arr = Array::Handle(data());
4417 arr.SetAt(index, value); 4424 arr.SetAt(index, value);
4418 } 4425 }
4419 4426
4420 void Add(const Object& value, Heap::Space space = Heap::kNew) const; 4427 void Add(const Object& value, Heap::Space space = Heap::kNew) const;
4428 void Add(Isolate* isolate,
4429 const Object& value,
4430 Heap::Space space = Heap::kNew) const;
4431
4421 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const; 4432 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const;
4422 RawObject* RemoveLast() const; 4433 RawObject* RemoveLast() const;
4423 4434
4424 virtual RawAbstractTypeArguments* GetTypeArguments() const { 4435 virtual RawAbstractTypeArguments* GetTypeArguments() const {
4425 ASSERT(AbstractTypeArguments::AreEqual( 4436 ASSERT(AbstractTypeArguments::AreEqual(
4426 AbstractTypeArguments::Handle(Array::Handle(data()).GetTypeArguments()), 4437 AbstractTypeArguments::Handle(Array::Handle(data()).GetTypeArguments()),
4427 AbstractTypeArguments::Handle(raw_ptr()->type_arguments_))); 4438 AbstractTypeArguments::Handle(raw_ptr()->type_arguments_)));
4428 return raw_ptr()->type_arguments_; 4439 return raw_ptr()->type_arguments_;
4429 } 4440 }
4430 virtual void SetTypeArguments(const AbstractTypeArguments& value) const { 4441 virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
5973 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5984 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5974 return false; 5985 return false;
5975 } 5986 }
5976 } 5987 }
5977 return true; 5988 return true;
5978 } 5989 }
5979 5990
5980 } // namespace dart 5991 } // namespace dart
5981 5992
5982 #endif // VM_OBJECT_H_ 5993 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698