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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 const AstRawString* GetOneByteString(const char* string) { | 354 const AstRawString* GetOneByteString(const char* string) { |
355 return GetOneByteString(Vector<const uint8_t>( | 355 return GetOneByteString(Vector<const uint8_t>( |
356 reinterpret_cast<const uint8_t*>(string), StrLength(string))); | 356 reinterpret_cast<const uint8_t*>(string), StrLength(string))); |
357 } | 357 } |
358 const AstRawString* GetTwoByteString(Vector<const uint16_t> literal) { | 358 const AstRawString* GetTwoByteString(Vector<const uint16_t> literal) { |
359 return GetTwoByteStringInternal(literal); | 359 return GetTwoByteStringInternal(literal); |
360 } | 360 } |
361 const AstRawString* GetString(Handle<String> literal); | 361 const AstRawString* GetString(Handle<String> literal); |
362 const AstConsString* NewConsString(const AstString* left, | 362 const AstConsString* NewConsString(const AstString* left, |
363 const AstString* right); | 363 const AstString* right); |
364 const AstRawString* ConcatStrings(const AstRawString* left, | |
365 const AstRawString* right); | |
366 | 364 |
367 void Internalize(Isolate* isolate); | 365 void Internalize(Isolate* isolate); |
368 | 366 |
369 #define F(name, str) \ | 367 #define F(name, str) \ |
370 const AstRawString* name##_string() { \ | 368 const AstRawString* name##_string() { \ |
371 if (name##_string_ == NULL) { \ | 369 if (name##_string_ == NULL) { \ |
372 const char* data = str; \ | 370 const char* data = str; \ |
373 name##_string_ = GetOneByteString( \ | 371 name##_string_ = GetOneByteString( \ |
374 Vector<const uint8_t>(reinterpret_cast<const uint8_t*>(data), \ | 372 Vector<const uint8_t>(reinterpret_cast<const uint8_t*>(data), \ |
375 static_cast<int>(strlen(data)))); \ | 373 static_cast<int>(strlen(data)))); \ |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 OTHER_CONSTANTS(F) | 438 OTHER_CONSTANTS(F) |
441 #undef F | 439 #undef F |
442 }; | 440 }; |
443 } // namespace internal | 441 } // namespace internal |
444 } // namespace v8 | 442 } // namespace v8 |
445 | 443 |
446 #undef STRING_CONSTANTS | 444 #undef STRING_CONSTANTS |
447 #undef OTHER_CONSTANTS | 445 #undef OTHER_CONSTANTS |
448 | 446 |
449 #endif // V8_AST_AST_VALUE_FACTORY_H_ | 447 #endif // V8_AST_AST_VALUE_FACTORY_H_ |
OLD | NEW |