GeneratorConstants.java

    1/*******************************************************************************
    2 * Copyright (c) 2009 Mountainminds GmbH & Co. KG and others
    3 * All rights reserved. This program and the accompanying materials
    4 * are made available under the terms of the Eclipse Public License v1.0
    5 * which accompanies this distribution, and is available at
    6 * http://www.eclipse.org/legal/epl-v10.html
    7 *
    8 * Contributors:
    9 *    Marc R. Hoffmann - initial API and implementation
   10 *    
   11 * $Id: $
   12 *******************************************************************************/
   13package org.jacoco.core.instr;
   14
   15import org.objectweb.asm.Opcodes;
   16import org.objectweb.asm.Type;
   17import org.objectweb.asm.commons.Method;
   18
   19/**
   20 * Constants for generated instrumentation code.
   21 * 
   22 * @author Marc R. Hoffmann
   23 * @version $Revision: $
   24 */
   25public final class GeneratorConstants {
   26
   27    /**
   28     * Type for array of primitive boolean values. This type is used to store
   29     * covered blocks of a single method.
   30     */
   31    public static final Type BLOCK_ARR = Type.getType("[Z");
   32
   33    // === Data Field ===
   34
   35    /**
   36     * Name of the field that stores coverage information of a class.
   37     */
   38    public static final String DATAFIELD_NAME = "$jacocoData";
   39
   40    /**
   41     * Access modifiers of the field that stores coverage information of a
   42     * class.
   43     */
   44    public static final int DATAFIELD_ACC = Opcodes.ACC_SYNTHETIC
   45            | Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
   46
   47    /**
   48     * The type of the field that stores coverage information of a class is a
   49     * 2-dimensional array of primitive boolean values.
   50     */
   51    public static final Type DATAFIELD_TYPE = Type.getType("[[Z");
   52
   53    // === Init Method ===
   54
   55    /**
   56     * Initialization method that is added into every instrumented class.
   57     */
   58    public static final Method INIT_METHOD = new Method("$jacocoInit", "(I)[Z");
   59
   60    /**
   61     * Access modifiers of the initialization method.
   62     */
   63    public static final int INIT_METHOD_ACC = Opcodes.ACC_SYNTHETIC
   64            | Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
   65
   66}