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

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

Issue 1422033002: [Interpreter] Add support for for..in. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes for 32-bit. Created 5 years, 1 month 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 builder.Jump(&start) 143 builder.Jump(&start)
144 .JumpIfTrue(&start) 144 .JumpIfTrue(&start)
145 .JumpIfFalse(&start) 145 .JumpIfFalse(&start)
146 .JumpIfToBooleanTrue(&start) 146 .JumpIfToBooleanTrue(&start)
147 .JumpIfToBooleanFalse(&start); 147 .JumpIfToBooleanFalse(&start);
148 148
149 builder.EnterBlock() 149 builder.EnterBlock()
150 .Throw() 150 .Throw()
151 .LeaveBlock(); 151 .LeaveBlock();
152 152
153 builder.ForInPrepare().ForInDone(reg).ForInNext(reg);
154
153 builder.Return(); 155 builder.Return();
154 156
155 // Generate BytecodeArray. 157 // Generate BytecodeArray.
156 Handle<BytecodeArray> the_array = builder.ToBytecodeArray(); 158 Handle<BytecodeArray> the_array = builder.ToBytecodeArray();
157 CHECK_EQ(the_array->frame_size(), 159 CHECK_EQ(the_array->frame_size(),
158 builder.fixed_register_count() * kPointerSize); 160 builder.fixed_register_count() * kPointerSize);
159 161
160 // Build scorecard of bytecodes encountered in the BytecodeArray. 162 // Build scorecard of bytecodes encountered in the BytecodeArray.
161 std::vector<int> scorecard(Bytecodes::ToByte(Bytecode::kLast) + 1); 163 std::vector<int> scorecard(Bytecodes::ToByte(Bytecode::kLast) + 1);
162 Bytecode final_bytecode = Bytecode::kLdaZero; 164 Bytecode final_bytecode = Bytecode::kLdaZero;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 539
538 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 540 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
539 iterator.Advance(); 541 iterator.Advance();
540 CHECK(iterator.done()); 542 CHECK(iterator.done());
541 } 543 }
542 544
543 545
544 } // namespace interpreter 546 } // namespace interpreter
545 } // namespace internal 547 } // namespace internal
546 } // namespace v8 548 } // namespace v8
OLDNEW
« src/runtime/runtime-interpreter.cc ('K') | « test/cctest/interpreter/test-interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698