Commit 36aa2c17 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Check that environments assigned via AssignEnvironment are actually used.

Port r20430 (e9457854)

Original commit message:
Check that environments assigned via AssignEnvironment are actually used.

Removed some temporary marker comments on the way.

BUG=
R=plind44@gmail.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20452 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 60b589c5
...@@ -744,6 +744,7 @@ void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id, ...@@ -744,6 +744,7 @@ void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id,
void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment, void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment,
Safepoint::DeoptMode mode) { Safepoint::DeoptMode mode) {
environment->set_has_been_used();
if (!environment->HasBeenRegistered()) { if (!environment->HasBeenRegistered()) {
// Physical stack frame layout: // Physical stack frame layout:
// -x ............. -4 0 ..................................... y // -x ............. -4 0 ..................................... y
......
...@@ -628,6 +628,8 @@ LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, ...@@ -628,6 +628,8 @@ LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
!hinstr->HasObservableSideEffects(); !hinstr->HasObservableSideEffects();
if (needs_environment && !instr->HasEnvironment()) { if (needs_environment && !instr->HasEnvironment()) {
instr = AssignEnvironment(instr); instr = AssignEnvironment(instr);
// We can't really figure out if the environment is needed or not.
instr->environment()->set_has_been_used();
} }
return instr; return instr;
...@@ -1845,10 +1847,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { ...@@ -1845,10 +1847,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
LOperand* temp2 = FixedTemp(f22); LOperand* temp2 = FixedTemp(f22);
LInstruction* result = LInstruction* result =
DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2)); DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2));
if (!val->representation().IsSmi()) { if (!val->representation().IsSmi()) result = AssignEnvironment(result);
// Note: Only deopts in deferred code.
result = AssignEnvironment(result);
}
return result; return result;
} }
} }
...@@ -1943,11 +1942,10 @@ LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { ...@@ -1943,11 +1942,10 @@ LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) {
value = UseRegisterAtStart(instr->value()); value = UseRegisterAtStart(instr->value());
if (instr->has_migration_target()) info()->MarkAsDeferredCalling(); if (instr->has_migration_target()) info()->MarkAsDeferredCalling();
} }
LCheckMaps* result = new(zone()) LCheckMaps(value); LInstruction* result = new(zone()) LCheckMaps(value);
if (!instr->CanOmitMapChecks()) { if (!instr->CanOmitMapChecks()) {
// Note: Only deopts in deferred code. result = AssignEnvironment(result);
AssignEnvironment(result); if (instr->has_migration_target()) result = AssignPointerMap(result);
if (instr->has_migration_target()) return AssignPointerMap(result);
} }
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment