< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java

Print this page




  59             ResolvedJavaType returnType = metaAccess.lookupJavaType(type);
  60             if (wordTypes.isWord(returnType)) {
  61                 return wordTypes.getWordStamp(returnType);
  62             } else {
  63                 return StampFactory.object(TypeReference.createWithoutAssumptions(returnType), nonNull);
  64             }
  65         } else {
  66             return StampFactory.forKind(kind);
  67         }
  68     }
  69 
  70     @Override
  71     public <T> T getInjectedArgument(Class<T> type) {
  72         T injected = snippetReflection.getInjectedNodeIntrinsicParameter(type);
  73         if (injected != null) {
  74             return injected;
  75         } else if (type.equals(ForeignCallsProvider.class) || type.equals(ArrayCopyForeignCalls.class)) {
  76             return type.cast(foreignCalls);
  77         } else if (type.equals(SnippetReflectionProvider.class)) {
  78             return type.cast(snippetReflection);


  79         } else {
  80             throw new GraalError("Cannot handle injected argument of type %s.", type.getName());
  81         }
  82     }
  83 }


  59             ResolvedJavaType returnType = metaAccess.lookupJavaType(type);
  60             if (wordTypes.isWord(returnType)) {
  61                 return wordTypes.getWordStamp(returnType);
  62             } else {
  63                 return StampFactory.object(TypeReference.createWithoutAssumptions(returnType), nonNull);
  64             }
  65         } else {
  66             return StampFactory.forKind(kind);
  67         }
  68     }
  69 
  70     @Override
  71     public <T> T getInjectedArgument(Class<T> type) {
  72         T injected = snippetReflection.getInjectedNodeIntrinsicParameter(type);
  73         if (injected != null) {
  74             return injected;
  75         } else if (type.equals(ForeignCallsProvider.class) || type.equals(ArrayCopyForeignCalls.class)) {
  76             return type.cast(foreignCalls);
  77         } else if (type.equals(SnippetReflectionProvider.class)) {
  78             return type.cast(snippetReflection);
  79         } else if (type.equals(WordTypes.class)) {
  80             return type.cast(wordTypes);
  81         } else {
  82             throw new GraalError("Cannot handle injected argument of type %s.", type.getName());
  83         }
  84     }
  85 }
< prev index next >