[kaffe] CVS kaffe (dalibor): Moved signature stack handling into own module
Kaffe CVS
Kaffe Mailing List <kaffe@kaffe.org>
Sun Feb 29 12:24:02 2004
PatchSet 4476
Date: 2004/02/29 20:14:26
Author: dalibor
Branch: HEAD
Tag: (none)
Log:
Moved signature stack handling into own module
2004-02-29 Dalibor Topic <robilad@kaffe.org>
* kaffe/kaffevm/verify-sigstack.c,
kaffe/kaffevm/verify-sigstack.h:
New files.
* kaffe/kaffevm/Makefile.am:
(libkaffevm_la_SOURCES): Added verify-sugstack.c.
(noinst_HEADERS): Added verify-sigstackt.h.
* kaffe/kaffevm/Makefile.in:
Regenerated.
* kaffe/kaffevm/gc.h:
Include gtypes.h.
* kaffe/kaffevm/verify.c,
kaffe/kaffevm/verify.h:
(pushSig, freeSigStack, SigStack) Moved to
kaffe/kaffevm/verify-sigstack.c and
kaffe/kaffevm/verify-sigstack.h.
Members:
ChangeLog:1.2056->1.2057
kaffe/kaffevm/Makefile.am:1.51->1.52
kaffe/kaffevm/Makefile.in:1.134->1.135
kaffe/kaffevm/gc.h:1.20->1.21
kaffe/kaffevm/verify-sigstack.c:INITIAL->1.1
kaffe/kaffevm/verify-sigstack.h:INITIAL->1.1
kaffe/kaffevm/verify.c:1.68->1.69
kaffe/kaffevm/verify.h:1.8->1.9
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2056 kaffe/ChangeLog:1.2057
--- kaffe/ChangeLog:1.2056 Sun Feb 29 18:42:44 2004
+++ kaffe/ChangeLog Sun Feb 29 20:14:26 2004
@@ -1,5 +1,27 @@
2004-02-29 Dalibor Topic <robilad@kaffe.org>
+ * kaffe/kaffevm/verify-sigstack.c,
+ kaffe/kaffevm/verify-sigstack.h:
+ New files.
+
+ * kaffe/kaffevm/Makefile.am:
+ (libkaffevm_la_SOURCES): Added verify-sugstack.c.
+ (noinst_HEADERS): Added verify-sigstackt.h.
+
+ * kaffe/kaffevm/Makefile.in:
+ Regenerated.
+
+ * kaffe/kaffevm/gc.h:
+ Include gtypes.h.
+
+ * kaffe/kaffevm/verify.c,
+ kaffe/kaffevm/verify.h:
+ (pushSig, freeSigStack, SigStack) Moved to
+ kaffe/kaffevm/verify-sigstack.c and
+ kaffe/kaffevm/verify-sigstack.h.
+
+2004-02-29 Dalibor Topic <robilad@kaffe.org>
+
* kaffe/kaffevm/verify-uninit.c,
kaffe/kaffevm/verify-uninit.h:
New files.
Index: kaffe/kaffe/kaffevm/Makefile.am
diff -u kaffe/kaffe/kaffevm/Makefile.am:1.51 kaffe/kaffe/kaffevm/Makefile.am:1.52
--- kaffe/kaffe/kaffevm/Makefile.am:1.51 Sun Feb 29 18:42:46 2004
+++ kaffe/kaffe/kaffevm/Makefile.am Sun Feb 29 20:14:28 2004
@@ -94,6 +94,7 @@
gcRefs.c \
verify.c \
verify-debug.c \
+ verify-sigstack.c \
verify-uninit.c
noinst_HEADERS = \
@@ -138,6 +139,7 @@
utf8const.h \
verify.h \
verify-debug.h \
+ verify-sigstack.h \
verify-uninit.h
gc-mem.c: stamp-h01
Index: kaffe/kaffe/kaffevm/Makefile.in
diff -u kaffe/kaffe/kaffevm/Makefile.in:1.134 kaffe/kaffe/kaffevm/Makefile.in:1.135
--- kaffe/kaffe/kaffevm/Makefile.in:1.134 Sun Feb 29 18:42:46 2004
+++ kaffe/kaffe/kaffevm/Makefile.in Sun Feb 29 20:14:28 2004
@@ -80,7 +80,7 @@
locks.lo lookup.lo object.lo readClass.lo sha-1.lo soft.lo \
stackTrace.lo stats.lo string.lo stringParsing.lo support.lo \
thread.lo utf8const.lo gcFuncs.lo gcRefs.lo verify.lo \
- verify-debug.lo verify-uninit.lo
+ verify-debug.lo verify-sigstack.lo verify-uninit.lo
am__objects_1 = gc-mem.lo md.lo
nodist_libkaffevm_la_OBJECTS = $(am__objects_1)
libkaffevm_la_OBJECTS = $(am_libkaffevm_la_OBJECTS) \
@@ -110,6 +110,7 @@
@AMDEP_TRUE@ ./$(DEPDIR)/support.Plo ./$(DEPDIR)/thread.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/utf8const.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/verify-debug.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/verify-sigstack.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/verify-uninit.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/verify.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -437,6 +438,7 @@
gcRefs.c \
verify.c \
verify-debug.c \
+ verify-sigstack.c \
verify-uninit.c
noinst_HEADERS = \
@@ -481,6 +483,7 @@
utf8const.h \
verify.h \
verify-debug.h \
+ verify-sigstack.h \
verify-uninit.h
CLEANFILES = so_locations
@@ -591,6 +594,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8const.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify-debug.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify-sigstack.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify-uninit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify.Plo@am__quote@
Index: kaffe/kaffe/kaffevm/gc.h
diff -u kaffe/kaffe/kaffevm/gc.h:1.20 kaffe/kaffe/kaffevm/gc.h:1.21
--- kaffe/kaffe/kaffevm/gc.h:1.20 Mon Sep 22 15:31:24 2003
+++ kaffe/kaffe/kaffevm/gc.h Sun Feb 29 20:14:28 2004
@@ -12,6 +12,8 @@
#ifndef __gc_h
#define __gc_h
+#include "gtypes.h"
+
/*
* We do not support incremental collection as this time.
*/
===================================================================
Checking out kaffe/kaffe/kaffevm/verify-sigstack.c
RCS: /home/cvs/kaffe/kaffe/kaffe/kaffevm/verify-sigstack.c,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/kaffe/kaffevm/verify-sigstack.c Sun Feb 29 20:17:32 2004
@@ -0,0 +1,44 @@
+/*
+ * verify-sigstack.c
+ *
+ * Copyright 2004
+ * Kaffe.org contributors. See ChangeLog for details. All rights reserved.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ *
+ * Code for handing of signature stack in the verifier.
+ */
+
+#include "errors.h"
+#include "gc.h"
+#include "verify-sigstack.h"
+
+/*
+ * pushSig()
+ * Pushes a new signature on the Stack
+ */
+SigStack*
+pushSig(SigStack* sigs, const char* sig)
+{
+ SigStack* new_sig = checkPtr(gc_malloc(sizeof(SigStack), GC_ALLOC_VERIFIER));
+ new_sig->sig = sig;
+ new_sig->next = sigs;
+ return new_sig;
+}
+
+
+/*
+ * freeSigStack()
+ * Frees the memory consumed by a stack of names and signatures.
+ */
+void
+freeSigStack(SigStack* sigs)
+{
+ SigStack* tmp;
+ while(sigs != NULL) {
+ tmp = sigs->next;
+ gc_free(sigs);
+ sigs = tmp;
+ }
+}
===================================================================
Checking out kaffe/kaffe/kaffevm/verify-sigstack.h
RCS: /home/cvs/kaffe/kaffe/kaffe/kaffevm/verify-sigstack.h,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/kaffe/kaffevm/verify-sigstack.h Sun Feb 29 20:17:32 2004
@@ -0,0 +1,27 @@
+/*
+ * verify-sigstack.h
+ *
+ * Copyright 2004
+ * Kaffe.org contributors. See ChangeLog for details. All rights reserved.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ *
+ * Interface to code for handing of signature stack in the verifier.
+ */
+
+/*
+ * the sig stack is the stack of signatures that we have allocated memory for which
+ * must be freed after verification.
+ */
+/* TODO: use the builtin hash table data structure instead
+ * so we can avoid repeats
+ */
+typedef struct sig_stack
+{
+ const char* sig;
+ struct sig_stack* next;
+} SigStack;
+
+extern SigStack* pushSig(SigStack* sigs, const char* sig);
+extern void freeSigStack(SigStack* sigs);
Index: kaffe/kaffe/kaffevm/verify.c
diff -u kaffe/kaffe/kaffevm/verify.c:1.68 kaffe/kaffe/kaffevm/verify.c:1.69
--- kaffe/kaffe/kaffevm/verify.c:1.68 Sun Feb 29 18:42:46 2004
+++ kaffe/kaffe/kaffevm/verify.c Sun Feb 29 20:14:28 2004
@@ -36,6 +36,7 @@
#include "verify.h"
#include "verify-debug.h"
+#include "verify-sigstack.h"
#include "verify-uninit.h"
/*
@@ -1023,10 +1024,6 @@
static BlockInfo* inWhichBlock(uint32 pc, BlockInfo** blocks, uint32 numBlocks);
-
-static SigStack* pushSig(SigStack* sigs, const char* sig);
-static void freeSigStack(SigStack* sigs);
-
static bool verifyMethod(errorInfo* einfo, Method* method);
static BlockInfo** verifyMethod3a(errorInfo* einfo,
Method* method,
@@ -5013,38 +5010,3 @@
return NULL;
}
-
-
-
-/*
- * pushSig()
- * Pushes a new signature on the Stack
- */
-static
-SigStack*
-pushSig(SigStack* sigs, const char* sig)
-{
- SigStack* new_sig = checkPtr(gc_malloc(sizeof(SigStack), GC_ALLOC_VERIFIER));
- new_sig->sig = sig;
- new_sig->next = sigs;
- return new_sig;
-}
-
-
-/*
- * freeSigStack()
- * Frees the memory consumed by a stack of names and signatures.
- */
-static
-void
-freeSigStack(SigStack* sigs)
-{
- SigStack* tmp;
- while(sigs != NULL) {
- tmp = sigs->next;
- gc_free(sigs);
- sigs = tmp;
- }
-}
-
-
Index: kaffe/kaffe/kaffevm/verify.h
diff -u kaffe/kaffe/kaffevm/verify.h:1.8 kaffe/kaffe/kaffevm/verify.h:1.9
--- kaffe/kaffe/kaffevm/verify.h:1.8 Sun Feb 29 18:42:46 2004
+++ kaffe/kaffe/kaffevm/verify.h Sun Feb 29 20:14:28 2004
@@ -135,22 +135,6 @@
#define EXCEPTION_HANDLER 64
-
-/*
- * the sig stack is the stack of signatures that we have allocated memory for which
- * must be freed after verification.
- */
-/* TODO: use the builtin hash table data structure instead
- * so we can avoid repeats
- */
-typedef struct sig_stack
-{
- const char* sig;
- struct sig_stack* next;
-} SigStack;
-
-
-
void initVerifierPrimTypes(void);
bool sameType(Type* t1, Type* t2);
bool verify3(Hjava_lang_Class* class, errorInfo *einfo);