class Main { publicstaticvoid main(String[] args) {
foo();
}
publicstaticvoid foo() { int a = myField1; // esi int b = myField2; // edi
$noinline$bar(); // makes allocation of a and b to be callee-save registers int c = myField3; // ecx int e = myField4; // ebx int f = myField5; // edx long d = a == 42 ? myLongField1 : 42L; // Will call AllocateBlockedReg -> edx/ebx
// At this point, the register allocator used to be in a bogus state, where the low // part of the interval was in the active set, but not the high part.
long i = myLongField1; // Will call TrySplitNonPairOrUnalignedPairIntervalAt -> Failing DCHECK
// Use esi and edi first to not have d allocated to them.
myField2 = a;
myField3 = b;
// The following sequence of instructions are making the AllocateBlockedReg call // for allocating the d variable misbehave: allocation of the low interval would split // both low and high interval at the fixed use; therefore the allocation of the high interval // would not see the register use, and think the interval can just be spilled and not be // put in the active set, even though it is holding a register.
myField1 = (int)d; // stack use
myLongField3 = (long) myField2; // edx fixed use
myLongField2 = d; // register use
// Ensure the HInstruction mapping to i, c, e, and f have a live range.
myLongField1 = i;
myField4 = c;
myField5 = e;
myField6 = f;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.