prepare for native method support

This commit is contained in:
Joel Dice 2007-06-22 17:43:31 -06:00
parent 137fdcb69e
commit f68f455d59
2 changed files with 18 additions and 10 deletions

View File

@ -243,8 +243,10 @@ const unsigned ACC_FINAL = 1 << 4;
const unsigned ACC_SUPER = 1 << 5;
const unsigned ACC_VOLATILE = 1 << 6;
const unsigned ACC_TRANSIENT = 1 << 7;
const unsigned ACC_NATIVE = 1 << 8;
const unsigned ACC_INTERFACE = 1 << 9;
const unsigned ACC_ABSTRACT = 1 << 10;
const unsigned ACC_STRICT = 1 << 11;
} // namespace vm

View File

@ -3120,19 +3120,25 @@ run(Thread* t)
goto throw_;
}
frameIp(t, frame) = ip;
if (methodFlags(t, code) & ACC_NATIVE) {
// todo
abort(t);
} else {
frameIp(t, frame) = ip;
ip = 0;
sp -= parameterCount;
sp -= parameterCount;
frame = makeFrame(t, code, frame, 0, sp,
codeMaxLocals(t, methodCode(t, code)), false);
code = methodCode(t, code);
frame = makeFrame(t, code, frame, 0, sp,
codeMaxLocals(t, methodCode(t, code)), false);
code = methodCode(t, code);
memcpy(&frameLocals(t, frame, 0), stack + sp, parameterCount * BytesPerWord);
memcpy(&frameLocals(t, frame, 0), stack + sp,
parameterCount * BytesPerWord);
memset(&frameLocals(t, frame, 0) + parameterCount, 0,
(frameLength(t, frame) - parameterCount) * BytesPerWord);
ip = 0;
memset(&frameLocals(t, frame, 0) + parameterCount, 0,
(frameLength(t, frame) - parameterCount) * BytesPerWord);
}
goto loop;
throw_: