view graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSite.java @ 5369:2e9a5365dfb0

moved conversion of type profiles into hints for type check instructions from front end to lowering phase
author Doug Simon <doug.simon@oracle.com>
date Wed, 09 May 2012 22:21:58 +0200
parents b11561111585
children 426c605c9d3c
line wrap: on
line source

/*
 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */
package com.oracle.max.cri.xir;

import com.oracle.max.cri.ci.*;

/**
 * Encapsulates the notion of a site where XIR can be supplied. It is supplied to the {@link RiXirGenerator} by the
 * compiler for each place where XIR can be generated. This interface allows a number of queries, including the
 * bytecode-level location and optimization hints computed by the compiler.
 */
public interface XirSite {

    /**
     * Checks whether the specified argument is guaranteed to be non-null at this site.
     * @param argument the argument
     * @return {@code true} if the argument is non null at this site
     */
    boolean isNonNull(XirArgument argument);

    /**
     * Checks whether this site requires a null check.
     * @return {@code true} if a null check is required
     */
    boolean requiresNullCheck();

    /**
     * Checks whether this site requires a range check.
     * @return {@code true} if a range check is required
     */
    boolean requiresBoundsCheck();

    /**
     * Checks whether this site requires a read barrier.
     * @return {@code true} if a read barrier is required
     */
    boolean requiresReadBarrier();

    /**
     * Checks whether this site requires a write barrier.
     * @return {@code true} if a write barrier is required
     */
    boolean requiresWriteBarrier();

    /**
     * Checks whether this site requires an array store check.
     * @return {@code true} if an array store check is required
     */
    boolean requiresArrayStoreCheck();

    /**
     * The object for recording speculations made during compilation.
     * May be null.
     */
    CiAssumptions assumptions();
}