Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin
  * Systems and Internet Infrastructure Security Laboratory
  * Author: Damien Octeau
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package edu.psu.cse.siis.coal;
import soot.Unit;
A constant propagation result.
public class Result {
  private Map<UnitMap<IntegerObject>> result = new HashMap<>();
  private String statistics;

Returns the results. A result is a map between statements and statement results. There may be more than an argument that is of interest in a COAL hotspot. A statement result is a map between argument index and value.

The results.
  public Map<UnitMap<IntegerObject>> getResults() {
    return ;

Returns the result for a given statement and a given argument.

unit A statement.
argument An argument.
The result for the input statement and argument.
  public Object getResult(Unit unitArgument argument) {
    Map<IntegerObjectunitResult = .get(unit);
    if (unitResult != null) {
      return unitResult.get(argument.getArgnum());
    return null;

Returns problem statistics in the form of a string.

Some statistics for the problem.
  public String getStatistics() {
    return ;

Adds a result.

unit A COAL hotspot.
argnum The argument index.
value The value of the argument.
  public void addResult(Unit unitint argnumObject value) {
    Map<IntegerObjectunitResult = .get(unit);
    if (unitResult == null) {
      unitResult = new HashMap<>();

Sets statistics in the form of a string.

statistics The statistics.
  public void setStatistics(String statistics) {
    this. = statistics;
New to GrepCode? Check out our FAQ X