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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 reinterpret_cast<const uint16_t*>(literal_bytes_.start()); | 87 reinterpret_cast<const uint16_t*>(literal_bytes_.start()); |
88 return *c; | 88 return *c; |
89 } | 89 } |
90 | 90 |
91 // For storing AstRawStrings in a hash map. | 91 // For storing AstRawStrings in a hash map. |
92 uint32_t hash() const { | 92 uint32_t hash() const { |
93 return hash_; | 93 return hash_; |
94 } | 94 } |
95 static bool Compare(void* a, void* b); | 95 static bool Compare(void* a, void* b); |
96 | 96 |
| 97 bool operator==(const AstRawString& rhs) const; |
| 98 |
97 private: | 99 private: |
98 friend class AstValueFactory; | 100 friend class AstValueFactory; |
99 friend class AstRawStringInternalizationKey; | 101 friend class AstRawStringInternalizationKey; |
100 | 102 |
101 AstRawString(bool is_one_byte, const Vector<const byte>& literal_bytes, | 103 AstRawString(bool is_one_byte, const Vector<const byte>& literal_bytes, |
102 uint32_t hash) | 104 uint32_t hash) |
103 : is_one_byte_(is_one_byte), literal_bytes_(literal_bytes), hash_(hash) {} | 105 : is_one_byte_(is_one_byte), literal_bytes_(literal_bytes), hash_(hash) {} |
104 | 106 |
105 AstRawString() | 107 AstRawString() |
106 : is_one_byte_(true), | 108 : is_one_byte_(true), |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 const AstRawString* name##_string_; | 338 const AstRawString* name##_string_; |
337 STRING_CONSTANTS(F) | 339 STRING_CONSTANTS(F) |
338 #undef F | 340 #undef F |
339 }; | 341 }; |
340 | 342 |
341 } } // namespace v8::internal | 343 } } // namespace v8::internal |
342 | 344 |
343 #undef STRING_CONSTANTS | 345 #undef STRING_CONSTANTS |
344 | 346 |
345 #endif // V8_AST_VALUE_FACTORY_H_ | 347 #endif // V8_AST_VALUE_FACTORY_H_ |
OLD | NEW |