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

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

Issue 1410863002: [Interpreter] Add support for Throw. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 Node* shared = __ GetAccumulator(); 880 Node* shared = __ GetAccumulator();
881 Node* tenured_raw = __ BytecodeOperandImm8(0); 881 Node* tenured_raw = __ BytecodeOperandImm8(0);
882 Node* tenured = __ SmiTag(tenured_raw); 882 Node* tenured = __ SmiTag(tenured_raw);
883 Node* result = 883 Node* result =
884 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); 884 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured);
885 __ SetAccumulator(result); 885 __ SetAccumulator(result);
886 __ Dispatch(); 886 __ Dispatch();
887 } 887 }
888 888
889 889
890 // Throw
891 //
892 // Throws the exception in the accumulator.
893 void Interpreter::DoThrow(compiler::InterpreterAssembler* assembler) {
894 Node* exception = __ GetAccumulator();
895 __ CallRuntime(Runtime::kThrow, exception);
896 // We shouldn't ever return from a throw.
897 __ Abort(kUnexpectedReturnFromThrow);
898 }
899
900
890 // Return 901 // Return
891 // 902 //
892 // Return the value in the accumulator. 903 // Return the value in the accumulator.
893 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 904 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
894 __ Return(); 905 __ Return();
895 } 906 }
896 907
897 908
898 } // namespace interpreter 909 } // namespace interpreter
899 } // namespace internal 910 } // namespace internal
900 } // namespace v8 911 } // 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