aboutsummaryrefslogtreecommitdiff
path: root/tests/nbody-java/native_java_lang_reflect_Array.c
blob: cfd13f8e50c1014afa12427a8543e72c3fe7e67a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#include "xmlvm.h"
#include "java_lang_reflect_Array.h"


//XMLVM_BEGIN_NATIVE_IMPLEMENTATION

#include "java_lang_Class.h"

//XMLVM_END_NATIVE_IMPLEMENTATION

JAVA_OBJECT java_lang_reflect_Array_multiNewArrayImpl___java_lang_Class_int_int_1ARRAY(JAVA_OBJECT n1, JAVA_INT n2, JAVA_OBJECT n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_multiNewArrayImpl___java_lang_Class_int_int_1ARRAY]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_OBJECT java_lang_reflect_Array_newArrayImpl___java_lang_Class_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_newArrayImpl___java_lang_Class_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_OBJECT java_lang_reflect_Array_get___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_get___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_BOOLEAN java_lang_reflect_Array_getBoolean___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getBoolean___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_BYTE java_lang_reflect_Array_getByte___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getByte___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_CHAR java_lang_reflect_Array_getChar___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getChar___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_DOUBLE java_lang_reflect_Array_getDouble___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getDouble___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_FLOAT java_lang_reflect_Array_getFloat___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getFloat___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_INT java_lang_reflect_Array_getInt___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getInt___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_INT java_lang_reflect_Array_getLength___java_lang_Object(JAVA_OBJECT n1)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getLength___java_lang_Object]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_LONG java_lang_reflect_Array_getLong___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getLong___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_SHORT java_lang_reflect_Array_getShort___java_lang_Object_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_getShort___java_lang_Object_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

JAVA_OBJECT java_lang_reflect_Array_newInstance___java_lang_Class_int_1ARRAY(JAVA_OBJECT n1, JAVA_OBJECT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_newInstance___java_lang_Class_int_1ARRAY]
    return XMLVMArray_createMultiDimensions(n1, n2);
    //XMLVM_END_NATIVE
}

JAVA_OBJECT java_lang_reflect_Array_newInstance___java_lang_Class_int(JAVA_OBJECT n1, JAVA_INT n2)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_newInstance___java_lang_Class_int]
    return XMLVMArray_createSingleDimension(n1, n2);
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_set___java_lang_Object_int_java_lang_Object(JAVA_OBJECT n1, JAVA_INT n2, JAVA_OBJECT n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_set___java_lang_Object_int_java_lang_Object]
    org_xmlvm_runtime_XMLVMArray* array = n1;
    JAVA_INT index = n2;
    JAVA_OBJECT obj = n3;
    
    JAVA_OBJECT arrayType = array->fields.org_xmlvm_runtime_XMLVMArray.type_;
    if (arrayType == __CLASS_boolean_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else if (arrayType == __CLASS_byte_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else if (arrayType == __CLASS_char_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else if (arrayType == __CLASS_short_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else if (arrayType == __CLASS_int_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else if (arrayType == __CLASS_float_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else if (arrayType == __CLASS_long_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else if (arrayType == __CLASS_double_1ARRAY) {
        XMLVM_INTERNAL_ERROR();
    } else {
        JAVA_ARRAY_OBJECT* data = (JAVA_ARRAY_OBJECT*) array->fields.org_xmlvm_runtime_XMLVMArray.array_;
        data[index] = obj;
    }
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setBoolean___java_lang_Object_int_boolean(JAVA_OBJECT n1, JAVA_INT n2, JAVA_BOOLEAN n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setBoolean___java_lang_Object_int_boolean]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setByte___java_lang_Object_int_byte(JAVA_OBJECT n1, JAVA_INT n2, JAVA_BYTE n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setByte___java_lang_Object_int_byte]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setChar___java_lang_Object_int_char(JAVA_OBJECT n1, JAVA_INT n2, JAVA_CHAR n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setChar___java_lang_Object_int_char]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setDouble___java_lang_Object_int_double(JAVA_OBJECT n1, JAVA_INT n2, JAVA_DOUBLE n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setDouble___java_lang_Object_int_double]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setFloat___java_lang_Object_int_float(JAVA_OBJECT n1, JAVA_INT n2, JAVA_FLOAT n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setFloat___java_lang_Object_int_float]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setInt___java_lang_Object_int_int(JAVA_OBJECT n1, JAVA_INT n2, JAVA_INT n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setInt___java_lang_Object_int_int]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setLong___java_lang_Object_int_long(JAVA_OBJECT n1, JAVA_INT n2, JAVA_LONG n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setLong___java_lang_Object_int_long]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}

void java_lang_reflect_Array_setShort___java_lang_Object_int_short(JAVA_OBJECT n1, JAVA_INT n2, JAVA_SHORT n3)
{
    //XMLVM_BEGIN_NATIVE[java_lang_reflect_Array_setShort___java_lang_Object_int_short]
    XMLVM_UNIMPLEMENTED_NATIVE_METHOD();
    //XMLVM_END_NATIVE
}