Changes to work with Maglev implementation of Ruby C extensions. #98

Open
wants to merge 28 commits into from

3 participants

@timfel

These changes will ensure that the official json gem is working on MagLev.

Major two problems fixed in these commits:

  • Use RTEST() in conditionals, because Qfalse is not 0 on Maglev
  • Use a macro to attach Ruby objects to the C json struct, that will, if compiled on Maglev, also set an ivar on that object, to keep the GC from collecting it. This is because in order to have an efficient GC Maglev cannot implement the rb_gc_mark* functions or support the mark function for Data_Wrap_Struct.

If you're interested, see https://gist.github.com/1245462 if you want to know more about the changes needed for Maglev and the reasons for them

@timfel

Hi, just bumping this. Is this something you could consider for inclusion at all?

@flori
Owner

I would include it, but at the moment it breaks all other implementations except the ones based on ruby 1.8.
See http://travis-ci.org/#!/flori/json/builds/197049 for the test results.

@timfel

I have made a mistake translating what MEMZERO means into Ruby constants. On MRI 0x0 is Qfalse, not Qnil. Setting the VALUE fields in the JSON_Parser struct to Qnil instead of Qfalse is, what caused the segv. I changed that and it now runs fine on at least rbx-head, ruby-head, 1.8-head, and maglev-head. (Maglev is failing a few tests, but those are shortcomings in our Ruby stdlib)

@timfel timfel Merge remote-tracking branch 'json/master'
Conflicts:
	ext/json/ext/parser/parser.c
	ext/json/ext/parser/parser.rl
59ecfad
@timfel

@flori I merged the latest changes from master, the tests pass on 1.8, 1.9 and rbx for me. Anything else I can do to get this accepted?

timfel added some commits Aug 16, 2012
@timfel timfel Merge tag 'v1.6.4'
Conflicts:
	ext/json/ext/parser/parser.c
464c055
@timfel timfel change gemspec name 63b6148
@timfel timfel Merge tag 'v1.6.5'
Conflicts:
	json.gemspec
4e60613
@timfel timfel Merge tag 'v1.6.6'
Conflicts:
	json.gemspec
d5983ec
@timfel timfel Merge tag 'v1.6.7'
Conflicts:
	ext/json/ext/parser/parser.c
	json.gemspec
f786a2e
@timfel timfel Merge tag 'v1.7.0'
Conflicts:
	json.gemspec
6250cf1
@timfel timfel Merge tag 'v1.7.1'
Conflicts:
	json.gemspec
be27c7e
@timfel timfel Merge tag 'v1.7.2'
Conflicts:
	json.gemspec
be340c6
@timfel timfel Merge tag 'v1.7.3'
Conflicts:
	json.gemspec
66c7ed2
@timfel timfel Merge tag 'v1.7.4'
Conflicts:
	json.gemspec
c3522fa
@travisbot

This pull request fails (merged c3522fa into 33dce92).

@travisbot

This pull request fails (merged 1c38b3b into 33dce92).

@travisbot

This pull request passes (merged 5e0f580 into 0d8c4b9).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment