Skip to content

Commit f389a71

Browse files
committed
8255737: Zero: DO_UPDATE_INSTRUCTION_COUNT should only update when relevant VM flags are set
Reviewed-by: sgehwolf
1 parent 93ef009 commit f389a71

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,23 @@
133133
#ifdef PRODUCT
134134
#define DO_UPDATE_INSTRUCTION_COUNT(opcode)
135135
#else
136-
#define DO_UPDATE_INSTRUCTION_COUNT(opcode) \
137-
{ \
138-
BytecodeCounter::_counter_value++; \
139-
BytecodeHistogram::_counters[(Bytecodes::Code)opcode]++; \
140-
if (StopInterpreterAt && StopInterpreterAt == BytecodeCounter::_counter_value) os::breakpoint(); \
141-
if (TraceBytecodes) { \
142-
CALL_VM((void)InterpreterRuntime::trace_bytecode(THREAD, 0, \
143-
topOfStack[Interpreter::expr_index_at(1)], \
144-
topOfStack[Interpreter::expr_index_at(2)]), \
145-
handle_exception); \
146-
} \
136+
#define DO_UPDATE_INSTRUCTION_COUNT(opcode) \
137+
{ \
138+
if (PrintBytecodeHistogram) { \
139+
BytecodeHistogram::_counters[(Bytecodes::Code)opcode]++; \
140+
} \
141+
if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) { \
142+
BytecodeCounter::_counter_value++; \
143+
if (StopInterpreterAt == BytecodeCounter::_counter_value) { \
144+
os::breakpoint(); \
145+
} \
146+
if (TraceBytecodes) { \
147+
CALL_VM((void)InterpreterRuntime::trace_bytecode(THREAD, 0, \
148+
topOfStack[Interpreter::expr_index_at(1)], \
149+
topOfStack[Interpreter::expr_index_at(2)]), \
150+
handle_exception); \
151+
} \
152+
} \
147153
}
148154
#endif
149155

0 commit comments

Comments
 (0)