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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1531693002: [Interpreter] Implement ForIn in bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0009-phi
Patch Set: Fix ForInPrepare. Created 5 years 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 202 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
203 .JumpIfFalse(&start); 203 .JumpIfFalse(&start);
204 204
205 // Emit throw in it's own basic block so that the rest of the code isn't 205 // Emit throw in it's own basic block so that the rest of the code isn't
206 // omitted due to being dead. 206 // omitted due to being dead.
207 BytecodeLabel after_throw; 207 BytecodeLabel after_throw;
208 builder.Jump(&after_throw) 208 builder.Jump(&after_throw)
209 .Throw() 209 .Throw()
210 .Bind(&after_throw); 210 .Bind(&after_throw);
211 211
212 builder.ForInPrepare(reg).ForInDone(reg).ForInNext(reg, reg); 212 builder.ForInPrepare(reg, reg, reg, reg)
213 .ForInDone(reg, reg)
214 .ForInNext(reg, reg, reg, reg)
215 .ForInStep(reg);
213 216
214 // Wide constant pool loads 217 // Wide constant pool loads
215 for (int i = 0; i < 256; i++) { 218 for (int i = 0; i < 256; i++) {
216 // Emit junk in constant pool to force wide constant pool index. 219 // Emit junk in constant pool to force wide constant pool index.
217 builder.GetConstantPoolEntry(handle(Smi::FromInt(i), isolate())); 220 builder.GetConstantPoolEntry(handle(Smi::FromInt(i), isolate()));
218 } 221 }
219 builder.LoadLiteral(Smi::FromInt(20000000)); 222 builder.LoadLiteral(Smi::FromInt(20000000));
220 223
221 // CreateClosureWide 224 // CreateClosureWide
222 Handle<SharedFunctionInfo> shared_info2 = factory->NewSharedFunctionInfo( 225 Handle<SharedFunctionInfo> shared_info2 = factory->NewSharedFunctionInfo(
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 iterator.Advance(); 662 iterator.Advance();
660 } 663 }
661 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 664 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
662 iterator.Advance(); 665 iterator.Advance();
663 CHECK(iterator.done()); 666 CHECK(iterator.done());
664 } 667 }
665 668
666 } // namespace interpreter 669 } // namespace interpreter
667 } // namespace internal 670 } // namespace internal
668 } // namespace v8 671 } // namespace v8
OLDNEW
« src/interpreter/interpreter.cc ('K') | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698