use more PIKA_PYTHON macro

This commit is contained in:
lyon1998 2022-03-24 11:48:17 +08:00
parent d384352c2c
commit 156c842381
2 changed files with 10 additions and 6 deletions

View File

@ -208,9 +208,10 @@ void PikaStdTask_Task_run_once(PikaObj* self) {
void __Task_update_tick(PikaObj* self) {
if (obj_getInt(self, "is_perod")) {
/*
pikaVM_run(self, "platformGetTick()");
*/
PIKA_PYTHON(
platformGetTick()
)
PIKA_BYTECODE_BEGIN
const uint8_t bytes[] = {
0x04, 0x00, /* instruct array size */
0x00, 0x82, 0x01, 0x00, /* instruct array */
@ -218,6 +219,7 @@ void __Task_update_tick(PikaObj* self) {
0x00, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,
0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x00, /* const pool */
};
PIKA_BYTECODE_END
pikaVM_runByteCode(self, (uint8_t*)bytes);
}
}

View File

@ -208,9 +208,10 @@ void PikaStdTask_Task_run_once(PikaObj* self) {
void __Task_update_tick(PikaObj* self) {
if (obj_getInt(self, "is_perod")) {
/*
pikaVM_run(self, "platformGetTick()");
*/
PIKA_PYTHON(
platformGetTick()
)
PIKA_BYTECODE_BEGIN
const uint8_t bytes[] = {
0x04, 0x00, /* instruct array size */
0x00, 0x82, 0x01, 0x00, /* instruct array */
@ -218,6 +219,7 @@ void __Task_update_tick(PikaObj* self) {
0x00, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,
0x47, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x00, /* const pool */
};
PIKA_BYTECODE_END
pikaVM_runByteCode(self, (uint8_t*)bytes);
}
}