1 2 20 21 22 23 package soot.options; 24 import java.util.*; 25 26 27 public class SparkOptions 28 { 29 private Map options; 30 31 public SparkOptions( Map options ) { 32 this.options = options; 33 } 34 35 41 public boolean enabled() { 42 return soot.PhaseOptions.getBoolean( options, "enabled" ); 43 } 44 45 52 public boolean verbose() { 53 return soot.PhaseOptions.getBoolean( options, "verbose" ); 54 } 55 56 63 public boolean ignore_types() { 64 return soot.PhaseOptions.getBoolean( options, "ignore-types" ); 65 } 66 67 75 public boolean force_gc() { 76 return soot.PhaseOptions.getBoolean( options, "force-gc" ); 77 } 78 79 90 public boolean pre_jimplify() { 91 return soot.PhaseOptions.getBoolean( options, "pre-jimplify" ); 92 } 93 94 105 public boolean vta() { 106 return soot.PhaseOptions.getBoolean( options, "vta" ); 107 } 108 109 117 public boolean rta() { 118 return soot.PhaseOptions.getBoolean( options, "rta" ); 119 } 120 121 132 public boolean field_based() { 133 return soot.PhaseOptions.getBoolean( options, "field-based" ); 134 } 135 136 144 public boolean types_for_sites() { 145 return soot.PhaseOptions.getBoolean( options, "types-for-sites" ); 146 } 147 148 156 public boolean merge_stringbuffer() { 157 return soot.PhaseOptions.getBoolean( options, "merge-stringbuffer" ); 158 } 159 160 171 public boolean string_constants() { 172 return soot.PhaseOptions.getBoolean( options, "string-constants" ); 173 } 174 175 182 public boolean simulate_natives() { 183 return soot.PhaseOptions.getBoolean( options, "simulate-natives" ); 184 } 185 186 194 public boolean simple_edges_bidirectional() { 195 return soot.PhaseOptions.getBoolean( options, "simple-edges-bidirectional" ); 196 } 197 198 206 public boolean on_fly_cg() { 207 return soot.PhaseOptions.getBoolean( options, "on-fly-cg" ); 208 } 209 210 218 public boolean simplify_offline() { 219 return soot.PhaseOptions.getBoolean( options, "simplify-offline" ); 220 } 221 222 230 public boolean simplify_sccs() { 231 return soot.PhaseOptions.getBoolean( options, "simplify-sccs" ); 232 } 233 234 246 public boolean ignore_types_for_sccs() { 247 return soot.PhaseOptions.getBoolean( options, "ignore-types-for-sccs" ); 248 } 249 250 259 public boolean dump_html() { 260 return soot.PhaseOptions.getBoolean( options, "dump-html" ); 261 } 262 263 272 public boolean dump_pag() { 273 return soot.PhaseOptions.getBoolean( options, "dump-pag" ); 274 } 275 276 285 public boolean dump_solution() { 286 return soot.PhaseOptions.getBoolean( options, "dump-solution" ); 287 } 288 289 298 public boolean topo_sort() { 299 return soot.PhaseOptions.getBoolean( options, "topo-sort" ); 300 } 301 302 310 public boolean dump_types() { 311 return soot.PhaseOptions.getBoolean( options, "dump-types" ); 312 } 313 314 326 public boolean class_method_var() { 327 return soot.PhaseOptions.getBoolean( options, "class-method-var" ); 328 } 329 330 339 public boolean dump_answer() { 340 return soot.PhaseOptions.getBoolean( options, "dump-answer" ); 341 } 342 343 351 public boolean add_tags() { 352 return soot.PhaseOptions.getBoolean( options, "add-tags" ); 353 } 354 355 363 public boolean set_mass() { 364 return soot.PhaseOptions.getBoolean( options, "set-mass" ); 365 } 366 367 public static final int propagator_iter = 1; 368 public static final int propagator_worklist = 2; 369 public static final int propagator_cycle = 3; 370 public static final int propagator_merge = 4; 371 public static final int propagator_alias = 5; 372 public static final int propagator_none = 6; 373 380 public int propagator() { 381 String s = soot.PhaseOptions.getString( options, "propagator" ); 382 383 if( s.equalsIgnoreCase( "iter" ) ) 384 return propagator_iter; 385 386 if( s.equalsIgnoreCase( "worklist" ) ) 387 return propagator_worklist; 388 389 if( s.equalsIgnoreCase( "cycle" ) ) 390 return propagator_cycle; 391 392 if( s.equalsIgnoreCase( "merge" ) ) 393 return propagator_merge; 394 395 if( s.equalsIgnoreCase( "alias" ) ) 396 return propagator_alias; 397 398 if( s.equalsIgnoreCase( "none" ) ) 399 return propagator_none; 400 401 throw new RuntimeException ( "Invalid value "+s+" of phase option propagator" ); 402 } 403 404 public static final int set_impl_hash = 1; 405 public static final int set_impl_bit = 2; 406 public static final int set_impl_hybrid = 3; 407 public static final int set_impl_array = 4; 408 public static final int set_impl_double = 5; 409 public static final int set_impl_shared = 6; 410 416 public int set_impl() { 417 String s = soot.PhaseOptions.getString( options, "set-impl" ); 418 419 if( s.equalsIgnoreCase( "hash" ) ) 420 return set_impl_hash; 421 422 if( s.equalsIgnoreCase( "bit" ) ) 423 return set_impl_bit; 424 425 if( s.equalsIgnoreCase( "hybrid" ) ) 426 return set_impl_hybrid; 427 428 if( s.equalsIgnoreCase( "array" ) ) 429 return set_impl_array; 430 431 if( s.equalsIgnoreCase( "double" ) ) 432 return set_impl_double; 433 434 if( s.equalsIgnoreCase( "shared" ) ) 435 return set_impl_shared; 436 437 throw new RuntimeException ( "Invalid value "+s+" of phase option set-impl" ); 438 } 439 440 public static final int double_set_old_hash = 1; 441 public static final int double_set_old_bit = 2; 442 public static final int double_set_old_hybrid = 3; 443 public static final int double_set_old_array = 4; 444 public static final int double_set_old_shared = 5; 445 454 public int double_set_old() { 455 String s = soot.PhaseOptions.getString( options, "double-set-old" ); 456 457 if( s.equalsIgnoreCase( "hash" ) ) 458 return double_set_old_hash; 459 460 if( s.equalsIgnoreCase( "bit" ) ) 461 return double_set_old_bit; 462 463 if( s.equalsIgnoreCase( "hybrid" ) ) 464 return double_set_old_hybrid; 465 466 if( s.equalsIgnoreCase( "array" ) ) 467 return double_set_old_array; 468 469 if( s.equalsIgnoreCase( "shared" ) ) 470 return double_set_old_shared; 471 472 throw new RuntimeException ( "Invalid value "+s+" of phase option double-set-old" ); 473 } 474 475 public static final int double_set_new_hash = 1; 476 public static final int double_set_new_bit = 2; 477 public static final int double_set_new_hybrid = 3; 478 public static final int double_set_new_array = 4; 479 public static final int double_set_new_shared = 5; 480 489 public int double_set_new() { 490 String s = soot.PhaseOptions.getString( options, "double-set-new" ); 491 492 if( s.equalsIgnoreCase( "hash" ) ) 493 return double_set_new_hash; 494 495 if( s.equalsIgnoreCase( "bit" ) ) 496 return double_set_new_bit; 497 498 if( s.equalsIgnoreCase( "hybrid" ) ) 499 return double_set_new_hybrid; 500 501 if( s.equalsIgnoreCase( "array" ) ) 502 return double_set_new_array; 503 504 if( s.equalsIgnoreCase( "shared" ) ) 505 return double_set_new_shared; 506 507 throw new RuntimeException ( "Invalid value "+s+" of phase option double-set-new" ); 508 } 509 510 } 511 | Popular Tags |