OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 // | 2320 // |
2321 // No special elements in the prefix and the element size is 1 | 2321 // No special elements in the prefix and the element size is 1 |
2322 // because only the symbol itself (the key) needs to be stored. | 2322 // because only the symbol itself (the key) needs to be stored. |
2323 class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> { | 2323 class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> { |
2324 public: | 2324 public: |
2325 // Find symbol in the symbol table. If it is not there yet, it is | 2325 // Find symbol in the symbol table. If it is not there yet, it is |
2326 // added. The return value is the symbol table which might have | 2326 // added. The return value is the symbol table which might have |
2327 // been enlarged. If the return value is not a failure, the symbol | 2327 // been enlarged. If the return value is not a failure, the symbol |
2328 // pointer *s is set to the symbol found. | 2328 // pointer *s is set to the symbol found. |
2329 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s); | 2329 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s); |
| 2330 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str, |
| 2331 Object** s); |
| 2332 MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol(Vector<const uc16> str, |
| 2333 Object** s); |
2330 MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s); | 2334 MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s); |
2331 | 2335 |
2332 // Looks up a symbol that is equal to the given string and returns | 2336 // Looks up a symbol that is equal to the given string and returns |
2333 // true if it is found, assigning the symbol to the given output | 2337 // true if it is found, assigning the symbol to the given output |
2334 // parameter. | 2338 // parameter. |
2335 bool LookupSymbolIfExists(String* str, String** symbol); | 2339 bool LookupSymbolIfExists(String* str, String** symbol); |
2336 bool LookupTwoCharsSymbolIfExists(uint32_t c1, uint32_t c2, String** symbol); | 2340 bool LookupTwoCharsSymbolIfExists(uint32_t c1, uint32_t c2, String** symbol); |
2337 | 2341 |
2338 // Casting. | 2342 // Casting. |
2339 static inline SymbolTable* cast(Object* obj); | 2343 static inline SymbolTable* cast(Object* obj); |
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5067 bool MarkAsUndetectable(); | 5071 bool MarkAsUndetectable(); |
5068 | 5072 |
5069 // Return a substring. | 5073 // Return a substring. |
5070 MUST_USE_RESULT MaybeObject* SubString(int from, | 5074 MUST_USE_RESULT MaybeObject* SubString(int from, |
5071 int to, | 5075 int to, |
5072 PretenureFlag pretenure = NOT_TENURED); | 5076 PretenureFlag pretenure = NOT_TENURED); |
5073 | 5077 |
5074 // String equality operations. | 5078 // String equality operations. |
5075 inline bool Equals(String* other); | 5079 inline bool Equals(String* other); |
5076 bool IsEqualTo(Vector<const char> str); | 5080 bool IsEqualTo(Vector<const char> str); |
| 5081 bool IsAsciiEqualTo(Vector<const char> str); |
| 5082 bool IsTwoByteEqualTo(Vector<const uc16> str); |
5077 | 5083 |
5078 // Return a UTF8 representation of the string. The string is null | 5084 // Return a UTF8 representation of the string. The string is null |
5079 // terminated but may optionally contain nulls. Length is returned | 5085 // terminated but may optionally contain nulls. Length is returned |
5080 // in length_output if length_output is not a null pointer The string | 5086 // in length_output if length_output is not a null pointer The string |
5081 // should be nearly flat, otherwise the performance of this method may | 5087 // should be nearly flat, otherwise the performance of this method may |
5082 // be very slow (quadratic in the length). Setting robustness_flag to | 5088 // be very slow (quadratic in the length). Setting robustness_flag to |
5083 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it | 5089 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it |
5084 // handles unexpected data without causing assert failures and it does not | 5090 // handles unexpected data without causing assert failures and it does not |
5085 // do any heap allocations. This is useful when printing stack traces. | 5091 // do any heap allocations. This is useful when printing stack traces. |
5086 SmartPointer<char> ToCString(AllowNullsFlag allow_nulls, | 5092 SmartPointer<char> ToCString(AllowNullsFlag allow_nulls, |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6376 } else { | 6382 } else { |
6377 value &= ~(1 << bit_position); | 6383 value &= ~(1 << bit_position); |
6378 } | 6384 } |
6379 return value; | 6385 return value; |
6380 } | 6386 } |
6381 }; | 6387 }; |
6382 | 6388 |
6383 } } // namespace v8::internal | 6389 } } // namespace v8::internal |
6384 | 6390 |
6385 #endif // V8_OBJECTS_H_ | 6391 #endif // V8_OBJECTS_H_ |
OLD | NEW |