Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1146063006: Fix arrow functions requiring context without slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup test case. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698