Skip to content

Commit cc006f2

Browse files
committed
Mark remaining hightiercodegen classes as HOSTED_ONLY
They're not actually used at run time, but are referenced from some run time code through the JSCallNode NodeInstrinsic
1 parent 011b487 commit cc006f2

File tree

9 files changed

+36
-0
lines changed

9 files changed

+36
-0
lines changed

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/CodeBuffer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
import java.nio.file.Path;
3333
import java.util.List;
3434

35+
import org.graalvm.nativeimage.Platform;
36+
import org.graalvm.nativeimage.Platforms;
37+
3538
import jdk.graal.compiler.core.common.calc.CanonicalCondition;
3639
import jdk.graal.compiler.nodes.ParameterNode;
3740
import jdk.vm.ci.common.JVMCIError;
@@ -42,6 +45,7 @@
4245
/**
4346
* Utility class that provides an abstraction layer for emitting code.
4447
*/
48+
@Platforms(Platform.HOSTED_ONLY.class)
4549
public abstract class CodeBuffer {
4650

4751
/**

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/CodeGenTool.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import java.lang.reflect.Method;
2929
import java.util.List;
3030

31+
import org.graalvm.nativeimage.Platform;
32+
import org.graalvm.nativeimage.Platforms;
33+
3134
import com.oracle.svm.webimage.hightiercodegen.variables.ResolvedVar;
3235
import com.oracle.svm.webimage.hightiercodegen.variables.VariableAllocation;
3336
import com.oracle.svm.webimage.hightiercodegen.variables.VariableMap;
@@ -50,6 +53,7 @@
5053
* abstraction (e.g. {@link #genArrayLoad}, {@link #genFunctionCall}) compared to
5154
* {@link CodeBuffer}, which is mainly concerned with emitting individual tokens.
5255
*/
56+
@Platforms(Platform.HOSTED_ONLY.class)
5357
public abstract class CodeGenTool {
5458

5559
protected final CodeBuffer codeBuffer;

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/Emitter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
import java.util.Objects;
3333
import java.util.function.Consumer;
3434

35+
import org.graalvm.nativeimage.Platform;
36+
import org.graalvm.nativeimage.Platforms;
37+
3538
import com.oracle.svm.webimage.hightiercodegen.variables.ResolvedVar;
3639

3740
import jdk.graal.compiler.nodes.ValueNode;
@@ -43,6 +46,7 @@
4346
* This class holds utility methods to create instances of {@link IEmitter} to generate various code
4447
* constructs, such as identifiers and literals of various types.
4548
*/
49+
@Platforms(Platform.HOSTED_ONLY.class)
4650
public class Emitter implements IEmitter {
4751
private static final Emitter NULL = new Emitter(CodeGenTool::genNull);
4852

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/IEmitter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@
2525

2626
package com.oracle.svm.webimage.hightiercodegen;
2727

28+
import org.graalvm.nativeimage.Platform;
29+
import org.graalvm.nativeimage.Platforms;
30+
2831
/**
2932
* Abstract interface to facilitate lowering of various objects.
3033
*
3134
* Methods that want to accept multiple different types for lowering, especially as part of a list
3235
* of arguments, can accept {@link IEmitter} instead of having to create many overloaded methods.
3336
*/
37+
@Platforms(Platform.HOSTED_ONLY.class)
3438
public interface IEmitter {
3539
void lower(CodeGenTool codeGenTool);
3640
}

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/Keyword.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@
2424
*/
2525
package com.oracle.svm.webimage.hightiercodegen;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
/**
2831
* This class represents keywords of a high level programming language.
2932
*/
33+
@Platforms(Platform.HOSTED_ONLY.class)
3034
public abstract class Keyword {
3135

3236
private final String symbol;

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/NodeLowerer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.webimage.hightiercodegen;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import com.oracle.svm.webimage.hightiercodegen.variables.ResolvedVar;
2831

2932
import jdk.graal.compiler.graph.GraalGraphError;
@@ -109,6 +112,7 @@
109112
/**
110113
* This class is responsible for generating code for individual {@link Node}s in the graph.
111114
*/
115+
@Platforms(Platform.HOSTED_ONLY.class)
112116
public abstract class NodeLowerer {
113117

114118
protected final CodeGenTool codeGenTool;

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/variables/ResolvedVar.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@
2424
*/
2525
package com.oracle.svm.webimage.hightiercodegen.variables;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import jdk.graal.compiler.graph.Node;
2831
import jdk.vm.ci.common.JVMCIError;
2932

33+
@Platforms(Platform.HOSTED_ONLY.class)
3034
public final class ResolvedVar {
3135
private final Node node;
3236
private boolean unborn;

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/variables/VariableAllocation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
import java.util.Collection;
3030
import java.util.List;
3131

32+
import org.graalvm.nativeimage.Platform;
33+
import org.graalvm.nativeimage.Platforms;
34+
3235
import com.oracle.svm.webimage.hightiercodegen.CodeGenTool;
3336
import com.oracle.svm.webimage.hightiercodegen.NodeLowerer;
3437

@@ -58,6 +61,7 @@
5861
* Whether to create a variable or to inline is tightly coupled to how code is generated for a node,
5962
* especially when it comes to correctness.
6063
*/
64+
@Platforms(Platform.HOSTED_ONLY.class)
6165
public abstract class VariableAllocation {
6266

6367
/**

web-image/src/com.oracle.svm.webimage/src/com/oracle/svm/webimage/hightiercodegen/variables/VariableMap.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,15 @@
2626

2727
import java.util.HashMap;
2828

29+
import org.graalvm.nativeimage.Platform;
30+
import org.graalvm.nativeimage.Platforms;
31+
2932
import jdk.graal.compiler.nodes.ValueNode;
3033

3134
/**
3235
* Storing variable allocation result for a method.
3336
*/
37+
@Platforms(Platform.HOSTED_ONLY.class)
3438
public final class VariableMap {
3539
public static final String LOCAL_PREFIX = "l";
3640

0 commit comments

Comments
 (0)