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

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

Issue 1664593003: [Interpreter] Adds support for rest parameters to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes comments. Created 4 years, 10 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/cctest.status » ('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/ast/prettyprinter.h" 7 #include "src/ast/prettyprinter.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/compiler/interpreter-assembler.h" 10 #include "src/compiler/interpreter-assembler.h"
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 // 1763 //
1764 // Creates a new unmapped arguments object. 1764 // Creates a new unmapped arguments object.
1765 void Interpreter::DoCreateUnmappedArguments( 1765 void Interpreter::DoCreateUnmappedArguments(
1766 compiler::InterpreterAssembler* assembler) { 1766 compiler::InterpreterAssembler* assembler) {
1767 Node* closure = __ LoadRegister(Register::function_closure()); 1767 Node* closure = __ LoadRegister(Register::function_closure());
1768 Node* result = __ CallRuntime(Runtime::kNewStrictArguments_Generic, closure); 1768 Node* result = __ CallRuntime(Runtime::kNewStrictArguments_Generic, closure);
1769 __ SetAccumulator(result); 1769 __ SetAccumulator(result);
1770 __ Dispatch(); 1770 __ Dispatch();
1771 } 1771 }
1772 1772
1773 // CreateRestArguments
1774 //
1775 // Creates a new rest arguments object starting at |rest_index|.
1776 void Interpreter::DoCreateRestArguments(
1777 compiler::InterpreterAssembler* assembler) {
1778 Node* closure = __ LoadRegister(Register::function_closure());
1779 Node* constant_pool_index = __ BytecodeOperandIdx(0);
1780 Node* rest_index = __ LoadConstantPoolEntry(constant_pool_index);
1781 Node* result =
1782 __ CallRuntime(Runtime::kNewRestArguments_Generic, closure, rest_index);
1783 __ SetAccumulator(result);
1784 __ Dispatch();
1785 }
1773 1786
1774 // Throw 1787 // Throw
1775 // 1788 //
1776 // Throws the exception in the accumulator. 1789 // Throws the exception in the accumulator.
1777 void Interpreter::DoThrow(compiler::InterpreterAssembler* assembler) { 1790 void Interpreter::DoThrow(compiler::InterpreterAssembler* assembler) {
1778 Node* exception = __ GetAccumulator(); 1791 Node* exception = __ GetAccumulator();
1779 __ CallRuntime(Runtime::kThrow, exception); 1792 __ CallRuntime(Runtime::kThrow, exception);
1780 // We shouldn't ever return from a throw. 1793 // We shouldn't ever return from a throw.
1781 __ Abort(kUnexpectedReturnFromThrow); 1794 __ Abort(kUnexpectedReturnFromThrow);
1782 } 1795 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 Node* index_reg = __ BytecodeOperandReg(0); 1899 Node* index_reg = __ BytecodeOperandReg(0);
1887 Node* index = __ LoadRegister(index_reg); 1900 Node* index = __ LoadRegister(index_reg);
1888 Node* result = __ CallRuntime(Runtime::kForInStep, index); 1901 Node* result = __ CallRuntime(Runtime::kForInStep, index);
1889 __ SetAccumulator(result); 1902 __ SetAccumulator(result);
1890 __ Dispatch(); 1903 __ Dispatch();
1891 } 1904 }
1892 1905
1893 } // namespace interpreter 1906 } // namespace interpreter
1894 } // namespace internal 1907 } // namespace internal
1895 } // namespace v8 1908 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698