Skip to content

Commit e565be0

Browse files
woessbulasevich
authored andcommitted
Fix hash collisions in CompilationResultBuilder.buildLabelOffsets().
LIRInstruction#hashCode() was inadequate for use in (identity) hash maps, since it was based on #id() which for many instructions would be -1 or -2, causing excessive hash collisions. Removing the hashCode() override so that the identity hash code is returned instead.
1 parent 1476a27 commit e565be0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/lir/LIRInstruction.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -474,11 +474,6 @@ public LIRInstructionClass<?> getLIRInstructionClass() {
474474
return instructionClass;
475475
}
476476

477-
@Override
478-
public int hashCode() {
479-
return id;
480-
}
481-
482477
public boolean needsClearUpperVectorRegisters() {
483478
return false;
484479
}

0 commit comments

Comments
 (0)