Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: src/ast-value-factory.h

Issue 699343004: Parser & internalization fix: ensure no heap allocs during GetString(Handle<String>). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ast-value-factory.cc » ('j') | src/ast-value-factory.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 const AstValue* NewSymbol(const char* name); 320 const AstValue* NewSymbol(const char* name);
321 const AstValue* NewNumber(double number); 321 const AstValue* NewNumber(double number);
322 const AstValue* NewSmi(int number); 322 const AstValue* NewSmi(int number);
323 const AstValue* NewBoolean(bool b); 323 const AstValue* NewBoolean(bool b);
324 const AstValue* NewStringList(ZoneList<const AstRawString*>* strings); 324 const AstValue* NewStringList(ZoneList<const AstRawString*>* strings);
325 const AstValue* NewNull(); 325 const AstValue* NewNull();
326 const AstValue* NewUndefined(); 326 const AstValue* NewUndefined();
327 const AstValue* NewTheHole(); 327 const AstValue* NewTheHole();
328 328
329 private: 329 private:
330 const AstRawString* GetString(uint32_t hash, bool is_one_byte, 330 AstRawString* GetString(uint32_t hash, bool is_one_byte,
331 Vector<const byte> literal_bytes); 331 Vector<const byte> literal_bytes);
332 332
333 // All strings are copied here, one after another (no NULLs inbetween). 333 // All strings are copied here, one after another (no NULLs inbetween).
334 HashMap string_table_; 334 HashMap string_table_;
335 // For keeping track of all AstValues and AstRawStrings we've created (so that 335 // For keeping track of all AstValues and AstRawStrings we've created (so that
336 // they can be internalized later). 336 // they can be internalized later).
337 List<AstValue*> values_; 337 List<AstValue*> values_;
338 List<AstString*> strings_; 338 List<AstString*> strings_;
339 Zone* zone_; 339 Zone* zone_;
340 Isolate* isolate_; 340 Isolate* isolate_;
341 341
(...skipping 11 matching lines...) Expand all
353 353
354 bool AstRawString::IsArguments(AstValueFactory* ast_value_factory) const { 354 bool AstRawString::IsArguments(AstValueFactory* ast_value_factory) const {
355 return ast_value_factory->arguments_string() == this; 355 return ast_value_factory->arguments_string() == this;
356 } 356 }
357 } } // namespace v8::internal 357 } } // namespace v8::internal
358 358
359 #undef STRING_CONSTANTS 359 #undef STRING_CONSTANTS
360 #undef OTHER_CONSTANTS 360 #undef OTHER_CONSTANTS
361 361
362 #endif // V8_AST_VALUE_FACTORY_H_ 362 #endif // V8_AST_VALUE_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast-value-factory.cc » ('j') | src/ast-value-factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698