@@ -29,15 +29,11 @@ class java_bytecode_instrumentt:public messaget
29
29
java_bytecode_instrumentt (
30
30
symbol_tablet &_symbol_table,
31
31
const bool _throw_runtime_exceptions,
32
- message_handlert &_message_handler,
33
- const size_t _max_array_length,
34
- const size_t _max_tree_depth):
32
+ message_handlert &_message_handler):
35
33
messaget (_message_handler),
36
34
symbol_table (_symbol_table),
37
35
throw_runtime_exceptions (_throw_runtime_exceptions),
38
- message_handler (_message_handler),
39
- max_array_length (_max_array_length),
40
- max_tree_depth (_max_tree_depth)
36
+ message_handler (_message_handler)
41
37
{
42
38
}
43
39
@@ -47,8 +43,6 @@ class java_bytecode_instrumentt:public messaget
47
43
symbol_tablet &symbol_table;
48
44
const bool throw_runtime_exceptions;
49
45
message_handlert &message_handler;
50
- const size_t max_array_length;
51
- const size_t max_tree_depth;
52
46
53
47
codet throw_exception (
54
48
const exprt &cond,
@@ -570,28 +564,23 @@ void java_bytecode_instrumentt::operator()(exprt &expr)
570
564
// / runtime exceptions or corresponding assertions.
571
565
// / Exceptions are thrown when the `throw_runtime_exceptions` flag is set.
572
566
// / Otherwise, assertions are emitted.
573
- // / \par parameters: `symbol_table`: global symbol table (may gain exception type
574
- // / stubs and similar)
575
- // / `symbol`: the symbol to instrument
576
- // / `throw_runtime_exceptions`: flag determining whether we instrument the code
577
- // / with runtime exceptions or with assertions. The former applies if this flag
578
- // / is set to true.
579
- // / `max_array_length`: maximum array length; the only reason we need this is
580
- // / in order to be able to call the object factory to create exceptions.
581
- void java_bytecode_instrument (
567
+ // / \param symbol_table: global symbol table (may gain exception type stubs and
568
+ // / similar)
569
+ // / \param symbol: the symbol to instrument
570
+ // / \param throw_runtime_exceptions: flag determining whether we instrument the
571
+ // / code with runtime exceptions or with assertions. The former applies if
572
+ // / this flag is set to true.
573
+ // / \param message_handler: stream to report status and warnings
574
+ void java_bytecode_instrument_symbol (
582
575
symbol_tablet &symbol_table,
583
576
symbolt &symbol,
584
577
const bool throw_runtime_exceptions,
585
- message_handlert &message_handler,
586
- const size_t max_array_length,
587
- const size_t max_tree_depth)
578
+ message_handlert &message_handler)
588
579
{
589
580
java_bytecode_instrumentt instrument (
590
581
symbol_table,
591
582
throw_runtime_exceptions,
592
- message_handler,
593
- max_array_length,
594
- max_tree_depth);
583
+ message_handler);
595
584
INVARIANT (
596
585
symbol.value .id ()==ID_code,
597
586
" java_bytecode_instrument expects a code-typed symbol" );
@@ -602,25 +591,21 @@ void java_bytecode_instrument(
602
591
// / runtime exceptions or corresponding assertions.
603
592
// / Exceptions are thrown when the `throw_runtime_exceptions` flag is set.
604
593
// / Otherwise, assertions are emitted.
605
- // / \par parameters: ` symbol_table`: the symbol table to instrument
606
- // / `throw_runtime_exceptions`: flag determining whether we instrument the code
607
- // / with runtime exceptions or with assertions. The former applies if this flag
608
- // / is set to true.
609
- // / `max_array_length`: maximum array length; the only reason we need this is
610
- // / in order to be able to call the object factory to create exceptions.
594
+ // / \param symbol_table: global symbol table, all of whose code members
595
+ // / will be annotated (may gain exception type stubs and similar)
596
+ // / \param throw_runtime_exceptions: flag determining whether we instrument the
597
+ // / code with runtime exceptions or with assertions. The former applies if
598
+ // / this flag is set to true.
599
+ // / \param message_handler: stream to report status and warnings
611
600
void java_bytecode_instrument (
612
601
symbol_tablet &symbol_table,
613
602
const bool throw_runtime_exceptions,
614
- message_handlert &message_handler,
615
- const size_t max_array_length,
616
- const size_t max_tree_depth)
603
+ message_handlert &message_handler)
617
604
{
618
605
java_bytecode_instrumentt instrument (
619
606
symbol_table,
620
607
throw_runtime_exceptions,
621
- message_handler,
622
- max_array_length,
623
- max_tree_depth);
608
+ message_handler);
624
609
625
610
std::vector<irep_idt> symbols_to_instrument;
626
611
forall_symbols (s_it, symbol_table.symbols )
@@ -632,9 +617,5 @@ void java_bytecode_instrument(
632
617
// instrument(...) can add symbols to the table, so it's
633
618
// not safe to hold a reference to a symbol across a call.
634
619
for (const auto &symbol : symbols_to_instrument)
635
- {
636
- exprt value=symbol_table.lookup (symbol).value ;
637
- instrument (value);
638
- symbol_table.lookup (symbol).value =value;
639
- }
620
+ instrument (symbol_table.lookup (symbol).value );
640
621
}
0 commit comments