-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade libv8 to latest stable version #85
Comments
I thought I already did... |
btw ... we got to get us up to 6.6 @ignisf if you have some time to do a new libv8 |
Oh! look at that. Sorry. |
will look into this :) |
|
anything we can do to help move libv8 to 66 ? |
Well, considering the complexity in the libv8 gem was mainly focused around wrestling with GYP, this release will certainly require more work than the previous ones. Have to research how to use |
Yuck. That sucks. Wish I had time to dive in and go on a compiler adventure! |
Hi, I was able to get v8 to build with GN. Will be working on incorporating the changes that will automate the process in Here are the changes needed to get mini_racer to compile against v8 6.7. The diff --git a/ext/mini_racer_extension/mini_racer_extension.cc b/ext/mini_racer_extension/mini_racer_extension.cc
index 168785d..4dfdf97 100644
--- a/ext/mini_racer_extension/mini_racer_extension.cc
+++ b/ext/mini_racer_extension/mini_racer_extension.cc
@@ -202,7 +202,7 @@ static void gc_callback(Isolate *isolate, GCType type, GCCallbackFlags flags) {
if(used > softlimit) {
isolate->SetData(MEM_SOFTLIMIT_REACHED, (void*)true);
- V8::TerminateExecution(isolate);
+ isolate->TerminateExecution();
}
}
@@ -626,11 +626,11 @@ static VALUE rb_isolate_init_with_snapshot(VALUE self, VALUE snapshot) {
return Qnil;
}
-static VALUE rb_isolate_idle_notification(VALUE self, VALUE idle_time_in_ms) {
+static VALUE rb_isolate_idle_notification_deadline(VALUE self, VALUE idle_time_in_s) {
IsolateInfo* isolate_info;
Data_Get_Struct(self, IsolateInfo, isolate_info);
- return isolate_info->isolate->IdleNotification(NUM2INT(idle_time_in_ms)) ? Qtrue : Qfalse;
+ return isolate_info->isolate->IdleNotificationDeadline(NUM2DBL(idle_time_in_s)) ? Qtrue : Qfalse;
}
static VALUE rb_context_init_unsafe(VALUE self, VALUE isolate, VALUE snap) {
@@ -901,7 +901,7 @@ gvl_ruby_callback(void* data) {
if ((bool)args->GetIsolate()->GetData(DO_TERMINATE) == true) {
args->GetIsolate()->ThrowException(String::NewFromUtf8(args->GetIsolate(), "Terminated execution during transition from Ruby to JS"));
- V8::TerminateExecution(args->GetIsolate());
+ args->GetIsolate()->TerminateExecution();
return NULL;
}
@@ -924,7 +924,7 @@ gvl_ruby_callback(void* data) {
if ((bool)args->GetIsolate()->GetData(DO_TERMINATE) == true) {
Isolate* isolate = args->GetIsolate();
- V8::TerminateExecution(isolate);
+ isolate->TerminateExecution();
}
return NULL;
@@ -1180,7 +1180,7 @@ rb_context_stop(VALUE self) {
// flag for termination
isolate->SetData(DO_TERMINATE, (void*)true);
- V8::TerminateExecution(isolate);
+ isolate->TerminateExecution();
rb_funcall(self, rb_intern("stop_attached"), 0);
return Qnil;
@@ -1361,7 +1361,7 @@ extern "C" {
rb_define_method(rb_cSnapshot, "warmup!", (VALUE(*)(...))&rb_snapshot_warmup, 1);
rb_define_private_method(rb_cSnapshot, "load", (VALUE(*)(...))&rb_snapshot_load, 1);
- rb_define_method(rb_cIsolate, "idle_notification", (VALUE(*)(...))&rb_isolate_idle_notification, 1);
+ rb_define_method(rb_cIsolate, "idle_notification_deadline", (VALUE(*)(...))&rb_isolate_idle_notification_deadline, 1);
rb_define_private_method(rb_cIsolate, "init_with_snapshot",(VALUE(*)(...))&rb_isolate_init_with_snapshot, 1);
rb_define_singleton_method(rb_cPlatform, "set_flag_as_str!", (VALUE(*)(...))&rb_platform_set_flag_as_str, 1);
diff --git a/test/mini_racer_test.rb b/test/mini_racer_test.rb
index 517303d..a40470a 100644
--- a/test/mini_racer_test.rb
+++ b/test/mini_racer_test.rb
@@ -502,7 +502,7 @@ raise FooError, "I like foos"
def test_isolate_can_be_notified_of_idle_time
isolate = MiniRacer::Isolate.new
- assert(isolate.idle_notification(1000))
+ assert(isolate.idle_notification_deadline(1))
end
def test_concurrent_access_over_the_same_isolate_1 |
Relevant review for the IdleNotification --> IdleNotificationDeadline change: https://chromium-review.googlesource.com/c/v8/v8/+/848782 |
|
wow this is awesome... once you have a libv8 version out I am perfectly happy changing mini_racer so it has a hard dependency on latest libv8 and we are not stuck with ugly #if blocks Let me know as soon as you have a gem out cause I want to see if this resolves #90 which really worries me. |
6.3 is released in libv8 -- is there a reason we haven't moved to it in mini_racer yet? (I don't remember)
@SamSaffron @ignisf
The text was updated successfully, but these errors were encountered: