OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 3034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3045 // sync with full codegen which doesn't prepare the proper bailout point (see | 3045 // sync with full codegen which doesn't prepare the proper bailout point (see |
3046 // the implementation of FullCodeGenerator::VisitForControl). | 3046 // the implementation of FullCodeGenerator::VisitForControl). |
3047 if (ast_context()->IsTest()) return environment()->Push(value); | 3047 if (ast_context()->IsTest()) return environment()->Push(value); |
3048 ast_context()->ProduceValue(expr, value); | 3048 ast_context()->ProduceValue(expr, value); |
3049 } | 3049 } |
3050 | 3050 |
3051 | 3051 |
3052 void AstGraphBuilder::VisitComma(BinaryOperation* expr) { | 3052 void AstGraphBuilder::VisitComma(BinaryOperation* expr) { |
3053 VisitForEffect(expr->left()); | 3053 VisitForEffect(expr->left()); |
3054 Visit(expr->right()); | 3054 Visit(expr->right()); |
| 3055 // Skip plugging AST evaluation contexts of the test kind. This is to stay in |
| 3056 // sync with full codegen which doesn't prepare the proper bailout point (see |
| 3057 // the implementation of FullCodeGenerator::VisitForControl). |
| 3058 if (ast_context()->IsTest()) return; |
3055 ast_context()->ReplaceValue(expr); | 3059 ast_context()->ReplaceValue(expr); |
3056 } | 3060 } |
3057 | 3061 |
3058 | 3062 |
3059 void AstGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) { | 3063 void AstGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) { |
3060 bool is_logical_and = expr->op() == Token::AND; | 3064 bool is_logical_and = expr->op() == Token::AND; |
3061 IfBuilder compare_if(this); | 3065 IfBuilder compare_if(this); |
3062 // Only use an AST evaluation context of the value kind when this expression | 3066 // Only use an AST evaluation context of the value kind when this expression |
3063 // is evaluated as value as well. Otherwise stick to a test context which is | 3067 // is evaluated as value as well. Otherwise stick to a test context which is |
3064 // in sync with full codegen (see FullCodeGenerator::VisitLogicalExpression). | 3068 // in sync with full codegen (see FullCodeGenerator::VisitLogicalExpression). |
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4367 // Phi does not exist yet, introduce one. | 4371 // Phi does not exist yet, introduce one. |
4368 value = NewPhi(inputs, value, control); | 4372 value = NewPhi(inputs, value, control); |
4369 value->ReplaceInput(inputs - 1, other); | 4373 value->ReplaceInput(inputs - 1, other); |
4370 } | 4374 } |
4371 return value; | 4375 return value; |
4372 } | 4376 } |
4373 | 4377 |
4374 } // namespace compiler | 4378 } // namespace compiler |
4375 } // namespace internal | 4379 } // namespace internal |
4376 } // namespace v8 | 4380 } // namespace v8 |
OLD | NEW |