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

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

Issue 2007023003: [interpreter] Address naming inconsistencies in bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0056-register-only
Patch Set: Rebase. Created 4 years, 7 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
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/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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar); 159 CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
160 CHECK_EQ(iterator.current_offset(), offset); 160 CHECK_EQ(iterator.current_offset(), offset);
161 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); 161 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
162 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index()); 162 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
163 CHECK_EQ(iterator.GetRegisterOperandRange(0), 1); 163 CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
164 CHECK(!iterator.done()); 164 CHECK(!iterator.done());
165 offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle); 165 offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
166 iterator.Advance(); 166 iterator.Advance();
167 167
168 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLoadIC); 168 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaNamedProperty);
169 CHECK_EQ(iterator.current_offset(), offset); 169 CHECK_EQ(iterator.current_offset(), offset);
170 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); 170 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
171 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index()); 171 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
172 CHECK_EQ(iterator.GetIndexOperand(1), name_index); 172 CHECK_EQ(iterator.GetIndexOperand(1), name_index);
173 CHECK_EQ(iterator.GetIndexOperand(2), feedback_slot); 173 CHECK_EQ(iterator.GetIndexOperand(2), feedback_slot);
174 CHECK(!iterator.done()); 174 CHECK(!iterator.done());
175 offset += Bytecodes::Size(Bytecode::kLoadIC, OperandScale::kSingle); 175 offset += Bytecodes::Size(Bytecode::kLdaNamedProperty, OperandScale::kSingle);
176 iterator.Advance(); 176 iterator.Advance();
177 177
178 CHECK_EQ(iterator.current_bytecode(), Bytecode::kAdd); 178 CHECK_EQ(iterator.current_bytecode(), Bytecode::kAdd);
179 CHECK_EQ(iterator.current_offset(), offset); 179 CHECK_EQ(iterator.current_offset(), offset);
180 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); 180 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
181 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index()); 181 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
182 CHECK_EQ(iterator.GetRegisterOperandRange(0), 1); 182 CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
183 CHECK(!iterator.done()); 183 CHECK(!iterator.done());
184 offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle); 184 offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
185 iterator.Advance(); 185 iterator.Advance();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 CHECK_EQ(iterator.current_offset(), offset); 247 CHECK_EQ(iterator.current_offset(), offset);
248 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); 248 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
249 CHECK(!iterator.done()); 249 CHECK(!iterator.done());
250 iterator.Advance(); 250 iterator.Advance();
251 CHECK(iterator.done()); 251 CHECK(iterator.done());
252 } 252 }
253 253
254 } // namespace interpreter 254 } // namespace interpreter
255 } // namespace internal 255 } // namespace internal
256 } // namespace v8 256 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698