staticvoid crash() { boolean b = baz(); // Create many objects to starve registers.
Main foo1 = create();
Main foo2 = create();
Main foo3 = create();
Main foo4 = create();
foo1.otherField = null; // On X86, we would force b to be in a byte register, which // would generate moves. This code exposed a bug in the // register allocator, where an input move was not just before // the instruction itself, and its destination was overridden // by another value.
foo1.field = b;
foo2.field = b;
foo3.field = b;
foo4.field = b;
foo1.lastField = b;
}
// Similar to `crash` but generated an NPE. staticvoid npe() { boolean b = baz();
Main foo1 = create();
Main foo2 = create();
Main foo3 = create();
Main foo4 = create();
foo1.field = b;
foo2.field = b;
foo3.field = b;
foo4.field = b;
foo1.lastField = b;
}
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.