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

Side by Side Diff: src/objects.h

Issue 7518: String equality improvements. (Closed)
Patch Set: Fixed lint issue 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2949 // failure. 2949 // failure.
2950 Object* Flatten(); 2950 Object* Flatten();
2951 // Try to flatten the string. Do not allow handling of allocation 2951 // Try to flatten the string. Do not allow handling of allocation
2952 // failures. After calling TryFlatten, the string could still be a 2952 // failures. After calling TryFlatten, the string could still be a
2953 // ConsString. 2953 // ConsString.
2954 inline void TryFlatten(); 2954 inline void TryFlatten();
2955 2955
2956 // Is this string an ascii string. 2956 // Is this string an ascii string.
2957 inline bool IsAsciiRepresentation(); 2957 inline bool IsAsciiRepresentation();
2958 2958
2959 // Specialization of this function from Object that skips the
2960 // string check.
2961 inline bool IsSeqAsciiString();
2962
2959 // Fast testing routines that assume the receiver is a string and 2963 // Fast testing routines that assume the receiver is a string and
2960 // just check whether it is a certain kind of string. 2964 // just check whether it is a certain kind of string.
2961 inline bool StringIsSlicedString(); 2965 inline bool StringIsSlicedString();
2962 inline bool StringIsConsString(); 2966 inline bool StringIsConsString();
2963 2967
2964 Vector<const char> ToAsciiVector(); 2968 Vector<const char> ToAsciiVector();
2965 Vector<const uc16> ToUC16Vector(); 2969 Vector<const uc16> ToUC16Vector();
2966 2970
2967 // Mark the string as an undetectable object. It only applies to 2971 // Mark the string as an undetectable object. It only applies to
2968 // ascii and two byte string types. 2972 // ascii and two byte string types.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 // Each character in the AsciiString is an ascii character. 3180 // Each character in the AsciiString is an ascii character.
3177 class SeqAsciiString: public SeqString { 3181 class SeqAsciiString: public SeqString {
3178 public: 3182 public:
3179 // Dispatched behavior. 3183 // Dispatched behavior.
3180 inline uint16_t SeqAsciiStringGet(int index); 3184 inline uint16_t SeqAsciiStringGet(int index);
3181 inline void SeqAsciiStringSet(int index, uint16_t value); 3185 inline void SeqAsciiStringSet(int index, uint16_t value);
3182 3186
3183 // Get the address of the characters in this string. 3187 // Get the address of the characters in this string.
3184 inline Address GetCharsAddress(); 3188 inline Address GetCharsAddress();
3185 3189
3190 inline const char* GetChars();
3191
3186 // Casting 3192 // Casting
3187 static inline SeqAsciiString* cast(Object* obj); 3193 static inline SeqAsciiString* cast(Object* obj);
3188 3194
3189 // Garbage collection support. This method is called by the 3195 // Garbage collection support. This method is called by the
3190 // garbage collector to compute the actual size of an AsciiString 3196 // garbage collector to compute the actual size of an AsciiString
3191 // instance. 3197 // instance.
3192 inline int SeqAsciiStringSize(Map* map); 3198 inline int SeqAsciiStringSize(Map* map);
3193 3199
3194 // Computes the size for an AsciiString instance of a given length. 3200 // Computes the size for an AsciiString instance of a given length.
3195 static int SizeFor(int length) { 3201 static int SizeFor(int length) {
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
4014 } else { 4020 } else {
4015 value &= ~(1 << bit_position); 4021 value &= ~(1 << bit_position);
4016 } 4022 }
4017 return value; 4023 return value;
4018 } 4024 }
4019 }; 4025 };
4020 4026
4021 } } // namespace v8::internal 4027 } } // namespace v8::internal
4022 4028
4023 #endif // V8_OBJECTS_H_ 4029 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698