Skip to content

Refere ISEQ BLOCK of binary bytecode to ROM directly(rebased).#880

Closed
kyab wants to merge 9 commits into
mruby:masterfrom
kyab:rom_iseq4
Closed

Refere ISEQ BLOCK of binary bytecode to ROM directly(rebased).#880
kyab wants to merge 9 commits into
mruby:masterfrom
kyab:rom_iseq4

Conversation

@kyab

@kyab kyab commented Feb 23, 2013

Copy link
Copy Markdown
Contributor

I've implemented idea of referring ISEQ BLOCK of binary bytecode to ROM directly. Based on (6) of http://www.csk.com/fukuoka/services/mruby/nxt02.html.

I'm not sure this kind of hack is wellcome, but in my environment, around 8kb of heap can be saved by this change.

@monaka

monaka commented Feb 24, 2013

Copy link
Copy Markdown
Contributor

Thank you for your re-post, @kyab. I'm interested in your hack. And there needs some additional hacks, I think.
I'll send pull request to you later (maybe tomorrow). Could you review my additional patch?

@kyab

kyab commented Feb 24, 2013

Copy link
Copy Markdown
Contributor Author

Yes, I will review your additional patch.

@monaka

monaka commented Feb 25, 2013

Copy link
Copy Markdown
Contributor

Thanks for your review and merge, @kyab.
In addition, I think it's better to reduce function call arguments.
I have a plan to do. Please stay tuned.

@kyab

kyab commented Feb 25, 2013

Copy link
Copy Markdown
Contributor Author

I just noticed our patch crashes in some phase on loading *.mrb.

[koji@macbookpro:~/work/mruby]$ cat foo.rb
puts "Hello"
[koji@macbookpro:~/work/mruby]$ mrbc foo.rb
[koji@macbookpro:~/work/mruby]$ mruby -b foo.mrb
failed to load mrb file: foo.mrb
mruby(8113) malloc: *** error for object 0x6000000000000000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Maybe more hack required..

@monaka

monaka commented Feb 25, 2013

Copy link
Copy Markdown
Contributor

It seems a free twice bug that can find out easily, right?
Anyway. I'll send pull request to your branch whether you close this request for now, or not.

@monaka

monaka commented Feb 26, 2013

Copy link
Copy Markdown
Contributor

I did a double check with foo.rb. I could run without crashes.
My environment is OSX 10.6.8, Apple genuine gcc4.2.1

@kyab

kyab commented Feb 27, 2013

Copy link
Copy Markdown
Contributor Author

@monaka It's strange, it should crash or at least fail to load foo.mrb.
The root problem is crc mismatch. In our patch, dump side calculate crc with little endian, but load side calculate crc with bin(big endian), in case of hex dump(dump to *.mrb. not *.c).

I've fixed, but might be ugly hack.. Could you please retry to reproduce crash(or fail) and review my fix?
https://github.com/kyab/mruby_min/commit/67f6859156bfd0a9c33a2ef2ce2af400092e102e

@monaka

monaka commented Feb 28, 2013

Copy link
Copy Markdown
Contributor

I reproduced the crash. And I checked it is stopped by the patch 67f6859.
The patch is effective ... but it's better you rearrange your patches, I feel, as you might feel.

@matz matz mentioned this pull request Mar 27, 2013
@kyab

kyab commented Jun 20, 2013

Copy link
Copy Markdown
Contributor Author

I put my comment on #964

@kyab kyab mentioned this pull request Jul 3, 2013
@monaka

monaka commented May 9, 2019

Copy link
Copy Markdown
Contributor

IMO, this issue can be closed as the second suggestion is on #1338. @kyab WDYT?

@kyab

kyab commented May 9, 2019

Copy link
Copy Markdown
Contributor Author

I think this issue can be closed.

@matz matz closed this May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants