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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast-value-factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast-value-factory.h
diff --git a/src/ast-value-factory.h b/src/ast-value-factory.h
index 071ca9ce9cc18abf23e17f09c31e69ca69a8ccce..09a41400fb3ec9b4b89f97b3ebe57e097f374e07 100644
--- a/src/ast-value-factory.h
+++ b/src/ast-value-factory.h
@@ -287,12 +287,16 @@ class AstValueFactory {
Zone* zone() const { return zone_; }
- const AstRawString* GetOneByteString(Vector<const uint8_t> literal);
+ const AstRawString* GetOneByteString(Vector<const uint8_t> literal) {
+ return GetOneByteStringInternal(literal);
+ }
const AstRawString* GetOneByteString(const char* string) {
return GetOneByteString(Vector<const uint8_t>(
reinterpret_cast<const uint8_t*>(string), StrLength(string)));
}
- const AstRawString* GetTwoByteString(Vector<const uint16_t> literal);
+ const AstRawString* GetTwoByteString(Vector<const uint16_t> literal) {
+ return GetTwoByteStringInternal(literal);
+ }
const AstRawString* GetString(Handle<String> literal);
const AstConsString* NewConsString(const AstString* left,
const AstString* right);
@@ -327,8 +331,10 @@ class AstValueFactory {
const AstValue* NewTheHole();
private:
- const AstRawString* GetString(uint32_t hash, bool is_one_byte,
- Vector<const byte> literal_bytes);
+ AstRawString* GetOneByteStringInternal(Vector<const uint8_t> literal);
+ AstRawString* GetTwoByteStringInternal(Vector<const uint16_t> literal);
+ AstRawString* GetString(uint32_t hash, bool is_one_byte,
+ Vector<const byte> literal_bytes);
// All strings are copied here, one after another (no NULLs inbetween).
HashMap string_table_;
« no previous file with comments | « no previous file | src/ast-value-factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698