Commit c2200099 by Anthony Green Committed by Anthony Green

defineclass.cc: Don't include alloca.h.

2001-02-15  Anthony Green  <green@redhat.com>

	* defineclass.cc: Don't include alloca.h.
	(prepare_pool_entry): Convert alloca to __builtin_alloca.
	* interpret.cc (run_normal): Ditto.
        (continue1): Ditto.
	* java/lang/natDouble.cc (parseDouble): Ditto.

From-SVN: r39719
parent 85b99cbe
2001-02-15 Anthony Green <green@redhat.com>
* defineclass.cc: Don't include alloca.h.
(prepare_pool_entry): Convert alloca to __builtin_alloca.
* interpret.cc (run_normal): Ditto.
(continue1): Ditto.
* java/lang/natDouble.cc (parseDouble): Ditto.
2001-02-15 Bryce McKinlay <bryce@albatross.co.nz> 2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/TreeSet.java (clone): Call TreeMap.clone(), not * java/util/TreeSet.java (clone): Call TreeMap.clone(), not
......
...@@ -25,9 +25,6 @@ details. */ ...@@ -25,9 +25,6 @@ details. */
#ifdef INTERPRETER #ifdef INTERPRETER
#include <stdlib.h> #include <stdlib.h>
#if HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <java-cpool.h> #include <java-cpool.h>
#include <gcj/cni.h> #include <gcj/cni.h>
...@@ -678,7 +675,7 @@ _Jv_ClassReader::prepare_pool_entry (int index, unsigned char this_tag) ...@@ -678,7 +675,7 @@ _Jv_ClassReader::prepare_pool_entry (int index, unsigned char this_tag)
// order to accomondate gcj's internal representation. // order to accomondate gcj's internal representation.
int len = get2u (this_data); int len = get2u (this_data);
char *buffer = (char*) alloca (len); char *buffer = (char*) __builtin_alloca (len);
char *s = ((char*) this_data)+2; char *s = ((char*) this_data)+2;
/* FIXME: avoid using a buffer here */ /* FIXME: avoid using a buffer here */
......
...@@ -36,9 +36,6 @@ details. */ ...@@ -36,9 +36,6 @@ details. */
#ifdef INTERPRETER #ifdef INTERPRETER
#include <stdlib.h> #include <stdlib.h>
#if HAVE_ALLOCA_H
#include <alloca.h>
#endif
static _Jv_Utf8Const *init_name = _Jv_makeUtf8Const ("<init>", 6); static _Jv_Utf8Const *init_name = _Jv_makeUtf8Const ("<init>", 6);
...@@ -336,8 +333,8 @@ void _Jv_InterpMethod::run_normal (ffi_cif* cif, ...@@ -336,8 +333,8 @@ void _Jv_InterpMethod::run_normal (ffi_cif* cif,
// "run" ro be inlined. Otherwise gcc will ignore the inline directive. // "run" ro be inlined. Otherwise gcc will ignore the inline directive.
int storage_size = _this->max_stack+_this->max_locals; int storage_size = _this->max_stack+_this->max_locals;
_Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*) _Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*)
alloca (sizeof (_Jv_InterpMethodInvocation) __builtin_alloca (sizeof (_Jv_InterpMethodInvocation)
+ storage_size * sizeof (_Jv_word)); + storage_size * sizeof (_Jv_word));
jobject ex = _this->run (cif, ret, args, inv); jobject ex = _this->run (cif, ret, args, inv);
if (ex != 0) _Jv_Throw (ex); if (ex != 0) _Jv_Throw (ex);
...@@ -353,8 +350,8 @@ void _Jv_InterpMethod::run_synch_object (ffi_cif* cif, ...@@ -353,8 +350,8 @@ void _Jv_InterpMethod::run_synch_object (ffi_cif* cif,
int storage_size = _this->max_stack+_this->max_locals; int storage_size = _this->max_stack+_this->max_locals;
_Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*) _Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*)
alloca (sizeof (_Jv_InterpMethodInvocation) __builtin_alloca (sizeof (_Jv_InterpMethodInvocation)
+ storage_size * sizeof (_Jv_word)); + storage_size * sizeof (_Jv_word));
_Jv_MonitorEnter (rcv); _Jv_MonitorEnter (rcv);
jobject ex = _this->run (cif, ret, args, inv); jobject ex = _this->run (cif, ret, args, inv);
...@@ -373,8 +370,8 @@ void _Jv_InterpMethod::run_synch_class (ffi_cif* cif, ...@@ -373,8 +370,8 @@ void _Jv_InterpMethod::run_synch_class (ffi_cif* cif,
int storage_size = _this->max_stack+_this->max_locals; int storage_size = _this->max_stack+_this->max_locals;
_Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*) _Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*)
alloca (sizeof (_Jv_InterpMethodInvocation) __builtin_alloca (sizeof (_Jv_InterpMethodInvocation)
+ storage_size * sizeof (_Jv_word)); + storage_size * sizeof (_Jv_word));
_Jv_MonitorEnter (sync); _Jv_MonitorEnter (sync);
jobject ex = _this->run (cif, ret, args, inv); jobject ex = _this->run (cif, ret, args, inv);
...@@ -2380,7 +2377,7 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv) ...@@ -2380,7 +2377,7 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv)
jclass type jclass type
= (_Jv_ResolvePoolEntry (defining_class, kind_index)).clazz; = (_Jv_ResolvePoolEntry (defining_class, kind_index)).clazz;
_Jv_InitClass (type); _Jv_InitClass (type);
jint *sizes = (jint*) alloca (sizeof (jint)*dim); jint *sizes = (jint*) __builtin_alloca (sizeof (jint)*dim);
for (int i = dim - 1; i >= 0; i--) for (int i = dim - 1; i >= 0; i--)
{ {
......
...@@ -10,10 +10,6 @@ details. */ ...@@ -10,10 +10,6 @@ details. */
#include <config.h> #include <config.h>
#if HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <gcj/cni.h> #include <gcj/cni.h>
...@@ -166,11 +162,7 @@ java::lang::Double::parseDouble(jstring str) ...@@ -166,11 +162,7 @@ java::lang::Double::parseDouble(jstring str)
int length = str->length(); int length = str->length();
// Note that UTF can expand 3x. // Note that UTF can expand 3x.
#ifdef HAVE_ALLOCA char *data = (char *) __builtin_alloca (3 * length + 1);
char *data = (char *) alloca (3 * length + 1);
#else
#error --- need an alternate implementation here ---
#endif
data[_Jv_GetStringUTFRegion (str, 0, length, data)] = 0; data[_Jv_GetStringUTFRegion (str, 0, length, data)] = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment