Auto merge of #28268 - sagudev:master, r=jdm

Update mozjs

Requires:
https://github.com/servo/mozjs/pull/268
https://github.com/servo/rust-mozjs/pull/535
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2021-03-16 09:09:14 -04:00 committed by GitHub
commit 5f91212866
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 88 additions and 76 deletions

4
Cargo.lock generated
View file

@ -3825,7 +3825,7 @@ dependencies = [
[[package]]
name = "mozjs"
version = "0.14.1"
source = "git+https://github.com/servo/rust-mozjs#b8122da4ea8a48ea21454e65f42d5b2194a2d311"
source = "git+https://github.com/servo/rust-mozjs#fe104a26147a42f6267286cd856361a126ab733b"
dependencies = [
"cc",
"lazy_static",
@ -3838,7 +3838,7 @@ dependencies = [
[[package]]
name = "mozjs_sys"
version = "0.68.2"
source = "git+https://github.com/servo/mozjs?rev=c6c7b5319975a8f0465ce8c17329e74be4cb80b1#c6c7b5319975a8f0465ce8c17329e74be4cb80b1"
source = "git+https://github.com/servo/mozjs?rev=82da136c53d7ca7b0b7fe1c5622627036ef31899#82da136c53d7ca7b0b7fe1c5622627036ef31899"
dependencies = [
"bindgen",
"cc",

View file

@ -29,7 +29,7 @@ use js::rust::wrappers::JS_FireOnNewGlobalObject;
use js::rust::wrappers::RUST_SYMBOL_TO_JSID;
use js::rust::wrappers::{JS_DefineProperty, JS_DefineProperty5};
use js::rust::wrappers::{JS_DefineProperty3, JS_DefineProperty4, JS_DefinePropertyById5};
use js::rust::wrappers::{JS_LinkConstructorAndPrototype, JS_NewObjectWithUniqueType};
use js::rust::wrappers::{JS_LinkConstructorAndPrototype, JS_NewObjectWithGivenProto};
use js::rust::{define_methods, define_properties, get_object_class};
use js::rust::{HandleObject, HandleValue, MutableHandleObject, RealmOptions};
use std::convert::TryFrom;
@ -316,7 +316,7 @@ pub fn create_object(
mut rval: MutableHandleObject,
) {
unsafe {
rval.set(JS_NewObjectWithUniqueType(*cx, class, proto));
rval.set(JS_NewObjectWithGivenProto(*cx, class, proto));
}
assert!(!rval.is_null());
define_guarded_methods(cx, rval.handle(), methods, global);

View file

@ -66,7 +66,6 @@ use std::io::{Read, Seek, Write};
use std::mem::replace;
use std::path::PathBuf;
use std::process::Command;
use std::ptr;
use std::rc::Rc;
use std::sync::{Arc, Mutex};
use style::str::{StaticStringVec, HTML_SPACE_CHARACTERS};
@ -446,16 +445,15 @@ impl FetchResponseListener for ClassicContext {
fetch_options: self.fetch_options.clone(),
});
let mut token = ptr::null_mut();
unsafe {
assert!(CompileOffThread1(
assert!(!CompileOffThread1(
*cx,
options.ptr as *const _,
&mut transform_str_to_source_text(&context.script_text) as *mut _,
Some(off_thread_compilation_callback),
Box::into_raw(context) as *mut c_void,
&mut token,
));
)
.is_null());
}
} else {
let load = ScriptOrigin::external(

View file

@ -45,7 +45,7 @@ use js::jsapi::Handle as RawHandle;
use js::jsapi::HandleObject;
use js::jsapi::HandleValue as RawHandleValue;
use js::jsapi::Value;
use js::jsapi::{CompileModule1, ExceptionStackBehavior, FinishDynamicModuleImport};
use js::jsapi::{CompileModule1, ExceptionStackBehavior, FinishDynamicModuleImport_NoTLA};
use js::jsapi::{DynamicImportStatus, SetModuleDynamicImportHook, SetScriptPrivateReferenceHooks};
use js::jsapi::{GetModuleResolveHook, JSRuntime, SetModuleResolveHook};
use js::jsapi::{GetRequestedModules, SetModuleMetadataHook};
@ -505,7 +505,8 @@ impl ModuleTree {
let _ac = JSAutoRealm::new(*global.get_cx(), *global.reflector().get_jsobject());
unsafe {
if !ModuleEvaluate(*global.get_cx(), module_record) {
rooted!(in(*global.get_cx()) let mut rval = UndefinedValue());
if !ModuleEvaluate(*global.get_cx(), module_record, rval.handle_mut().into()) {
warn!("fail to evaluate module");
rooted!(in(*global.get_cx()) let mut exception = UndefinedValue());
@ -1024,7 +1025,7 @@ impl ModuleOwner {
debug!("Finishing dynamic import for {:?}", module_identity);
unsafe {
FinishDynamicModuleImport(
FinishDynamicModuleImport_NoTLA(
*cx,
status,
module.referencing_private.handle(),

View file

@ -56,7 +56,7 @@ use js::jsapi::{
};
use js::jsapi::{HandleObject, Heap, JobQueue};
use js::jsapi::{JSContext as RawJSContext, JSTracer, SetDOMCallbacks, SetGCSliceCallback};
use js::jsapi::{JSGCMode, JSGCParamKey, JS_SetGCParameter, JS_SetGlobalJitCompilerOption};
use js::jsapi::{JSGCParamKey, JS_SetGCParameter, JS_SetGlobalJitCompilerOption};
use js::jsapi::{
JSJitCompilerOption, JS_SetOffthreadIonCompilationEnabled, JS_SetParallelParsingEnabled,
};
@ -591,14 +591,16 @@ unsafe fn new_rt_and_cx_with_parent(
.unwrap_or(u32::max_value()),
);
// NOTE: This is disabled above, so enabling it here will do nothing for now.
let js_gc_mode = if pref!(js.mem.gc.incremental.enabled) {
JSGCMode::JSGC_MODE_INCREMENTAL
} else if pref!(js.mem.gc.per_zone.enabled) {
JSGCMode::JSGC_MODE_ZONE
} else {
JSGCMode::JSGC_MODE_GLOBAL
};
JS_SetGCParameter(cx, JSGCParamKey::JSGC_MODE, js_gc_mode as u32);
JS_SetGCParameter(
cx,
JSGCParamKey::JSGC_INCREMENTAL_GC_ENABLED,
pref!(js.mem.gc.incremental.enabled) as u32,
);
JS_SetGCParameter(
cx,
JSGCParamKey::JSGC_PER_ZONE_GC_ENABLED,
pref!(js.mem.gc.per_zone.enabled) as u32,
);
if let Some(val) = in_range(pref!(js.mem.gc.incremental.slice_ms), 0, 100_000) {
JS_SetGCParameter(cx, JSGCParamKey::JSGC_SLICE_TIME_BUDGET_MS, val as u32);
}

View file

@ -0,0 +1,4 @@
[hit-test-floats-002.html]
[Hit test float]
expected: FAIL

View file

@ -14,3 +14,6 @@
[<li>Outside 3</li>]
expected: FAIL
[<li>Inside 3</li>]
expected: FAIL

View file

@ -1,4 +0,0 @@
[elementsFromPoint-invalid-cases.html]
[The root element is the last element returned for otherwise empty queries within the viewport]
expected: FAIL

View file

@ -5,3 +5,15 @@
[Test javascript URL string return values in direct and indirect (target) frame contexts. 9]
expected: FAIL
[Test javascript URL string return values in direct and indirect (target) frame contexts. 5]
expected: FAIL
[Test javascript URL string return values in direct and indirect (target) frame contexts. 6]
expected: FAIL
[Test javascript URL string return values in direct and indirect (target) frame contexts. 7]
expected: FAIL
[Test javascript URL string return values in direct and indirect (target) frame contexts. 8]
expected: FAIL

View file

@ -2,19 +2,19 @@
[input type search: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type text: selectionStart a second time (must not fire select)]
[input type url: selectionStart out of range a second time (must not fire select)]
expected: FAIL
[input type search: setRangeText() a second time (must not fire select)]
[input type password: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[textarea: selectionEnd a second time (must not fire select)]
[input type text: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type tel: select() a second time (must not fire select)]
[input type tel: selectionEnd out of range a second time (must not fire select)]
expected: FAIL
[input type url: setRangeText() a second time (must not fire select)]
[textarea: selectionStart out of range a second time (must not fire select)]
expected: FAIL
[input type text: selectionStart out of range a second time (must not fire select)]
@ -29,16 +29,31 @@
[input type url: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type password: selectionDirection a second time (must not fire select)]
[input type password: select() a second time (must not fire select)]
expected: FAIL
[textarea: selectionDirection a second time (must not fire select)]
[textarea: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type text: setSelectionRange out of range a second time (must not fire select)]
[input type text: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type url: selectionEnd a second time (must not fire select)]
[input type text: selectionDirection a second time (must not fire select)]
expected: FAIL
[input type text: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type search: selectionStart a second time (must not fire select)]
expected: FAIL
[input type search: selectionEnd a second time (must not fire select)]
expected: FAIL
[input type tel: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type tel: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL
[input type password: selectionStart a second time (must not fire select)]
@ -47,9 +62,3 @@
[input type password: setRangeText() a second time (must not fire select)]
expected: FAIL
[input type password: selectionStart out of range a second time (must not fire select)]
expected: FAIL
[input type password: setSelectionRange out of range a second time (must not fire select)]
expected: FAIL

View file

@ -1,21 +0,0 @@
[constructor-reftypes.tentative.any.html]
[initialize anyfunc table with a bad default value]
expected: FAIL
[initialize externref table with default value]
expected: FAIL
[initialize anyfunc table with default value]
expected: FAIL
[constructor-reftypes.tentative.any.worker.html]
[initialize anyfunc table with a bad default value]
expected: FAIL
[initialize externref table with default value]
expected: FAIL
[initialize anyfunc table with default value]
expected: FAIL

View file

@ -0,0 +1,9 @@
[constructor.any.html]
[Stray argument]
expected: FAIL
[constructor.any.worker.html]
[Stray argument]
expected: FAIL

View file

@ -0,0 +1,9 @@
[get-set.any.worker.html]
[Missing arguments: set]
expected: FAIL
[get-set.any.html]
[Missing arguments: set]
expected: FAIL

View file

@ -1,15 +0,0 @@
[set-reftypes.tentative.any.worker.html]
[Arguments for externref table set]
expected: FAIL
[Arguments for anyfunc table set]
expected: FAIL
[set-reftypes.tentative.any.html]
[Arguments for externref table set]
expected: FAIL
[Arguments for anyfunc table set]
expected: FAIL

View file

@ -0,0 +1,5 @@
[018.html]
expected: TIMEOUT
[origin of the script that invoked the method, javascript:]
expected: TIMEOUT