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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 F(value, "value") | 226 F(value, "value") |
227 | 227 |
228 class AstValueFactory { | 228 class AstValueFactory { |
229 public: | 229 public: |
230 explicit AstValueFactory(Zone* zone) | 230 explicit AstValueFactory(Zone* zone) |
231 : literal_chars_(0), | 231 : literal_chars_(0), |
232 string_table_keys_(0), | 232 string_table_keys_(0), |
233 string_table_(AstString::Compare), | 233 string_table_(AstString::Compare), |
234 zone_(zone), | 234 zone_(zone), |
235 isolate_(NULL) { | 235 isolate_(NULL) { |
236 #define F(name, str) { \ | 236 #define F(name, str) { \ |
237 const char* data = str; \ | 237 const char* data = str; \ |
238 name##_string_ = GetOneByteString( \ | 238 name##_string_ = GetOneByteString( \ |
239 Vector<const uint8_t>(reinterpret_cast<const uint8_t*>(data), \ | 239 Vector<const uint8_t>(reinterpret_cast<const uint8_t*>(data), \ |
240 strlen(data))); \ | 240 static_cast<int>(strlen(data)))); \ |
241 } | 241 } |
242 STRING_CONSTANTS(F) | 242 STRING_CONSTANTS(F) |
243 #undef F | 243 #undef F |
244 } | 244 } |
245 | 245 |
246 const AstString* GetOneByteString(Vector<const uint8_t> literal); | 246 const AstString* GetOneByteString(Vector<const uint8_t> literal); |
247 const AstString* GetTwoByteString(Vector<const uint16_t> literal); | 247 const AstString* GetTwoByteString(Vector<const uint16_t> literal); |
248 const AstString* GetString(Handle<String> literal); | 248 const AstString* GetString(Handle<String> literal); |
249 | 249 |
250 void Internalize(Isolate* isolate); | 250 void Internalize(Isolate* isolate); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 const AstString* name##_string_; | 285 const AstString* name##_string_; |
286 STRING_CONSTANTS(F) | 286 STRING_CONSTANTS(F) |
287 #undef F | 287 #undef F |
288 }; | 288 }; |
289 | 289 |
290 } } // namespace v8::internal | 290 } } // namespace v8::internal |
291 | 291 |
292 #undef STRING_CONSTANTS | 292 #undef STRING_CONSTANTS |
293 | 293 |
294 #endif // V8_AST_VALUE_FACTORY_H_ | 294 #endif // V8_AST_VALUE_FACTORY_H_ |
OLD | NEW |