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/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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
901 Node* shared = __ GetAccumulator(); | 901 Node* shared = __ GetAccumulator(); |
902 Node* tenured_raw = __ BytecodeOperandImm8(0); | 902 Node* tenured_raw = __ BytecodeOperandImm8(0); |
903 Node* tenured = __ SmiTag(tenured_raw); | 903 Node* tenured = __ SmiTag(tenured_raw); |
904 Node* result = | 904 Node* result = |
905 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); | 905 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); |
906 __ SetAccumulator(result); | 906 __ SetAccumulator(result); |
907 __ Dispatch(); | 907 __ Dispatch(); |
908 } | 908 } |
909 | 909 |
910 | 910 |
911 // CreateArgumentsSloppy <type> | |
Michael Starzinger
2015/10/21 18:44:37
nit: Comment looks outdated, no <type> parameter.
rmcilroy
2015/10/22 15:19:52
Done.
| |
912 // | |
913 // Creates a new arguments object for sloppy mode. | |
914 void Interpreter::DoCreateArgumentsSloppy( | |
915 compiler::InterpreterAssembler* assembler) { | |
916 Node* closure = __ LoadRegister(Register::function_closure()); | |
917 Node* result = __ CallRuntime(Runtime::kNewSloppyArguments_Generic, closure); | |
918 __ SetAccumulator(result); | |
919 __ Dispatch(); | |
920 } | |
921 | |
922 | |
923 // CreateArgumentsStrict <type> | |
Michael Starzinger
2015/10/21 18:44:37
nit: Likewise.
rmcilroy
2015/10/22 15:19:52
Done.
| |
924 // | |
925 // Creates a new arguments object for strict mode. | |
926 void Interpreter::DoCreateArgumentsStrict( | |
927 compiler::InterpreterAssembler* assembler) { | |
928 Node* closure = __ LoadRegister(Register::function_closure()); | |
929 Node* result = __ CallRuntime(Runtime::kNewStrictArguments_Generic, closure); | |
930 __ SetAccumulator(result); | |
931 __ Dispatch(); | |
932 } | |
933 | |
934 | |
911 // Throw | 935 // Throw |
912 // | 936 // |
913 // Throws the exception in the accumulator. | 937 // Throws the exception in the accumulator. |
914 void Interpreter::DoThrow(compiler::InterpreterAssembler* assembler) { | 938 void Interpreter::DoThrow(compiler::InterpreterAssembler* assembler) { |
915 Node* exception = __ GetAccumulator(); | 939 Node* exception = __ GetAccumulator(); |
916 __ CallRuntime(Runtime::kThrow, exception); | 940 __ CallRuntime(Runtime::kThrow, exception); |
917 // We shouldn't ever return from a throw. | 941 // We shouldn't ever return from a throw. |
918 __ Abort(kUnexpectedReturnFromThrow); | 942 __ Abort(kUnexpectedReturnFromThrow); |
919 } | 943 } |
920 | 944 |
921 | 945 |
922 // Return | 946 // Return |
923 // | 947 // |
924 // Return the value in the accumulator. | 948 // Return the value in the accumulator. |
925 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 949 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
926 __ Return(); | 950 __ Return(); |
927 } | 951 } |
928 | 952 |
929 | 953 |
930 } // namespace interpreter | 954 } // namespace interpreter |
931 } // namespace internal | 955 } // namespace internal |
932 } // namespace v8 | 956 } // namespace v8 |
OLD | NEW |