From f943914730db8ad2ff03d49a2cacd31885d08fd7 Mon Sep 17 00:00:00 2001 From: Dave Allison Date: Thu, 27 Mar 2014 15:10:22 -0700 Subject: Implement implicit stack overflow checks This also fixes some failing run tests due to missing null pointer markers. The implementation of the implicit stack overflow checks introduces the ability to have a gap in the stack that is skipped during stack walk backs. This gap is protected against read/write and is used to trigger a SIGSEGV at function entry if the stack will overflow. Change-Id: I0c3e214c8b87dc250cf886472c6d327b5d58653e --- runtime/stack.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runtime/stack.h') diff --git a/runtime/stack.h b/runtime/stack.h index 4ee5de1..ab903d6 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -100,6 +100,14 @@ enum VRegBaseRegNum : int { kVRegNonSpecialTempBaseReg = -3, }; +// Special object used to mark the gap in the stack placed when a stack +// overflow fault occurs during implicit stack checking. This is not +// a real object - it is used simply as a valid address to which a +// mirror::ArtMethod* can be compared during a stack walk. It is inserted +// into the stack during the stack overflow signal handling to mark the gap +// in which the memory is protected against read and write. +extern void* stack_overflow_gap_marker; + // A reference from the shadow stack to a MirrorType object within the Java heap. template class MANAGED StackReference : public mirror::ObjectReference { -- cgit v1.1