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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // the AstRawString will not be moved). | 264 // the AstRawString will not be moved). |
265 AstConsString* new_string = new (zone_) AstConsString(left, right); | 265 AstConsString* new_string = new (zone_) AstConsString(left, right); |
266 strings_.Add(new_string); | 266 strings_.Add(new_string); |
267 if (isolate_) { | 267 if (isolate_) { |
268 new_string->Internalize(isolate_); | 268 new_string->Internalize(isolate_); |
269 } | 269 } |
270 return new_string; | 270 return new_string; |
271 } | 271 } |
272 | 272 |
273 | 273 |
| 274 const AstTemplateSpan* AstValueFactory::NewTemplateSpan( |
| 275 const AstString* value, const AstString* rawValue) { |
| 276 AstTemplateSpan* new_span = new (zone_) AstTemplateSpan(value, rawValue); |
| 277 return new_span; |
| 278 } |
| 279 |
| 280 |
274 void AstValueFactory::Internalize(Isolate* isolate) { | 281 void AstValueFactory::Internalize(Isolate* isolate) { |
275 if (isolate_) { | 282 if (isolate_) { |
276 // Everything is already internalized. | 283 // Everything is already internalized. |
277 return; | 284 return; |
278 } | 285 } |
279 // Strings need to be internalized before values, because values refer to | 286 // Strings need to be internalized before values, because values refer to |
280 // strings. | 287 // strings. |
281 for (int i = 0; i < strings_.length(); ++i) { | 288 for (int i = 0; i < strings_.length(); ++i) { |
282 strings_[i]->Internalize(isolate); | 289 strings_[i]->Internalize(isolate); |
283 } | 290 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 if (isolate_) { | 405 if (isolate_) { |
399 new_string->Internalize(isolate_); | 406 new_string->Internalize(isolate_); |
400 } | 407 } |
401 entry->value = reinterpret_cast<void*>(1); | 408 entry->value = reinterpret_cast<void*>(1); |
402 } | 409 } |
403 return reinterpret_cast<AstRawString*>(entry->key); | 410 return reinterpret_cast<AstRawString*>(entry->key); |
404 } | 411 } |
405 | 412 |
406 | 413 |
407 } } // namespace v8::internal | 414 } } // namespace v8::internal |
OLD | NEW |