src/cpu/x86/vm/stubGenerator_x86_32.cpp

changeset 1609
ddb7834449d0
parent 1280
df6caf649ff7
child 1627
776fb94f33cc
equal deleted inserted replaced
1608:73b22f919c34 1609:ddb7834449d0
1 /* 1 /*
2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
2028 entry_oop_arraycopy, 2028 entry_oop_arraycopy,
2029 entry_jlong_arraycopy, 2029 entry_jlong_arraycopy,
2030 entry_checkcast_arraycopy); 2030 entry_checkcast_arraycopy);
2031 } 2031 }
2032 2032
2033 void generate_math_stubs() {
2034 {
2035 StubCodeMark mark(this, "StubRoutines", "log");
2036 StubRoutines::_intrinsic_log = (double (*)(double)) __ pc();
2037
2038 __ fld_d(Address(rsp, 4));
2039 __ flog();
2040 __ ret(0);
2041 }
2042 {
2043 StubCodeMark mark(this, "StubRoutines", "log10");
2044 StubRoutines::_intrinsic_log10 = (double (*)(double)) __ pc();
2045
2046 __ fld_d(Address(rsp, 4));
2047 __ flog10();
2048 __ ret(0);
2049 }
2050 {
2051 StubCodeMark mark(this, "StubRoutines", "sin");
2052 StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc();
2053
2054 __ fld_d(Address(rsp, 4));
2055 __ trigfunc('s');
2056 __ ret(0);
2057 }
2058 {
2059 StubCodeMark mark(this, "StubRoutines", "cos");
2060 StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc();
2061
2062 __ fld_d(Address(rsp, 4));
2063 __ trigfunc('c');
2064 __ ret(0);
2065 }
2066 {
2067 StubCodeMark mark(this, "StubRoutines", "tan");
2068 StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc();
2069
2070 __ fld_d(Address(rsp, 4));
2071 __ trigfunc('t');
2072 __ ret(0);
2073 }
2074
2075 // The intrinsic version of these seem to return the same value as
2076 // the strict version.
2077 StubRoutines::_intrinsic_exp = SharedRuntime::dexp;
2078 StubRoutines::_intrinsic_pow = SharedRuntime::dpow;
2079 }
2080
2033 public: 2081 public:
2034 // Information about frame layout at time of blocking runtime call. 2082 // Information about frame layout at time of blocking runtime call.
2035 // Note that we only have to preserve callee-saved registers since 2083 // Note that we only have to preserve callee-saved registers since
2036 // the compilers are responsible for supplying a continuation point 2084 // the compilers are responsible for supplying a continuation point
2037 // if they expect all registers to be preserved. 2085 // if they expect all registers to be preserved.
2226 ek = MethodHandles::EntryKind(1 + (int)ek)) { 2274 ek = MethodHandles::EntryKind(1 + (int)ek)) {
2227 StubCodeMark mark(this, "MethodHandle", MethodHandles::entry_name(ek)); 2275 StubCodeMark mark(this, "MethodHandle", MethodHandles::entry_name(ek));
2228 MethodHandles::generate_method_handle_stub(_masm, ek); 2276 MethodHandles::generate_method_handle_stub(_masm, ek);
2229 } 2277 }
2230 } 2278 }
2279
2280 generate_math_stubs();
2231 } 2281 }
2232 2282
2233 2283
2234 public: 2284 public:
2235 StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) { 2285 StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) {

mercurial