< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java

Print this page




  25 package org.graalvm.compiler.serviceprovider;
  26 
  27 import static java.lang.Thread.currentThread;
  28 
  29 import java.io.IOException;
  30 import java.io.InputStream;
  31 import java.util.Arrays;
  32 import java.util.ArrayList;
  33 import java.util.HashMap;
  34 import java.util.Iterator;
  35 import java.util.List;
  36 import java.util.Map;
  37 import java.util.ServiceConfigurationError;
  38 import java.util.ServiceLoader;
  39 import java.util.concurrent.atomic.AtomicLong;
  40 import java.util.function.Supplier;
  41 
  42 import org.graalvm.compiler.serviceprovider.SpeculationReasonGroup.SpeculationContextObject;
  43 
  44 import jdk.vm.ci.code.BytecodePosition;
  45 import jdk.vm.ci.code.VirtualObject;
  46 import jdk.vm.ci.meta.ResolvedJavaField;
  47 import jdk.vm.ci.meta.ResolvedJavaMethod;
  48 import jdk.vm.ci.meta.ResolvedJavaType;
  49 import jdk.vm.ci.meta.SpeculationLog.SpeculationReason;
  50 import jdk.vm.ci.meta.SpeculationLog.SpeculationReasonEncoding;
  51 import jdk.vm.ci.runtime.JVMCI;
  52 import jdk.vm.ci.services.JVMCIPermission;
  53 import jdk.vm.ci.services.Services;
  54 
  55 import static jdk.vm.ci.services.Services.IS_IN_NATIVE_IMAGE;
  56 import static jdk.vm.ci.services.Services.IS_BUILDING_NATIVE_IMAGE;
  57 
  58 /**
  59  * JDK 13+ version of {@link GraalServices}.
  60  */
  61 public final class GraalServices {
  62 
  63     private static final Map<Class<?>, List<?>> servicesCache = IS_BUILDING_NATIVE_IMAGE ? new HashMap<>() : null;
  64 
  65     private GraalServices() {


 502         }
 503         return jmx.getInputArguments();
 504     }
 505 
 506     /**
 507      * Returns the fused multiply add of the three arguments; that is, returns the exact product of
 508      * the first two arguments summed with the third argument and then rounded once to the nearest
 509      * {@code float}.
 510      */
 511     public static float fma(float a, float b, float c) {
 512         return Math.fma(a, b, c);
 513     }
 514 
 515     /**
 516      * Returns the fused multiply add of the three arguments; that is, returns the exact product of
 517      * the first two arguments summed with the third argument and then rounded once to the nearest
 518      * {@code double}.
 519      */
 520     public static double fma(double a, double b, double c) {
 521         return Math.fma(a, b, c);
 522     }
 523 
 524     /**
 525      * Set the flag in the {@link VirtualObject} that indicates that it is a boxed primitive that
 526      * was produced as a result of a call to a {@code valueOf} method.
 527      */
 528     public static void markVirtualObjectAsAutoBox(VirtualObject virtualObject) {
 529        virtualObject.setIsAutoBox(true);
 530     }
 531 }


  25 package org.graalvm.compiler.serviceprovider;
  26 
  27 import static java.lang.Thread.currentThread;
  28 
  29 import java.io.IOException;
  30 import java.io.InputStream;
  31 import java.util.Arrays;
  32 import java.util.ArrayList;
  33 import java.util.HashMap;
  34 import java.util.Iterator;
  35 import java.util.List;
  36 import java.util.Map;
  37 import java.util.ServiceConfigurationError;
  38 import java.util.ServiceLoader;
  39 import java.util.concurrent.atomic.AtomicLong;
  40 import java.util.function.Supplier;
  41 
  42 import org.graalvm.compiler.serviceprovider.SpeculationReasonGroup.SpeculationContextObject;
  43 
  44 import jdk.vm.ci.code.BytecodePosition;

  45 import jdk.vm.ci.meta.ResolvedJavaField;
  46 import jdk.vm.ci.meta.ResolvedJavaMethod;
  47 import jdk.vm.ci.meta.ResolvedJavaType;
  48 import jdk.vm.ci.meta.SpeculationLog.SpeculationReason;
  49 import jdk.vm.ci.meta.SpeculationLog.SpeculationReasonEncoding;
  50 import jdk.vm.ci.runtime.JVMCI;
  51 import jdk.vm.ci.services.JVMCIPermission;
  52 import jdk.vm.ci.services.Services;
  53 
  54 import static jdk.vm.ci.services.Services.IS_IN_NATIVE_IMAGE;
  55 import static jdk.vm.ci.services.Services.IS_BUILDING_NATIVE_IMAGE;
  56 
  57 /**
  58  * JDK 13+ version of {@link GraalServices}.
  59  */
  60 public final class GraalServices {
  61 
  62     private static final Map<Class<?>, List<?>> servicesCache = IS_BUILDING_NATIVE_IMAGE ? new HashMap<>() : null;
  63 
  64     private GraalServices() {


 501         }
 502         return jmx.getInputArguments();
 503     }
 504 
 505     /**
 506      * Returns the fused multiply add of the three arguments; that is, returns the exact product of
 507      * the first two arguments summed with the third argument and then rounded once to the nearest
 508      * {@code float}.
 509      */
 510     public static float fma(float a, float b, float c) {
 511         return Math.fma(a, b, c);
 512     }
 513 
 514     /**
 515      * Returns the fused multiply add of the three arguments; that is, returns the exact product of
 516      * the first two arguments summed with the third argument and then rounded once to the nearest
 517      * {@code double}.
 518      */
 519     public static double fma(double a, double b, double c) {
 520         return Math.fma(a, b, c);








 521     }
 522 }
< prev index next >