Merge pull request #182 from joshuawarner32/ffi-split

split out ffi::call from System
This commit is contained in:
Joel Dice 2014-02-26 15:46:05 -07:00
commit 2036eeaaa6
5 changed files with 13 additions and 29 deletions

View File

@ -128,9 +128,7 @@ class System : public avian::util::Aborter {
virtual Status visit(Thread* thread, Thread* target,
ThreadVisitor* visitor) = 0;
virtual uint64_t call(void* function, uintptr_t* arguments, uint8_t* types,
unsigned count, unsigned size,
unsigned returnType) = 0;
virtual Status map(Region**, const char* name) = 0;
virtual FileType stat(const char* name, unsigned* length) = 0;
virtual Status open(Directory**, const char* name) = 0;

View File

@ -7426,13 +7426,12 @@ invokeNativeSlow(MyThread* t, object method, void* function)
t->checkpoint->noThrow = true;
THREAD_RESOURCE(t, bool, noThrow, t->checkpoint->noThrow = noThrow);
result = t->m->system->call
(function,
RUNTIME_ARRAY_BODY(args),
RUNTIME_ARRAY_BODY(types),
count,
footprint * BytesPerWord,
returnType);
result = vm::dynamicCall(function,
RUNTIME_ARRAY_BODY(args),
RUNTIME_ARRAY_BODY(types),
count,
footprint * BytesPerWord,
returnType);
}
if (methodFlags(t, method) & ACC_SYNCHRONIZED) {

View File

@ -597,13 +597,12 @@ invokeNativeSlow(Thread* t, object method, void* function)
t->checkpoint->noThrow = true;
THREAD_RESOURCE(t, bool, noThrow, t->checkpoint->noThrow = noThrow);
result = t->m->system->call
(function,
RUNTIME_ARRAY_BODY(args),
RUNTIME_ARRAY_BODY(types),
count,
footprint * BytesPerWord,
returnType);
result = vm::dynamicCall(function,
RUNTIME_ARRAY_BODY(args),
RUNTIME_ARRAY_BODY(types),
count,
footprint * BytesPerWord,
returnType);
}
if (DebugRun) {

View File

@ -745,12 +745,6 @@ class MySystem: public System {
#endif // not __APPLE__
}
virtual uint64_t call(void* function, uintptr_t* arguments, uint8_t* types,
unsigned count, unsigned size, unsigned returnType)
{
return dynamicCall(function, arguments, types, count, size, returnType);
}
virtual Status map(System::Region** region, const char* name) {
Status status = 1;

View File

@ -730,12 +730,6 @@ class MySystem: public System {
#endif
}
virtual uint64_t call(void* function, uintptr_t* arguments, uint8_t* types,
unsigned count, unsigned size, unsigned returnType)
{
return dynamicCall(function, arguments, types, count, size, returnType);
}
virtual Status map(System::Region** region, const char* name) {
Status status = 1;
size_t nameLen = strlen(name) * 2;