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

Unified Diff: src/objects.h

Issue 8011: Use direct copy and templates to speed up flattening of strings. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 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 side-by-side diff with in-line comments
Download patch
Index: src/objects.h
===================================================================
--- src/objects.h (revision 535)
+++ src/objects.h (working copy)
@@ -2965,7 +2965,7 @@
inline bool StringIsSlicedString();
inline bool StringIsConsString();
- Vector<const char> ToAsciiVector();
+ Vector<const byte> ToAsciiVector();
Vector<const uc16> ToUC16Vector();
// Mark the string as an undetectable object. It only applies to
@@ -3043,6 +3043,8 @@
// Get the representation tag.
inline StringRepresentationTag representation_tag();
+ // Get the representation and ASCII tag.
+ inline int full_representation_tag();
static inline StringRepresentationTag map_representation_tag(Map* map);
// For use during stack traces. Performs rudimentary sanity check.
@@ -3069,6 +3071,9 @@
// Max ascii char code.
static const int kMaxAsciiCharCode = 127;
+ // Minimum lenth for a cons or sliced string.
+ static const int kMinNonFlatLength = 13;
+
// Mask constant for checking if a string has a computed hash code
// and if it is an array index. The least significant bit indicates
// whether a hash code has been computed. If the hash code has been
@@ -3106,11 +3111,11 @@
unsigned* offset);
// Helper function for flattening strings.
- static void Flatten(String* source,
- String* sink,
- int from,
- int to,
- int sink_offset);
+ template <typename sinkchar>
+ static void WriteToFlat(String* source,
+ sinkchar* sink,
+ int from,
+ int to);
protected:
class ReadBlockBuffer {
@@ -3301,8 +3306,6 @@
unsigned chars);
- // Minimum lenth for a cons string.
- static const int kMinLength = 13;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ConsString);
@@ -3348,9 +3351,6 @@
unsigned* offset_ptr,
unsigned chars);
- // Minimum lenth for a sliced string.
- static const int kMinLength = 13;
-
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(SlicedString);
};

Powered by Google App Engine
This is Rietveld 408576698