From f663c93c7159956b664c2e55bf6b7de2171cc48a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Thu, 3 Apr 2003 16:56:26 +0200
Subject: [PATCH] Reverted some low_mega_apply() changes.

Rev: src/interpret.c:1.302
Rev: src/interpret.h:1.135
Rev: src/interpret_functions.h:1.144
---
 src/interpret.c           | 40 +++++----------------------------------
 src/interpret.h           |  5 ++---
 src/interpret_functions.h | 28 +++++++++++++--------------
 3 files changed, 21 insertions(+), 52 deletions(-)

diff --git a/src/interpret.c b/src/interpret.c
index efc2f32cd0..aab355e37a 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -2,11 +2,11 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: interpret.c,v 1.301 2003/03/24 12:23:32 jonasw Exp $
+|| $Id: interpret.c,v 1.302 2003/04/03 14:56:26 grubba Exp $
 */
 
 #include "global.h"
-RCSID("$Id: interpret.c,v 1.301 2003/03/24 12:23:32 jonasw Exp $");
+RCSID("$Id: interpret.c,v 1.302 2003/04/03 14:56:26 grubba Exp $");
 #include "interpret.h"
 #include "object.h"
 #include "program.h"
@@ -1364,8 +1364,7 @@ void really_free_pike_scope(struct pike_frame *scope)
  *   eval_instruction() is done the frame needs to be removed by a call
  *   to low_return() or low_return_pop().
  */
-PIKE_OPCODE_T *low_mega_apply(enum apply_type type, int frame_flags,
-			      INT32 args, void *arg1, void *arg2)
+int low_mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2)
 {
   struct object *o;
   struct pike_frame *scope=0;
@@ -1561,36 +1560,7 @@ PIKE_OPCODE_T *low_mega_apply(enum apply_type type, int frame_flags,
     }
     if(Pike_interpreter.trace_level>1) trace_return_value();
   }
-#if 0
-  if (frame_flags & PIKE_FRAME_RETURN_POP) {
-    pop_stack();
-  }
-  if (frame_flags & PIKE_FRAME_RETURN_INTERNAL) {
-    /* Inlined DO_DUMB_RETURN */
-    if (Pike_fp->flags & PIKE_FRAME_RETURN_INTERNAL) {
-      if (Pike_fp->flags & PIKE_FRAME_RETURN_POP) {
-	low_return_pop();
-      } else {
-	low_return();
-      }
-#ifdef PIKE_DEBUG
-      if (t_flag) {
-	fprintf(stderr, "Returning to 0x%p\n", Pike_fp->pc);
-      }
-#endif /* PIKE_DEBUG */
-      return Pike_fp->pc;
-    } else {
-      /* Inter return */
-#ifdef PIKE_DEBUG
-      if (t_flag) {
-	fprintf(stderr, "Inter return\n");
-      }
-#endif /* PIKE_DEBUG */
-      return 1;
-    }
-  }
-#endif /* 0 */
-  return NULL;
+  return 0;
 }
 
 
@@ -1725,7 +1695,7 @@ void unlink_previous_frame(void)
 void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2)
 {
   check_c_stack(8192);
-  if(low_mega_apply(type, 0, args, arg1, arg2))
+  if(low_mega_apply(type, args, arg1, arg2))
   {
     eval_instruction(Pike_fp->pc
 #ifdef ENTRY_PROLOGUE_SIZE
diff --git a/src/interpret.h b/src/interpret.h
index a2ba0bf3c0..b9c06b1291 100644
--- a/src/interpret.h
+++ b/src/interpret.h
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: interpret.h,v 1.134 2003/03/21 14:36:01 mast Exp $
+|| $Id: interpret.h,v 1.135 2003/04/03 14:56:26 grubba Exp $
 */
 
 #ifndef INTERPRET_H
@@ -399,8 +399,7 @@ void simple_debug_instr_prologue_2 (PIKE_INSTR_T instr, INT32 arg1, INT32 arg2);
 PMOD_EXPORT void find_external_context(struct external_variable_context *loc,
 				       int arg2);
 void really_free_pike_scope(struct pike_frame *scope);
-PIKE_OPCODE_T *low_mega_apply(enum apply_type type, int frame_flags,
-			      INT32 args, void *arg1, void *arg2);
+int low_mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2);
 void low_return(void);
 void low_return_pop(void);
 void unlink_previous_frame(void);
diff --git a/src/interpret_functions.h b/src/interpret_functions.h
index 8f769cf576..3ef0d838a1 100644
--- a/src/interpret_functions.h
+++ b/src/interpret_functions.h
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: interpret_functions.h,v 1.143 2003/03/25 15:40:42 marcus Exp $
+|| $Id: interpret_functions.h,v 1.144 2003/04/03 14:56:26 grubba Exp $
 */
 
 /*
@@ -1721,7 +1721,7 @@ OPCODE1_ALIAS(F_SSCANF, "sscanf", 0, o_sscanf);
 #define MKAPPLY(OP,OPCODE,NAME,TYPE,  ARG2, ARG3)			   \
 OP(PIKE_CONCAT(F_,OPCODE),NAME, I_PC_AT_NEXT, {				   \
 Pike_fp->pc=PROG_COUNTER;						   \
-if(low_mega_apply(TYPE,0,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),  \
+if(low_mega_apply(TYPE,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    \
 		  ARG2, ARG3))						   \
 {									   \
   Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;				   \
@@ -1731,7 +1731,7 @@ if(low_mega_apply(TYPE,0,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),  \
 									   \
 OP(PIKE_CONCAT3(F_,OPCODE,_AND_POP),NAME " & pop", I_PC_AT_NEXT, {	   \
   Pike_fp->pc=PROG_COUNTER;						   \
-  if(low_mega_apply(TYPE, 0, DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \
+  if(low_mega_apply(TYPE, DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \
 		    ARG2, ARG3))					   \
   {									   \
     Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP;  \
@@ -1743,7 +1743,7 @@ OP(PIKE_CONCAT3(F_,OPCODE,_AND_POP),NAME " & pop", I_PC_AT_NEXT, {	   \
 									   \
 PIKE_CONCAT(OP,_RETURN)(PIKE_CONCAT3(F_,OPCODE,_AND_RETURN),		   \
 			NAME " & return", 0, {				   \
-  if(low_mega_apply(TYPE,0,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),  \
+  if(low_mega_apply(TYPE,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),  \
 		    ARG2,ARG3))						   \
   {									   \
     PIKE_OPCODE_T *addr = Pike_fp->pc;					   \
@@ -1762,7 +1762,7 @@ MKAPPLY(OP,OPCODE,NAME,TYPE,  ARG2, ARG3)			           \
 									   \
 OP(PIKE_CONCAT(F_MARK_,OPCODE),"mark, " NAME, I_PC_AT_NEXT, {		   \
   Pike_fp->pc=PROG_COUNTER;						   \
-  if(low_mega_apply(TYPE,0, 0,						   \
+  if(low_mega_apply(TYPE, 0,						   \
 		    ARG2, ARG3))					   \
   {									   \
     Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;			   \
@@ -1772,7 +1772,7 @@ OP(PIKE_CONCAT(F_MARK_,OPCODE),"mark, " NAME, I_PC_AT_NEXT, {		   \
 									   \
 OP(PIKE_CONCAT3(F_MARK_,OPCODE,_AND_POP),"mark, " NAME " & pop", I_PC_AT_NEXT, { \
   Pike_fp->pc=PROG_COUNTER;						   \
-  if(low_mega_apply(TYPE, 0, 0,						   \
+  if(low_mega_apply(TYPE, 0,						   \
 		    ARG2, ARG3))					   \
   {									   \
     Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP;  \
@@ -1784,7 +1784,7 @@ OP(PIKE_CONCAT3(F_MARK_,OPCODE,_AND_POP),"mark, " NAME " & pop", I_PC_AT_NEXT, {
 									   \
 PIKE_CONCAT(OP,_RETURN)(PIKE_CONCAT3(F_MARK_,OPCODE,_AND_RETURN),	   \
 			"mark, " NAME " & return", 0, {			   \
-  if(low_mega_apply(TYPE,0, 0,						   \
+  if(low_mega_apply(TYPE, 0,						   \
 		    ARG2,ARG3))						   \
   {									   \
     PIKE_OPCODE_T *addr = Pike_fp->pc;					   \
@@ -1823,7 +1823,7 @@ OPCODE1(F_CALL_OTHER,"call other", I_PC_AT_NEXT, {
 					  p);
 	if(fun >= 0)
 	{
-	  if(low_mega_apply(APPLY_LOW, 0, args-1, o, (void *)(ptrdiff_t)fun))
+	  if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun))
 	  {
 	    Pike_fp->save_sp--;
 	    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;
@@ -1849,7 +1849,7 @@ OPCODE1(F_CALL_OTHER,"call other", I_PC_AT_NEXT, {
     *s=tmp2;
     print_return_value();
 
-    if(low_mega_apply(APPLY_STACK, 0, args, 0, 0))
+    if(low_mega_apply(APPLY_STACK, args, 0, 0))
     {
       Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;
       DO_JUMP_TO(Pike_fp->pc);
@@ -1875,7 +1875,7 @@ OPCODE1(F_CALL_OTHER_AND_POP,"call other & pop", I_PC_AT_NEXT, {
 					  p);
 	if(fun >= 0)
 	{
-	  if(low_mega_apply(APPLY_LOW, 0, args-1, o, (void *)(ptrdiff_t)fun))
+	  if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun))
 	  {
 	    Pike_fp->save_sp--;
 	    Pike_fp->flags |=
@@ -1903,7 +1903,7 @@ OPCODE1(F_CALL_OTHER_AND_POP,"call other & pop", I_PC_AT_NEXT, {
     *s=tmp2;
     print_return_value();
 
-    if(low_mega_apply(APPLY_STACK, 0, args, 0, 0))
+    if(low_mega_apply(APPLY_STACK, args, 0, 0))
     {
       Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP;
       DO_JUMP_TO(Pike_fp->pc);
@@ -1928,7 +1928,7 @@ OPCODE1(F_CALL_OTHER_AND_RETURN,"call other & return", 0, {
 					  p);
 	if(fun >= 0)
 	{
-	  if(low_mega_apply(APPLY_LOW, 0, args-1, o, (void *)(ptrdiff_t)fun))
+	  if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun))
 	  {
 	    PIKE_OPCODE_T *addr = Pike_fp->pc;
 	    Pike_fp->save_sp--;
@@ -1956,7 +1956,7 @@ OPCODE1(F_CALL_OTHER_AND_RETURN,"call other & return", 0, {
     *s=tmp2;
     print_return_value();
 
-    if(low_mega_apply(APPLY_STACK, 0, args, 0, 0))
+    if(low_mega_apply(APPLY_STACK, args, 0, 0))
     {
       PIKE_OPCODE_T *addr = Pike_fp->pc;
       DO_IF_DEBUG(Pike_fp->next->pc=0);
@@ -2137,7 +2137,7 @@ OPCODE1_JUMP(F_COND_RECUR, "recur if not overloaded", I_PC_AT_NEXT, {
     ptrdiff_t num_locals = READ_INCR_BYTE(faddr);	/* ignored */
     ptrdiff_t args = READ_INCR_BYTE(faddr);
 
-    if(low_mega_apply(APPLY_LOW, 0,
+    if(low_mega_apply(APPLY_LOW,
 		      args,
 		      Pike_fp->current_object,
 		      (void *)(ptrdiff_t)(arg1+
-- 
GitLab