Index: src/parser.h |
diff --git a/src/parser.h b/src/parser.h |
index 2a79b63bfdc4075f0964849bbce7cbee5ccd6d8c..773d59a5e20b51e934e18a2e506dfdc68b2481da 100644 |
--- a/src/parser.h |
+++ b/src/parser.h |
@@ -200,12 +200,12 @@ class BufferedZoneList { |
// Adds element at end of list. This element is buffered and can |
// be read using last() or removed using RemoveLast until a new Add or until |
// RemoveLast or GetList has been called. |
- void Add(T* value) { |
+ void Add(T* value, Zone* zone) { |
if (last_ != NULL) { |
if (list_ == NULL) { |
- list_ = new ZoneList<T*>(initial_size); |
+ list_ = new(zone) ZoneList<T*>(initial_size, zone); |
} |
- list_->Add(last_); |
+ list_->Add(last_, zone); |
} |
last_ = value; |
} |
@@ -250,12 +250,12 @@ class BufferedZoneList { |
return length + ((last_ == NULL) ? 0 : 1); |
} |
- ZoneList<T*>* GetList() { |
+ ZoneList<T*>* GetList(Zone* zone) { |
if (list_ == NULL) { |
- list_ = new ZoneList<T*>(initial_size); |
+ list_ = new(zone) ZoneList<T*>(initial_size, zone); |
} |
if (last_ != NULL) { |
- list_->Add(last_); |
+ list_->Add(last_, zone); |
last_ = NULL; |
} |
return list_; |
@@ -285,7 +285,7 @@ class RegExpBuilder: public ZoneObject { |
void FlushCharacters(); |
void FlushText(); |
void FlushTerms(); |
- Zone* zone() { return zone_; } |
+ Zone* zone() const { return zone_; } |
Zone* zone_; |
bool pending_empty_; |
@@ -371,7 +371,7 @@ class RegExpParser { |
int disjunction_capture_index, |
Zone* zone) |
: previous_state_(previous_state), |
- builder_(new RegExpBuilder(zone)), |
+ builder_(new(zone) RegExpBuilder(zone)), |
group_type_(group_type), |
disjunction_capture_index_(disjunction_capture_index) {} |
// Parser state of containing expression, if any. |
@@ -398,7 +398,7 @@ class RegExpParser { |
}; |
Isolate* isolate() { return isolate_; } |
- Zone* zone() { return isolate_->zone(); } |
+ Zone* zone() const { return isolate_->zone(); } |
uc32 current() { return current_; } |
bool has_more() { return has_more_; } |
@@ -548,7 +548,7 @@ class Parser { |
ZoneScope* zone_scope); |
Isolate* isolate() { return isolate_; } |
- Zone* zone() { return zone_; } |
+ Zone* zone() const { return zone_; } |
// Called by ParseProgram after setting up the scanner. |
FunctionLiteral* DoParseProgram(CompilationInfo* info, |