File tree Expand file tree Collapse file tree 9 files changed +36
-0
lines changed
web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen Expand file tree Collapse file tree 9 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 32
32
import java .nio .file .Path ;
33
33
import java .util .List ;
34
34
35
+ import org .graalvm .nativeimage .Platform ;
36
+ import org .graalvm .nativeimage .Platforms ;
37
+
35
38
import jdk .graal .compiler .core .common .calc .CanonicalCondition ;
36
39
import jdk .graal .compiler .nodes .ParameterNode ;
37
40
import jdk .vm .ci .common .JVMCIError ;
42
45
/**
43
46
* Utility class that provides an abstraction layer for emitting code.
44
47
*/
48
+ @ Platforms (Platform .HOSTED_ONLY .class )
45
49
public abstract class CodeBuffer {
46
50
47
51
/**
Original file line number Diff line number Diff line change 28
28
import java .lang .reflect .Method ;
29
29
import java .util .List ;
30
30
31
+ import org .graalvm .nativeimage .Platform ;
32
+ import org .graalvm .nativeimage .Platforms ;
33
+
31
34
import com .oracle .svm .webimage .hightiercodegen .variables .ResolvedVar ;
32
35
import com .oracle .svm .webimage .hightiercodegen .variables .VariableAllocation ;
33
36
import com .oracle .svm .webimage .hightiercodegen .variables .VariableMap ;
50
53
* abstraction (e.g. {@link #genArrayLoad}, {@link #genFunctionCall}) compared to
51
54
* {@link CodeBuffer}, which is mainly concerned with emitting individual tokens.
52
55
*/
56
+ @ Platforms (Platform .HOSTED_ONLY .class )
53
57
public abstract class CodeGenTool {
54
58
55
59
protected final CodeBuffer codeBuffer ;
Original file line number Diff line number Diff line change 32
32
import java .util .Objects ;
33
33
import java .util .function .Consumer ;
34
34
35
+ import org .graalvm .nativeimage .Platform ;
36
+ import org .graalvm .nativeimage .Platforms ;
37
+
35
38
import com .oracle .svm .webimage .hightiercodegen .variables .ResolvedVar ;
36
39
37
40
import jdk .graal .compiler .nodes .ValueNode ;
43
46
* This class holds utility methods to create instances of {@link IEmitter} to generate various code
44
47
* constructs, such as identifiers and literals of various types.
45
48
*/
49
+ @ Platforms (Platform .HOSTED_ONLY .class )
46
50
public class Emitter implements IEmitter {
47
51
private static final Emitter NULL = new Emitter (CodeGenTool ::genNull );
48
52
Original file line number Diff line number Diff line change 25
25
26
26
package com .oracle .svm .webimage .hightiercodegen ;
27
27
28
+ import org .graalvm .nativeimage .Platform ;
29
+ import org .graalvm .nativeimage .Platforms ;
30
+
28
31
/**
29
32
* Abstract interface to facilitate lowering of various objects.
30
33
*
31
34
* Methods that want to accept multiple different types for lowering, especially as part of a list
32
35
* of arguments, can accept {@link IEmitter} instead of having to create many overloaded methods.
33
36
*/
37
+ @ Platforms (Platform .HOSTED_ONLY .class )
34
38
public interface IEmitter {
35
39
void lower (CodeGenTool codeGenTool );
36
40
}
Original file line number Diff line number Diff line change 24
24
*/
25
25
package com .oracle .svm .webimage .hightiercodegen ;
26
26
27
+ import org .graalvm .nativeimage .Platform ;
28
+ import org .graalvm .nativeimage .Platforms ;
29
+
27
30
/**
28
31
* This class represents keywords of a high level programming language.
29
32
*/
33
+ @ Platforms (Platform .HOSTED_ONLY .class )
30
34
public abstract class Keyword {
31
35
32
36
private final String symbol ;
Original file line number Diff line number Diff line change 24
24
*/
25
25
package com .oracle .svm .webimage .hightiercodegen ;
26
26
27
+ import org .graalvm .nativeimage .Platform ;
28
+ import org .graalvm .nativeimage .Platforms ;
29
+
27
30
import com .oracle .svm .webimage .hightiercodegen .variables .ResolvedVar ;
28
31
29
32
import jdk .graal .compiler .graph .GraalGraphError ;
109
112
/**
110
113
* This class is responsible for generating code for individual {@link Node}s in the graph.
111
114
*/
115
+ @ Platforms (Platform .HOSTED_ONLY .class )
112
116
public abstract class NodeLowerer {
113
117
114
118
protected final CodeGenTool codeGenTool ;
Original file line number Diff line number Diff line change 24
24
*/
25
25
package com .oracle .svm .webimage .hightiercodegen .variables ;
26
26
27
+ import org .graalvm .nativeimage .Platform ;
28
+ import org .graalvm .nativeimage .Platforms ;
29
+
27
30
import jdk .graal .compiler .graph .Node ;
28
31
import jdk .vm .ci .common .JVMCIError ;
29
32
33
+ @ Platforms (Platform .HOSTED_ONLY .class )
30
34
public final class ResolvedVar {
31
35
private final Node node ;
32
36
private boolean unborn ;
Original file line number Diff line number Diff line change 29
29
import java .util .Collection ;
30
30
import java .util .List ;
31
31
32
+ import org .graalvm .nativeimage .Platform ;
33
+ import org .graalvm .nativeimage .Platforms ;
34
+
32
35
import com .oracle .svm .webimage .hightiercodegen .CodeGenTool ;
33
36
import com .oracle .svm .webimage .hightiercodegen .NodeLowerer ;
34
37
58
61
* Whether to create a variable or to inline is tightly coupled to how code is generated for a node,
59
62
* especially when it comes to correctness.
60
63
*/
64
+ @ Platforms (Platform .HOSTED_ONLY .class )
61
65
public abstract class VariableAllocation {
62
66
63
67
/**
Original file line number Diff line number Diff line change 26
26
27
27
import java .util .HashMap ;
28
28
29
+ import org .graalvm .nativeimage .Platform ;
30
+ import org .graalvm .nativeimage .Platforms ;
31
+
29
32
import jdk .graal .compiler .nodes .ValueNode ;
30
33
31
34
/**
32
35
* Storing variable allocation result for a method.
33
36
*/
37
+ @ Platforms (Platform .HOSTED_ONLY .class )
34
38
public final class VariableMap {
35
39
public static final String LOCAL_PREFIX = "l" ;
36
40
You can’t perform that action at this time.
0 commit comments