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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 // =========================================================================== | 251 // =========================================================================== |
252 // The following build methods all generate graph fragments and return one | 252 // The following build methods all generate graph fragments and return one |
253 // resulting node. The operand stack height remains the same, variables and | 253 // resulting node. The operand stack height remains the same, variables and |
254 // other dependencies tracked by the environment might be mutated though. | 254 // other dependencies tracked by the environment might be mutated though. |
255 | 255 |
256 // Builder to create a receiver check for sloppy mode. | 256 // Builder to create a receiver check for sloppy mode. |
257 Node* BuildPatchReceiverToGlobalProxy(Node* receiver); | 257 Node* BuildPatchReceiverToGlobalProxy(Node* receiver); |
258 | 258 |
259 // Builders to create local function, script and block contexts. | 259 // Builders to create local function, script and block contexts. |
260 Node* BuildLocalFunctionContext(Node* context, Node* patched_receiver); | 260 Node* BuildLocalFunctionContext(Node* context); |
261 Node* BuildLocalScriptContext(Scope* scope); | 261 Node* BuildLocalScriptContext(Scope* scope); |
262 Node* BuildLocalBlockContext(Scope* scope); | 262 Node* BuildLocalBlockContext(Scope* scope); |
263 | 263 |
264 // Builder to create an arguments object if it is used. | 264 // Builder to create an arguments object if it is used. |
265 Node* BuildArgumentsObject(Variable* arguments); | 265 Node* BuildArgumentsObject(Variable* arguments); |
266 | 266 |
267 // Builder to create an array of rest parameters if used | 267 // Builder to create an array of rest parameters if used |
268 Node* BuildRestArgumentsArray(Variable* rest, int index); | 268 Node* BuildRestArgumentsArray(Variable* rest, int index); |
269 | 269 |
270 // Builder that assigns to the .this_function internal variable if needed. | 270 // Builder that assigns to the .this_function internal variable if needed. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 int stack_height() { | 428 int stack_height() { |
429 return static_cast<int>(values()->size()) - parameters_count_ - | 429 return static_cast<int>(values()->size()) - parameters_count_ - |
430 locals_count_; | 430 locals_count_; |
431 } | 431 } |
432 | 432 |
433 // Operations on parameter or local variables. | 433 // Operations on parameter or local variables. |
434 void Bind(Variable* variable, Node* node); | 434 void Bind(Variable* variable, Node* node); |
435 Node* Lookup(Variable* variable); | 435 Node* Lookup(Variable* variable); |
436 void MarkAllLocalsLive(); | 436 void MarkAllLocalsLive(); |
437 | 437 |
| 438 // Raw operations on parameter variables. |
| 439 void RawParameterBind(int index, Node* node); |
| 440 Node* RawParameterLookup(int index); |
| 441 |
438 // Operations on the context chain. | 442 // Operations on the context chain. |
439 Node* Context() const { return contexts_.back(); } | 443 Node* Context() const { return contexts_.back(); } |
440 void PushContext(Node* context) { contexts()->push_back(context); } | 444 void PushContext(Node* context) { contexts()->push_back(context); } |
441 void PopContext() { contexts()->pop_back(); } | 445 void PopContext() { contexts()->pop_back(); } |
442 void TrimContextChain(int trim_to_length) { | 446 void TrimContextChain(int trim_to_length) { |
443 contexts()->resize(trim_to_length); | 447 contexts()->resize(trim_to_length); |
444 } | 448 } |
445 | 449 |
446 // Operations on the operand stack. | 450 // Operations on the operand stack. |
447 void Push(Node* node) { | 451 void Push(Node* node) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 | 551 |
548 // Prepare environment to be used as loop header. | 552 // Prepare environment to be used as loop header. |
549 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 553 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
550 }; | 554 }; |
551 | 555 |
552 } // namespace compiler | 556 } // namespace compiler |
553 } // namespace internal | 557 } // namespace internal |
554 } // namespace v8 | 558 } // namespace v8 |
555 | 559 |
556 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 560 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |