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 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 | 1770 |
1771 | 1771 |
1772 void BytecodeGraphBuilder::VisitReturn( | 1772 void BytecodeGraphBuilder::VisitReturn( |
1773 const interpreter::BytecodeArrayIterator& iterator) { | 1773 const interpreter::BytecodeArrayIterator& iterator) { |
1774 Node* control = | 1774 Node* control = |
1775 NewNode(common()->Return(), environment()->LookupAccumulator()); | 1775 NewNode(common()->Return(), environment()->LookupAccumulator()); |
1776 UpdateControlDependencyToLeaveFunction(control); | 1776 UpdateControlDependencyToLeaveFunction(control); |
1777 set_environment(nullptr); | 1777 set_environment(nullptr); |
1778 } | 1778 } |
1779 | 1779 |
| 1780 void BytecodeGraphBuilder::BuildIntrinsicOneArg( |
| 1781 const interpreter::BytecodeArrayIterator& iterator) { |
| 1782 FrameStateBeforeAndAfter states(this, iterator); |
| 1783 Runtime::FunctionId functionId = |
| 1784 static_cast<Runtime::FunctionId>(iterator.GetIndexOperand(0)); |
| 1785 interpreter::Register first_arg = iterator.GetRegisterOperand(1); |
| 1786 size_t arg_count = 1; |
| 1787 |
| 1788 // Create node to perform the runtime call. |
| 1789 const Operator* call = javascript()->CallRuntime(functionId, arg_count); |
| 1790 Node* value = ProcessCallRuntimeArguments(call, first_arg, arg_count); |
| 1791 environment()->BindAccumulator(value, &states); |
| 1792 } |
| 1793 |
| 1794 void BytecodeGraphBuilder::VisitIntrinsicOneArg( |
| 1795 const interpreter::BytecodeArrayIterator& iterator) { |
| 1796 BuildIntrinsicOneArg(iterator); |
| 1797 } |
1780 | 1798 |
1781 void BytecodeGraphBuilder::BuildForInPrepare( | 1799 void BytecodeGraphBuilder::BuildForInPrepare( |
1782 const interpreter::BytecodeArrayIterator& iterator) { | 1800 const interpreter::BytecodeArrayIterator& iterator) { |
1783 FrameStateBeforeAndAfter states(this, iterator); | 1801 FrameStateBeforeAndAfter states(this, iterator); |
1784 Node* receiver = environment()->LookupAccumulator(); | 1802 Node* receiver = environment()->LookupAccumulator(); |
1785 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver); | 1803 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver); |
1786 environment()->BindRegistersToProjections(iterator.GetRegisterOperand(0), | 1804 environment()->BindRegistersToProjections(iterator.GetRegisterOperand(0), |
1787 prepare, &states); | 1805 prepare, &states); |
1788 } | 1806 } |
1789 | 1807 |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 | 2166 |
2149 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 2167 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
2150 if (environment()->IsMarkedAsUnreachable()) return; | 2168 if (environment()->IsMarkedAsUnreachable()) return; |
2151 environment()->MarkAsUnreachable(); | 2169 environment()->MarkAsUnreachable(); |
2152 exit_controls_.push_back(exit); | 2170 exit_controls_.push_back(exit); |
2153 } | 2171 } |
2154 | 2172 |
2155 } // namespace compiler | 2173 } // namespace compiler |
2156 } // namespace internal | 2174 } // namespace internal |
2157 } // namespace v8 | 2175 } // namespace v8 |
OLD | NEW |