@@ -3,10 +3,6 @@ mod dot;
3
3
4
4
use itertools:: Itertools ;
5
5
use oxc_ast:: AstKind ;
6
- use oxc_span:: CompactStr ;
7
- use oxc_syntax:: operator:: {
8
- AssignmentOperator , BinaryOperator , LogicalOperator , UnaryOperator , UpdateOperator ,
9
- } ;
10
6
use petgraph:: {
11
7
stable_graph:: NodeIndex ,
12
8
visit:: { depth_first_search, Control , DfsEvent , EdgeRef } ,
@@ -20,101 +16,6 @@ pub use dot::{DebugDot, DebugDotContext, DisplayDot};
20
16
21
17
pub type BasicBlockId = NodeIndex ;
22
18
23
- #[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
24
- pub enum Register {
25
- Index ( u32 ) ,
26
- Return ,
27
- }
28
-
29
- #[ derive( Debug , Clone ) ]
30
- pub enum ObjectPropertyAccessBy {
31
- PrivateProperty ( CompactStr ) ,
32
- Property ( CompactStr ) ,
33
- Expression ( Register ) ,
34
- }
35
-
36
- #[ derive( Debug , Clone ) ]
37
- pub struct CollectionAssignmentValue {
38
- pub id : AstNodeId ,
39
- pub elements : Vec < Register > ,
40
- pub spreads : Vec < usize > ,
41
- pub collection_type : CollectionType ,
42
- }
43
-
44
- #[ derive( Debug , Clone ) ]
45
- pub struct CalleeWithArgumentsAssignmentValue {
46
- pub id : AstNodeId ,
47
- pub callee : Register ,
48
- pub arguments : Vec < Register > ,
49
- pub spreads : Vec < usize > ,
50
- pub call_type : CallType ,
51
- }
52
-
53
- #[ derive( Debug , Clone ) ]
54
- pub struct ObjectPropertyAccessAssignmentValue {
55
- pub id : AstNodeId ,
56
- pub access_on : Register ,
57
- pub access_by : ObjectPropertyAccessBy ,
58
- pub optional : bool ,
59
- }
60
-
61
- #[ derive( Debug , Clone ) ]
62
- pub struct BinaryAssignmentValue {
63
- pub id : AstNodeId ,
64
- pub a : Register ,
65
- pub b : Register ,
66
- pub operator : BinaryOp ,
67
- }
68
-
69
- #[ derive( Debug , Clone ) ]
70
- pub struct UpdateAssignmentValue {
71
- pub id : AstNodeId ,
72
- pub expr : Register ,
73
- pub op : UpdateOperator ,
74
- pub prefix : bool ,
75
- }
76
-
77
- #[ derive( Debug , Clone ) ]
78
- pub struct UnaryExpressioneAssignmentValue ( pub AstNodeId , pub UnaryOperator , pub Register ) ;
79
-
80
- #[ derive( Debug , Clone ) ]
81
- pub enum AssignmentValue {
82
- ImplicitUndefined ,
83
- NotImplicitUndefined ,
84
- }
85
-
86
- #[ derive( Debug , Clone ) ]
87
- pub enum BinaryOp {
88
- BinaryOperator ( BinaryOperator ) ,
89
- LogicalOperator ( LogicalOperator ) ,
90
- AssignmentOperator ( AssignmentOperator ) ,
91
- }
92
-
93
- #[ derive( Debug , Clone ) ]
94
- pub enum CollectionType {
95
- Array ,
96
- // Note: we do not currently track object names in objects.
97
- Object ,
98
- JSXElement ,
99
- JSXFragment ,
100
- // doesn't use spreads
101
- Class ,
102
- TemplateLiteral ,
103
- }
104
-
105
- #[ derive( Debug , Clone ) ]
106
- pub enum CallType {
107
- New ,
108
- CallExpression ,
109
- // the callee is the yielded value, arguments are always empty
110
- // spreads are always empty
111
- Yield ,
112
- // spreads are always empty
113
- TaggedTemplate ,
114
- // spreads are always empty
115
- Import ,
116
- }
117
-
118
19
#[ derive( Debug ) ]
119
20
pub struct BasicBlock {
120
21
pub instructions : Vec < Instruction > ,
0 commit comments