src/cpu/x86/vm/stubGenerator_x86_32.cpp

changeset 1609
ddb7834449d0
parent 1280
df6caf649ff7
child 1627
776fb94f33cc
     1.1 --- a/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Wed Jan 13 23:05:52 2010 -0800
     1.2 +++ b/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Fri Jan 15 11:53:33 2010 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1999-2010 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -2030,6 +2030,54 @@
    1.11                                 entry_checkcast_arraycopy);
    1.12    }
    1.13  
    1.14 +  void generate_math_stubs() {
    1.15 +    {
    1.16 +      StubCodeMark mark(this, "StubRoutines", "log");
    1.17 +      StubRoutines::_intrinsic_log = (double (*)(double)) __ pc();
    1.18 +
    1.19 +      __ fld_d(Address(rsp, 4));
    1.20 +      __ flog();
    1.21 +      __ ret(0);
    1.22 +    }
    1.23 +    {
    1.24 +      StubCodeMark mark(this, "StubRoutines", "log10");
    1.25 +      StubRoutines::_intrinsic_log10 = (double (*)(double)) __ pc();
    1.26 +
    1.27 +      __ fld_d(Address(rsp, 4));
    1.28 +      __ flog10();
    1.29 +      __ ret(0);
    1.30 +    }
    1.31 +    {
    1.32 +      StubCodeMark mark(this, "StubRoutines", "sin");
    1.33 +      StubRoutines::_intrinsic_sin = (double (*)(double))  __ pc();
    1.34 +
    1.35 +      __ fld_d(Address(rsp, 4));
    1.36 +      __ trigfunc('s');
    1.37 +      __ ret(0);
    1.38 +    }
    1.39 +    {
    1.40 +      StubCodeMark mark(this, "StubRoutines", "cos");
    1.41 +      StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc();
    1.42 +
    1.43 +      __ fld_d(Address(rsp, 4));
    1.44 +      __ trigfunc('c');
    1.45 +      __ ret(0);
    1.46 +    }
    1.47 +    {
    1.48 +      StubCodeMark mark(this, "StubRoutines", "tan");
    1.49 +      StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc();
    1.50 +
    1.51 +      __ fld_d(Address(rsp, 4));
    1.52 +      __ trigfunc('t');
    1.53 +      __ ret(0);
    1.54 +    }
    1.55 +
    1.56 +    // The intrinsic version of these seem to return the same value as
    1.57 +    // the strict version.
    1.58 +    StubRoutines::_intrinsic_exp = SharedRuntime::dexp;
    1.59 +    StubRoutines::_intrinsic_pow = SharedRuntime::dpow;
    1.60 +  }
    1.61 +
    1.62   public:
    1.63    // Information about frame layout at time of blocking runtime call.
    1.64    // Note that we only have to preserve callee-saved registers since
    1.65 @@ -2228,6 +2276,8 @@
    1.66          MethodHandles::generate_method_handle_stub(_masm, ek);
    1.67        }
    1.68      }
    1.69 +
    1.70 +    generate_math_stubs();
    1.71    }
    1.72  
    1.73  

mercurial