summaryrefslogtreecommitdiff
path: root/libjava/java/io/natVMObjectStreamClass.cc
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libjava/java/io/natVMObjectStreamClass.cc
downloadcbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.bz2
cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libjava/java/io/natVMObjectStreamClass.cc')
-rw-r--r--libjava/java/io/natVMObjectStreamClass.cc87
1 files changed, 87 insertions, 0 deletions
diff --git a/libjava/java/io/natVMObjectStreamClass.cc b/libjava/java/io/natVMObjectStreamClass.cc
new file mode 100644
index 000000000..847b540f0
--- /dev/null
+++ b/libjava/java/io/natVMObjectStreamClass.cc
@@ -0,0 +1,87 @@
+// natVMObjectStreamClass.cc - Native part of VMObjectStreamClass class.
+
+/* Copyright (C) 2003 Free Software Foundation
+
+ This VMObjectStreamClass is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the ObjectInputStream "LIBGCJ_LICENSE" for
+details. */
+
+#include <gcj/cni.h>
+#include <jvm.h>
+
+#include <java/io/VMObjectStreamClass.h>
+#include <java/lang/Class.h>
+#include <java/lang/reflect/Field.h>
+
+using namespace java::lang::reflect;
+
+jboolean
+java::io::VMObjectStreamClass::hasClassInitializer (jclass klass)
+{
+ if (klass->isPrimitive())
+ return false;
+ _Jv_Method *meth = _Jv_GetMethodLocal(klass, gcj::clinit_name,
+ gcj::void_signature);
+ return (meth != NULL);
+}
+
+void
+java::io::VMObjectStreamClass::setDoubleNative (Field *f, jobject obj,
+ jdouble val)
+{
+ f->setDouble (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setFloatNative (Field *f, jobject obj,
+ jfloat val)
+{
+ f->setFloat (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setLongNative (Field *f, jobject obj, jlong val)
+{
+ f->setLong (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setIntNative (Field *f, jobject obj, jint val)
+{
+ f->setInt (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setShortNative (Field *f, jobject obj,
+ jshort val)
+{
+ f->setShort (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setCharNative (Field *f, jobject obj, jchar val)
+{
+ f->setChar (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setByteNative (Field *f, jobject obj, jbyte val)
+{
+ f->setByte (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setBooleanNative (Field *f, jobject obj,
+ jboolean val)
+{
+ f->setBoolean (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setObjectNative (Field *f, jobject obj,
+ jobject val)
+{
+ f->set (NULL, obj, val, f->getType(), false);
+}