@@ -61,13 +61,13 @@ ci_lazy_methodst::ci_lazy_methodst(
61
61
// / from the main entry point (usually provided with the --function command-
62
62
// / line option
63
63
// / \param symbol_table: global symbol table
64
- // / \param [out] lazy_methods : map from method names to relevant symbol and
64
+ // / \param [out] method_bytecode : map from method names to relevant symbol and
65
65
// / parsed-method objects.
66
66
// / \param method_converter: Function for converting methods on demand.
67
67
// / \return Returns false on success
68
68
bool ci_lazy_methodst::operator ()(
69
69
symbol_tablet &symbol_table,
70
- lazy_methodst &lazy_methods ,
70
+ method_bytecodet &method_bytecode ,
71
71
method_convertert method_converter)
72
72
{
73
73
std::vector<irep_idt> method_worklist1;
@@ -141,8 +141,8 @@ bool ci_lazy_methodst::operator()(
141
141
{
142
142
if (!methods_already_populated.insert (mname).second )
143
143
continue ;
144
- auto findit=lazy_methods .find (mname);
145
- if (findit==lazy_methods .end ())
144
+ auto findit = method_bytecode .find (mname);
145
+ if (findit == method_bytecode .end ())
146
146
{
147
147
debug () << " Skip " << mname << eom;
148
148
continue ;
@@ -191,8 +191,9 @@ bool ci_lazy_methodst::operator()(
191
191
{
192
192
if (sym.second .is_static_lifetime )
193
193
continue ;
194
- if (lazy_methods.count (sym.first ) &&
195
- !methods_already_populated.count (sym.first ))
194
+ if (
195
+ method_bytecode.count (sym.first ) &&
196
+ !methods_already_populated.count (sym.first ))
196
197
{
197
198
continue ;
198
199
}
@@ -263,13 +264,13 @@ void ci_lazy_methodst::resolve_method_names(
263
264
// / \param entry_points: list of fully-qualified function names that
264
265
// / we should assume are reachable
265
266
// / \param ns: global namespace
266
- // / \param [out] lazy_methods : Populated with all Java reference types whose
267
- // / references may be passed, directly or indirectly, to any of the functions
268
- // / in `entry_points`.
267
+ // / \param [out] needed_lazy_methods : Populated with all Java reference types
268
+ // / whose references may be passed, directly or indirectly, to any of the
269
+ // / functions in `entry_points`.
269
270
void ci_lazy_methodst::initialize_needed_classes (
270
271
const std::vector<irep_idt> &entry_points,
271
272
const namespacet &ns,
272
- ci_lazy_methods_neededt &lazy_methods )
273
+ ci_lazy_methods_neededt &needed_lazy_methods )
273
274
{
274
275
for (const auto &mname : entry_points)
275
276
{
@@ -281,67 +282,66 @@ void ci_lazy_methodst::initialize_needed_classes(
281
282
{
282
283
const pointer_typet &original_pointer=to_pointer_type (param.type ());
283
284
initialize_all_needed_classes_from_pointer (
284
- original_pointer, ns, lazy_methods );
285
+ original_pointer, ns, needed_lazy_methods );
285
286
}
286
287
}
287
288
}
288
289
289
290
// Also add classes whose instances are magically
290
291
// created by the JVM and so won't be spotted by
291
292
// looking for constructors and calls as usual:
292
- lazy_methods .add_needed_class (" java::java.lang.String" );
293
- lazy_methods .add_needed_class (" java::java.lang.Class" );
294
- lazy_methods .add_needed_class (" java::java.lang.Object" );
293
+ needed_lazy_methods .add_needed_class (" java::java.lang.String" );
294
+ needed_lazy_methods .add_needed_class (" java::java.lang.Class" );
295
+ needed_lazy_methods .add_needed_class (" java::java.lang.Object" );
295
296
296
297
// As in class_loader, ensure these classes stay available
297
298
for (const auto &id : extra_needed_classes)
298
- lazy_methods .add_needed_class (" java::" + id2string (id));
299
+ needed_lazy_methods .add_needed_class (" java::" + id2string (id));
299
300
}
300
301
301
302
// / Build up list of methods for types for a pointer and any types it
302
303
// / might be subsituted for. See
303
304
// / `initialize_needed_classes` for more details.
304
305
// / \param pointer_type: The type to gather methods for.
305
306
// / \param ns: global namespace
306
- // / \param [out] lazy_methods : Populated with all Java reference types whose
307
- // / references may be passed, directly or indirectly, to any of the functions
308
- // / in `entry_points
307
+ // / \param [out] needed_lazy_methods : Populated with all Java reference types
308
+ // / whose references may be passed, directly or indirectly, to any of the
309
+ // / functions in `entry_points`
309
310
void ci_lazy_methodst::initialize_all_needed_classes_from_pointer (
310
311
const pointer_typet &pointer_type,
311
312
const namespacet &ns,
312
- ci_lazy_methods_neededt &lazy_methods )
313
+ ci_lazy_methods_neededt &needed_lazy_methods )
313
314
{
314
- initialize_needed_classes_from_pointer (
315
- pointer_type, ns, lazy_methods);
315
+ initialize_needed_classes_from_pointer (pointer_type, ns, needed_lazy_methods);
316
316
317
317
const pointer_typet &subbed_pointer_type=
318
318
pointer_type_selector.convert_pointer_type (pointer_type, ns);
319
319
320
320
if (subbed_pointer_type!=pointer_type)
321
321
{
322
322
initialize_needed_classes_from_pointer (
323
- subbed_pointer_type, ns, lazy_methods );
323
+ subbed_pointer_type, ns, needed_lazy_methods );
324
324
}
325
325
}
326
326
327
327
// / Build up list of methods for types for a specific pointer type. See
328
328
// / `initialize_needed_classes` for more details.
329
329
// / \param pointer_type: The type to gather methods for.
330
330
// / \param ns: global namespace
331
- // / \param [out] lazy_methods : Populated with all Java reference types whose
332
- // / references may be passed, directly or indirectly, to any of the functions
333
- // / in `entry_points
331
+ // / \param [out] needed_lazy_methods : Populated with all Java reference types
332
+ // / whose references may be passed, directly or indirectly, to any of the
333
+ // / functions in `entry_points`
334
334
void ci_lazy_methodst::initialize_needed_classes_from_pointer (
335
335
const pointer_typet &pointer_type,
336
336
const namespacet &ns,
337
- ci_lazy_methods_neededt &lazy_methods )
337
+ ci_lazy_methods_neededt &needed_lazy_methods )
338
338
{
339
339
const symbol_typet &class_type=to_symbol_type (pointer_type.subtype ());
340
340
const auto ¶m_classid=class_type.get_identifier ();
341
341
342
- if (lazy_methods .add_needed_class (param_classid))
342
+ if (needed_lazy_methods .add_needed_class (param_classid))
343
343
{
344
- gather_field_types (pointer_type.subtype (), ns, lazy_methods );
344
+ gather_field_types (pointer_type.subtype (), ns, needed_lazy_methods );
345
345
}
346
346
}
347
347
@@ -462,30 +462,30 @@ void ci_lazy_methodst::gather_needed_globals(
462
462
gather_needed_globals (*opit, symbol_table, needed);
463
463
}
464
464
465
- // / See param lazy_methods
465
+ // / See param needed_lazy_methods
466
466
// / \param class_type: root of class tree to search
467
467
// / \param ns: global namespace
468
- // / \param [out] lazy_methods : Popualted with all Java reference types reachable
469
- // / starting at `class_type`. For example if `class_type` is
468
+ // / \param [out] needed_lazy_methods : Popualted with all Java reference types
469
+ // / reachable starting at `class_type`. For example if `class_type` is
470
470
// / `symbol_typet("java::A")` and A has a B field, then `B` (but not `A`) will
471
471
// / noted as a needed class.
472
472
void ci_lazy_methodst::gather_field_types (
473
473
const typet &class_type,
474
474
const namespacet &ns,
475
- ci_lazy_methods_neededt &lazy_methods )
475
+ ci_lazy_methods_neededt &needed_lazy_methods )
476
476
{
477
477
const auto &underlying_type=to_struct_type (ns.follow (class_type));
478
478
for (const auto &field : underlying_type.components ())
479
479
{
480
480
if (field.type ().id ()==ID_struct || field.type ().id ()==ID_symbol)
481
- gather_field_types (field.type (), ns, lazy_methods );
481
+ gather_field_types (field.type (), ns, needed_lazy_methods );
482
482
else if (field.type ().id ()==ID_pointer)
483
483
{
484
484
// Skip array primitive pointers, for example:
485
485
if (field.type ().subtype ().id ()!=ID_symbol)
486
486
continue ;
487
487
initialize_all_needed_classes_from_pointer (
488
- to_pointer_type (field.type ()), ns, lazy_methods );
488
+ to_pointer_type (field.type ()), ns, needed_lazy_methods );
489
489
}
490
490
}
491
491
}
0 commit comments