rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.66k stars 191 forks source link

remove backref code. #365

Closed cowboyd closed 9 years ago

cowboyd commented 9 years ago

The current backref implementation is designed to ensure that if a V8 object is converted to a ruby object, it gets the same Data_Wrap_Struct every time it is passed to Ruby.

While this is not necessarily a bad approach, it is definitely what I'd classify as an optimization. The current issues with The Ruby Racer all center around stability and none center around performance, and so I'd like to remove it until such time as we have that as a hard requirement. I know that it will result in more object allocations in both the Ruby world and the V8 world, but the trade off is code that is more difficult to reason about, and might be prone to subtle race conditions that involve multiple garbage collectors.

The Ruby side already has an identity map, so that we can resolve 'sameness' at the layer above.