| OLD | NEW |
| 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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 ConvertReceiverMode receiver_hint = ConvertReceiverMode::kAny; | 1104 ConvertReceiverMode receiver_hint = ConvertReceiverMode::kAny; |
| 1105 Node* callee = | 1105 Node* callee = |
| 1106 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1106 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 1107 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); | 1107 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); |
| 1108 size_t arg_count = bytecode_iterator().GetCountOperand(2); | 1108 size_t arg_count = bytecode_iterator().GetCountOperand(2); |
| 1109 VectorSlotPair feedback = | 1109 VectorSlotPair feedback = |
| 1110 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); | 1110 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); |
| 1111 | 1111 |
| 1112 // TODO(ishell): provide correct tail_call_mode value to CallFunction. | 1112 // TODO(ishell): provide correct tail_call_mode value to CallFunction. |
| 1113 const Operator* call = javascript()->CallFunction( | 1113 const Operator* call = javascript()->CallFunction( |
| 1114 arg_count + 2, language_mode(), feedback, receiver_hint); | 1114 arg_count + 1, language_mode(), feedback, receiver_hint); |
| 1115 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 2); | 1115 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); |
| 1116 environment()->BindAccumulator(value, &states); | 1116 environment()->BindAccumulator(value, &states); |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 void BytecodeGraphBuilder::VisitCall() { BuildCall(); } | 1119 void BytecodeGraphBuilder::VisitCall() { BuildCall(); } |
| 1120 | 1120 |
| 1121 void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); } | 1121 void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); } |
| 1122 | 1122 |
| 1123 void BytecodeGraphBuilder::BuildCallJSRuntime() { | 1123 void BytecodeGraphBuilder::BuildCallJSRuntime() { |
| 1124 FrameStateBeforeAndAfter states(this); | 1124 FrameStateBeforeAndAfter states(this); |
| 1125 Node* callee = | 1125 Node* callee = |
| 1126 BuildLoadNativeContextField(bytecode_iterator().GetIndexOperand(0)); | 1126 BuildLoadNativeContextField(bytecode_iterator().GetIndexOperand(0)); |
| 1127 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); | 1127 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); |
| 1128 size_t arg_count = bytecode_iterator().GetCountOperand(2); | 1128 size_t arg_count = bytecode_iterator().GetCountOperand(2); |
| 1129 | 1129 |
| 1130 // Create node to perform the JS runtime call. | 1130 // Create node to perform the JS runtime call. |
| 1131 const Operator* call = | 1131 const Operator* call = |
| 1132 javascript()->CallFunction(arg_count + 2, language_mode()); | 1132 javascript()->CallFunction(arg_count + 1, language_mode()); |
| 1133 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 2); | 1133 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); |
| 1134 environment()->BindAccumulator(value, &states); | 1134 environment()->BindAccumulator(value, &states); |
| 1135 } | 1135 } |
| 1136 | 1136 |
| 1137 void BytecodeGraphBuilder::VisitCallJSRuntime() { BuildCallJSRuntime(); } | 1137 void BytecodeGraphBuilder::VisitCallJSRuntime() { BuildCallJSRuntime(); } |
| 1138 | 1138 |
| 1139 void BytecodeGraphBuilder::VisitCallJSRuntimeWide() { BuildCallJSRuntime(); } | 1139 void BytecodeGraphBuilder::VisitCallJSRuntimeWide() { BuildCallJSRuntime(); } |
| 1140 | 1140 |
| 1141 Node* BytecodeGraphBuilder::ProcessCallRuntimeArguments( | 1141 Node* BytecodeGraphBuilder::ProcessCallRuntimeArguments( |
| 1142 const Operator* call_runtime_op, interpreter::Register first_arg, | 1142 const Operator* call_runtime_op, interpreter::Register first_arg, |
| 1143 size_t arity) { | 1143 size_t arity) { |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1828 // Phi does not exist yet, introduce one. | 1828 // Phi does not exist yet, introduce one. |
| 1829 value = NewPhi(inputs, value, control); | 1829 value = NewPhi(inputs, value, control); |
| 1830 value->ReplaceInput(inputs - 1, other); | 1830 value->ReplaceInput(inputs - 1, other); |
| 1831 } | 1831 } |
| 1832 return value; | 1832 return value; |
| 1833 } | 1833 } |
| 1834 | 1834 |
| 1835 } // namespace compiler | 1835 } // namespace compiler |
| 1836 } // namespace internal | 1836 } // namespace internal |
| 1837 } // namespace v8 | 1837 } // namespace v8 |
| OLD | NEW |