1
1
/*
2
- * Copyright (c) 2021, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2021, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
23
23
24
24
package compiler .lib .ir_framework .driver .irmatching ;
25
25
26
- import compiler .lib .ir_framework .driver .irmatching .parser .MethodCompilationParser ;
26
+ import compiler .lib .ir_framework .driver .irmatching .parser .TestClassParser ;
27
27
import compiler .lib .ir_framework .driver .irmatching .report .CompilationOutputBuilder ;
28
28
import compiler .lib .ir_framework .driver .irmatching .report .FailureMessageBuilder ;
29
29
30
30
/**
31
- * This class performs IR matching on the prepared {@link TestClass} object parsed by {@link MethodCompilationParser }.
31
+ * This class performs IR matching on the prepared {@link TestClass} object parsed by {@link TestClassParser }.
32
32
* All applicable @IR rules are matched with all their defined compilation phases. If there are any IR matching failures,
33
33
* an {@link IRViolationException} is reported which provides a formatted failure message and the compilation outputs
34
34
* of the failed compilation phases.
35
35
*/
36
36
public class IRMatcher {
37
- public static final String SAFEPOINT_WHILE_PRINTING_MESSAGE = "<!-- safepoint while printing -->" ;
38
37
private final Matchable testClass ;
39
38
40
39
public IRMatcher (Matchable testClass ) {
41
40
this .testClass = testClass ;
42
41
}
43
42
44
43
/**
45
- * Do an IR matching of all methods with applicable @IR rules prepared with by the {@link MethodCompilationParser }.
44
+ * Do an IR matching of all methods with applicable @IR rules prepared with by the {@link TestClassParser }.
46
45
*/
47
46
public void match () {
48
47
MatchResult result = testClass .match ();
@@ -58,20 +57,7 @@ public void match() {
58
57
*/
59
58
private void reportFailures (MatchResult result ) {
60
59
String failureMsg = new FailureMessageBuilder (result ).build ();
61
- String compilationOutput = new CompilationOutputBuilder (result ).build ();
62
- throwIfNoSafepointWhilePrinting (failureMsg , compilationOutput );
63
- }
64
-
65
- /**
66
- * In some very rare cases, the hotspot_pid* file to IR match on contains "<!-- safepoint while printing -->"
67
- * (emitted by ttyLocker::break_tty_for_safepoint) which might be the reason for a matching error.
68
- * Do not throw an exception in this case (i.e. bailout).
69
- */
70
- private void throwIfNoSafepointWhilePrinting (String failures , String compilations ) {
71
- if (!compilations .contains (SAFEPOINT_WHILE_PRINTING_MESSAGE )) {
72
- throw new IRViolationException (failures , compilations );
73
- } else {
74
- System .out .println ("Found " + SAFEPOINT_WHILE_PRINTING_MESSAGE + ", bail out of IR matching" );
75
- }
60
+ String compilationOutput = new CompilationOutputBuilder (result ).build ();
61
+ throw new IRViolationException (failureMsg , compilationOutput );
76
62
}
77
63
}
0 commit comments