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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1421 Node* node = NewNode(javascript()->StackCheck()); | 1421 Node* node = NewNode(javascript()->StackCheck()); |
1422 environment()->RecordAfterState(node, &states); | 1422 environment()->RecordAfterState(node, &states); |
1423 } | 1423 } |
1424 | 1424 |
1425 void BytecodeGraphBuilder::VisitReturn() { | 1425 void BytecodeGraphBuilder::VisitReturn() { |
1426 Node* control = | 1426 Node* control = |
1427 NewNode(common()->Return(), environment()->LookupAccumulator()); | 1427 NewNode(common()->Return(), environment()->LookupAccumulator()); |
1428 MergeControlToLeaveFunction(control); | 1428 MergeControlToLeaveFunction(control); |
1429 } | 1429 } |
1430 | 1430 |
1431 void BytecodeGraphBuilder::BuildInvokeIntrinsic() { | |
rmcilroy
2016/03/08 11:19:30
nit - move up below VisitCallRuntimeForPairWide
epertoso
2016/03/08 14:11:09
Done.
| |
1432 FrameStateBeforeAndAfter states(this); | |
1433 Runtime::FunctionId functionId = | |
1434 static_cast<Runtime::FunctionId>(bytecode_iterator().GetIndexOperand(0)); | |
1435 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); | |
1436 int arg_count = bytecode_iterator().GetRegisterCountOperand(2); | |
1437 | |
1438 // Create node to perform the runtime call. | |
1439 const Operator* call = javascript()->CallRuntime(functionId, arg_count); | |
1440 Node* value = ProcessCallRuntimeArguments(call, first_arg, arg_count); | |
1441 environment()->BindAccumulator(value, &states); | |
1442 } | |
1443 | |
1444 void BytecodeGraphBuilder::VisitInvokeIntrinsic() { BuildInvokeIntrinsic(); } | |
1445 | |
1446 void BytecodeGraphBuilder::VisitInvokeIntrinsicWide() { | |
1447 BuildInvokeIntrinsic(); | |
1448 } | |
1449 | |
1431 void BytecodeGraphBuilder::VisitDebugger() { | 1450 void BytecodeGraphBuilder::VisitDebugger() { |
1432 FrameStateBeforeAndAfter states(this); | 1451 FrameStateBeforeAndAfter states(this); |
1433 Node* call = | 1452 Node* call = |
1434 NewNode(javascript()->CallRuntime(Runtime::kHandleDebuggerStatement)); | 1453 NewNode(javascript()->CallRuntime(Runtime::kHandleDebuggerStatement)); |
1435 environment()->BindAccumulator(call, &states); | 1454 environment()->BindAccumulator(call, &states); |
1436 } | 1455 } |
1437 | 1456 |
1438 // We cannot create a graph from the debugger copy of the bytecode array. | 1457 // We cannot create a graph from the debugger copy of the bytecode array. |
1439 #define DEBUG_BREAK(Name, ...) \ | 1458 #define DEBUG_BREAK(Name, ...) \ |
1440 void BytecodeGraphBuilder::Visit##Name() { UNREACHABLE(); } | 1459 void BytecodeGraphBuilder::Visit##Name() { UNREACHABLE(); } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1757 // Phi does not exist yet, introduce one. | 1776 // Phi does not exist yet, introduce one. |
1758 value = NewPhi(inputs, value, control); | 1777 value = NewPhi(inputs, value, control); |
1759 value->ReplaceInput(inputs - 1, other); | 1778 value->ReplaceInput(inputs - 1, other); |
1760 } | 1779 } |
1761 return value; | 1780 return value; |
1762 } | 1781 } |
1763 | 1782 |
1764 } // namespace compiler | 1783 } // namespace compiler |
1765 } // namespace internal | 1784 } // namespace internal |
1766 } // namespace v8 | 1785 } // namespace v8 |
OLD | NEW |