Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8294340

The `StrictMath` implementation methods of `Math` intrinsics should also be intrinsics

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      Since JEP 306 (JDK-8175916), the implementations of `java.lang.StrictMath` and `java.lang.Math` were changed to delegate to each other.
      However there exist several methods in `Math` which are annotated with `@IntrinsicCandidate`, but the fallback implementation methods in `StrictMath` are not.

      I propose that the implementation methods in `StrictMath` are also made into intrinsic candidates:

      - `public static double java.lang.Math.sin(double)` → `public static native double java.lang.StrictMath.sin(double)`
      - `public static double java.lang.Math.cos(double)` → `public static native double java.lang.StrictMath.cos(double)`
      - `public static double java.lang.Math.tan(double)` → `public static native double java.lang.StrictMath.tan(double)`
      - `public static double java.lang.Math.exp(double)` → `public static double java.lang.StrictMath.exp(double)`
      - `public static double java.lang.Math.log(double)` → `public static native double java.lang.StrictMath.log(double)`
      - `public static double java.lang.Math.log10(double)` → `public static native double java.lang.StrictMath.log10(double)`
      - `public static double java.lang.Math.ceil(double)` → `public static double java.lang.StrictMath.ceil(double)`
      - `public static double java.lang.Math.floor(double)` → `public static double java.lang.StrictMath.floor(double)`
      - `public static double java.lang.Math.rint(double)` → `public static double java.lang.StrictMath.rint(double)`
      - `public static double java.lang.Math.atan2(double,double)` → `public static double java.lang.StrictMath.atan2(double,double)`
      - `public static double java.lang.Math.pow(double,double)` → `public static double java.lang.StrictMath.pow(double,double)`


      Attachments

        Issue Links

          Activity

            People

              darcy Joe Darcy
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: