Reviewers: ulan, Jakob,
Message:
This is a pre-requisite commit for issue 296113008.
Description:
Provide a helper to generate multiple Lithium instructions for one Hydrogen
instruction.
Please review this at https://codereview.chromium.org/296993002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+65, -25 lines):
M src/arm/lithium-arm.h
M src/arm/lithium-arm.cc
M src/arm64/lithium-arm64.h
M src/arm64/lithium-arm64.cc
M src/ia32/lithium-ia32.h
M src/ia32/lithium-ia32.cc
M src/mips/lithium-mips.h
M src/mips/lithium-mips.cc
M src/x64/lithium-x64.h
M src/x64/lithium-x64.cc
Index: src/arm/lithium-arm.cc
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
index
1e54695d3ffec4eb969015abdae659f842a8e835..a35470ec209aced9012c4a455337c533d5f529f8
100644
--- a/src/arm/lithium-arm.cc
+++ b/src/arm/lithium-arm.cc
@@ -834,10 +834,18 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
argument_count_ += current->argument_delta();
ASSERT(argument_count_ >= 0);
+ CheckAndAddInstruction(instr, current);
+
+ current_instruction_ = old_current;
+}
+
+
+void LChunkBuilder::CheckAndAddInstruction(LInstruction* instr,
+ HInstruction* hydrogen_val) {
if (instr != NULL) {
// Associate the hydrogen instruction first, since we may need it for
// the ClobbersRegisters() or ClobbersDoubleRegisters() calls below.
- instr->set_hydrogen_value(current);
+ instr->set_hydrogen_value(hydrogen_val);
#if DEBUG
// Make sure that the lithium instruction has either no fixed register
@@ -878,10 +886,10 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall()) {
- HValue* hydrogen_value_for_lazy_bailout = current;
+ HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
LInstruction* instruction_needing_environment = NULL;
- if (current->HasObservableSideEffects()) {
- HSimulate* sim = HSimulate::cast(current->next());
+ if (hydrogen_val->HasObservableSideEffects()) {
+ HSimulate* sim = HSimulate::cast(hydrogen_val->next());
instruction_needing_environment = instr;
sim->ReplayEnvironment(current_block_->last_environment());
hydrogen_value_for_lazy_bailout = sim;
@@ -897,7 +905,6 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
}
}
}
- current_instruction_ = old_current;
}
Index: src/arm/lithium-arm.h
diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h
index
714ec55e2a984f0b58ec2600e1accfccb4046511..aae2ac98812dc5e0889c986844eb83aa5a1923be
100644
--- a/src/arm/lithium-arm.h
+++ b/src/arm/lithium-arm.h
@@ -2837,6 +2837,7 @@ class LChunkBuilder V8_FINAL : public
LChunkBuilderBase {
CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
void VisitInstruction(HInstruction* current);
+ void CheckAndAddInstruction(LInstruction* instr, HInstruction* current);
void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
Index: src/arm64/lithium-arm64.cc
diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc
index
d18808a587b1cd2a50dc9a58120786de46a978ea..3d3f724fe23ce8c73f9b1102dd29de5432c85282
100644
--- a/src/arm64/lithium-arm64.cc
+++ b/src/arm64/lithium-arm64.cc
@@ -678,10 +678,18 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
argument_count_ += current->argument_delta();
ASSERT(argument_count_ >= 0);
+ CheckAndAddInstruction(instr, current);
+
+ current_instruction_ = old_current;
+}
+
+
+void LChunkBuilder::CheckAndAddInstruction(LInstruction* instr,
+ HInstruction* hydrogen_val) {
if (instr != NULL) {
// Associate the hydrogen instruction first, since we may need it for
// the ClobbersRegisters() or ClobbersDoubleRegisters() calls below.
- instr->set_hydrogen_value(current);
+ instr->set_hydrogen_value(hydrogen_val);
#if DEBUG
// Make sure that the lithium instruction has either no fixed register
@@ -722,10 +730,10 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall()) {
- HValue* hydrogen_value_for_lazy_bailout = current;
+ HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
LInstruction* instruction_needing_environment = NULL;
- if (current->HasObservableSideEffects()) {
- HSimulate* sim = HSimulate::cast(current->next());
+ if (hydrogen_val->HasObservableSideEffects()) {
+ HSimulate* sim = HSimulate::cast(hydrogen_val->next());
instruction_needing_environment = instr;
sim->ReplayEnvironment(current_block_->last_environment());
hydrogen_value_for_lazy_bailout = sim;
@@ -741,7 +749,6 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
}
}
}
- current_instruction_ = old_current;
}
Index: src/arm64/lithium-arm64.h
diff --git a/src/arm64/lithium-arm64.h b/src/arm64/lithium-arm64.h
index
7bd2c5ad62df5d01ae65bc375f7f30d4da3ebd8e..94658286a0bc7b00140d7e64a4efaa188ba22e61
100644
--- a/src/arm64/lithium-arm64.h
+++ b/src/arm64/lithium-arm64.h
@@ -3137,6 +3137,7 @@ class LChunkBuilder V8_FINAL : public
LChunkBuilderBase {
LInstruction* AssignEnvironment(LInstruction* instr);
void VisitInstruction(HInstruction* current);
+ void CheckAndAddInstruction(LInstruction* instr, HInstruction* current);
void DoBasicBlock(HBasicBlock* block);
int JSShiftAmountFromHConstant(HValue* constant) {
Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index
76a107dc523376a35a30c3b8d2a2da782c5edcc2..be4291219665d60fc0c748ef0748cb5631998776
100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -888,10 +888,18 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
argument_count_ += current->argument_delta();
ASSERT(argument_count_ >= 0);
+ CheckAndAddInstruction(instr, current);
+
+ current_instruction_ = old_current;
+}
+
+
+void LChunkBuilder::CheckAndAddInstruction(LInstruction* instr,
+ HInstruction* hydrogen_val) {
if (instr != NULL) {
// Associate the hydrogen instruction first, since we may need it for
// the ClobbersRegisters() or ClobbersDoubleRegisters() calls below.
- instr->set_hydrogen_value(current);
+ instr->set_hydrogen_value(hydrogen_val);
#if DEBUG
// Make sure that the lithium instruction has either no fixed register
@@ -932,10 +940,10 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall()) {
- HValue* hydrogen_value_for_lazy_bailout = current;
+ HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
LInstruction* instruction_needing_environment = NULL;
- if (current->HasObservableSideEffects()) {
- HSimulate* sim = HSimulate::cast(current->next());
+ if (hydrogen_val->HasObservableSideEffects()) {
+ HSimulate* sim = HSimulate::cast(hydrogen_val->next());
instruction_needing_environment = instr;
sim->ReplayEnvironment(current_block_->last_environment());
hydrogen_value_for_lazy_bailout = sim;
@@ -951,7 +959,6 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
}
}
}
- current_instruction_ = old_current;
}
Index: src/ia32/lithium-ia32.h
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index
6cfe3e17f6f6937690d7cbcc3fcebe6e89a6bfe3..aeb1ab7025a26bda94fb08dff4c9dadbcc74b313
100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -2831,6 +2831,7 @@ class LChunkBuilder V8_FINAL : public
LChunkBuilderBase {
CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
void VisitInstruction(HInstruction* current);
+ void CheckAndAddInstruction(LInstruction* instr, HInstruction* current);
void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index
97b91fac3995476829ce2f3d7347820ff4aa7a4b..cd00edbddc76e8d4ad369434b72cb9e7bab44e3a
100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -842,10 +842,18 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
argument_count_ += current->argument_delta();
ASSERT(argument_count_ >= 0);
+ CheckAndAddInstruction(instr, current);
+
+ current_instruction_ = old_current;
+}
+
+
+void LChunkBuilder::CheckAndAddInstruction(LInstruction* instr,
+ HInstruction* hydrogen_val) {
if (instr != NULL) {
// Associate the hydrogen instruction first, since we may need it for
// the ClobbersRegisters() or ClobbersDoubleRegisters() calls below.
- instr->set_hydrogen_value(current);
+ instr->set_hydrogen_value(hydrogen_val);
#if DEBUG
// Make sure that the lithium instruction has either no fixed register
@@ -886,10 +894,10 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall()) {
- HValue* hydrogen_value_for_lazy_bailout = current;
+ HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
LInstruction* instruction_needing_environment = NULL;
- if (current->HasObservableSideEffects()) {
- HSimulate* sim = HSimulate::cast(current->next());
+ if (hydrogen_val->HasObservableSideEffects()) {
+ HSimulate* sim = HSimulate::cast(hydrogen_val->next());
instruction_needing_environment = instr;
sim->ReplayEnvironment(current_block_->last_environment());
hydrogen_value_for_lazy_bailout = sim;
@@ -905,7 +913,6 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
}
}
}
- current_instruction_ = old_current;
}
Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index
8133c31a0a5df75b5cce44a264fde6d67f113456..ced087a60f09225a719b45d78a119560d507230e
100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -2792,6 +2792,7 @@ class LChunkBuilder V8_FINAL : public
LChunkBuilderBase {
CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
void VisitInstruction(HInstruction* current);
+ void CheckAndAddInstruction(LInstruction* instr, HInstruction* current);
void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index
ec677ee3cc691b1d9c1f65436bb9ff6643bc9ff7..7468b10589ea37a47b048a8d04730e516d4103c6
100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -855,10 +855,18 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
argument_count_ += current->argument_delta();
ASSERT(argument_count_ >= 0);
+ CheckAndAddInstruction(instr, current);
+
+ current_instruction_ = old_current;
+}
+
+
+void LChunkBuilder::CheckAndAddInstruction(LInstruction* instr,
+ HInstruction* hydrogen_val) {
if (instr != NULL) {
// Associate the hydrogen instruction first, since we may need it for
// the ClobbersRegisters() or ClobbersDoubleRegisters() calls below.
- instr->set_hydrogen_value(current);
+ instr->set_hydrogen_value(hydrogen_val);
#if DEBUG
// Make sure that the lithium instruction has either no fixed register
@@ -899,10 +907,10 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
chunk_->AddInstruction(instr, current_block_);
if (instr->IsCall()) {
- HValue* hydrogen_value_for_lazy_bailout = current;
+ HValue* hydrogen_value_for_lazy_bailout = hydrogen_val;
LInstruction* instruction_needing_environment = NULL;
- if (current->HasObservableSideEffects()) {
- HSimulate* sim = HSimulate::cast(current->next());
+ if (hydrogen_val->HasObservableSideEffects()) {
+ HSimulate* sim = HSimulate::cast(hydrogen_val->next());
instruction_needing_environment = instr;
sim->ReplayEnvironment(current_block_->last_environment());
hydrogen_value_for_lazy_bailout = sim;
@@ -918,7 +926,6 @@ void LChunkBuilder::VisitInstruction(HInstruction*
current) {
}
}
}
- current_instruction_ = old_current;
}
Index: src/x64/lithium-x64.h
diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h
index
e3db375973473a1ff3bb4b78ba8ea4c2c6c56f4f..0d983d722b825e76312d383c0d3d020b7d6b452d
100644
--- a/src/x64/lithium-x64.h
+++ b/src/x64/lithium-x64.h
@@ -2806,6 +2806,7 @@ class LChunkBuilder V8_FINAL : public
LChunkBuilderBase {
CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
void VisitInstruction(HInstruction* current);
+ void CheckAndAddInstruction(LInstruction* instr, HInstruction* current);
void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.