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

Side by Side Diff: src/objects.h

Issue 10332054: Force inlining CopyChars and String::Get. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 8 years, 7 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/globals.h ('k') | src/v8utils.h » ('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 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 6868 matching lines...) Expand 10 before | Expand all | Expand 10 after
6879 inline bool IsTwoByteRepresentationUnderneath(); 6879 inline bool IsTwoByteRepresentationUnderneath();
6880 6880
6881 // NOTE: this should be considered only a hint. False negatives are 6881 // NOTE: this should be considered only a hint. False negatives are
6882 // possible. 6882 // possible.
6883 inline bool HasOnlyAsciiChars(); 6883 inline bool HasOnlyAsciiChars();
6884 6884
6885 // Get and set individual two byte chars in the string. 6885 // Get and set individual two byte chars in the string.
6886 inline void Set(int index, uint16_t value); 6886 inline void Set(int index, uint16_t value);
6887 // Get individual two byte char in the string. Repeated calls 6887 // Get individual two byte char in the string. Repeated calls
6888 // to this method are not efficient unless the string is flat. 6888 // to this method are not efficient unless the string is flat.
6889 inline uint16_t Get(int index); 6889 INLINE(uint16_t Get(int index));
6890 6890
6891 // Try to flatten the string. Checks first inline to see if it is 6891 // Try to flatten the string. Checks first inline to see if it is
6892 // necessary. Does nothing if the string is not a cons string. 6892 // necessary. Does nothing if the string is not a cons string.
6893 // Flattening allocates a sequential string with the same data as 6893 // Flattening allocates a sequential string with the same data as
6894 // the given string and mutates the cons string to a degenerate 6894 // the given string and mutates the cons string to a degenerate
6895 // form, where the first component is the new sequential string and 6895 // form, where the first component is the new sequential string and
6896 // the second component is the empty string. If allocation fails, 6896 // the second component is the empty string. If allocation fails,
6897 // this function returns a failure. If flattening succeeds, this 6897 // this function returns a failure. If flattening succeeds, this
6898 // function returns the sequential string that is now the first 6898 // function returns the sequential string that is now the first
6899 // component of the cons string. 6899 // component of the cons string.
(...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after
8658 } else { 8658 } else {
8659 value &= ~(1 << bit_position); 8659 value &= ~(1 << bit_position);
8660 } 8660 }
8661 return value; 8661 return value;
8662 } 8662 }
8663 }; 8663 };
8664 8664
8665 } } // namespace v8::internal 8665 } } // namespace v8::internal
8666 8666
8667 #endif // V8_OBJECTS_H_ 8667 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/v8utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698