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

Side by Side Diff: test/unittests/interpreter/bytecodes-unittest.cc

Issue 2216023003: [interpreter] Add register output to ObjectLiteral (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments Created 4 years, 4 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 | « test/unittests/interpreter/bytecode-decoder-unittest.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 <vector> 5 #include <vector>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/interpreter/bytecode-register.h" 9 #include "src/interpreter/bytecode-register.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #define VALUE(Name, _) OperandScale::k##Name, 81 #define VALUE(Name, _) OperandScale::k##Name,
82 OPERAND_SCALE_LIST(VALUE) 82 OPERAND_SCALE_LIST(VALUE)
83 #undef VALUE 83 #undef VALUE
84 }; 84 };
85 85
86 for (OperandScale operand_scale : kOperandScales) { 86 for (OperandScale operand_scale : kOperandScales) {
87 int scale = static_cast<int>(operand_scale); 87 int scale = static_cast<int>(operand_scale);
88 CHECK_EQ(Bytecodes::Size(Bytecode::kCallRuntime, operand_scale), 88 CHECK_EQ(Bytecodes::Size(Bytecode::kCallRuntime, operand_scale),
89 1 + 2 + 2 * scale); 89 1 + 2 + 2 * scale);
90 CHECK_EQ(Bytecodes::Size(Bytecode::kCreateObjectLiteral, operand_scale), 90 CHECK_EQ(Bytecodes::Size(Bytecode::kCreateObjectLiteral, operand_scale),
91 1 + 2 * scale + 1); 91 1 + 2 * scale + 1 + 1 * scale);
92 CHECK_EQ(Bytecodes::Size(Bytecode::kTestIn, operand_scale), 1 + scale); 92 CHECK_EQ(Bytecodes::Size(Bytecode::kTestIn, operand_scale), 1 + scale);
93 } 93 }
94 } 94 }
95 95
96 TEST(Bytecodes, RegisterOperands) { 96 TEST(Bytecodes, RegisterOperands) {
97 CHECK(Bytecodes::IsRegisterOperandType(OperandType::kReg)); 97 CHECK(Bytecodes::IsRegisterOperandType(OperandType::kReg));
98 CHECK(Bytecodes::IsRegisterInputOperandType(OperandType::kReg)); 98 CHECK(Bytecodes::IsRegisterInputOperandType(OperandType::kReg));
99 CHECK(!Bytecodes::IsRegisterOutputOperandType(OperandType::kReg)); 99 CHECK(!Bytecodes::IsRegisterOutputOperandType(OperandType::kReg));
100 CHECK(!Bytecodes::IsRegisterInputOperandType(OperandType::kRegOut)); 100 CHECK(!Bytecodes::IsRegisterInputOperandType(OperandType::kRegOut));
101 CHECK(Bytecodes::IsRegisterOutputOperandType(OperandType::kRegOut)); 101 CHECK(Bytecodes::IsRegisterOutputOperandType(OperandType::kRegOut));
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 std::set<std::string> names; 240 std::set<std::string> names;
241 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kNone)); 241 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kNone));
242 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kRead)); 242 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kRead));
243 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kWrite)); 243 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kWrite));
244 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kReadWrite)); 244 names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kReadWrite));
245 CHECK_EQ(names.size(), 4); 245 CHECK_EQ(names.size(), 4);
246 } 246 }
247 } // namespace interpreter 247 } // namespace interpreter
248 } // namespace internal 248 } // namespace internal
249 } // namespace v8 249 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/interpreter/bytecode-decoder-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698