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

Side by Side Diff: src/objects.h

Issue 9536018: Faster WriteUtf8 for medium size strings? Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 9 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 | « src/api.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6728 matching lines...) Expand 10 before | Expand all | Expand 10 after
6739 int offset, 6739 int offset,
6740 int length, 6740 int length,
6741 int* length_output = 0); 6741 int* length_output = 0);
6742 SmartArrayPointer<char> ToCString( 6742 SmartArrayPointer<char> ToCString(
6743 AllowNullsFlag allow_nulls = DISALLOW_NULLS, 6743 AllowNullsFlag allow_nulls = DISALLOW_NULLS,
6744 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL, 6744 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL,
6745 int* length_output = 0); 6745 int* length_output = 0);
6746 6746
6747 inline int Utf8Length() { return Utf8Length(this, 0, length()); } 6747 inline int Utf8Length() { return Utf8Length(this, 0, length()); }
6748 static int Utf8Length(String* input, int from, int to); 6748 static int Utf8Length(String* input, int from, int to);
6749 int RecursivelySerializeToUtf8(char* buffer, int start, int end);
6749 6750
6750 // Return a 16 bit Unicode representation of the string. 6751 // Return a 16 bit Unicode representation of the string.
6751 // The string should be nearly flat, otherwise the performance of 6752 // The string should be nearly flat, otherwise the performance of
6752 // of this method may be very bad. Setting robustness_flag to 6753 // of this method may be very bad. Setting robustness_flag to
6753 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it 6754 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it
6754 // handles unexpected data without causing assert failures and it does not 6755 // handles unexpected data without causing assert failures and it does not
6755 // do any heap allocations. This is useful when printing stack traces. 6756 // do any heap allocations. This is useful when printing stack traces.
6756 SmartArrayPointer<uc16> ToWideCString( 6757 SmartArrayPointer<uc16> ToWideCString(
6757 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL); 6758 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL);
6758 6759
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
8423 } else { 8424 } else {
8424 value &= ~(1 << bit_position); 8425 value &= ~(1 << bit_position);
8425 } 8426 }
8426 return value; 8427 return value;
8427 } 8428 }
8428 }; 8429 };
8429 8430
8430 } } // namespace v8::internal 8431 } } // namespace v8::internal
8431 8432
8432 #endif // V8_OBJECTS_H_ 8433 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698