OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 strings_end_ = &strings_; | 396 strings_end_ = &strings_; |
397 } | 397 } |
398 AstRawString* GetOneByteStringInternal(Vector<const uint8_t> literal); | 398 AstRawString* GetOneByteStringInternal(Vector<const uint8_t> literal); |
399 AstRawString* GetTwoByteStringInternal(Vector<const uint16_t> literal); | 399 AstRawString* GetTwoByteStringInternal(Vector<const uint16_t> literal); |
400 AstRawString* GetString(uint32_t hash, bool is_one_byte, | 400 AstRawString* GetString(uint32_t hash, bool is_one_byte, |
401 Vector<const byte> literal_bytes); | 401 Vector<const byte> literal_bytes); |
402 | 402 |
403 static bool AstRawStringCompare(void* a, void* b); | 403 static bool AstRawStringCompare(void* a, void* b); |
404 | 404 |
405 // All strings are copied here, one after another (no NULLs inbetween). | 405 // All strings are copied here, one after another (no NULLs inbetween). |
406 base::HashMap string_table_; | 406 base::CustomMatcherHashMap string_table_; |
407 // For keeping track of all AstValues and AstRawStrings we've created (so that | 407 // For keeping track of all AstValues and AstRawStrings we've created (so that |
408 // they can be internalized later). | 408 // they can be internalized later). |
409 AstValue* values_; | 409 AstValue* values_; |
410 // We need to keep track of strings_ in order, since cons strings require | 410 // We need to keep track of strings_ in order, since cons strings require |
411 // their members to be internalized first. | 411 // their members to be internalized first. |
412 AstString* strings_; | 412 AstString* strings_; |
413 AstString** strings_end_; | 413 AstString** strings_end_; |
414 Zone* zone_; | 414 Zone* zone_; |
415 | 415 |
416 uint32_t hash_seed_; | 416 uint32_t hash_seed_; |
417 | 417 |
418 #define F(name, str) const AstRawString* name##_string_; | 418 #define F(name, str) const AstRawString* name##_string_; |
419 STRING_CONSTANTS(F) | 419 STRING_CONSTANTS(F) |
420 #undef F | 420 #undef F |
421 | 421 |
422 #define F(name) AstValue* name##_; | 422 #define F(name) AstValue* name##_; |
423 OTHER_CONSTANTS(F) | 423 OTHER_CONSTANTS(F) |
424 #undef F | 424 #undef F |
425 }; | 425 }; |
426 } // namespace internal | 426 } // namespace internal |
427 } // namespace v8 | 427 } // namespace v8 |
428 | 428 |
429 #undef STRING_CONSTANTS | 429 #undef STRING_CONSTANTS |
430 #undef OTHER_CONSTANTS | 430 #undef OTHER_CONSTANTS |
431 | 431 |
432 #endif // V8_AST_AST_VALUE_FACTORY_H_ | 432 #endif // V8_AST_AST_VALUE_FACTORY_H_ |
OLD | NEW |