| 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 ControlScope control(this); | 561 ControlScope control(this); |
| 562 | 562 |
| 563 // TODO(mstarzinger): For now we cannot assume that the {this} parameter is | 563 // TODO(mstarzinger): For now we cannot assume that the {this} parameter is |
| 564 // not {the_hole}, because for derived classes {this} has a TDZ and the | 564 // not {the_hole}, because for derived classes {this} has a TDZ and the |
| 565 // JSConstructStubForDerived magically passes {the_hole} as a receiver. | 565 // JSConstructStubForDerived magically passes {the_hole} as a receiver. |
| 566 if (scope->has_this_declaration() && scope->receiver()->is_const_mode()) { | 566 if (scope->has_this_declaration() && scope->receiver()->is_const_mode()) { |
| 567 env.RawParameterBind(0, jsgraph()->TheHoleConstant()); | 567 env.RawParameterBind(0, jsgraph()->TheHoleConstant()); |
| 568 } | 568 } |
| 569 | 569 |
| 570 // Build local context only if there are context allocated variables. | 570 // Build local context only if there are context allocated variables. |
| 571 if (info()->num_heap_slots() > 0) { | 571 if (scope->num_heap_slots() > 0) { |
| 572 // Push a new inner context scope for the current activation. | 572 // Push a new inner context scope for the current activation. |
| 573 Node* inner_context = BuildLocalActivationContext(GetFunctionContext()); | 573 Node* inner_context = BuildLocalActivationContext(GetFunctionContext()); |
| 574 ContextScope top_context(this, scope, inner_context); | 574 ContextScope top_context(this, scope, inner_context); |
| 575 CreateGraphBody(stack_check); | 575 CreateGraphBody(stack_check); |
| 576 } else { | 576 } else { |
| 577 // Simply use the outer function context in building the graph. | 577 // Simply use the outer function context in building the graph. |
| 578 CreateGraphBody(stack_check); | 578 CreateGraphBody(stack_check); |
| 579 } | 579 } |
| 580 | 580 |
| 581 // Finish the basic structure of the graph. | 581 // Finish the basic structure of the graph. |
| (...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4369 // Phi does not exist yet, introduce one. | 4369 // Phi does not exist yet, introduce one. |
| 4370 value = NewPhi(inputs, value, control); | 4370 value = NewPhi(inputs, value, control); |
| 4371 value->ReplaceInput(inputs - 1, other); | 4371 value->ReplaceInput(inputs - 1, other); |
| 4372 } | 4372 } |
| 4373 return value; | 4373 return value; |
| 4374 } | 4374 } |
| 4375 | 4375 |
| 4376 } // namespace compiler | 4376 } // namespace compiler |
| 4377 } // namespace internal | 4377 } // namespace internal |
| 4378 } // namespace v8 | 4378 } // namespace v8 |
| OLD | NEW |