Added off thread compilation

Co-authored-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Abhishek Sharma <20724848+AbhishekSharma102@users.noreply.github.com>
This commit is contained in:
AbhishekSharma102 2020-07-13 06:04:00 +00:00 committed by Josh Matthews
parent bfb7bea704
commit 1119dd119e
8 changed files with 310 additions and 85 deletions

View file

@ -14,6 +14,7 @@ use crate::dom::bindings::str::DOMString;
use crate::dom::document::AnimationFrameCallback;
use crate::dom::element::Element;
use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlscriptelement::SourceCode;
use crate::dom::node::{window_from_node, Node, ShadowIncluding};
use crate::realms::enter_realm;
use crate::script_module::ScriptFetchOptions;
@ -25,6 +26,7 @@ use js::jsval::UndefinedValue;
use js::rust::wrappers::ObjectClassName;
use msg::constellation_msg::PipelineId;
use std::ffi::CStr;
use std::rc::Rc;
use std::str;
use uuid::Uuid;
@ -35,8 +37,9 @@ pub fn handle_evaluate_js(global: &GlobalScope, eval: String, reply: IpcSender<E
let cx = global.get_cx();
let _ac = enter_realm(global);
rooted!(in(*cx) let mut rval = UndefinedValue());
let source_code = SourceCode::Text(Rc::new(DOMString::from_string(eval)));
global.evaluate_script_on_global_with_result(
&eval,
&source_code,
"<eval>",
rval.handle_mut(),
1,