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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 Node* patched_receiver = nullptr; | 518 Node* patched_receiver = nullptr; |
519 if (scope->has_this_declaration()) { | 519 if (scope->has_this_declaration()) { |
520 Node* original_receiver = NewNode(common()->Parameter(0), graph()->start()); | 520 Node* original_receiver = NewNode(common()->Parameter(0), graph()->start()); |
521 patched_receiver = BuildPatchReceiverToGlobalProxy(original_receiver); | 521 patched_receiver = BuildPatchReceiverToGlobalProxy(original_receiver); |
522 if (scope->receiver()->IsStackAllocated()) { | 522 if (scope->receiver()->IsStackAllocated()) { |
523 env.Bind(scope->receiver(), patched_receiver); | 523 env.Bind(scope->receiver(), patched_receiver); |
524 } | 524 } |
525 } | 525 } |
526 | 526 |
527 // Build function context only if there are context allocated variables. | 527 // Build function context only if there are context allocated variables. |
528 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 528 if (info()->num_heap_slots() > 0) { |
529 if (heap_slots > 0) { | |
530 // Push a new inner context scope for the function. | 529 // Push a new inner context scope for the function. |
531 Node* inner_context = | 530 Node* inner_context = |
532 BuildLocalFunctionContext(function_context_.get(), patched_receiver); | 531 BuildLocalFunctionContext(function_context_.get(), patched_receiver); |
533 ContextScope top_context(this, scope, inner_context); | 532 ContextScope top_context(this, scope, inner_context); |
534 CreateGraphBody(stack_check); | 533 CreateGraphBody(stack_check); |
535 } else { | 534 } else { |
536 // Simply use the outer function context in building the graph. | 535 // Simply use the outer function context in building the graph. |
537 CreateGraphBody(stack_check); | 536 CreateGraphBody(stack_check); |
538 } | 537 } |
539 | 538 |
(...skipping 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3779 // Phi does not exist yet, introduce one. | 3778 // Phi does not exist yet, introduce one. |
3780 value = NewPhi(inputs, value, control); | 3779 value = NewPhi(inputs, value, control); |
3781 value->ReplaceInput(inputs - 1, other); | 3780 value->ReplaceInput(inputs - 1, other); |
3782 } | 3781 } |
3783 return value; | 3782 return value; |
3784 } | 3783 } |
3785 | 3784 |
3786 } // namespace compiler | 3785 } // namespace compiler |
3787 } // namespace internal | 3786 } // namespace internal |
3788 } // namespace v8 | 3787 } // namespace v8 |
OLD | NEW |