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

Unified Diff: src/ast.h

Issue 27128: Go into slow case when encountering object initialization on the top level to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 10 months 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/codegen-ia32.cc » ('j') | src/codegen-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
===================================================================
--- src/ast.h (revision 1358)
+++ src/ast.h (working copy)
@@ -1106,7 +1106,8 @@
class Assignment: public Expression {
public:
Assignment(Token::Value op, Expression* target, Expression* value, int pos)
- : op_(op), target_(target), value_(value), pos_(pos) {
+ : op_(op), target_(target), value_(value), pos_(pos),
+ block_start_(false), block_end_(false) {
ASSERT(Token::IsAssignmentOp(op));
}
@@ -1120,11 +1121,22 @@
Expression* value() const { return value_; }
int position() { return pos_; }
+ // An initialization block is a series of statments of the form
+ // x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and
+ // ending of these blocks to allow for optimizations of initialization
+ // blocks.
+ bool starts_initialization_block() { return block_start_; }
+ bool ends_initialization_block() { return block_end_; }
+ void mark_block_start() { block_start_ = true; }
+ void mark_block_end() { block_end_ = true; }
+
private:
Token::Value op_;
Expression* target_;
Expression* value_;
int pos_;
+ bool block_start_;
+ bool block_end_;
};
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('j') | src/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698