mruby bytecode loader. More...
#include "mrubyc.h"Go to the source code of this file.
Enumerations | |
| enum | irep_pool_type { IREP_TT_STR = 0 , IREP_TT_SSTR = 2 , IREP_TT_INT32 = 1 , IREP_TT_INT64 = 3 , IREP_TT_FLOAT = 5 } |
Functions | |
| static int | load_header (struct VM *vm, const uint8_t *bin) |
| static mrbc_irep * | load_irep_1 (struct VM *vm, const uint8_t *bin, int *len) |
| static mrbc_irep * | load_irep (struct VM *vm, const uint8_t *bin, int *len) |
| int | mrbc_load_mrb (struct VM *vm, const void *bytecode) |
| int | mrbc_load_irep (struct VM *vm, const void *bytecode) |
| void | mrbc_irep_free (struct IREP *irep) |
| mrbc_value | mrbc_irep_pool_value (struct VM *vm, int n) |
Variables | |
| static const char | RITE [4] = "RITE" |
| static const char | RITE_VERSION [4] = "0300" |
| static const int | SIZE_RITE_BINARY_HEADER = 20 |
| static const int | SIZE_RITE_SECTION_HEADER = 12 |
| static const int | SIZE_RITE_CATCH_HANDLER = 13 |
| static const char | IREP [4] = "IREP" |
| static const char | END [4] = "END\0" |
mruby bytecode loader.
Copyright (C) 2015- Kyushu Institute of Technology. Copyright (C) 2015- Shimane IT Open-Innovation Center. This file is distributed under BSD 3-Clause License.
Definition in file load.c.
| enum irep_pool_type |
|
static |
Parse header section.
| vm | A pointer to VM. |
| bin | A pointer to RITE header. |
Structure "RITE" identifier "03" major version "00" minor version 0000_0000 total size "MATZ" compiler name "0000" compiler version
Definition at line 73 of file load.c.
read one irep section.
| vm | A pointer to VM. |
| bin | A pointer to RITE ISEQ. |
| len | Returns the parsed length. |
(loop n of child irep below) 0000_0000 record size 0000 n of local variable 0000 n of register 0000 n of child irep 0000 n of catch handler 0000_0000 n of byte code (ISEQ BLOCK) ... byte codes (CATCH HANDLER 13bytes) 00 type 0000_0000 begin 0000_0000 end 0000_0000 target (POOL BLOCK) 0000 n of pool (loop n of pool) 00 type ... pool data (SYMS BLOCK) 0000 n of symbol (loop n of symbol) 0000 length ... symbol data
Definition at line 129 of file load.c.
| void mrbc_irep_free | ( | struct IREP * | irep | ) |
| mrbc_value mrbc_irep_pool_value | ( | struct VM * | vm, |
| int | n ) |
get a mrbc_value in irep pool.
| vm | Pointer to VM. |
| n | n'th |
Definition at line 360 of file load.c.
| int mrbc_load_irep | ( | struct VM * | vm, |
| const void * | bytecode ) |
| int mrbc_load_mrb | ( | struct VM * | vm, |
| const void * | bytecode ) |