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

Unified Diff: src/compiler/bytecode-analysis.cc

Issue 2894293003: Save/restore only live registers in the generator suspend/resume. (Closed)
Patch Set: Tweak Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-analysis.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-analysis.cc
diff --git a/src/compiler/bytecode-analysis.cc b/src/compiler/bytecode-analysis.cc
index e531e75b8c37986b7a746ed1a0b65eaddb29b202..13185db208b141c145c0888e789f8aebff16f470 100644
--- a/src/compiler/bytecode-analysis.cc
+++ b/src/compiler/bytecode-analysis.cc
@@ -28,31 +28,17 @@ void BytecodeLoopAssignments::Add(interpreter::Register r) {
}
}
-void BytecodeLoopAssignments::AddPair(interpreter::Register r) {
+void BytecodeLoopAssignments::AddList(interpreter::Register r, uint32_t count) {
if (r.is_parameter()) {
- DCHECK(interpreter::Register(r.index() + 1).is_parameter());
- bit_vector_->Add(r.ToParameterIndex(parameter_count_));
- bit_vector_->Add(r.ToParameterIndex(parameter_count_) + 1);
- } else {
- DCHECK(!interpreter::Register(r.index() + 1).is_parameter());
- bit_vector_->Add(parameter_count_ + r.index());
- bit_vector_->Add(parameter_count_ + r.index() + 1);
- }
-}
-
-void BytecodeLoopAssignments::AddTriple(interpreter::Register r) {
- if (r.is_parameter()) {
- DCHECK(interpreter::Register(r.index() + 1).is_parameter());
- DCHECK(interpreter::Register(r.index() + 2).is_parameter());
- bit_vector_->Add(r.ToParameterIndex(parameter_count_));
- bit_vector_->Add(r.ToParameterIndex(parameter_count_) + 1);
- bit_vector_->Add(r.ToParameterIndex(parameter_count_) + 2);
+ for (uint32_t i = 0; i < count; i++) {
+ DCHECK(interpreter::Register(r.index() + i).is_parameter());
+ bit_vector_->Add(r.ToParameterIndex(parameter_count_) + i);
+ }
} else {
- DCHECK(!interpreter::Register(r.index() + 1).is_parameter());
- DCHECK(!interpreter::Register(r.index() + 2).is_parameter());
- bit_vector_->Add(parameter_count_ + r.index());
- bit_vector_->Add(parameter_count_ + r.index() + 1);
- bit_vector_->Add(parameter_count_ + r.index() + 2);
+ for (uint32_t i = 0; i < count; i++) {
+ DCHECK(!interpreter::Register(r.index() + i).is_parameter());
+ bit_vector_->Add(parameter_count_ + r.index() + i);
+ }
}
}
@@ -112,6 +98,17 @@ void UpdateInLiveness(Bytecode bytecode, BytecodeLivenessState& in_liveness,
}
break;
}
+ case OperandType::kRegOutList: {
+ interpreter::Register r = accessor.GetRegisterOperand(i++);
+ uint32_t reg_count = accessor.GetRegisterCountOperand(i);
+ if (!r.is_parameter()) {
+ for (uint32_t j = 0; j < reg_count; ++j) {
+ DCHECK(!interpreter::Register(r.index() + j).is_parameter());
+ in_liveness.MarkRegisterDead(r.index() + j);
+ }
+ }
+ break;
+ }
case OperandType::kRegOutPair: {
interpreter::Register r = accessor.GetRegisterOperand(i);
if (!r.is_parameter()) {
@@ -227,12 +224,18 @@ void UpdateAssignments(Bytecode bytecode, BytecodeLoopAssignments& assignments,
assignments.Add(accessor.GetRegisterOperand(i));
break;
}
+ case OperandType::kRegOutList: {
+ interpreter::Register r = accessor.GetRegisterOperand(i++);
+ uint32_t reg_count = accessor.GetRegisterCountOperand(i);
+ assignments.AddList(r, reg_count);
+ break;
+ }
case OperandType::kRegOutPair: {
- assignments.AddPair(accessor.GetRegisterOperand(i));
+ assignments.AddList(accessor.GetRegisterOperand(i), 2);
break;
}
case OperandType::kRegOutTriple: {
- assignments.AddTriple(accessor.GetRegisterOperand(i));
+ assignments.AddList(accessor.GetRegisterOperand(i), 3);
break;
}
default:
« no previous file with comments | « src/compiler/bytecode-analysis.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698