Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.asm.sparc/src/com/oracle/jvmci/asm/sparc/SPARCInstructionCounter.java @ 21708:6df25b1418be
moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 03 Jun 2015 18:06:44 +0200 |
parents | graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCInstructionCounter.java@422e60a2f4b9 |
children |
rev | line source |
---|---|
20003
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
1 /* |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
4 * |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
8 * |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
14 * |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
18 * |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
22 */ |
21708
6df25b1418be
moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
20003
diff
changeset
|
23 package com.oracle.jvmci.asm.sparc; |
20003
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
24 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
25 import java.util.*; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
26 |
21708
6df25b1418be
moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
20003
diff
changeset
|
27 import com.oracle.jvmci.asm.Assembler.*; |
20003
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
28 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
29 public class SPARCInstructionCounter implements InstructionCounter { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
30 // Use a treemap to keep the order in the output |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
31 private static final TreeMap<String, SPARCInstructionMatch> INSTRUCTION_MATCHER = new TreeMap<>(); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
32 static { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
33 // @formatter:off |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
34 INSTRUCTION_MATCHER.put("nop", new SPARCInstructionMatch(0xFFFF_FFFF, 0x0100_0000)); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
35 INSTRUCTION_MATCHER.put("st", new OP3LowBitsMatcher(0b11, 0x4, 0x5, 0x6, 0x7, 0xe, 0xf)); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
36 INSTRUCTION_MATCHER.put("ld", new OP3LowBitsMatcher(0b11, 0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd)); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
37 INSTRUCTION_MATCHER.put("all", new SPARCInstructionMatch(0x0, 0x0)); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
38 // @formatter:on |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
39 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
40 private final SPARCAssembler asm; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
41 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
42 public SPARCInstructionCounter(SPARCAssembler asm) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
43 super(); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
44 this.asm = asm; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
45 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
46 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
47 @Override |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
48 public int[] countInstructions(String[] instructionTypes, int beginPc, int endPc) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
49 SPARCInstructionMatch[] matchers = new SPARCInstructionMatch[instructionTypes.length]; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
50 for (int i = 0; i < instructionTypes.length; i++) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
51 String typeName = instructionTypes[i]; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
52 matchers[i] = INSTRUCTION_MATCHER.get(typeName); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
53 if (matchers[i] == null) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
54 throw new IllegalArgumentException(String.format("Unknown instruction class %s, supported types are: %s", typeName, INSTRUCTION_MATCHER.keySet())); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
55 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
56 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
57 return countBetween(matchers, beginPc, endPc); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
58 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
59 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
60 private int[] countBetween(SPARCInstructionMatch[] matchers, int startPc, int endPc) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
61 int[] counts = new int[matchers.length]; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
62 for (int p = startPc; p < endPc; p += 4) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
63 int instr = asm.getInt(p); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
64 for (int i = 0; i < matchers.length; i++) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
65 SPARCInstructionMatch matcher = matchers[i]; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
66 if (matcher.matches(instr)) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
67 counts[i]++; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
68 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
69 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
70 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
71 return counts; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
72 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
73 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
74 @Override |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
75 public String[] getSupportedInstructionTypes() { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
76 return INSTRUCTION_MATCHER.keySet().toArray(new String[0]); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
77 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
78 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
79 /** |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
80 * Tests the lower 3 bits of the op3 field. |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
81 */ |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
82 private static class OP3LowBitsMatcher extends SPARCInstructionMatch { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
83 private final int[] op3b03; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
84 private final int op; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
85 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
86 public OP3LowBitsMatcher(int op, int... op3b03) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
87 super(0, 0); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
88 this.op = op; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
89 this.op3b03 = op3b03; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
90 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
91 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
92 @Override |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
93 public boolean matches(int instruction) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
94 if (instruction >>> 30 != op) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
95 return false; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
96 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
97 int op3lo = (instruction >> 19) & ((1 << 4) - 1); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
98 for (int op3Part : op3b03) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
99 if (op3Part == op3lo) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
100 return true; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
101 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
102 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
103 return false; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
104 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
105 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
106 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
107 private static class SPARCInstructionMatch { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
108 private final int mask; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
109 private final int[] patterns; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
110 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
111 public SPARCInstructionMatch(int mask, int... patterns) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
112 super(); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
113 this.mask = mask; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
114 this.patterns = patterns; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
115 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
116 |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
117 public boolean matches(int instruction) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
118 for (int pattern : patterns) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
119 if ((instruction & mask) == pattern) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
120 return true; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
121 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
122 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
123 return false; |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
124 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
125 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
diff
changeset
|
126 } |