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

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

Issue 1738823002: [Interpreter] Implement ForInStep directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/compiler/code-stub-assembler.cc ('k') | no next file » | 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/factory.h" 10 #include "src/factory.h"
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 __ SetAccumulator(result); 1826 __ SetAccumulator(result);
1827 __ Dispatch(); 1827 __ Dispatch();
1828 } 1828 }
1829 1829
1830 1830
1831 // ForInStep <index> 1831 // ForInStep <index>
1832 // 1832 //
1833 // Increments the loop counter in register |index| and stores the result 1833 // Increments the loop counter in register |index| and stores the result
1834 // in the accumulator. 1834 // in the accumulator.
1835 void Interpreter::DoForInStep(InterpreterAssembler* assembler) { 1835 void Interpreter::DoForInStep(InterpreterAssembler* assembler) {
1836 // TODO(oth): Implement directly rather than making a runtime call.
1837 Node* index_reg = __ BytecodeOperandReg(0); 1836 Node* index_reg = __ BytecodeOperandReg(0);
1838 Node* index = __ LoadRegister(index_reg); 1837 Node* index = __ LoadRegister(index_reg);
1839 Node* context = __ GetContext(); 1838 Node* one = __ SmiConstant(Smi::FromInt(1));
1840 Node* result = __ CallRuntime(Runtime::kForInStep, context, index); 1839 Node* result = __ SmiAdd(index, one);
1841 __ SetAccumulator(result); 1840 __ SetAccumulator(result);
1842 __ Dispatch(); 1841 __ Dispatch();
1843 } 1842 }
1844 1843
1845 } // namespace interpreter 1844 } // namespace interpreter
1846 } // namespace internal 1845 } // namespace internal
1847 } // namespace v8 1846 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-stub-assembler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698