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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 Node* value = environment()->LookupAccumulator(); | 1361 Node* value = environment()->LookupAccumulator(); |
1362 // TODO(mythria): Change to Runtime::kThrow when we have deoptimization | 1362 // TODO(mythria): Change to Runtime::kThrow when we have deoptimization |
1363 // information support in the interpreter. | 1363 // information support in the interpreter. |
1364 NewNode(javascript()->CallRuntime(Runtime::kReThrow), value); | 1364 NewNode(javascript()->CallRuntime(Runtime::kReThrow), value); |
1365 Node* control = NewNode(common()->Throw(), value); | 1365 Node* control = NewNode(common()->Throw(), value); |
1366 environment()->RecordAfterState(control, &states); | 1366 environment()->RecordAfterState(control, &states); |
1367 UpdateControlDependencyToLeaveFunction(control); | 1367 UpdateControlDependencyToLeaveFunction(control); |
1368 } | 1368 } |
1369 | 1369 |
1370 | 1370 |
| 1371 void BytecodeGraphBuilder::VisitReThrow( |
| 1372 const interpreter::BytecodeArrayIterator& iterator) { |
| 1373 FrameStateBeforeAndAfter states(this, iterator); |
| 1374 Node* value = environment()->LookupAccumulator(); |
| 1375 NewNode(javascript()->CallRuntime(Runtime::kReThrow), value); |
| 1376 Node* control = NewNode(common()->Throw(), value); |
| 1377 environment()->RecordAfterState(control, &states); |
| 1378 UpdateControlDependencyToLeaveFunction(control); |
| 1379 } |
| 1380 |
| 1381 |
1371 void BytecodeGraphBuilder::BuildBinaryOp( | 1382 void BytecodeGraphBuilder::BuildBinaryOp( |
1372 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { | 1383 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { |
1373 FrameStateBeforeAndAfter states(this, iterator); | 1384 FrameStateBeforeAndAfter states(this, iterator); |
1374 Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0)); | 1385 Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
1375 Node* right = environment()->LookupAccumulator(); | 1386 Node* right = environment()->LookupAccumulator(); |
1376 Node* node = NewNode(js_op, left, right); | 1387 Node* node = NewNode(js_op, left, right); |
1377 environment()->BindAccumulator(node, &states); | 1388 environment()->BindAccumulator(node, &states); |
1378 } | 1389 } |
1379 | 1390 |
1380 | 1391 |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2089 | 2100 |
2090 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 2101 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
2091 if (environment()->IsMarkedAsUnreachable()) return; | 2102 if (environment()->IsMarkedAsUnreachable()) return; |
2092 environment()->MarkAsUnreachable(); | 2103 environment()->MarkAsUnreachable(); |
2093 exit_controls_.push_back(exit); | 2104 exit_controls_.push_back(exit); |
2094 } | 2105 } |
2095 | 2106 |
2096 } // namespace compiler | 2107 } // namespace compiler |
2097 } // namespace internal | 2108 } // namespace internal |
2098 } // namespace v8 | 2109 } // namespace v8 |
OLD | NEW |