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

Unified Diff: src/ast.h

Issue 6062002: Merge 6006:6095 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 10 years 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 | « src/assembler.cc ('k') | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
===================================================================
--- src/ast.h (revision 6095)
+++ src/ast.h (working copy)
@@ -476,12 +476,14 @@
void set_condition_position(int pos) { condition_position_ = pos; }
// Bailout support.
- virtual int ContinueId() const { return next_id_; }
+ virtual int ContinueId() const { return continue_id_; }
+ int BackEdgeId() const { return back_edge_id_; }
private:
Expression* cond_;
int condition_position_;
- int next_id_;
+ int continue_id_;
+ int back_edge_id_;
};
@@ -506,11 +508,13 @@
// Bailout support.
virtual int ContinueId() const { return EntryId(); }
+ int BodyId() const { return body_id_; }
private:
Expression* cond_;
// True if there is a function literal subexpression in the condition.
bool may_have_function_literal_;
+ int body_id_;
};
@@ -542,7 +546,8 @@
}
// Bailout support.
- virtual int ContinueId() const { return next_id_; }
+ virtual int ContinueId() const { return continue_id_; }
+ int BodyId() const { return body_id_; }
bool is_fast_smi_loop() { return loop_variable_ != NULL; }
Variable* loop_variable() { return loop_variable_; }
@@ -555,7 +560,8 @@
// True if there is a function literal subexpression in the condition.
bool may_have_function_literal_;
Variable* loop_variable_;
- int next_id_;
+ int continue_id_;
+ int body_id_;
};
@@ -735,7 +741,10 @@
Statement* else_statement)
: condition_(condition),
then_statement_(then_statement),
- else_statement_(else_statement) { }
+ else_statement_(else_statement),
+ then_id_(GetNextId()),
+ else_id_(GetNextId()) {
+ }
DECLARE_NODE_TYPE(IfStatement)
@@ -748,10 +757,15 @@
Statement* then_statement() const { return then_statement_; }
Statement* else_statement() const { return else_statement_; }
+ int ThenId() const { return then_id_; }
+ int ElseId() const { return else_id_; }
+
private:
Expression* condition_;
Statement* then_statement_;
Statement* else_statement_;
+ int then_id_;
+ int else_id_;
};
@@ -1376,6 +1390,9 @@
int pos)
: op_(op), left_(left), right_(right), pos_(pos), is_smi_only_(false) {
ASSERT(Token::IsBinaryOp(op));
+ right_id_ = (op == Token::AND || op == Token::OR)
+ ? GetNextId()
+ : AstNode::kNoNumber;
}
// Create the binary operation corresponding to a compound assignment.
@@ -1396,12 +1413,18 @@
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsSmiOnly() const { return is_smi_only_; }
+ // Bailout support.
+ int RightId() const { return right_id_; }
+
private:
Token::Value op_;
Expression* left_;
Expression* right_;
int pos_;
bool is_smi_only_;
+ // The short-circuit logical operations have an AST ID for their
+ // right-hand subexpression.
+ int right_id_;
};
@@ -1526,7 +1549,10 @@
then_expression_(then_expression),
else_expression_(else_expression),
then_expression_position_(then_expression_position),
- else_expression_position_(else_expression_position) { }
+ else_expression_position_(else_expression_position),
+ then_id_(GetNextId()),
+ else_id_(GetNextId()) {
+ }
DECLARE_NODE_TYPE(Conditional)
@@ -1536,15 +1562,20 @@
Expression* then_expression() const { return then_expression_; }
Expression* else_expression() const { return else_expression_; }
- int then_expression_position() { return then_expression_position_; }
- int else_expression_position() { return else_expression_position_; }
+ int then_expression_position() const { return then_expression_position_; }
+ int else_expression_position() const { return else_expression_position_; }
+ int ThenId() const { return then_id_; }
+ int ElseId() const { return else_id_; }
+
private:
Expression* condition_;
Expression* then_expression_;
Expression* else_expression_;
int then_expression_position_;
int else_expression_position_;
+ int then_id_;
+ int else_id_;
};
« no previous file with comments | « src/assembler.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698