@@ -72,8 +72,7 @@ bool ci_lazy_methodst::operator()(
72
72
method_bytecodet &method_bytecode,
73
73
const method_convertert &method_converter)
74
74
{
75
- std::vector<irep_idt> method_worklist1;
76
- std::vector<irep_idt> method_worklist2;
75
+ std::vector<irep_idt> methods_to_convert_later;
77
76
78
77
main_function_resultt main_function =
79
78
get_main_symbol (symbol_table, main_class, get_message_handler ());
@@ -95,19 +94,19 @@ bool ci_lazy_methodst::operator()(
95
94
const irep_idt methodid =
96
95
" java::" + id2string (class_name) + " ." + id2string (method.name )
97
96
+ " :" + id2string (method.descriptor );
98
- method_worklist2 .push_back (methodid);
97
+ methods_to_convert_later .push_back (methodid);
99
98
}
100
99
}
101
100
}
102
101
else
103
- method_worklist2 .push_back (main_function.main_function .name );
102
+ methods_to_convert_later .push_back (main_function.main_function .name );
104
103
105
104
// Add any extra entry points specified; we should elaborate these in the
106
105
// same way as the main function.
107
106
std::vector<irep_idt> extra_entry_points=lazy_methods_extra_entry_points;
108
107
resolve_method_names (extra_entry_points, symbol_table);
109
- method_worklist2 .insert (
110
- method_worklist2 .begin (),
108
+ methods_to_convert_later .insert (
109
+ methods_to_convert_later .begin (),
111
110
extra_entry_points.begin (),
112
111
extra_entry_points.end ());
113
112
@@ -120,11 +119,9 @@ bool ci_lazy_methodst::operator()(
120
119
instantiated_classes,
121
120
symbol_table);
122
121
initialize_instantiated_classes (
123
- method_worklist2,
124
- namespacet (symbol_table),
125
- initial_lazy_methods);
126
- method_worklist2.insert (
127
- method_worklist2.end (),
122
+ methods_to_convert_later, namespacet (symbol_table), initial_lazy_methods);
123
+ methods_to_convert_later.insert (
124
+ methods_to_convert_later.end (),
128
125
initial_callable_methods.begin (),
129
126
initial_callable_methods.end ());
130
127
}
@@ -136,21 +133,22 @@ bool ci_lazy_methodst::operator()(
136
133
while (any_new_methods)
137
134
{
138
135
any_new_methods=false ;
139
- while (!method_worklist2 .empty ())
136
+ while (!methods_to_convert_later .empty ())
140
137
{
141
- std::swap (method_worklist1, method_worklist2);
142
- for (const auto &mname : method_worklist1)
138
+ std::vector<irep_idt> methods_to_convert;
139
+ std::swap (methods_to_convert, methods_to_convert_later);
140
+ for (const auto &mname : methods_to_convert)
143
141
{
144
142
if (!methods_already_populated.insert (mname).second )
145
143
continue ;
146
144
debug () << " CI lazy methods: elaborate " << mname << eom;
147
145
if (
148
146
method_converter (
149
147
mname,
150
- // Note this wraps *references* to method_worklist2 &
148
+ // Note this wraps *references* to methods_to_convert_later &
151
149
// instantiated_classes
152
150
ci_lazy_methods_neededt (
153
- method_worklist2 , instantiated_classes, symbol_table)))
151
+ methods_to_convert_later , instantiated_classes, symbol_table)))
154
152
{
155
153
// Couldn't convert this function
156
154
continue ;
@@ -160,7 +158,6 @@ bool ci_lazy_methodst::operator()(
160
158
virtual_callsites);
161
159
any_new_methods=true ;
162
160
}
163
- method_worklist1.clear ();
164
161
}
165
162
166
163
// Given the object types we now know may be created, populate more
@@ -179,7 +176,7 @@ bool ci_lazy_methodst::operator()(
179
176
{
180
177
// This will also create a stub if a virtual callsite has no targets.
181
178
get_virtual_method_targets (
182
- function, instantiated_classes, method_worklist2 , symbol_table);
179
+ function, instantiated_classes, methods_to_convert_later , symbol_table);
183
180
}
184
181
}
185
182
0 commit comments