|
|
@@ -301,11 +301,11 @@ Arg* __vm_get(PikaObj* self, Arg* key, Arg* obj) {
|
|
|
)
|
|
|
/* clang-format on */
|
|
|
const uint8_t bytes[] = {
|
|
|
- 0x0c, 0x00, /* instruct array size */
|
|
|
+ 0x0c, 0x00, 0x00, 0x00,/* instruct array size */
|
|
|
0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, 0x04, 0x13,
|
|
|
0x00,
|
|
|
/* instruct array */
|
|
|
- 0x19, 0x00, /* const pool size */
|
|
|
+ 0x19, 0x00, 0x00, 0x00,/* const pool size */
|
|
|
0x00, 0x5f, 0x5f, 0x6b, 0x65, 0x79, 0x00, 0x5f, 0x5f, 0x67, 0x65,
|
|
|
0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72,
|
|
|
0x65, 0x73, 0x00,
|
|
|
@@ -495,11 +495,11 @@ static Arg* _proxy_getattribute(PikaObj* host, char* name) {
|
|
|
)
|
|
|
/* clang-format on */
|
|
|
const uint8_t bytes[] = {
|
|
|
- 0x0c, 0x00, /* instruct array size */
|
|
|
+ 0x0c, 0x00, 0x00, 0x00,/* instruct array size */
|
|
|
0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, 0x04, 0x18,
|
|
|
0x00,
|
|
|
/* instruct array */
|
|
|
- 0x1d, 0x00, /* const pool size */
|
|
|
+ 0x1d, 0x00, 0x00, 0x00,/* const pool size */
|
|
|
0x00, 0x40, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x5f, 0x5f, 0x67, 0x65,
|
|
|
0x74, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f,
|
|
|
0x5f, 0x00, 0x40, 0x72, 0x65, 0x73, 0x00, /* const pool */
|
|
|
@@ -522,11 +522,11 @@ static Arg* _proxy_getattr(PikaObj* host, char* name) {
|
|
|
)
|
|
|
/* clang-format on */
|
|
|
const uint8_t bytes[] = {
|
|
|
- 0x0c, 0x00, /* instruct array size */
|
|
|
+ 0x0c, 0x00, 0x00, 0x00,/* instruct array size */
|
|
|
0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, 0x04, 0x13,
|
|
|
0x00,
|
|
|
/* instruct array */
|
|
|
- 0x18, 0x00, /* const pool size */
|
|
|
+ 0x18, 0x00, 0x00, 0x00,/* const pool size */
|
|
|
0x00, 0x40, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x5f, 0x5f, 0x67, 0x65,
|
|
|
0x74, 0x61, 0x74, 0x74, 0x72, 0x5f, 0x5f, 0x00, 0x40, 0x72, 0x65,
|
|
|
0x73, 0x00, /* const pool */
|
|
|
@@ -1410,11 +1410,11 @@ static PIKA_BOOL _proxy_setattr(PikaObj* self, char* name, Arg* arg) {
|
|
|
)
|
|
|
/* clang-format on */
|
|
|
const uint8_t bytes[] = {
|
|
|
- 0x0c, 0x00, /* instruct array size */
|
|
|
+ 0x0c, 0x00, 0x00, 0x00,/* instruct array size */
|
|
|
0x10, 0x81, 0x01, 0x00, 0x10, 0x01, 0x07, 0x00, 0x00, 0x02, 0x0e,
|
|
|
0x00,
|
|
|
/* instruct array */
|
|
|
- 0x1a, 0x00, /* const pool size */
|
|
|
+ 0x1a, 0x00, 0x00, 0x00,/* const pool size */
|
|
|
0x00, 0x40, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x40, 0x76, 0x61, 0x6c,
|
|
|
0x75, 0x65, 0x00, 0x5f, 0x5f, 0x73, 0x65, 0x74, 0x61, 0x74, 0x74,
|
|
|
0x72, 0x5f, 0x5f, 0x00, /* const pool */
|
|
|
@@ -1708,11 +1708,11 @@ static void _OPT_ADD(OperatorInfo* op) {
|
|
|
)
|
|
|
/* clang-format on */
|
|
|
const uint8_t bytes[] = {
|
|
|
- 0x0c, 0x00, /* instruct array size */
|
|
|
+ 0x0c, 0x00, 0x00, 0x00,/* instruct array size */
|
|
|
0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x04, 0x12,
|
|
|
0x00,
|
|
|
/* instruct array */
|
|
|
- 0x18, 0x00, /* const pool size */
|
|
|
+ 0x18, 0x00, 0x00, 0x00,/* const pool size */
|
|
|
0x00, 0x5f, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x00, 0x5f,
|
|
|
0x5f, 0x61, 0x64, 0x64, 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72, 0x65,
|
|
|
0x73, 0x00, /* const pool */
|
|
|
@@ -1771,11 +1771,11 @@ static void _OPT_SUB(OperatorInfo* op) {
|
|
|
)
|
|
|
/* clang-format on */
|
|
|
const uint8_t bytes[] = {
|
|
|
- 0x0c, 0x00, /* instruct array size */
|
|
|
+ 0x0c, 0x00, 0x00, 0x00,/* instruct array size */
|
|
|
0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x04, 0x12,
|
|
|
0x00,
|
|
|
/* instruct array */
|
|
|
- 0x18, 0x00, /* const pool size */
|
|
|
+ 0x18, 0x00, 0x00, 0x00,/* const pool size */
|
|
|
0x00, 0x5f, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x00, 0x5f,
|
|
|
0x5f, 0x73, 0x75, 0x62, 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72, 0x65,
|
|
|
0x73, 0x00, /* const pool */
|
|
|
@@ -2003,11 +2003,11 @@ static Arg* VM_instruction_handler_OPT(PikaObj* self,
|
|
|
obj_setArg(obj2, "__others", op.a1);
|
|
|
/* clang-format on */
|
|
|
const uint8_t bytes[] = {
|
|
|
- 0x0c, 0x00, /* instruct array size */
|
|
|
+ 0x0c, 0x00, 0x00, 0x00,/* instruct array size */
|
|
|
0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x04,
|
|
|
0x17, 0x00,
|
|
|
/* instruct array */
|
|
|
- 0x1d, 0x00, /* const pool size */
|
|
|
+ 0x1d, 0x00, 0x00, 0x00,/* const pool size */
|
|
|
0x00, 0x5f, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x00,
|
|
|
0x5f, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73,
|
|
|
0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72, 0x65, 0x73,
|
|
|
@@ -2653,14 +2653,15 @@ void byteCodeFrame_init(ByteCodeFrame* self) {
|
|
|
}
|
|
|
|
|
|
void byteCodeFrame_loadByteCode(ByteCodeFrame* self, uint8_t* bytes) {
|
|
|
- uint16_t* ins_size_p = (uint16_t*)bytes;
|
|
|
- void* ins_start_p = (uint16_t*)(bytes + 2);
|
|
|
- uint16_t* const_size_p =
|
|
|
- (uint16_t*)((uintptr_t)ins_start_p + (uintptr_t)(*ins_size_p));
|
|
|
+ uint32_t* ins_size_p = (uint32_t*)bytes;
|
|
|
+ void* ins_start_p = (uint32_t*)((uintptr_t)bytes + sizeof(*ins_size_p));
|
|
|
+ uint32_t* const_size_p =
|
|
|
+ (uint32_t*)((uintptr_t)ins_start_p + (uintptr_t)(*ins_size_p));
|
|
|
self->instruct_array.size = *ins_size_p;
|
|
|
self->instruct_array.content_start = ins_start_p;
|
|
|
self->const_pool.size = *const_size_p;
|
|
|
- self->const_pool.content_start = (char*)((uintptr_t)const_size_p + 2);
|
|
|
+ self->const_pool.content_start =
|
|
|
+ (char*)((uintptr_t)const_size_p + sizeof(*const_size_p));
|
|
|
}
|
|
|
|
|
|
void byteCodeFrame_deinit(ByteCodeFrame* self) {
|