src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DelegatingReplacements.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58299 6df94ce3ab2f
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     1
/*
58299
6df94ce3ab2f 8229201: Update Graal
dlong
parents: 55509
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     4
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     8
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    13
 * accompanied this code).
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    14
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    18
 *
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    21
 * questions.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    22
 */
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    23
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    24
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    25
package org.graalvm.compiler.nodes.spi;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    26
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    27
import org.graalvm.compiler.api.replacements.SnippetTemplateCache;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    28
import org.graalvm.compiler.bytecode.BytecodeProvider;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    29
import org.graalvm.compiler.core.common.CompilationIdentifier;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    30
import org.graalvm.compiler.debug.DebugContext;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    31
import org.graalvm.compiler.graph.NodeSourcePosition;
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54601
diff changeset
    32
import org.graalvm.compiler.nodes.Cancellable;
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    33
import org.graalvm.compiler.nodes.StructuredGraph;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    34
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
52956
4b0b796dd581 8215224: Update Graal
iveresov
parents: 52578
diff changeset
    35
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderPlugin;
54601
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    36
import org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext;
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    37
import org.graalvm.compiler.nodes.graphbuilderconf.MethodSubstitutionPlugin;
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    38
import org.graalvm.compiler.options.OptionValues;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    39
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    40
import jdk.vm.ci.meta.ResolvedJavaMethod;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    41
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    42
/**
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    43
 * A convenience class when want to subclass and override just a portion of the Replacements API.
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    44
 */
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    45
public class DelegatingReplacements implements Replacements {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    46
    protected final Replacements delegate;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    47
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    48
    public DelegatingReplacements(Replacements delegate) {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    49
        this.delegate = delegate;
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    50
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    51
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    52
    @Override
54601
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    53
    public CoreProviders getProviders() {
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    54
        return delegate.getProviders();
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    55
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    56
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    57
    @Override
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    58
    public GraphBuilderConfiguration.Plugins getGraphBuilderPlugins() {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    59
        return delegate.getGraphBuilderPlugins();
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    60
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    61
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    62
    @Override
52956
4b0b796dd581 8215224: Update Graal
iveresov
parents: 52578
diff changeset
    63
    public Class<? extends GraphBuilderPlugin> getIntrinsifyingPlugin(ResolvedJavaMethod method) {
4b0b796dd581 8215224: Update Graal
iveresov
parents: 52578
diff changeset
    64
        return delegate.getIntrinsifyingPlugin(method);
4b0b796dd581 8215224: Update Graal
iveresov
parents: 52578
diff changeset
    65
    }
4b0b796dd581 8215224: Update Graal
iveresov
parents: 52578
diff changeset
    66
4b0b796dd581 8215224: Update Graal
iveresov
parents: 52578
diff changeset
    67
    @Override
54601
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    68
    public StructuredGraph getSnippet(ResolvedJavaMethod method, ResolvedJavaMethod recursiveEntry, Object[] args, boolean trackNodeSourcePosition, NodeSourcePosition replaceePosition,
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    69
                    OptionValues options) {
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    70
        return delegate.getSnippet(method, recursiveEntry, args, trackNodeSourcePosition, replaceePosition, options);
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    71
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    72
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    73
    @Override
54601
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    74
    public void registerSnippet(ResolvedJavaMethod method, ResolvedJavaMethod original, Object receiver, boolean trackNodeSourcePosition, OptionValues options) {
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    75
        delegate.registerSnippet(method, original, receiver, trackNodeSourcePosition, options);
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    76
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    77
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    78
    @Override
54601
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    79
    public StructuredGraph getMethodSubstitution(MethodSubstitutionPlugin plugin, ResolvedJavaMethod original, IntrinsicContext.CompilationContext context,
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54601
diff changeset
    80
                    StructuredGraph.AllowAssumptions allowAssumptions, Cancellable cancellable, OptionValues options) {
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54601
diff changeset
    81
        return delegate.getMethodSubstitution(plugin, original, context, allowAssumptions, cancellable, options);
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    82
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    83
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    84
    @Override
54601
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    85
    public void registerMethodSubstitution(MethodSubstitutionPlugin plugin, ResolvedJavaMethod original, IntrinsicContext.CompilationContext context, OptionValues options) {
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    86
        delegate.registerMethodSubstitution(plugin, original, context, options);
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    87
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    88
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    89
    @Override
54601
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    90
    public StructuredGraph getSubstitution(ResolvedJavaMethod method, int invokeBci, boolean trackNodeSourcePosition, NodeSourcePosition replaceePosition, OptionValues options) {
c40b2a190173 8221598: Update Graal
jwilhelm
parents: 52956
diff changeset
    91
        return delegate.getSubstitution(method, invokeBci, trackNodeSourcePosition, replaceePosition, options);
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    92
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    93
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    94
    @Override
55509
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54601
diff changeset
    95
    public StructuredGraph getIntrinsicGraph(ResolvedJavaMethod method, CompilationIdentifier compilationId, DebugContext debug, Cancellable cancellable) {
d58442b8abc1 8225497: Update Graal
jwilhelm
parents: 54601
diff changeset
    96
        return delegate.getIntrinsicGraph(method, compilationId, debug, cancellable);
52578
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    97
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    98
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
    99
    @Override
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   100
    public boolean hasSubstitution(ResolvedJavaMethod method, int invokeBci) {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   101
        return delegate.hasSubstitution(method, invokeBci);
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   102
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   103
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   104
    @Override
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   105
    public BytecodeProvider getDefaultReplacementBytecodeProvider() {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   106
        return delegate.getDefaultReplacementBytecodeProvider();
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   107
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   108
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   109
    @Override
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   110
    public void registerSnippetTemplateCache(SnippetTemplateCache snippetTemplates) {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   111
        delegate.registerSnippetTemplateCache(snippetTemplates);
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   112
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   113
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   114
    @Override
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   115
    public <T extends SnippetTemplateCache> T getSnippetTemplateCache(Class<T> templatesClass) {
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   116
        return delegate.getSnippetTemplateCache(templatesClass);
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   117
    }
7dd81e82d083 8210777: Update Graal
dlong
parents:
diff changeset
   118
}