| 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 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| 7 | 7 |
| 8 #include "src/ast.h" | 8 #include "src/ast.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/liveness-analyzer.h" | 10 #include "src/compiler/liveness-analyzer.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 Node* BuildThrow(Node* exception_value); | 348 Node* BuildThrow(Node* exception_value); |
| 349 | 349 |
| 350 // Builders for binary operations. | 350 // Builders for binary operations. |
| 351 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op); | 351 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op); |
| 352 | 352 |
| 353 // Process arguments to a call by popping {arity} elements off the operand | 353 // Process arguments to a call by popping {arity} elements off the operand |
| 354 // stack and build a call node using the given call operator. | 354 // stack and build a call node using the given call operator. |
| 355 Node* ProcessArguments(const Operator* op, int arity); | 355 Node* ProcessArguments(const Operator* op, int arity); |
| 356 | 356 |
| 357 // =========================================================================== | 357 // =========================================================================== |
| 358 // The following build methods have the same contract as the above ones, but |
| 359 // they can also return {NULL} to indicate that no fragment was built. Note |
| 360 // that these are optimizations, disabling any of them should still produce |
| 361 // correct graphs. |
| 362 |
| 363 // Optimization for variable load from global object. |
| 364 Node* TryLoadGlobalConstant(Handle<Name> name); |
| 365 |
| 366 // Optimizations for automatic type conversion. |
| 367 Node* TryFastToBoolean(Node* input); |
| 368 Node* TryFastToName(Node* input); |
| 369 |
| 370 // =========================================================================== |
| 358 // The following visitation methods all recursively visit a subtree of the | 371 // The following visitation methods all recursively visit a subtree of the |
| 359 // underlying AST and extent the graph. The operand stack is mutated in a way | 372 // underlying AST and extent the graph. The operand stack is mutated in a way |
| 360 // consistent with other compilers: | 373 // consistent with other compilers: |
| 361 // - Expressions pop operands and push result, depending on {AstContext}. | 374 // - Expressions pop operands and push result, depending on {AstContext}. |
| 362 // - Statements keep the operand stack balanced. | 375 // - Statements keep the operand stack balanced. |
| 363 | 376 |
| 364 // Visit statements. | 377 // Visit statements. |
| 365 void VisitIfNotNull(Statement* stmt); | 378 void VisitIfNotNull(Statement* stmt); |
| 366 void VisitInScope(Statement* stmt, Scope* scope, Node* context); | 379 void VisitInScope(Statement* stmt, Scope* scope, Node* context); |
| 367 | 380 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 | 566 |
| 554 // Prepare environment to be used as loop header. | 567 // Prepare environment to be used as loop header. |
| 555 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 568 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
| 556 }; | 569 }; |
| 557 | 570 |
| 558 } // namespace compiler | 571 } // namespace compiler |
| 559 } // namespace internal | 572 } // namespace internal |
| 560 } // namespace v8 | 573 } // namespace v8 |
| 561 | 574 |
| 562 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 575 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| OLD | NEW |