1 /*
2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
2013 generate_checkcast_copy("checkcast_arraycopy",
2014 &entry_checkcast_arraycopy);
2015
2016 StubRoutines::_unsafe_arraycopy =
2017 generate_unsafe_copy("unsafe_arraycopy",
2018 entry_jbyte_arraycopy,
2019 entry_jshort_arraycopy,
2020 entry_jint_arraycopy,
2021 entry_jlong_arraycopy);
2022
2023 StubRoutines::_generic_arraycopy =
2024 generate_generic_copy("generic_arraycopy",
2025 entry_jbyte_arraycopy,
2026 entry_jshort_arraycopy,
2027 entry_jint_arraycopy,
2028 entry_oop_arraycopy,
2029 entry_jlong_arraycopy,
2030 entry_checkcast_arraycopy);
2031 }
2032
2033 public:
2034 // Information about frame layout at time of blocking runtime call.
2035 // Note that we only have to preserve callee-saved registers since
2036 // the compilers are responsible for supplying a continuation point
2037 // if they expect all registers to be preserved.
2038 enum layout {
2039 thread_off, // last_java_sp
2040 rbp_off, // callee saved register
2041 ret_pc,
2042 framesize
2043 };
2044
2045 private:
2046
2047 #undef __
2048 #define __ masm->
2049
2050 //------------------------------------------------------------------------------------------------------------------------
2051 // Continuation point for throwing of implicit exceptions that are not handled in
2052 // the current activation. Fabricates an exception oop and initiates normal
2211 StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError), false);
2212
2213 //------------------------------------------------------------------------------------------------------------------------
2214 // entry points that are platform specific
2215
2216 // support for verify_oop (must happen after universe_init)
2217 StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop();
2218
2219 // arraycopy stubs used by compilers
2220 generate_arraycopy_stubs();
2221
2222 // generic method handle stubs
2223 if (EnableMethodHandles && SystemDictionary::MethodHandle_klass() != NULL) {
2224 for (MethodHandles::EntryKind ek = MethodHandles::_EK_FIRST;
2225 ek < MethodHandles::_EK_LIMIT;
2226 ek = MethodHandles::EntryKind(1 + (int)ek)) {
2227 StubCodeMark mark(this, "MethodHandle", MethodHandles::entry_name(ek));
2228 MethodHandles::generate_method_handle_stub(_masm, ek);
2229 }
2230 }
2231 }
2232
2233
2234 public:
2235 StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) {
2236 if (all) {
2237 generate_all();
2238 } else {
2239 generate_initial();
2240 }
2241 }
2242 }; // end class declaration
2243
2244
2245 void StubGenerator_generate(CodeBuffer* code, bool all) {
2246 StubGenerator g(code, all);
2247 }
|
1 /*
2 * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
2013 generate_checkcast_copy("checkcast_arraycopy",
2014 &entry_checkcast_arraycopy);
2015
2016 StubRoutines::_unsafe_arraycopy =
2017 generate_unsafe_copy("unsafe_arraycopy",
2018 entry_jbyte_arraycopy,
2019 entry_jshort_arraycopy,
2020 entry_jint_arraycopy,
2021 entry_jlong_arraycopy);
2022
2023 StubRoutines::_generic_arraycopy =
2024 generate_generic_copy("generic_arraycopy",
2025 entry_jbyte_arraycopy,
2026 entry_jshort_arraycopy,
2027 entry_jint_arraycopy,
2028 entry_oop_arraycopy,
2029 entry_jlong_arraycopy,
2030 entry_checkcast_arraycopy);
2031 }
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
2081 public:
2082 // Information about frame layout at time of blocking runtime call.
2083 // Note that we only have to preserve callee-saved registers since
2084 // the compilers are responsible for supplying a continuation point
2085 // if they expect all registers to be preserved.
2086 enum layout {
2087 thread_off, // last_java_sp
2088 rbp_off, // callee saved register
2089 ret_pc,
2090 framesize
2091 };
2092
2093 private:
2094
2095 #undef __
2096 #define __ masm->
2097
2098 //------------------------------------------------------------------------------------------------------------------------
2099 // Continuation point for throwing of implicit exceptions that are not handled in
2100 // the current activation. Fabricates an exception oop and initiates normal
2259 StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError), false);
2260
2261 //------------------------------------------------------------------------------------------------------------------------
2262 // entry points that are platform specific
2263
2264 // support for verify_oop (must happen after universe_init)
2265 StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop();
2266
2267 // arraycopy stubs used by compilers
2268 generate_arraycopy_stubs();
2269
2270 // generic method handle stubs
2271 if (EnableMethodHandles && SystemDictionary::MethodHandle_klass() != NULL) {
2272 for (MethodHandles::EntryKind ek = MethodHandles::_EK_FIRST;
2273 ek < MethodHandles::_EK_LIMIT;
2274 ek = MethodHandles::EntryKind(1 + (int)ek)) {
2275 StubCodeMark mark(this, "MethodHandle", MethodHandles::entry_name(ek));
2276 MethodHandles::generate_method_handle_stub(_masm, ek);
2277 }
2278 }
2279
2280 generate_math_stubs();
2281 }
2282
2283
2284 public:
2285 StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) {
2286 if (all) {
2287 generate_all();
2288 } else {
2289 generate_initial();
2290 }
2291 }
2292 }; // end class declaration
2293
2294
2295 void StubGenerator_generate(CodeBuffer* code, bool all) {
2296 StubGenerator g(code, all);
2297 }
|