OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2421 return key->HashForObject(object); | 2421 return key->HashForObject(object); |
2422 } | 2422 } |
2423 MUST_USE_RESULT static inline MaybeObject* AsObject(HashTableKey* key) { | 2423 MUST_USE_RESULT static inline MaybeObject* AsObject(HashTableKey* key) { |
2424 return key->AsObject(); | 2424 return key->AsObject(); |
2425 } | 2425 } |
2426 | 2426 |
2427 static const int kPrefixSize = 0; | 2427 static const int kPrefixSize = 0; |
2428 static const int kEntrySize = 1; | 2428 static const int kEntrySize = 1; |
2429 }; | 2429 }; |
2430 | 2430 |
| 2431 class SeqAsciiString; |
| 2432 |
2431 // SymbolTable. | 2433 // SymbolTable. |
2432 // | 2434 // |
2433 // No special elements in the prefix and the element size is 1 | 2435 // No special elements in the prefix and the element size is 1 |
2434 // because only the symbol itself (the key) needs to be stored. | 2436 // because only the symbol itself (the key) needs to be stored. |
2435 class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> { | 2437 class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> { |
2436 public: | 2438 public: |
2437 // Find symbol in the symbol table. If it is not there yet, it is | 2439 // Find symbol in the symbol table. If it is not there yet, it is |
2438 // added. The return value is the symbol table which might have | 2440 // added. The return value is the symbol table which might have |
2439 // been enlarged. If the return value is not a failure, the symbol | 2441 // been enlarged. If the return value is not a failure, the symbol |
2440 // pointer *s is set to the symbol found. | 2442 // pointer *s is set to the symbol found. |
2441 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s); | 2443 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s); |
2442 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str, | 2444 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str, |
2443 Object** s); | 2445 Object** s); |
| 2446 MUST_USE_RESULT MaybeObject* LookupSubStringAsciiSymbol( |
| 2447 Handle<SeqAsciiString> str, |
| 2448 int from, |
| 2449 int length, |
| 2450 Object** s); |
2444 MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol(Vector<const uc16> str, | 2451 MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol(Vector<const uc16> str, |
2445 Object** s); | 2452 Object** s); |
2446 MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s); | 2453 MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s); |
2447 | 2454 |
2448 // Looks up a symbol that is equal to the given string and returns | 2455 // Looks up a symbol that is equal to the given string and returns |
2449 // true if it is found, assigning the symbol to the given output | 2456 // true if it is found, assigning the symbol to the given output |
2450 // parameter. | 2457 // parameter. |
2451 bool LookupSymbolIfExists(String* str, String** symbol); | 2458 bool LookupSymbolIfExists(String* str, String** symbol); |
2452 bool LookupTwoCharsSymbolIfExists(uint32_t c1, uint32_t c2, String** symbol); | 2459 bool LookupTwoCharsSymbolIfExists(uint32_t c1, uint32_t c2, String** symbol); |
2453 | 2460 |
(...skipping 4321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6775 } else { | 6782 } else { |
6776 value &= ~(1 << bit_position); | 6783 value &= ~(1 << bit_position); |
6777 } | 6784 } |
6778 return value; | 6785 return value; |
6779 } | 6786 } |
6780 }; | 6787 }; |
6781 | 6788 |
6782 } } // namespace v8::internal | 6789 } } // namespace v8::internal |
6783 | 6790 |
6784 #endif // V8_OBJECTS_H_ | 6791 #endif // V8_OBJECTS_H_ |
OLD | NEW |