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 * executed probes of a class.
30 */
31 public static final Type PROBEDATA_TYPE = 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 // === Init Method ===
48
49 /**
50 * Initialization method that is added into every instrumented class.
51 */
52 public static final Method INIT_METHOD = new Method("$jacocoInit", "()[Z");
53
54 /**
55 * Access modifiers of the initialization method.
56 */
57 public static final int INIT_METHOD_ACC = Opcodes.ACC_SYNTHETIC
58 | Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
59
60}