22#include " openminecraft/binary/om_bin_endians.hpp"
33#include " openminecraft/log/om_log_common.hpp"
44#include " openminecraft/vm/bytecode/om_bytecodes.hpp"
5+ #include " openminecraft/vm/classfile/om_class_file.hpp"
6+ #include " openminecraft/vm/err/om_validation_error.hpp"
57#include " openminecraft/vm/pixeltower/v0/om_pixeltower.hpp"
68#include " openminecraft/vm/pixeltower/v0/om_pixeltower_field.hpp"
79#include " openminecraft/vm/pixeltower/v0/om_pixeltower_frame.hpp"
@@ -24,8 +26,12 @@ OMInterpreter::~OMInterpreter()
2426
2527void OMInterpreter::call (OMMethod *met)
2628{
27- logger.info (" {}.{}{}, first frame: {}" , met->klass ->name , met->name , met->desc ,
28- currentThread.currentFrame == nullptr );
29+ if (met->accessFlags & JVM_Acc_Native)
30+ {
31+ throw err::OMValidationError{err::Instructions, " native functions not supported!" ,
32+ fmt::format (" {}.{}{}" , met->klass ->name , met->name , met->desc )};
33+ }
34+
2935 if (!currentThread.currentFrame )
3036 {
3137 currentThread.stackPointer = currentThread.stack ;
@@ -77,6 +83,12 @@ void OMInterpreter::call(OMMethod *met)
7783
7884void OMInterpreter::callDynamic (OMMethod *met)
7985{
86+ if (met->accessFlags & JVM_Acc_Native)
87+ {
88+ throw err::OMValidationError{err::Instructions, " native functions not supported!" ,
89+ fmt::format (" {}.{}{}" , met->klass ->name , met->name , met->desc )};
90+ }
91+
8092 auto frame = currentThread.currentFrame ;
8193 auto nextframe = (OMFrame *)((uint8_t *)currentThread.stackPointer - sizeof (OMFrame) + sizeof (void *) +
8294 met->args * sizeof (void *));
0 commit comments