@@ -1929,17 +1929,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
1929
1929
}
1930
1930
else if (statement==" monitorenter" )
1931
1931
{
1932
- // becomes a function call
1933
- code_typet type;
1934
- type.return_type ()=void_typet ();
1935
- type.parameters ().resize (1 );
1936
- type.parameters ()[0 ].type ()=java_reference_type (void_typet ());
1937
- code_function_callt call;
1938
- call.function ()=symbol_exprt (" java::monitorenter" , type);
1939
- call.lhs ().make_nil ();
1940
- call.arguments ().push_back (op[0 ]);
1941
- call.add_source_location ()=i_it->source_location ;
1942
- c=call;
1932
+ c = convert_monitorenter (i_it->source_location , op);
1943
1933
}
1944
1934
else if (statement==" monitorexit" )
1945
1935
{
@@ -2310,6 +2300,22 @@ codet java_bytecode_convert_methodt::convert_instructions(
2310
2300
return code;
2311
2301
}
2312
2302
2303
+ codet java_bytecode_convert_methodt::convert_monitorenter (
2304
+ const source_locationt &location,
2305
+ const exprt::operandst &op) const
2306
+ {
2307
+ code_typet type;
2308
+ type.return_type () = void_typet ();
2309
+ type.parameters ().resize (1 );
2310
+ type.parameters ()[0 ].type () = java_reference_type (void_typet ());
2311
+ code_function_callt call;
2312
+ call.function () = symbol_exprt (" java::monitorenter" , type);
2313
+ call.lhs ().make_nil ();
2314
+ call.arguments ().push_back (op[0 ]);
2315
+ call.add_source_location () = location;
2316
+ return call;
2317
+ }
2318
+
2313
2319
void java_bytecode_convert_methodt::convert_multianewarray (
2314
2320
const source_locationt &location,
2315
2321
const exprt &arg0,
0 commit comments