Chromium Code Reviews| 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/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
| 9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
| 10 | 10 |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 809 const Operator* call = javascript()->CallConstruct( | 809 const Operator* call = javascript()->CallConstruct( |
| 810 static_cast<int>(arg_count) + 2, VectorSlotPair()); | 810 static_cast<int>(arg_count) + 2, VectorSlotPair()); |
| 811 Node* value = ProcessCallNewArguments(call, callee, first_arg, arg_count + 2); | 811 Node* value = ProcessCallNewArguments(call, callee, first_arg, arg_count + 2); |
| 812 AddEmptyFrameStateInputs(value); | 812 AddEmptyFrameStateInputs(value); |
| 813 environment()->BindAccumulator(value); | 813 environment()->BindAccumulator(value); |
| 814 } | 814 } |
| 815 | 815 |
| 816 | 816 |
| 817 void BytecodeGraphBuilder::VisitThrow( | 817 void BytecodeGraphBuilder::VisitThrow( |
| 818 const interpreter::BytecodeArrayIterator& iterator) { | 818 const interpreter::BytecodeArrayIterator& iterator) { |
| 819 UNIMPLEMENTED(); | 819 Node* value = environment()->LookupAccumulator(); |
| 820 NewNode(javascript()->CallRuntime(Runtime::kReThrow, 1), value); | |
|
Michael Starzinger
2015/11/26 17:27:45
This should be Runtime::kThrow, not Runtime::kReTh
Michael Starzinger
2015/11/27 09:28:46
I realized later that creating the exception messa
mythria
2015/11/27 14:54:47
Thanks for pointing this. We should use Runtime::k
Michael Starzinger
2015/11/27 15:09:18
Acknowledged. Yep, correct, TODO sounds good to me
| |
| 821 Node* control = NewNode(common()->Throw(), value); | |
| 822 UpdateControlDependencyToLeaveFunction(control); | |
| 823 environment()->BindAccumulator(value); | |
| 820 } | 824 } |
| 821 | 825 |
| 822 | 826 |
| 823 void BytecodeGraphBuilder::BuildBinaryOp( | 827 void BytecodeGraphBuilder::BuildBinaryOp( |
| 824 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { | 828 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { |
| 825 Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0)); | 829 Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
| 826 Node* right = environment()->LookupAccumulator(); | 830 Node* right = environment()->LookupAccumulator(); |
| 827 Node* node = NewNode(js_op, left, right); | 831 Node* node = NewNode(js_op, left, right); |
| 828 | 832 |
| 829 AddEmptyFrameStateInputs(node); | 833 AddEmptyFrameStateInputs(node); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1252 | 1256 |
| 1253 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1257 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
| 1254 if (environment()->IsMarkedAsUnreachable()) return; | 1258 if (environment()->IsMarkedAsUnreachable()) return; |
| 1255 environment()->MarkAsUnreachable(); | 1259 environment()->MarkAsUnreachable(); |
| 1256 exit_controls_.push_back(exit); | 1260 exit_controls_.push_back(exit); |
| 1257 } | 1261 } |
| 1258 | 1262 |
| 1259 } // namespace compiler | 1263 } // namespace compiler |
| 1260 } // namespace internal | 1264 } // namespace internal |
| 1261 } // namespace v8 | 1265 } // namespace v8 |
| OLD | NEW |