Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 1481763002: [Interpreter] Adds support for throw to bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed nits Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-bytecode-graph-builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // TODO(mythria): Change to Runtime::kThrow when we have deoptimization
821 // information support in the interpreter.
822 NewNode(javascript()->CallRuntime(Runtime::kReThrow, 1), value);
823 Node* control = NewNode(common()->Throw(), value);
824 UpdateControlDependencyToLeaveFunction(control);
825 environment()->BindAccumulator(value);
820 } 826 }
821 827
822 828
823 void BytecodeGraphBuilder::BuildBinaryOp( 829 void BytecodeGraphBuilder::BuildBinaryOp(
824 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) { 830 const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) {
825 Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0)); 831 Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0));
826 Node* right = environment()->LookupAccumulator(); 832 Node* right = environment()->LookupAccumulator();
827 Node* node = NewNode(js_op, left, right); 833 Node* node = NewNode(js_op, left, right);
828 834
829 AddEmptyFrameStateInputs(node); 835 AddEmptyFrameStateInputs(node);
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 1258
1253 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { 1259 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) {
1254 if (environment()->IsMarkedAsUnreachable()) return; 1260 if (environment()->IsMarkedAsUnreachable()) return;
1255 environment()->MarkAsUnreachable(); 1261 environment()->MarkAsUnreachable();
1256 exit_controls_.push_back(exit); 1262 exit_controls_.push_back(exit);
1257 } 1263 }
1258 1264
1259 } // namespace compiler 1265 } // namespace compiler
1260 } // namespace internal 1266 } // namespace internal
1261 } // namespace v8 1267 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698