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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-stub-assembler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 4eb4253de03e9e40b4cf5bc2e0c0b71fc7b1ed7e..38d534f43faf505d2626a2678c0f507068ad8ebd 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1833,11 +1833,10 @@ void Interpreter::DoForInDone(InterpreterAssembler* assembler) {
// Increments the loop counter in register |index| and stores the result
// in the accumulator.
void Interpreter::DoForInStep(InterpreterAssembler* assembler) {
- // TODO(oth): Implement directly rather than making a runtime call.
Node* index_reg = __ BytecodeOperandReg(0);
Node* index = __ LoadRegister(index_reg);
- Node* context = __ GetContext();
- Node* result = __ CallRuntime(Runtime::kForInStep, context, index);
+ Node* one = __ SmiConstant(Smi::FromInt(1));
+ Node* result = __ SmiAdd(index, one);
__ SetAccumulator(result);
__ Dispatch();
}
« 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