[Vm-dev] [commit][3339] hopefully better version of isCFramePinterInUse()

commits at squeakvm.org commits at squeakvm.org
Wed May 13 00:03:29 UTC 2015


Revision: 3339
Author:   rowledge
Date:     2015-05-12 17:03:29 -0700 (Tue, 12 May 2015)
Log Message:
-----------
hopefully better version of isCFramePinterInUse()

Modified Paths:
--------------
    branches/Cog/platforms/unix/vm/sqUnixMain.c

Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMain.c	2015-05-13 00:02:31 UTC (rev 3338)
+++ branches/Cog/platforms/unix/vm/sqUnixMain.c	2015-05-13 00:03:29 UTC (rev 3339)
@@ -2122,7 +2122,16 @@
 /* Currently pretty sure fp is used but prepared to be shown wrong */
  int
 isCFramePointerInUse()
-{ return true; }
+{
+	extern unsigned long CStackPointer, CFramePointer;
+	extern void (*ceCaptureCStackPointers)(void);
+	unsigned long currentCSP = CStackPointer;
+
+	currentCSP = CStackPointer;
+	ceCaptureCStackPointers();
+	assert(CStackPointer < currentCSP);
+	return CFramePointer >= CStackPointer && CFramePointer <= currentCSP;
+}
 #endif /* defined(__arm__) || defined(__arm32__) || defined(ARM32) */
 /* Answer an approximation of the size of the redzone (if any).  Do so by
  * sending a signal to the process and computing the difference between the



More information about the Vm-dev mailing list