Bug 1865597 - Add error checking when initializing parallel marking and disable on...
[gecko.git] / js / src / frontend / smoosh / build.rs
blob367c682f8687cd84a095a77c4af01d1d9ed0d403
1 use jsparagus::stencil::opcode_info;
3 fn compare(name: &str, orig: &str, copied: &str) {
4     if copied != orig {
5         panic!(
6             "{} is out of sync. \
7                 It's possible that the bytecode generated by jsparagus is \
8                 based on older opcodes. Please run \
9                 update_stencil.py in jsparagus. \
10                 You can disable this check by setting \
11                 JS_SMOOSH_DISABLE_OPCODE_CHECK environment variable.",
12             name
13         );
14     }
17 fn main() {
18     if std::env::var("JS_SMOOSH_DISABLE_OPCODE_CHECK").is_ok() {
19         return;
20     }
22     compare(
23         "Opcodes.h",
24         include_str!("../../vm/Opcodes.h"),
25         opcode_info::get_opcodes_source(),
26     );