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

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

Issue 2187523002: [interpreter] Add CreateFunctionContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fncontextstubslotparam
Patch Set: fix bytecode graph builder Created 4 years, 4 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.cc ('k') | src/interpreter/bytecode-array-builder.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/compiler/bytecode-branch-analysis.h" 7 #include "src/compiler/bytecode-branch-analysis.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/operator-properties.h" 9 #include "src/compiler/operator-properties.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 void BytecodeGraphBuilder::VisitCreateClosure() { 898 void BytecodeGraphBuilder::VisitCreateClosure() {
899 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast( 899 Handle<SharedFunctionInfo> shared_info = Handle<SharedFunctionInfo>::cast(
900 bytecode_iterator().GetConstantForIndexOperand(0)); 900 bytecode_iterator().GetConstantForIndexOperand(0));
901 PretenureFlag tenured = 901 PretenureFlag tenured =
902 bytecode_iterator().GetFlagOperand(1) ? TENURED : NOT_TENURED; 902 bytecode_iterator().GetFlagOperand(1) ? TENURED : NOT_TENURED;
903 const Operator* op = javascript()->CreateClosure(shared_info, tenured); 903 const Operator* op = javascript()->CreateClosure(shared_info, tenured);
904 Node* closure = NewNode(op); 904 Node* closure = NewNode(op);
905 environment()->BindAccumulator(closure); 905 environment()->BindAccumulator(closure);
906 } 906 }
907 907
908 void BytecodeGraphBuilder::VisitCreateFunctionContext() {
909 uint32_t slots = bytecode_iterator().GetIndexOperand(0);
910 const Operator* op = javascript()->CreateFunctionContext(slots);
911 Node* context = NewNode(op, GetFunctionClosure());
912 environment()->BindAccumulator(context);
913 }
914
908 void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) { 915 void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) {
909 FrameStateBeforeAndAfter states(this); 916 FrameStateBeforeAndAfter states(this);
910 const Operator* op = javascript()->CreateArguments(type); 917 const Operator* op = javascript()->CreateArguments(type);
911 Node* object = NewNode(op, GetFunctionClosure()); 918 Node* object = NewNode(op, GetFunctionClosure());
912 environment()->BindAccumulator(object, &states); 919 environment()->BindAccumulator(object, &states);
913 } 920 }
914 921
915 void BytecodeGraphBuilder::VisitCreateMappedArguments() { 922 void BytecodeGraphBuilder::VisitCreateMappedArguments() {
916 BuildCreateArguments(CreateArgumentsType::kMappedArguments); 923 BuildCreateArguments(CreateArgumentsType::kMappedArguments);
917 } 924 }
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 // Phi does not exist yet, introduce one. 1836 // Phi does not exist yet, introduce one.
1830 value = NewPhi(inputs, value, control); 1837 value = NewPhi(inputs, value, control);
1831 value->ReplaceInput(inputs - 1, other); 1838 value->ReplaceInput(inputs - 1, other);
1832 } 1839 }
1833 return value; 1840 return value;
1834 } 1841 }
1835 1842
1836 } // namespace compiler 1843 } // namespace compiler
1837 } // namespace internal 1844 } // namespace internal
1838 } // namespace v8 1845 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698