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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); | 976 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
977 interpreter::Register first_return = | 977 interpreter::Register first_return = |
978 bytecode_iterator().GetRegisterOperand(3); | 978 bytecode_iterator().GetRegisterOperand(3); |
979 | 979 |
980 // Create node to perform the runtime call. | 980 // Create node to perform the runtime call. |
981 const Operator* call = javascript()->CallRuntime(functionId, arg_count); | 981 const Operator* call = javascript()->CallRuntime(functionId, arg_count); |
982 Node* return_pair = ProcessCallRuntimeArguments(call, first_arg, arg_count); | 982 Node* return_pair = ProcessCallRuntimeArguments(call, first_arg, arg_count); |
983 environment()->BindRegistersToProjections(first_return, return_pair, &states); | 983 environment()->BindRegistersToProjections(first_return, return_pair, &states); |
984 } | 984 } |
985 | 985 |
| 986 void BytecodeGraphBuilder::VisitInvokeIntrinsic() { |
| 987 FrameStateBeforeAndAfter states(this); |
| 988 Runtime::FunctionId functionId = static_cast<Runtime::FunctionId>( |
| 989 bytecode_iterator().GetRuntimeIdOperand(0)); |
| 990 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); |
| 991 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
| 992 |
| 993 // Create node to perform the runtime call. Turbofan will take care of the |
| 994 // lowering. |
| 995 const Operator* call = javascript()->CallRuntime(functionId, arg_count); |
| 996 Node* value = ProcessCallRuntimeArguments(call, first_arg, arg_count); |
| 997 environment()->BindAccumulator(value, &states); |
| 998 } |
| 999 |
986 Node* BytecodeGraphBuilder::ProcessCallNewArguments( | 1000 Node* BytecodeGraphBuilder::ProcessCallNewArguments( |
987 const Operator* call_new_op, Node* callee, Node* new_target, | 1001 const Operator* call_new_op, Node* callee, Node* new_target, |
988 interpreter::Register first_arg, size_t arity) { | 1002 interpreter::Register first_arg, size_t arity) { |
989 Node** all = local_zone()->NewArray<Node*>(arity); | 1003 Node** all = local_zone()->NewArray<Node*>(arity); |
990 all[0] = new_target; | 1004 all[0] = new_target; |
991 int first_arg_index = first_arg.index(); | 1005 int first_arg_index = first_arg.index(); |
992 for (int i = 1; i < static_cast<int>(arity) - 1; ++i) { | 1006 for (int i = 1; i < static_cast<int>(arity) - 1; ++i) { |
993 all[i] = environment()->LookupRegister( | 1007 all[i] = environment()->LookupRegister( |
994 interpreter::Register(first_arg_index + i - 1)); | 1008 interpreter::Register(first_arg_index + i - 1)); |
995 } | 1009 } |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 // Phi does not exist yet, introduce one. | 1636 // Phi does not exist yet, introduce one. |
1623 value = NewPhi(inputs, value, control); | 1637 value = NewPhi(inputs, value, control); |
1624 value->ReplaceInput(inputs - 1, other); | 1638 value->ReplaceInput(inputs - 1, other); |
1625 } | 1639 } |
1626 return value; | 1640 return value; |
1627 } | 1641 } |
1628 | 1642 |
1629 } // namespace compiler | 1643 } // namespace compiler |
1630 } // namespace internal | 1644 } // namespace internal |
1631 } // namespace v8 | 1645 } // namespace v8 |
OLD | NEW |