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

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

Issue 1691433002: [Interpreter] Rename GetCountOperand to GetRegisterCountOperand. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Solve collision between CLs in flight. Created 4 years, 10 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 | « no previous file | src/interpreter/bytecode-array-iterator.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 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 1043
1044 void BytecodeGraphBuilder::BuildCall() { 1044 void BytecodeGraphBuilder::BuildCall() {
1045 FrameStateBeforeAndAfter states(this); 1045 FrameStateBeforeAndAfter states(this);
1046 // TODO(rmcilroy): Set receiver_hint correctly based on whether the receiver 1046 // TODO(rmcilroy): Set receiver_hint correctly based on whether the receiver
1047 // register has been loaded with null / undefined explicitly or we are sure it 1047 // register has been loaded with null / undefined explicitly or we are sure it
1048 // is not null / undefined. 1048 // is not null / undefined.
1049 ConvertReceiverMode receiver_hint = ConvertReceiverMode::kAny; 1049 ConvertReceiverMode receiver_hint = ConvertReceiverMode::kAny;
1050 Node* callee = 1050 Node* callee =
1051 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); 1051 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
1052 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); 1052 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1);
1053 size_t arg_count = bytecode_iterator().GetCountOperand(2); 1053 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
1054 VectorSlotPair feedback = 1054 VectorSlotPair feedback =
1055 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); 1055 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3));
1056 1056
1057 // TODO(ishell): provide correct tail_call_mode value to CallFunction. 1057 // TODO(ishell): provide correct tail_call_mode value to CallFunction.
1058 const Operator* call = javascript()->CallFunction( 1058 const Operator* call = javascript()->CallFunction(
1059 arg_count + 1, language_mode(), feedback, receiver_hint); 1059 arg_count + 1, language_mode(), feedback, receiver_hint);
1060 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); 1060 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1);
1061 environment()->BindAccumulator(value, &states); 1061 environment()->BindAccumulator(value, &states);
1062 } 1062 }
1063 1063
1064 void BytecodeGraphBuilder::VisitCall() { BuildCall(); } 1064 void BytecodeGraphBuilder::VisitCall() { BuildCall(); }
1065 1065
1066 void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); } 1066 void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); }
1067 1067
1068 void BytecodeGraphBuilder::BuildCallJSRuntime() { 1068 void BytecodeGraphBuilder::BuildCallJSRuntime() {
1069 FrameStateBeforeAndAfter states(this); 1069 FrameStateBeforeAndAfter states(this);
1070 Node* callee = 1070 Node* callee =
1071 BuildLoadNativeContextField(bytecode_iterator().GetIndexOperand(0)); 1071 BuildLoadNativeContextField(bytecode_iterator().GetIndexOperand(0));
1072 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); 1072 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1);
1073 size_t arg_count = bytecode_iterator().GetCountOperand(2); 1073 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
1074 1074
1075 // Create node to perform the JS runtime call. 1075 // Create node to perform the JS runtime call.
1076 const Operator* call = 1076 const Operator* call =
1077 javascript()->CallFunction(arg_count + 1, language_mode()); 1077 javascript()->CallFunction(arg_count + 1, language_mode());
1078 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); 1078 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1);
1079 environment()->BindAccumulator(value, &states); 1079 environment()->BindAccumulator(value, &states);
1080 } 1080 }
1081 1081
1082 void BytecodeGraphBuilder::VisitCallJSRuntime() { BuildCallJSRuntime(); } 1082 void BytecodeGraphBuilder::VisitCallJSRuntime() { BuildCallJSRuntime(); }
1083 1083
(...skipping 10 matching lines...) Expand all
1094 } 1094 }
1095 Node* value = MakeNode(call_runtime_op, static_cast<int>(arity), all, false); 1095 Node* value = MakeNode(call_runtime_op, static_cast<int>(arity), all, false);
1096 return value; 1096 return value;
1097 } 1097 }
1098 1098
1099 void BytecodeGraphBuilder::BuildCallRuntime() { 1099 void BytecodeGraphBuilder::BuildCallRuntime() {
1100 FrameStateBeforeAndAfter states(this); 1100 FrameStateBeforeAndAfter states(this);
1101 Runtime::FunctionId functionId = 1101 Runtime::FunctionId functionId =
1102 static_cast<Runtime::FunctionId>(bytecode_iterator().GetIndexOperand(0)); 1102 static_cast<Runtime::FunctionId>(bytecode_iterator().GetIndexOperand(0));
1103 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); 1103 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
1104 size_t arg_count = bytecode_iterator().GetCountOperand(2); 1104 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
1105 1105
1106 // Create node to perform the runtime call. 1106 // Create node to perform the runtime call.
1107 const Operator* call = javascript()->CallRuntime(functionId, arg_count); 1107 const Operator* call = javascript()->CallRuntime(functionId, arg_count);
1108 Node* value = ProcessCallRuntimeArguments(call, first_arg, arg_count); 1108 Node* value = ProcessCallRuntimeArguments(call, first_arg, arg_count);
1109 environment()->BindAccumulator(value, &states); 1109 environment()->BindAccumulator(value, &states);
1110 } 1110 }
1111 1111
1112 void BytecodeGraphBuilder::VisitCallRuntime() { BuildCallRuntime(); } 1112 void BytecodeGraphBuilder::VisitCallRuntime() { BuildCallRuntime(); }
1113 1113
1114 void BytecodeGraphBuilder::VisitCallRuntimeWide() { BuildCallRuntime(); } 1114 void BytecodeGraphBuilder::VisitCallRuntimeWide() { BuildCallRuntime(); }
1115 1115
1116 void BytecodeGraphBuilder::BuildCallRuntimeForPair() { 1116 void BytecodeGraphBuilder::BuildCallRuntimeForPair() {
1117 FrameStateBeforeAndAfter states(this); 1117 FrameStateBeforeAndAfter states(this);
1118 Runtime::FunctionId functionId = 1118 Runtime::FunctionId functionId =
1119 static_cast<Runtime::FunctionId>(bytecode_iterator().GetIndexOperand(0)); 1119 static_cast<Runtime::FunctionId>(bytecode_iterator().GetIndexOperand(0));
1120 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); 1120 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
1121 size_t arg_count = bytecode_iterator().GetCountOperand(2); 1121 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
1122 interpreter::Register first_return = 1122 interpreter::Register first_return =
1123 bytecode_iterator().GetRegisterOperand(3); 1123 bytecode_iterator().GetRegisterOperand(3);
1124 1124
1125 // Create node to perform the runtime call. 1125 // Create node to perform the runtime call.
1126 const Operator* call = javascript()->CallRuntime(functionId, arg_count); 1126 const Operator* call = javascript()->CallRuntime(functionId, arg_count);
1127 Node* return_pair = ProcessCallRuntimeArguments(call, first_arg, arg_count); 1127 Node* return_pair = ProcessCallRuntimeArguments(call, first_arg, arg_count);
1128 environment()->BindRegistersToProjections(first_return, return_pair, &states); 1128 environment()->BindRegistersToProjections(first_return, return_pair, &states);
1129 } 1129 }
1130 1130
1131 void BytecodeGraphBuilder::VisitCallRuntimeForPair() { 1131 void BytecodeGraphBuilder::VisitCallRuntimeForPair() {
(...skipping 18 matching lines...) Expand all
1150 // Original constructor is the same as the callee. 1150 // Original constructor is the same as the callee.
1151 all[arity - 1] = environment()->LookupRegister(callee); 1151 all[arity - 1] = environment()->LookupRegister(callee);
1152 Node* value = MakeNode(call_new_op, static_cast<int>(arity), all, false); 1152 Node* value = MakeNode(call_new_op, static_cast<int>(arity), all, false);
1153 return value; 1153 return value;
1154 } 1154 }
1155 1155
1156 void BytecodeGraphBuilder::BuildCallConstruct() { 1156 void BytecodeGraphBuilder::BuildCallConstruct() {
1157 FrameStateBeforeAndAfter states(this); 1157 FrameStateBeforeAndAfter states(this);
1158 interpreter::Register callee = bytecode_iterator().GetRegisterOperand(0); 1158 interpreter::Register callee = bytecode_iterator().GetRegisterOperand(0);
1159 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); 1159 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
1160 size_t arg_count = bytecode_iterator().GetCountOperand(2); 1160 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
1161 1161
1162 // TODO(turbofan): Pass the feedback here. 1162 // TODO(turbofan): Pass the feedback here.
1163 const Operator* call = javascript()->CallConstruct( 1163 const Operator* call = javascript()->CallConstruct(
1164 static_cast<int>(arg_count) + 2, VectorSlotPair()); 1164 static_cast<int>(arg_count) + 2, VectorSlotPair());
1165 Node* value = ProcessCallNewArguments(call, callee, first_arg, arg_count + 2); 1165 Node* value = ProcessCallNewArguments(call, callee, first_arg, arg_count + 2);
1166 environment()->BindAccumulator(value, &states); 1166 environment()->BindAccumulator(value, &states);
1167 } 1167 }
1168 1168
1169 void BytecodeGraphBuilder::VisitNew() { BuildCallConstruct(); } 1169 void BytecodeGraphBuilder::VisitNew() { BuildCallConstruct(); }
1170 1170
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 // Phi does not exist yet, introduce one. 1794 // Phi does not exist yet, introduce one.
1795 value = NewPhi(inputs, value, control); 1795 value = NewPhi(inputs, value, control);
1796 value->ReplaceInput(inputs - 1, other); 1796 value->ReplaceInput(inputs - 1, other);
1797 } 1797 }
1798 return value; 1798 return value;
1799 } 1799 }
1800 1800
1801 } // namespace compiler 1801 } // namespace compiler
1802 } // namespace internal 1802 } // namespace internal
1803 } // namespace v8 1803 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698