| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool is_one_byte() const { return is_one_byte_; } | 81 bool is_one_byte() const { return is_one_byte_; } |
| 82 bool IsOneByteEqualTo(const char* data) const; | 82 bool IsOneByteEqualTo(const char* data) const; |
| 83 uint16_t FirstCharacter() const { | 83 uint16_t FirstCharacter() const { |
| 84 if (is_one_byte_) | 84 if (is_one_byte_) |
| 85 return literal_bytes_[0]; | 85 return literal_bytes_[0]; |
| 86 const uint16_t* c = | 86 const uint16_t* c = |
| 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 V8_INLINE bool IsArguments(AstValueFactory* ast_value_factory) const; | |
| 92 | |
| 93 // For storing AstRawStrings in a hash map. | 91 // For storing AstRawStrings in a hash map. |
| 94 uint32_t hash() const { | 92 uint32_t hash() const { |
| 95 return hash_; | 93 return hash_; |
| 96 } | 94 } |
| 97 static bool Compare(void* a, void* b); | 95 static bool Compare(void* a, void* b); |
| 98 | 96 |
| 99 bool operator==(const AstRawString& rhs) const; | 97 bool operator==(const AstRawString& rhs) const; |
| 100 | 98 |
| 101 private: | 99 private: |
| 102 friend class AstValueFactory; | 100 friend class AstValueFactory; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 uint32_t hash_seed_; | 348 uint32_t hash_seed_; |
| 351 | 349 |
| 352 #define F(name, str) const AstRawString* name##_string_; | 350 #define F(name, str) const AstRawString* name##_string_; |
| 353 STRING_CONSTANTS(F) | 351 STRING_CONSTANTS(F) |
| 354 #undef F | 352 #undef F |
| 355 | 353 |
| 356 #define F(name) AstValue* name##_; | 354 #define F(name) AstValue* name##_; |
| 357 OTHER_CONSTANTS(F) | 355 OTHER_CONSTANTS(F) |
| 358 #undef F | 356 #undef F |
| 359 }; | 357 }; |
| 360 | |
| 361 | |
| 362 bool AstRawString::IsArguments(AstValueFactory* ast_value_factory) const { | |
| 363 return ast_value_factory->arguments_string() == this; | |
| 364 } | |
| 365 } } // namespace v8::internal | 358 } } // namespace v8::internal |
| 366 | 359 |
| 367 #undef STRING_CONSTANTS | 360 #undef STRING_CONSTANTS |
| 368 #undef OTHER_CONSTANTS | 361 #undef OTHER_CONSTANTS |
| 369 | 362 |
| 370 #endif // V8_AST_VALUE_FACTORY_H_ | 363 #endif // V8_AST_VALUE_FACTORY_H_ |
| OLD | NEW |