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

Unified Diff: src/interpreter/bytecode-pipeline.cc

Issue 2041913002: [interpreter] Remove OperandScale from front stages of pipeline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-pipeline.h ('k') | src/interpreter/bytecode-register-optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-pipeline.cc
diff --git a/src/interpreter/bytecode-pipeline.cc b/src/interpreter/bytecode-pipeline.cc
index 5812c89954d51a8c369388ecec194662001eeccc..89d9ad6cfdda61d70c4b756daf99dd80bae6e72f 100644
--- a/src/interpreter/bytecode-pipeline.cc
+++ b/src/interpreter/bytecode-pipeline.cc
@@ -34,47 +34,40 @@ void BytecodeSourceInfo::Update(const BytecodeSourceInfo& entry) {
BytecodeNode::BytecodeNode(Bytecode bytecode) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0);
bytecode_ = bytecode;
- operand_scale_ = OperandScale::kSingle;
}
-BytecodeNode::BytecodeNode(Bytecode bytecode, uint32_t operand0,
- OperandScale operand_scale) {
+BytecodeNode::BytecodeNode(Bytecode bytecode, uint32_t operand0) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 1);
bytecode_ = bytecode;
operands_[0] = operand0;
- operand_scale_ = operand_scale;
}
BytecodeNode::BytecodeNode(Bytecode bytecode, uint32_t operand0,
- uint32_t operand1, OperandScale operand_scale) {
+ uint32_t operand1) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 2);
bytecode_ = bytecode;
operands_[0] = operand0;
operands_[1] = operand1;
- operand_scale_ = operand_scale;
}
BytecodeNode::BytecodeNode(Bytecode bytecode, uint32_t operand0,
- uint32_t operand1, uint32_t operand2,
- OperandScale operand_scale) {
+ uint32_t operand1, uint32_t operand2) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 3);
bytecode_ = bytecode;
operands_[0] = operand0;
operands_[1] = operand1;
operands_[2] = operand2;
- operand_scale_ = operand_scale;
}
BytecodeNode::BytecodeNode(Bytecode bytecode, uint32_t operand0,
uint32_t operand1, uint32_t operand2,
- uint32_t operand3, OperandScale operand_scale) {
+ uint32_t operand3) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 4);
bytecode_ = bytecode;
operands_[0] = operand0;
operands_[1] = operand1;
operands_[2] = operand2;
operands_[3] = operand3;
- operand_scale_ = operand_scale;
}
BytecodeNode::BytecodeNode(const BytecodeNode& other) {
@@ -89,15 +82,12 @@ BytecodeNode& BytecodeNode::operator=(const BytecodeNode& other) {
void BytecodeNode::set_bytecode(Bytecode bytecode) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0);
bytecode_ = bytecode;
- operand_scale_ = OperandScale::kSingle;
}
-void BytecodeNode::set_bytecode(Bytecode bytecode, uint32_t operand0,
- OperandScale operand_scale) {
+void BytecodeNode::set_bytecode(Bytecode bytecode, uint32_t operand0) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 1);
bytecode_ = bytecode;
operands_[0] = operand0;
- operand_scale_ = operand_scale;
}
void BytecodeNode::Clone(const BytecodeNode* const other) {
@@ -108,13 +98,7 @@ void BytecodeNode::Print(std::ostream& os) const {
#ifdef DEBUG
std::ios saved_state(nullptr);
saved_state.copyfmt(os);
-
os << Bytecodes::ToString(bytecode_);
- if (Bytecodes::OperandScaleRequiresPrefixBytecode(operand_scale_)) {
- Bytecode scale_prefix =
- Bytecodes::OperandScaleToPrefixBytecode(operand_scale_);
- os << '.' << Bytecodes::ToString(scale_prefix);
- }
for (int i = 0; i < operand_count(); ++i) {
os << ' ' << std::setw(8) << std::setfill('0') << std::hex << operands_[i];
@@ -130,16 +114,7 @@ void BytecodeNode::Print(std::ostream& os) const {
#endif // DEBUG
}
-size_t BytecodeNode::Size() const {
- size_t size = Bytecodes::Size(bytecode_, operand_scale_);
- if (Bytecodes::OperandScaleRequiresPrefixBytecode(operand_scale_)) {
- size += 1;
- }
- return size;
-}
-
-void BytecodeNode::Transform(Bytecode new_bytecode, uint32_t extra_operand,
- OperandScale extra_operand_scale) {
+void BytecodeNode::Transform(Bytecode new_bytecode, uint32_t extra_operand) {
DCHECK_EQ(Bytecodes::NumberOfOperands(new_bytecode),
Bytecodes::NumberOfOperands(bytecode()) + 1);
DCHECK(Bytecodes::NumberOfOperands(bytecode()) < 1 ||
@@ -152,7 +127,6 @@ void BytecodeNode::Transform(Bytecode new_bytecode, uint32_t extra_operand,
Bytecodes::GetOperandType(new_bytecode, 2) ==
Bytecodes::GetOperandType(bytecode(), 2));
DCHECK(Bytecodes::NumberOfOperands(bytecode()) < 4);
- operand_scale_ = std::max(extra_operand_scale, operand_scale());
operands_[operand_count()] = extra_operand;
bytecode_ = new_bytecode;
}
@@ -173,11 +147,6 @@ bool BytecodeNode::operator==(const BytecodeNode& other) const {
return true;
}
-std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) {
- node.Print(os);
- return os;
-}
-
std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info) {
if (info.is_valid()) {
char description = info.is_statement() ? 'S' : 'E';
@@ -186,6 +155,11 @@ std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info) {
return os;
}
+std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) {
+ node.Print(os);
+ return os;
+}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « src/interpreter/bytecode-pipeline.h ('k') | src/interpreter/bytecode-register-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698