mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-30 03:14:44 +08:00
b3208f56cb
* exception.cc (java_eh_info): Make value type jthrowable. (_Jv_type_matcher): Remove now unneeded cast. (_Jv_Throw): Make argument type jthrowable. Munge name for SJLJ_EXCEPTIONS here ... * gcj/cni.h: ... not here. (JvThrow): Remove. * gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations. * defineclass.cc, interpret.cc, jni.cc, posix-threads.cc, prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc, gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc, gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc, gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc, java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc, java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc, java/lang/natClass.cc, java/lang/natClassLoader.cc, java/lang/natDouble.cc, java/lang/natObject.cc, java/lang/natPosixProcess.cc, java/lang/natRuntime.cc, java/lang/natString.cc, java/lang/natSystem.cc, java/lang/natThread.cc, java/lang/reflect/natArray.cc, java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc, java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc, java/util/zip/natInflater.cc: Use throw, not JvThrow or _Jv_Throw. From-SVN: r40838
59 lines
1.6 KiB
C++
59 lines
1.6 KiB
C++
// natConstructor.cc - Native code for Constructor class.
|
|
|
|
/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
|
|
|
|
This file is part of libgcj.
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|
details. */
|
|
|
|
#include <config.h>
|
|
|
|
#include <gcj/cni.h>
|
|
#include <jvm.h>
|
|
|
|
#include <java/lang/reflect/Constructor.h>
|
|
#include <java/lang/reflect/Method.h>
|
|
#include <java/lang/reflect/InvocationTargetException.h>
|
|
#include <java/lang/reflect/Modifier.h>
|
|
#include <java/lang/InstantiationException.h>
|
|
#include <gcj/method.h>
|
|
|
|
jint
|
|
java::lang::reflect::Constructor::getModifiers ()
|
|
{
|
|
// Ignore all unknown flags.
|
|
return _Jv_FromReflectedConstructor (this)->accflags & Modifier::ALL_FLAGS;
|
|
}
|
|
|
|
void
|
|
java::lang::reflect::Constructor::getType ()
|
|
{
|
|
_Jv_GetTypesFromSignature (_Jv_FromReflectedConstructor (this),
|
|
declaringClass,
|
|
¶meter_types,
|
|
NULL);
|
|
|
|
// FIXME: for now we have no way to get exception information.
|
|
exception_types =
|
|
(JArray<jclass> *) JvNewObjectArray (0, &java::lang::Class::class$, NULL);
|
|
}
|
|
|
|
jobject
|
|
java::lang::reflect::Constructor::newInstance (jobjectArray args)
|
|
{
|
|
if (parameter_types == NULL)
|
|
getType ();
|
|
|
|
using namespace java::lang::reflect;
|
|
if (Modifier::isAbstract (declaringClass->getModifiers()))
|
|
throw new InstantiationException;
|
|
|
|
jmethodID meth = _Jv_FromReflectedConstructor (this);
|
|
// In the constructor case the return type is the type of the
|
|
// constructor.
|
|
return _Jv_CallAnyMethodA (NULL, declaringClass, meth, true,
|
|
parameter_types, args);
|
|
}
|