[project @ 2004-08-22 16:34:54 by panne]
[ghc-hetmet.git] / ghc / rts / Adjustor.c
index ea91d90..da8951c 100644 (file)
@@ -153,7 +153,8 @@ createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr)
      <c>:      ff e0             jmp    %eax              # and jump to it.
                # the callee cleans up the stack
     */
-    if ((adjustor = stgMallocBytes(14, "createAdjustor")) != NULL) {
+    adjustor = stgMallocBytes(14, "createAdjustor");
+    {
        unsigned char *const adj_code = (unsigned char *)adjustor;
        adj_code[0x00] = (unsigned char)0x58;  /* popl %eax  */
 
@@ -199,7 +200,8 @@ createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr)
     That's (thankfully) the case here with the restricted set of 
     return types that we support.
   */
-    if ((adjustor = stgMallocBytes(17, "createAdjustor")) != NULL) {
+    adjustor = stgMallocBytes(17, "createAdjustor");
+    {
        unsigned char *const adj_code = (unsigned char *)adjustor;
 
        adj_code[0x00] = (unsigned char)0x68;  /* pushl hptr (which is a dword immediate ) */
@@ -246,7 +248,8 @@ createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr)
      similarly, and local variables should be accessed via %fp, not %sp. In a
      nutshell: This should work! (Famous last words! :-)
   */
-    if ((adjustor = stgMallocBytes(4*(11+1), "createAdjustor")) != NULL) {
+    adjustor = stgMallocBytes(4*(11+1), "createAdjustor");
+    {
         unsigned long *const adj_code = (unsigned long *)adjustor;
 
         adj_code[ 0]  = 0x9C23A008UL;   /* sub   %sp, 8, %sp         */
@@ -322,7 +325,8 @@ TODO: Depending on how much allocation overhead stgMallocBytes uses for
       4 bytes (getting rid of the nop), hence saving memory. [ccshan]
   */
     ASSERT(((StgWord64)wptr & 3) == 0);
-    if ((adjustor = stgMallocBytes(48, "createAdjustor")) != NULL) {
+    adjustor = stgMallocBytes(48, "createAdjustor");
+    {
        StgWord64 *const code = (StgWord64 *)adjustor;
 
        code[0] = 0x4610041246520414L;
@@ -359,7 +363,8 @@ TODO: Depending on how much allocation overhead stgMallocBytes uses for
        this code, it only works for up to 6 arguments (when floating point arguments
        are involved, this may be more or less, depending on the exact situation).
 */
-       if ((adjustor = stgMallocBytes(4*13, "createAdjustor")) != NULL) {
+       adjustor = stgMallocBytes(4*13, "createAdjustor");
+       {
                unsigned long *const adj_code = (unsigned long *)adjustor;
 
                // make room for extra arguments