{"action":"created","issue":{"url":"https://api.github.com/repos/cowboyd/therubyracer/issues/334","labels_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/334/labels{/name}","comments_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/334/comments","events_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/334/events","html_url":"https://github.com/cowboyd/therubyracer/pull/334","id":63312593,"number":334,"title":"WIP: V8 upgrade","user":{"login":"stormbreakerbg","id":756418,"avatar_url":"https://avatars.githubusercontent.com/u/756418?v=3","gravatar_id":"","url":"https://api.github.com/users/stormbreakerbg","html_url":"https://github.com/stormbreakerbg","followers_url":"https://api.github.com/users/stormbreakerbg/followers","following_url":"https://api.github.com/users/stormbreakerbg/following{/other_user}","gists_url":"https://api.github.com/users/stormbreakerbg/gists{/gist_id}","starred_url":"https://api.github.com/users/stormbreakerbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormbreakerbg/subscriptions","organizations_url":"https://api.github.com/users/stormbreakerbg/orgs","repos_url":"https://api.github.com/users/stormbreakerbg/repos","events_url":"https://api.github.com/users/stormbreakerbg/events{/privacy}","received_events_url":"https://api.github.com/users/stormbreakerbg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-20T21:35:29Z","updated_at":"2015-04-04T08:00:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cowboyd/therubyracer/pulls/334","html_url":"https://github.com/cowboyd/therubyracer/pull/334","diff_url":"https://github.com/cowboyd/therubyracer/pull/334.diff","patch_url":"https://github.com/cowboyd/therubyracer/pull/334.patch"},"body":"Hey!\r\n\r\nI started working on porting the C extension part of the code so that it works with V8 3.31 (the trunk branch in libv8). I'm creating this pull request to document my progress and for it to be of help if I get bored along the way.\r\n\r\nThe current idea is to start clean (no `c` or `h` files and no tests) and reimplement it via copy/paste and updating the parts that rely on the old V8 API. I also decided to create separate header files for each class as I am completely hopeless in navigating the current `rr.h`.\r\n\r\n**Current status:** V8 objects can be created through Ruby. Still, there's a lot more work to be done.\r\n\r\n**Changes in V8 that affect the code:**\r\n\r\n- The main new thing is the `v8::Isolate` class. _From what I understand:_\r\n    - It's a context for a V8 instance. It holds a reference to a V8 heap and state.\r\n    - You can (and must) use it if you want to have two instances of V8 running at the same time.\r\n    - Most of the V8 object constructors now require an isolate object as a parameter.\r\n    - Just like `Context`, the `Isolate` can be entered and exited, and they can be stacked (you can enter multiple ones). You can currently get the entered isolate with `v8::Isolate::GetCurrent()`. However, from what I read, this method will be removed in the future so the isolate should be explicitly passed where necessary.\r\n    - You must not use one isolate from more than one thread at the same time.\r\n- `v8::Persistent` has some important changes as well:\r\n    - The `New` method is removed in favor of the constructors.\r\n    - It is now non-copyable (by default). This means that we need to hold a pointer.\r\n    - It no longer inherits from Handle. To convert `Persistent<T>` to `Handle<T>` we need to use `Local<T>::New`\r\n    - `MakeWeak` is now `SetWeak` and it requires a slightly different callback.\r\n    - `Dispose` is now `Reset`\r\n- `String`\r\n    - `NewSymbol` is removed\r\n    - `New` is removed in favor of `NewFromUtf8`, `NewFromOneByte` and `NewFromTwoByte`\r\n\r\nComments and help are most welcome! :)"},"comment":{"url":"https://api.github.com/repos/cowboyd/therubyracer/issues/comments/89521727","html_url":"https://github.com/cowboyd/therubyracer/pull/334#issuecomment-89521727","issue_url":"https://api.github.com/repos/cowboyd/therubyracer/issues/334","id":89521727,"user":{"login":"stormbreakerbg","id":756418,"avatar_url":"https://avatars.githubusercontent.com/u/756418?v=3","gravatar_id":"","url":"https://api.github.com/users/stormbreakerbg","html_url":"https://github.com/stormbreakerbg","followers_url":"https://api.github.com/users/stormbreakerbg/followers","following_url":"https://api.github.com/users/stormbreakerbg/following{/other_user}","gists_url":"https://api.github.com/users/stormbreakerbg/gists{/gist_id}","starred_url":"https://api.github.com/users/stormbreakerbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormbreakerbg/subscriptions","organizations_url":"https://api.github.com/users/stormbreakerbg/orgs","repos_url":"https://api.github.com/users/stormbreakerbg/repos","events_url":"https://api.github.com/users/stormbreakerbg/events{/privacy}","received_events_url":"https://api.github.com/users/stormbreakerbg/received_events","type":"User","site_admin":false},"created_at":"2015-04-04T08:00:36Z","updated_at":"2015-04-04T08:00:36Z","body":"No, unfortunately. I plan to now during the weekend."}}