Skip to content

Commit

Permalink
fix(es): Temporarily disable bytecheck (#5414)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj authored Aug 8, 2022
1 parent a88ac5a commit 2b5080e
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 130 deletions.
8 changes: 0 additions & 8 deletions crates/ast_node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@ pub fn ast_node(
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
#[cfg_attr(
feature = "rkyv",
archive(bound(
Expand Down Expand Up @@ -276,10 +272,6 @@ pub fn ast_node(
)
)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(C), derive(bytecheck::CheckBytes))
)]
serde_tag
#[serde(rename_all = "camelCase")]
serde_rename
Expand Down
1 change: 0 additions & 1 deletion crates/swc_atoms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ include!(concat!(env!("OUT_DIR"), "/js_word.rs"));
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct Atom(#[cfg_attr(feature = "rkyv", with(crate::EncodeAtom))] Arc<str>);

impl Atom {
Expand Down
5 changes: 0 additions & 5 deletions crates/swc_common/src/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ impl SingleThreadedComments {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct Comment {
pub kind: CommentKind,
pub span: Span,
Expand All @@ -561,10 +560,6 @@ impl Spanned for Comment {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum CommentKind {
Line,
Block,
Expand Down
12 changes: 0 additions & 12 deletions crates/swc_common/src/errors/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ use crate::syntax_pos::{MultiSpan, Span};
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(C), derive(bytecheck::CheckBytes))
)]
pub struct Diagnostic {
pub level: Level,
pub message: Vec<(String, Style)>,
Expand All @@ -45,10 +41,6 @@ pub struct Diagnostic {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum DiagnosticId {
Error(String),
Lint(String),
Expand All @@ -64,10 +56,6 @@ pub enum DiagnosticId {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(C), derive(bytecheck::CheckBytes))
)]
pub struct SubDiagnostic {
pub level: Level,
pub message: Vec<(String, Style)>,
Expand Down
20 changes: 0 additions & 20 deletions crates/swc_common/src/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ mod styled_buffer;
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum Applicability {
MachineApplicable,
HasPlaceholders,
Expand All @@ -70,10 +66,6 @@ pub enum Applicability {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(C), derive(bytecheck::CheckBytes))
)]
pub struct CodeSuggestion {
/// Each substitute can have multiple variants due to multiple
/// applicable suggestions
Expand Down Expand Up @@ -125,10 +117,6 @@ pub struct CodeSuggestion {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(C), derive(bytecheck::CheckBytes))
)]
pub struct Substitution {
pub parts: Vec<SubstitutionPart>,
}
Expand All @@ -142,10 +130,6 @@ pub struct Substitution {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(C), derive(bytecheck::CheckBytes))
)]
pub struct SubstitutionPart {
pub span: Span,
pub snippet: String,
Expand Down Expand Up @@ -893,10 +877,6 @@ impl Handler {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum Level {
Bug,
Fatal,
Expand Down
4 changes: 0 additions & 4 deletions crates/swc_common/src/errors/snippet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ pub struct StyledString {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum Style {
MainHeaderMsg,
HeaderMsg,
Expand Down
4 changes: 0 additions & 4 deletions crates/swc_common/src/plugin/serialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ pub const PLUGIN_TRANSFORM_AST_SCHEMA_VERSION: u32 = u32::MAX - 1;
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
/// Enum for possible errors while running transform via plugin.
/// This error indicates internal operation failure either in plugin_runner
/// or plugin_macro. Plugin's transform fn itself does not allow to return
Expand Down
26 changes: 0 additions & 26 deletions crates/swc_common/src/syntax_pos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pub mod hygiene;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct Span {
#[serde(rename = "start")]
#[cfg_attr(feature = "rkyv", omit_bounds)]
Expand Down Expand Up @@ -107,10 +106,6 @@ better_scoped_tls::scoped_tls!(
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash)]
pub enum FileName {
Real(#[cfg_attr(feature = "rkyv", with(crate::source_map::EncodePathBuf))] PathBuf),
Expand Down Expand Up @@ -304,10 +299,6 @@ impl FileName {
feature = "plugin-base",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "plugin-base",
archive_attr(repr(C), derive(bytecheck::CheckBytes))
)]
pub struct MultiSpan {
primary_spans: Vec<Span>,
span_labels: Vec<(Span, String)>,
Expand Down Expand Up @@ -724,7 +715,6 @@ pub const NO_EXPANSION: SyntaxContext = SyntaxContext::empty();
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub struct MultiByteChar {
/// The absolute offset of the character in the SourceMap
Expand All @@ -738,10 +728,6 @@ pub struct MultiByteChar {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum NonNarrowChar {
/// Represents a zero-width character
Expand Down Expand Up @@ -809,7 +795,6 @@ impl Sub<BytePos> for NonNarrowChar {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
#[derive(Clone)]
pub struct SourceFile {
/// The name of the file that the source came from. Source that doesn't
Expand Down Expand Up @@ -1010,7 +995,6 @@ pub trait Pos {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct BytePos(#[cfg_attr(feature = "rkyv", omit_bounds)] pub u32);

impl BytePos {
Expand All @@ -1036,7 +1020,6 @@ impl BytePos {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
pub struct CharPos(pub usize);

Expand Down Expand Up @@ -1132,7 +1115,6 @@ impl Sub for CharPos {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
#[derive(Debug, Clone)]
pub struct Loc {
/// Information about the original source
Expand Down Expand Up @@ -1167,7 +1149,6 @@ pub struct SourceFileAndLine {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
#[derive(Debug)]
pub struct SourceFileAndBytePos {
pub sf: Lrc<SourceFile>,
Expand All @@ -1179,7 +1160,6 @@ pub struct SourceFileAndBytePos {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct LineInfo {
/// Index of line, starting from 0.
pub line_index: usize,
Expand All @@ -1202,7 +1182,6 @@ pub struct LineCol {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct FileLines {
pub file: Lrc<SourceFile>,
pub lines: Vec<LineInfo>,
Expand All @@ -1220,10 +1199,6 @@ pub type FileLinesResult = Result<FileLines, SpanLinesError>;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum SpanLinesError {
IllFormedSpan(Span),
DistinctSources(DistinctSources),
Expand All @@ -1243,7 +1218,6 @@ pub enum SpanSnippetError {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct DistinctSources {
pub begin: (FileName, BytePos),
pub end: (FileName, BytePos),
Expand Down
2 changes: 0 additions & 2 deletions crates/swc_common/src/syntax_pos/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use crate::collections::AHashMap;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct SyntaxContext(#[cfg_attr(feature = "rkyv", omit_bounds)] u32);

#[cfg(feature = "arbitrary")]
Expand Down Expand Up @@ -71,7 +70,6 @@ struct MarkData {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct MutableMarkContext(pub u32, pub u32, pub u32);

// List of proxy calls injected by the host in the plugin's runtime context.
Expand Down
1 change: 0 additions & 1 deletion crates/swc_common/tests/attr_interop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub struct Tuple(#[span] HasSpan, usize, usize);
feature = "rkyv",
archive(bound(serialize = "__S: rkyv::ser::Serializer + rkyv::ser::ScratchSpace"))
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct HasSpan {
#[cfg_attr(feature = "rkyv", omit_bounds)]
pub span: Span,
Expand Down
4 changes: 0 additions & 4 deletions crates/swc_ecma_ast/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ pub struct Decorator {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum MethodKind {
#[serde(rename = "method")]
Method,
Expand Down
4 changes: 0 additions & 4 deletions crates/swc_ecma_ast/src/decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ impl Take for VarDecl {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum VarDeclKind {
/// `var`
Var,
Expand Down
5 changes: 0 additions & 5 deletions crates/swc_ecma_ast/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,6 @@ pub struct MetaPropExpr {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum MetaPropKind {
/// `new.target`
NewTarget,
Expand Down Expand Up @@ -897,7 +893,6 @@ impl Take for Import {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
#[cfg_attr(
feature = "rkyv",
archive(bound(
Expand Down
1 change: 0 additions & 1 deletion crates/swc_ecma_ast/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use crate::typescript::TsTypeAnn;
deserialize = "__D: rkyv::de::SharedDeserializeRegistry"
))
)]
#[cfg_attr(feature = "rkyv", archive_attr(repr(C), derive(bytecheck::CheckBytes)))]
pub struct BindingIdent {
#[span]
#[serde(flatten)]
Expand Down
16 changes: 0 additions & 16 deletions crates/swc_ecma_ast/src/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ use swc_common::EqIgnoreSpan;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum BinaryOp {
/// `==`
EqEq,
Expand Down Expand Up @@ -116,10 +112,6 @@ impl BinaryOp {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum AssignOp {
/// `=`
Assign,
Expand Down Expand Up @@ -193,10 +185,6 @@ impl AssignOp {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum UpdateOp {
/// `++`
PlusPlus,
Expand All @@ -210,10 +198,6 @@ pub enum UpdateOp {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)
)]
#[cfg_attr(
feature = "rkyv",
archive_attr(repr(u32), derive(bytecheck::CheckBytes))
)]
pub enum UnaryOp {
/// `-`
Minus,
Expand Down
Loading

1 comment on commit 2b5080e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 2b5080e Previous: d1da899 Ratio
es/full/minify/libraries/antd 1817126970 ns/iter (± 52087996) 1813451491 ns/iter (± 41726537) 1.00
es/full/minify/libraries/d3 398988642 ns/iter (± 10912914) 413209141 ns/iter (± 11600319) 0.97
es/full/minify/libraries/echarts 1548934458 ns/iter (± 44486252) 1564234687 ns/iter (± 40830689) 0.99
es/full/minify/libraries/jquery 96188049 ns/iter (± 3258965) 111385998 ns/iter (± 5766588) 0.86
es/full/minify/libraries/lodash 122720850 ns/iter (± 3651444) 137654345 ns/iter (± 7253852) 0.89
es/full/minify/libraries/moment 58129675 ns/iter (± 2323883) 59843894 ns/iter (± 5093291) 0.97
es/full/minify/libraries/react 19054708 ns/iter (± 664757) 20131663 ns/iter (± 1088388) 0.95
es/full/minify/libraries/terser 320277066 ns/iter (± 21665411) 335737698 ns/iter (± 13643378) 0.95
es/full/minify/libraries/three 607341713 ns/iter (± 39495984) 597851383 ns/iter (± 11202766) 1.02
es/full/minify/libraries/typescript 3802231265 ns/iter (± 57833353) 3891446647 ns/iter (± 70045143) 0.98
es/full/minify/libraries/victory 825056813 ns/iter (± 16308884) 840592258 ns/iter (± 40756009) 0.98
es/full/minify/libraries/vue 143851090 ns/iter (± 8006378) 154193572 ns/iter (± 6421762) 0.93
es/full/codegen/es3 34222 ns/iter (± 4956) 32549 ns/iter (± 422) 1.05
es/full/codegen/es5 34179 ns/iter (± 6788) 32657 ns/iter (± 776) 1.05
es/full/codegen/es2015 34266 ns/iter (± 4534) 32635 ns/iter (± 889) 1.05
es/full/codegen/es2016 33791 ns/iter (± 3613) 32650 ns/iter (± 2056) 1.03
es/full/codegen/es2017 33941 ns/iter (± 3048) 32594 ns/iter (± 268) 1.04
es/full/codegen/es2018 33442 ns/iter (± 3099) 32580 ns/iter (± 338) 1.03
es/full/codegen/es2019 35436 ns/iter (± 7304) 32392 ns/iter (± 322) 1.09
es/full/codegen/es2020 33463 ns/iter (± 3729) 32535 ns/iter (± 618) 1.03
es/full/all/es3 198742458 ns/iter (± 9681680) 206215333 ns/iter (± 9343424) 0.96
es/full/all/es5 188523311 ns/iter (± 9748492) 182582971 ns/iter (± 17226422) 1.03
es/full/all/es2015 148529818 ns/iter (± 9798219) 153345947 ns/iter (± 10491497) 0.97
es/full/all/es2016 154400970 ns/iter (± 14620988) 147551155 ns/iter (± 7238980) 1.05
es/full/all/es2017 152658778 ns/iter (± 9294926) 144139767 ns/iter (± 7565328) 1.06
es/full/all/es2018 144859726 ns/iter (± 10405748) 143596895 ns/iter (± 7743901) 1.01
es/full/all/es2019 147952893 ns/iter (± 11206800) 155028112 ns/iter (± 10732794) 0.95
es/full/all/es2020 137817109 ns/iter (± 5808709) 139015687 ns/iter (± 10435193) 0.99
es/full/parser 787781 ns/iter (± 65787) 746232 ns/iter (± 25365) 1.06
es/full/base/fixer 29498 ns/iter (± 1352) 28913 ns/iter (± 319) 1.02
es/full/base/resolver_and_hygiene 97360 ns/iter (± 10565) 86941 ns/iter (± 2530) 1.12
serialization of ast node 222 ns/iter (± 26) 210 ns/iter (± 3) 1.06
serialization of serde 233 ns/iter (± 10) 226 ns/iter (± 8) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.