Skip to content

Commit 4367867

Browse files
joshuawarner32Joshua Warner
authored andcommitted
use setters in classpath-android.cpp
1 parent 43b9cce commit 4367867

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/classpath-android.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ void initVmThread(Thread* t, GcThread* thread, unsigned offset)
188188

189189
t->m->processor->invoke(t, constructor, instance, thread);
190190

191-
set(t, reinterpret_cast<object>(thread), offset, instance);
191+
setField(t, reinterpret_cast<object>(thread), offset, instance);
192192
}
193193

194194
if (thread->group() == 0) {
195-
set(t, thread, ThreadGroup, t->javaThread->group());
195+
thread->setGroup(t, t->javaThread->group());
196196
expect(t, thread->group());
197197
}
198198
}
@@ -220,7 +220,7 @@ translateStackTrace(Thread* t, object raw)
220220
for (unsigned i = 0; i < objectArrayLength(t, array); ++i) {
221221
GcStackTraceElement* e = makeStackTraceElement(t, cast<GcTraceElement>(t, objectArrayBody(t, raw, i)));
222222

223-
set(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(e));
223+
setField(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(e));
224224
}
225225

226226
return array;
@@ -237,11 +237,11 @@ class MyClasspath : public Classpath {
237237
{
238238
PROTECT(t, class_);
239239

240-
object c = allocate(t, GcJclass::FixedSize, true);
241-
setObjectClass(t, c, type(t, GcJclass::Type));
242-
set(t, c, JclassVmClass, reinterpret_cast<object>(class_));
240+
GcJclass* c = reinterpret_cast<GcJclass*>(allocate(t, GcJclass::FixedSize, true));
241+
setObjectClass(t, reinterpret_cast<object>(c), type(t, GcJclass::Type));
242+
c->setVmClass(t, class_);
243243

244-
return c;
244+
return reinterpret_cast<object>(c);
245245
}
246246

247247
virtual GcString*
@@ -303,7 +303,7 @@ class MyClasspath : public Classpath {
303303
t->m->processor->invoke
304304
(t, constructor, reinterpret_cast<object>(thread), group, 0, NormalPriority, false);
305305

306-
set(t, thread, ThreadContextClassLoader, roots(t)->appLoader());
306+
thread->setContextClassLoader(t, roots(t)->appLoader());
307307

308308
initVmThread(t, thread);
309309

@@ -823,7 +823,7 @@ setField(Thread* t, GcField* field, object instance, object value)
823823
break;
824824

825825
case ObjectField:
826-
set(t, target, offset, value);
826+
setField(t, target, offset, value);
827827
break;
828828

829829
default: abort(t);
@@ -1097,7 +1097,7 @@ Avian_java_lang_Class_getInterfaces
10971097

10981098
for (unsigned i = 0; i < table->length(); ++i) {
10991099
GcJclass* c = getJClass(t, cast<GcClass>(t, table->body()[i]));
1100-
set(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(c));
1100+
setField(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(c));
11011101
}
11021102

11031103
return reinterpret_cast<uintptr_t>(array);
@@ -1349,12 +1349,12 @@ Avian_dalvik_system_VMRuntime_properties
13491349
unsigned i;
13501350
for (i = 0; i < t->m->propertyCount; ++i) {
13511351
GcString* s = makeString(t, "%s", t->m->properties[i]);
1352-
set(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(s));
1352+
setField(t, array, ArrayBody + (i * BytesPerWord), reinterpret_cast<object>(s));
13531353
}
13541354

13551355
{
13561356
GcString* s = makeString(t, "%s", "java.protocol.handler.pkgs=avian");
1357-
set(t, array, ArrayBody + (i++ * BytesPerWord), reinterpret_cast<object>(s));
1357+
setField(t, array, ArrayBody + (i++ * BytesPerWord), reinterpret_cast<object>(s));
13581358
}
13591359

13601360
return reinterpret_cast<uintptr_t>(array);
@@ -1478,7 +1478,7 @@ Avian_java_lang_VMThread_sleep
14781478

14791479
if (t->javaThread->sleepLock() == 0) {
14801480
object lock = reinterpret_cast<object>(makeJobject(t));
1481-
set(t, reinterpret_cast<object>(t->javaThread), ThreadSleepLock, lock);
1481+
t->javaThread->setSleepLock(t, lock);
14821482
}
14831483

14841484
acquire(t, t->javaThread->sleepLock());
@@ -1552,7 +1552,7 @@ Avian_dalvik_system_VMStack_getClasses
15521552

15531553
assertT(t, counter - 2 < objectArrayLength(t, array));
15541554

1555-
set(t, array, ArrayBody + ((counter - 2) * BytesPerWord), reinterpret_cast<object>(c));
1555+
setField(t, array, ArrayBody + ((counter - 2) * BytesPerWord), reinterpret_cast<object>(c));
15561556

15571557
return true;
15581558
}
@@ -1963,7 +1963,7 @@ Avian_java_lang_reflect_Method_getDeclaredAnnotations
19631963
(t, get, 0, method->class_()->loader(),
19641964
objectArrayBody(t, table, i));
19651965

1966-
set(t, array, ArrayBody + (i * BytesPerWord), a);
1966+
setField(t, array, ArrayBody + (i * BytesPerWord), a);
19671967
}
19681968

19691969
return reinterpret_cast<uintptr_t>(array);
@@ -2018,7 +2018,7 @@ extern "C" AVIAN_EXPORT int64_t JNICALL
20182018
cast<GcClass>(t, reinterpret_cast<object>(arguments[0]))->loader(),
20192019
objectArrayBody(t, table, i));
20202020

2021-
set(t, array, ArrayBody + (i * BytesPerWord), a);
2021+
setField(t, array, ArrayBody + (i * BytesPerWord), a);
20222022
}
20232023

20242024
return reinterpret_cast<uintptr_t>(array);
@@ -2226,7 +2226,7 @@ Avian_java_lang_reflect_Field_getSignatureAnnotation
22262226
GcString* string = t->m->classpath->makeString
22272227
(t, reinterpret_cast<object>(signature), 0, signature->length() - 1);
22282228

2229-
set(t, array, ArrayBody, reinterpret_cast<object>(string));
2229+
setField(t, array, ArrayBody, reinterpret_cast<object>(string));
22302230

22312231
return reinterpret_cast<uintptr_t>(array);
22322232
}

0 commit comments

Comments
 (0)