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

Unified Diff: src/ast.cc

Issue 1530003: Rework flow graph construction. (Closed)
Patch Set: Created 10 years, 9 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 | « src/ast.h ('k') | src/compiler.h » ('j') | src/data-flow.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 9204a840c84fd6520dbd1b8792abdbc7addaa43d..e63ebdc09a6edee005d1e9fb902b44ea14d1dc42 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -749,117 +749,6 @@ bool CompareOperation::IsCritical() {
}
-static inline void MarkIfNotLive(Expression* expr, List<AstNode*>* stack) {
- if (!expr->is_live()) {
- expr->mark_as_live();
- stack->Add(expr);
- }
-}
-
-
-// Overloaded functions for marking children of live code as live.
-void VariableProxy::ProcessNonLiveChildren(
- List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- // A reference to a stack-allocated variable depends on all the
- // definitions reaching it.
- BitVector* defs = reaching_definitions();
- if (defs != NULL) {
- ASSERT(var()->IsStackAllocated());
- // The first variable_count definitions are the initial parameter and
- // local declarations.
- for (int i = variable_count; i < defs->length(); i++) {
- if (defs->Contains(i)) {
- MarkIfNotLive(body_definitions->at(i - variable_count), stack);
- }
- }
- }
-}
-
-
-void Literal::ProcessNonLiveChildren(List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- // Leaf node, no children.
-}
-
-
-void Assignment::ProcessNonLiveChildren(
- List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- Property* prop = target()->AsProperty();
- VariableProxy* proxy = target()->AsVariableProxy();
-
- if (prop != NULL) {
- if (!prop->key()->IsPropertyName()) MarkIfNotLive(prop->key(), stack);
- MarkIfNotLive(prop->obj(), stack);
- } else if (proxy == NULL) {
- // Must be a reference error.
- ASSERT(!target()->IsValidLeftHandSide());
- MarkIfNotLive(target(), stack);
- } else if (is_compound()) {
- // A variable assignment so lhs is an operand to the operation.
- MarkIfNotLive(target(), stack);
- }
- MarkIfNotLive(value(), stack);
-}
-
-
-void Property::ProcessNonLiveChildren(List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- if (!key()->IsPropertyName()) MarkIfNotLive(key(), stack);
- MarkIfNotLive(obj(), stack);
-}
-
-
-void Call::ProcessNonLiveChildren(List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- ZoneList<Expression*>* args = arguments();
- for (int i = args->length() - 1; i >= 0; i--) {
- MarkIfNotLive(args->at(i), stack);
- }
- MarkIfNotLive(expression(), stack);
-}
-
-
-void UnaryOperation::ProcessNonLiveChildren(
- List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- MarkIfNotLive(expression(), stack);
-}
-
-
-void CountOperation::ProcessNonLiveChildren(
- List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- MarkIfNotLive(expression(), stack);
-}
-
-
-void BinaryOperation::ProcessNonLiveChildren(
- List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- MarkIfNotLive(right(), stack);
- MarkIfNotLive(left(), stack);
-}
-
-
-void CompareOperation::ProcessNonLiveChildren(
- List<AstNode*>* stack,
- ZoneList<Expression*>* body_definitions,
- int variable_count) {
- MarkIfNotLive(right(), stack);
- MarkIfNotLive(left(), stack);
-}
-
-
// Implementation of a copy visitor. The visitor create a deep copy
// of ast nodes. Nodes that do not require a deep copy are copied
// with the default copy constructor.
« no previous file with comments | « src/ast.h ('k') | src/compiler.h » ('j') | src/data-flow.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698