diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-02 20:58:15 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-02 20:58:15 +0900 |
| commit | 788e4388f86452c119e145b835e7853f39732811 (patch) | |
| tree | e19bae416e8dad076eaa9109dd4df207367b5a61 /src/dump.c | |
| parent | 0419f07915603f74bbd3f6435ffee42cde5eaa5f (diff) | |
| parent | 57a435aa1d26c7d64c9d38c6865255a98e32d4cb (diff) | |
| download | mruby-788e4388f86452c119e145b835e7853f39732811.tar.gz mruby-788e4388f86452c119e145b835e7853f39732811.zip | |
Merge branch 'take-cheeze-fix_dump_load'
Since our new VM instruction is byte based, there's no need to endian
conversion of instruction sequences.
Diffstat (limited to 'src/dump.c')
| -rw-r--r-- | src/dump.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/dump.c b/src/dump.c index df1e171e4..c2c334c9a 100644 --- a/src/dump.c +++ b/src/dump.c @@ -81,30 +81,11 @@ static ptrdiff_t write_iseq_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf, uint8_t flags) { uint8_t *cur = buf; - int iseq_no; cur += uint32_to_bin(irep->ilen, cur); /* number of opcode */ cur += write_padding(cur); - switch (flags & DUMP_ENDIAN_NAT) { - case DUMP_ENDIAN_BIG: - if (bigendian_p()) goto native; - for (iseq_no = 0; iseq_no < irep->ilen; iseq_no++) { - cur += uint32_to_bin(irep->iseq[iseq_no], cur); /* opcode */ - } - break; - case DUMP_ENDIAN_LIL: - if (!bigendian_p()) goto native; - for (iseq_no = 0; iseq_no < irep->ilen; iseq_no++) { - cur += uint32l_to_bin(irep->iseq[iseq_no], cur); /* opcode */ - } - break; - - native: - case DUMP_ENDIAN_NAT: - memcpy(cur, irep->iseq, irep->ilen * sizeof(mrb_code)); - cur += irep->ilen * sizeof(mrb_code); - break; - } + memcpy(cur, irep->iseq, irep->ilen * sizeof(mrb_code)); + cur += irep->ilen * sizeof(mrb_code); return cur - buf; } |
