Ensure LModByPowerOf2I only gets environment when it deopts.

R=svenpanne@chromium.org
TEST=mozilla (with new --always-opt)

Review URL: https://codereview.chromium.org/423093009

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2014-08-04 08:47:15 +00:00
parent 84525e2b2f
commit ab1cb70c8d
8 changed files with 16 additions and 9 deletions

View File

@ -1416,7 +1416,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
dividend, divisor));
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
return result;

View File

@ -1854,7 +1854,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
dividend, divisor));
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
return result;

View File

@ -1464,7 +1464,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
dividend, divisor));
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
return result;

View File

@ -116,12 +116,12 @@ void LCodeGenBase::CheckEnvironmentUsage() {
HInstruction* hinstr = HInstruction::cast(hval);
if (!hinstr->CanDeoptimize() && instr->HasEnvironment()) {
V8_Fatal(__FILE__, __LINE__, "CanDeoptimize is wrong for %s (%s)\n",
V8_Fatal(__FILE__, __LINE__, "CanDeoptimize is wrong for %s (%s)",
hinstr->Mnemonic(), instr->Mnemonic());
}
if (instr->HasEnvironment() && !instr->environment()->has_been_used()) {
V8_Fatal(__FILE__, __LINE__, "unused environment for %s (%s)\n",
V8_Fatal(__FILE__, __LINE__, "unused environment for %s (%s)",
hinstr->Mnemonic(), instr->Mnemonic());
}
}

View File

@ -1419,7 +1419,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
dividend, divisor));
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
return result;

View File

@ -1421,7 +1421,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
dividend, divisor));
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
return result;

View File

@ -1444,7 +1444,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
dividend, divisor));
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
return result;

View File

@ -1450,7 +1450,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
dividend, divisor));
if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
return result;