| 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/ast.h" | 8 #include "src/ast/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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 Node* GetFunctionClosure(); | 162 Node* GetFunctionClosure(); |
| 163 | 163 |
| 164 // Get or create the node that represents the incoming function context. | 164 // Get or create the node that represents the incoming function context. |
| 165 Node* GetFunctionContext(); | 165 Node* GetFunctionContext(); |
| 166 | 166 |
| 167 // Get or create the node that represents the incoming new target value. | 167 // Get or create the node that represents the incoming new target value. |
| 168 Node* GetNewTarget(); | 168 Node* GetNewTarget(); |
| 169 | 169 |
| 170 // Node creation helpers. | 170 // Node creation helpers. |
| 171 Node* NewNode(const Operator* op, bool incomplete = false) { | 171 Node* NewNode(const Operator* op, bool incomplete = false) { |
| 172 return MakeNode(op, 0, static_cast<Node**>(NULL), incomplete); | 172 return MakeNode(op, 0, static_cast<Node**>(nullptr), incomplete); |
| 173 } | 173 } |
| 174 | 174 |
| 175 Node* NewNode(const Operator* op, Node* n1) { | 175 Node* NewNode(const Operator* op, Node* n1) { |
| 176 return MakeNode(op, 1, &n1, false); | 176 return MakeNode(op, 1, &n1, false); |
| 177 } | 177 } |
| 178 | 178 |
| 179 Node* NewNode(const Operator* op, Node* n1, Node* n2) { | 179 Node* NewNode(const Operator* op, Node* n1, Node* n2) { |
| 180 Node* buffer[] = {n1, n2}; | 180 Node* buffer[] = {n1, n2}; |
| 181 return MakeNode(op, arraysize(buffer), buffer, false); | 181 return MakeNode(op, arraysize(buffer), buffer, false); |
| 182 } | 182 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 // Builders for binary operations. | 358 // Builders for binary operations. |
| 359 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op, | 359 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op, |
| 360 TypeFeedbackId feedback_id); | 360 TypeFeedbackId feedback_id); |
| 361 | 361 |
| 362 // Process arguments to a call by popping {arity} elements off the operand | 362 // Process arguments to a call by popping {arity} elements off the operand |
| 363 // stack and build a call node using the given call operator. | 363 // stack and build a call node using the given call operator. |
| 364 Node* ProcessArguments(const Operator* op, int arity); | 364 Node* ProcessArguments(const Operator* op, int arity); |
| 365 | 365 |
| 366 // =========================================================================== | 366 // =========================================================================== |
| 367 // The following build methods have the same contract as the above ones, but | 367 // The following build methods have the same contract as the above ones, but |
| 368 // they can also return {NULL} to indicate that no fragment was built. Note | 368 // they can also return {nullptr} to indicate that no fragment was built. Note |
| 369 // that these are optimizations, disabling any of them should still produce | 369 // that these are optimizations, disabling any of them should still produce |
| 370 // correct graphs. | 370 // correct graphs. |
| 371 | 371 |
| 372 // Optimization for variable load from global object. | 372 // Optimization for variable load from global object. |
| 373 Node* TryLoadGlobalConstant(Handle<Name> name); | 373 Node* TryLoadGlobalConstant(Handle<Name> name); |
| 374 | 374 |
| 375 // Optimization for variable load of dynamic lookup slot that is most likely | 375 // Optimization for variable load of dynamic lookup slot that is most likely |
| 376 // to resolve to a global slot or context slot (inferred from scope chain). | 376 // to resolve to a global slot or context slot (inferred from scope chain). |
| 377 Node* TryLoadDynamicVariable(Variable* variable, Handle<String> name, | 377 Node* TryLoadDynamicVariable(Variable* variable, Handle<String> name, |
| 378 BailoutId bailout_id, | 378 BailoutId bailout_id, |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 584 |
| 585 // Prepare environment to be used as loop header. | 585 // Prepare environment to be used as loop header. |
| 586 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 586 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
| 587 }; | 587 }; |
| 588 | 588 |
| 589 } // namespace compiler | 589 } // namespace compiler |
| 590 } // namespace internal | 590 } // namespace internal |
| 591 } // namespace v8 | 591 } // namespace v8 |
| 592 | 592 |
| 593 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 593 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| OLD | NEW |