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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 // is not null / undefined. | 1000 // is not null / undefined. |
1001 ConvertReceiverMode receiver_hint = ConvertReceiverMode::kAny; | 1001 ConvertReceiverMode receiver_hint = ConvertReceiverMode::kAny; |
1002 Node* callee = | 1002 Node* callee = |
1003 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1003 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
1004 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); | 1004 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); |
1005 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); | 1005 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
1006 VectorSlotPair feedback = | 1006 VectorSlotPair feedback = |
1007 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); | 1007 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); |
1008 | 1008 |
1009 // TODO(ishell): provide correct tail_call_mode value to CallFunction. | 1009 // TODO(ishell): provide correct tail_call_mode value to CallFunction. |
1010 const Operator* call = javascript()->CallFunction( | 1010 const Operator* call = |
1011 arg_count + 1, language_mode(), feedback, receiver_hint); | 1011 javascript()->CallFunction(arg_count + 1, feedback, receiver_hint); |
1012 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); | 1012 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); |
1013 environment()->BindAccumulator(value, &states); | 1013 environment()->BindAccumulator(value, &states); |
1014 } | 1014 } |
1015 | 1015 |
1016 void BytecodeGraphBuilder::VisitCall() { BuildCall(); } | 1016 void BytecodeGraphBuilder::VisitCall() { BuildCall(); } |
1017 | 1017 |
1018 void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); } | 1018 void BytecodeGraphBuilder::VisitCallWide() { BuildCall(); } |
1019 | 1019 |
1020 void BytecodeGraphBuilder::BuildCallJSRuntime() { | 1020 void BytecodeGraphBuilder::BuildCallJSRuntime() { |
1021 FrameStateBeforeAndAfter states(this); | 1021 FrameStateBeforeAndAfter states(this); |
1022 Node* callee = | 1022 Node* callee = |
1023 BuildLoadNativeContextField(bytecode_iterator().GetIndexOperand(0)); | 1023 BuildLoadNativeContextField(bytecode_iterator().GetIndexOperand(0)); |
1024 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); | 1024 interpreter::Register receiver = bytecode_iterator().GetRegisterOperand(1); |
1025 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); | 1025 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
1026 | 1026 |
1027 // Create node to perform the JS runtime call. | 1027 // Create node to perform the JS runtime call. |
1028 const Operator* call = | 1028 const Operator* call = javascript()->CallFunction(arg_count + 1); |
1029 javascript()->CallFunction(arg_count + 1, language_mode()); | |
1030 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); | 1029 Node* value = ProcessCallArguments(call, callee, receiver, arg_count + 1); |
1031 environment()->BindAccumulator(value, &states); | 1030 environment()->BindAccumulator(value, &states); |
1032 } | 1031 } |
1033 | 1032 |
1034 void BytecodeGraphBuilder::VisitCallJSRuntime() { BuildCallJSRuntime(); } | 1033 void BytecodeGraphBuilder::VisitCallJSRuntime() { BuildCallJSRuntime(); } |
1035 | 1034 |
1036 void BytecodeGraphBuilder::VisitCallJSRuntimeWide() { BuildCallJSRuntime(); } | 1035 void BytecodeGraphBuilder::VisitCallJSRuntimeWide() { BuildCallJSRuntime(); } |
1037 | 1036 |
1038 Node* BytecodeGraphBuilder::ProcessCallRuntimeArguments( | 1037 Node* BytecodeGraphBuilder::ProcessCallRuntimeArguments( |
1039 const Operator* call_runtime_op, interpreter::Register first_arg, | 1038 const Operator* call_runtime_op, interpreter::Register first_arg, |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 // Phi does not exist yet, introduce one. | 1745 // Phi does not exist yet, introduce one. |
1747 value = NewPhi(inputs, value, control); | 1746 value = NewPhi(inputs, value, control); |
1748 value->ReplaceInput(inputs - 1, other); | 1747 value->ReplaceInput(inputs - 1, other); |
1749 } | 1748 } |
1750 return value; | 1749 return value; |
1751 } | 1750 } |
1752 | 1751 |
1753 } // namespace compiler | 1752 } // namespace compiler |
1754 } // namespace internal | 1753 } // namespace internal |
1755 } // namespace v8 | 1754 } // namespace v8 |
OLD | NEW |