<commit_before>/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * 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
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.dx.rop.code;

import com.android.dx.rop.cst.Constant;
import com.android.dx.rop.cst.CstString;
import com.android.dx.rop.type.Type;
import com.android.dx.rop.type.TypeBearer;
import com.android.dx.util.ToHuman;
import java.util.HashMap;

/**
 * Combination of a register number and a type, used as the sources and
 * destinations of register-based operations.
 */
public final class RegisterSpec
        implements TypeBearer, ToHuman, Comparable<RegisterSpec> {
    /** {@code non-null;} string to prefix register numbers with */
    public static final String PREFIX = "v";

    /** {@code non-null;} intern table for instances */
    private static final HashMap<Object, RegisterSpec> theInterns =
        new HashMap<Object, RegisterSpec>(1000);

    /** {@code non-null;} common comparison instance used while interning */
    private static final ForComparison theInterningItem = new ForComparison();

    /** {@code >= 0;} register number */
    private final int reg;

    /** {@code non-null;} type loaded or stored */
    private final TypeBearer type;

    /**
     * {@code null-ok;} local variable info associated with this register,
     * if any
     */
    private final LocalItem local;

    /**
     * Intern the given triple as an instance of this class.
     *
     * @param reg {@code >= 0;} the register number
     * @param type {@code non-null;} the type (or possibly actual value) which
     * is loaded from or stored to the indicated register
     * @param local {@code null-ok;} the associated local variable, if any
     * @return {@code non-null;} an appropriately-constructed instance
     */
    private static RegisterSpec intern(int reg, TypeBearer type,
            LocalItem local) {<commit_msg>Disable interning for RegisterSpec<commit_after>/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * 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
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.dx.rop.code;

import com.android.dx.rop.cst.Constant;
import com.android.dx.rop.cst.CstString;
import com.android.dx.rop.type.Type;
import com.android.dx.rop.type.TypeBearer;
import com.android.dx.util.ToHuman;
import java.util.HashMap;

/**
 * Combination of a register number and a type, used as the sources and
 * destinations of register-based operations.
 */
public final class RegisterSpec
        implements TypeBearer, ToHuman, Comparable<RegisterSpec> {
    private static boolean DISABLE_INTERNING = true;

    /** {@code non-null;} string to prefix register numbers with */
    public static final String PREFIX = "v";

    /** {@code non-null;} intern table for instances */
    private static final HashMap<Object, RegisterSpec> theInterns =
        new HashMap<Object, RegisterSpec>(1000);

    /** {@code non-null;} common comparison instance used while interning */
    private static final ForComparison theInterningItem = new ForComparison();

    /** {@code >= 0;} register number */
    private final int reg;

    /** {@code non-null;} type loaded or stored */
    private final TypeBearer type;

    /**
     * {@code null-ok;} local variable info associated with this register,
     * if any
     */
    private final LocalItem local;

    /**
     * Intern the given triple as an instance of this class.
     *
     * @param reg {@code >= 0;} the register number
     * @param type {@code non-null;} the type (or possibly actual value) which
     * is loaded from or stored to the indicated register
     * @param local {@code null-ok;} the associated local variable, if any
     * @return {@code non-null;} an appropriately-constructed instance
     */
    private static RegisterSpec intern(int reg, TypeBearer type,
            LocalItem local) {
        if (DISABLE_INTERNING) {
            return new RegisterSpec(reg, type, local);
        }

{'fraction_non_alphanumeric': 0.09518997574777688, 'fraction_numerical': 0.005658852061438965, 'mean_word_length': 3.2627045650301465, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3112373', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1280, 'n_words': 545}