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

Side by Side Diff: src/interpreter/bytecode-operands.cc

Issue 2360193003: Revert of [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter. (Closed)
Patch Set: Created 4 years, 3 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 | « src/interpreter/bytecode-operands.h ('k') | src/interpreter/bytecode-peephole-optimizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/interpreter/bytecode-operands.h"
6
7 #include <iomanip>
8
9 namespace v8 {
10 namespace internal {
11 namespace interpreter {
12
13 namespace {
14
15 const char* AccumulatorUseToString(AccumulatorUse accumulator_use) {
16 switch (accumulator_use) {
17 case AccumulatorUse::kNone:
18 return "None";
19 case AccumulatorUse::kRead:
20 return "Read";
21 case AccumulatorUse::kWrite:
22 return "Write";
23 case AccumulatorUse::kReadWrite:
24 return "ReadWrite";
25 }
26 UNREACHABLE();
27 return "";
28 }
29
30 const char* OperandTypeToString(OperandType operand_type) {
31 switch (operand_type) {
32 #define CASE(Name, _) \
33 case OperandType::k##Name: \
34 return #Name;
35 OPERAND_TYPE_LIST(CASE)
36 #undef CASE
37 }
38 UNREACHABLE();
39 return "";
40 }
41
42 const char* OperandScaleToString(OperandScale operand_scale) {
43 switch (operand_scale) {
44 #define CASE(Name, _) \
45 case OperandScale::k##Name: \
46 return #Name;
47 OPERAND_SCALE_LIST(CASE)
48 #undef CASE
49 }
50 UNREACHABLE();
51 return "";
52 }
53
54 const char* OperandSizeToString(OperandSize operand_size) {
55 switch (operand_size) {
56 case OperandSize::kNone:
57 return "None";
58 case OperandSize::kByte:
59 return "Byte";
60 case OperandSize::kShort:
61 return "Short";
62 case OperandSize::kQuad:
63 return "Quad";
64 }
65 UNREACHABLE();
66 return "";
67 }
68
69 } // namespace
70
71 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use) {
72 return os << AccumulatorUseToString(use);
73 }
74
75 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) {
76 return os << OperandSizeToString(operand_size);
77 }
78
79 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale) {
80 return os << OperandScaleToString(operand_scale);
81 }
82
83 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type) {
84 return os << OperandTypeToString(operand_type);
85 }
86
87 } // namespace interpreter
88 } // namespace internal
89 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-operands.h ('k') | src/interpreter/bytecode-peephole-optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698