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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1621673002: [interpreter] Add ReThrow bytecode for try-finally support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_int-6
Patch Set: Rebased. Created 4 years, 11 months 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 | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.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/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/interpreter-assembler.h" 9 #include "src/compiler/interpreter-assembler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 // 1744 //
1745 // Throws the exception in the accumulator. 1745 // Throws the exception in the accumulator.
1746 void Interpreter::DoThrow(compiler::InterpreterAssembler* assembler) { 1746 void Interpreter::DoThrow(compiler::InterpreterAssembler* assembler) {
1747 Node* exception = __ GetAccumulator(); 1747 Node* exception = __ GetAccumulator();
1748 __ CallRuntime(Runtime::kThrow, exception); 1748 __ CallRuntime(Runtime::kThrow, exception);
1749 // We shouldn't ever return from a throw. 1749 // We shouldn't ever return from a throw.
1750 __ Abort(kUnexpectedReturnFromThrow); 1750 __ Abort(kUnexpectedReturnFromThrow);
1751 } 1751 }
1752 1752
1753 1753
1754 // ReThrow
1755 //
1756 // Re-throws the exception in the accumulator.
1757 void Interpreter::DoReThrow(compiler::InterpreterAssembler* assembler) {
1758 Node* exception = __ GetAccumulator();
1759 __ CallRuntime(Runtime::kReThrow, exception);
1760 // We shouldn't ever return from a throw.
1761 __ Abort(kUnexpectedReturnFromThrow);
1762 }
1763
1764
1754 // Return 1765 // Return
1755 // 1766 //
1756 // Return the value in the accumulator. 1767 // Return the value in the accumulator.
1757 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 1768 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
1758 __ Return(); 1769 __ Return();
1759 } 1770 }
1760 1771
1761 1772
1762 // ForInPrepare <cache_info_triple> 1773 // ForInPrepare <cache_info_triple>
1763 // 1774 //
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 Node* index_reg = __ BytecodeOperandReg(0); 1855 Node* index_reg = __ BytecodeOperandReg(0);
1845 Node* index = __ LoadRegister(index_reg); 1856 Node* index = __ LoadRegister(index_reg);
1846 Node* result = __ CallRuntime(Runtime::kForInStep, index); 1857 Node* result = __ CallRuntime(Runtime::kForInStep, index);
1847 __ SetAccumulator(result); 1858 __ SetAccumulator(result);
1848 __ Dispatch(); 1859 __ Dispatch();
1849 } 1860 }
1850 1861
1851 } // namespace interpreter 1862 } // namespace interpreter
1852 } // namespace internal 1863 } // namespace internal
1853 } // namespace v8 1864 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698