<commit_before>package tomasulo;

import instructions.Instruction;

import java.util.ArrayList;

import memory.Register;

public class ReorderBuffer {
	private static ArrayList<ReorderBufferElement> table;
	private static int size;
	private static int cnt = 0;
	
	public static void init(int sz) {
		size = sz;
		table = new ArrayList<ReorderBufferElement>(size);
	}
	
	public static void insert(String dest) {
		table.add(new ReorderBufferElement(cnt%size, dest, "", false));
		cnt ++;
	}
	
	public static int getFirst() {
		return table.get(0).getIdx();
	}
	
	public static void removeFirst() {
		if (table.size() > 0) {
			table.remove(0);
		}
	}
	
	public static boolean isFull() {
		return (table.size() == size);
	}
	
	public static void issue(Instruction instruction) {
		String dest = null;
		if (instruction.getType() != RSType.ST) {
			dest = instruction.getRegA();
		}
	}
}<commit_msg>Updates<commit_after>package tomasulo;

import instructions.Instruction;
import instructions.isa.Jalr;

import java.util.ArrayList;

import memory.Memory;
import memory.Register;

public class ReorderBuffer {
	private static ArrayList<ReorderBufferElement> table;
	private static int size;
	private static int cnt = 0;

	public static void init(int sz) {
		size = sz;
		table = new ArrayList<ReorderBufferElement>(size);
	}

	public static void insert(String dest) {
		table.add(new ReorderBufferElement(cnt % size, dest, "", false));
		Memory.getInstance().getRegister(dest).setROBNum(cnt % size);
		cnt++;
	}

	public static int getFirst() {
		return table.get(0).getIdx();
	}

	public static void removeFirst() {
		if (table.size() > 0) {
			table.remove(0);
		}
	}

	public static boolean isFull() {
		return (table.size() == size);
	}

	public static void issue(Instruction instruction) {
		String dest = "";
		if (instruction.getType() != RSType.ST
				&& (instruction.getType() != RSType.JMP || (instruction
						.getType() == RSType.JMP && instruction instanceof Jalr))) {
			dest = instruction.getRegA();
		}
		insert(dest);
	}
}
{'fraction_non_alphanumeric': 0.12923832923832923, 'fraction_numerical': 0.003931203931203931, 'mean_word_length': 4.154430379746835, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5280247', 'n_tokens_mistral': 706, 'n_tokens_neox': 648, 'n_words': 171}