rt: Update 32-bit __morestack for recent LLVM changes

This commit is contained in:
Brian Anderson
2011-12-04 20:40:34 -08:00
parent a69eab16ec
commit 52d7dc5e0a
2 changed files with 24 additions and 20 deletions

View File

@@ -598,10 +598,17 @@ rust_task::del_stack() {
void
rust_task::record_stack_limit() {
// FIXME: Future LLVM patches expect us to add an additional 256 bytes
// here so that, if the frame size is < 256 it can generate the
// comparison against esp directly, instead of some offset from esp
record_sp(stk->data + RED_ZONE_SIZE);
// The function prolog compares the amount of stack needed to the end of
// the stack. As an optimization, when the frame size is less than 256
// bytes, it will simply compare %esp to to the stack limit instead of
// subtracting the frame size. As a result we need our stack limit to
// account for those 256 bytes.
const unsigned LIMIT_OFFSET = 256;
A(sched,
(uintptr_t)stk->limit - RED_ZONE_SIZE
- (uintptr_t)stk->data >= LIMIT_OFFSET,
"Stack size must be greater than LIMIT_OFFSET");
record_sp(stk->data + LIMIT_OFFSET + RED_ZONE_SIZE);
}
//
// Local Variables: