1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. 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. |
21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "jvm.h" |
|
27 #include "interpreter/bytecodeStream.hpp" |
26 #include "interpreter/bytecodeStream.hpp" |
28 #include "logging/log.hpp" |
27 #include "logging/log.hpp" |
29 #include "logging/logStream.hpp" |
28 #include "logging/logStream.hpp" |
30 #include "memory/allocation.inline.hpp" |
29 #include "memory/allocation.inline.hpp" |
31 #include "oops/generateOopMap.hpp" |
30 #include "oops/generateOopMap.hpp" |
32 #include "oops/oop.inline.hpp" |
31 #include "oops/oop.inline.hpp" |
33 #include "oops/symbol.hpp" |
32 #include "oops/symbol.hpp" |
34 #include "runtime/handles.inline.hpp" |
33 #include "runtime/handles.inline.hpp" |
35 #include "runtime/java.hpp" |
34 #include "runtime/java.hpp" |
|
35 #include "runtime/os.hpp" |
36 #include "runtime/relocator.hpp" |
36 #include "runtime/relocator.hpp" |
37 #include "runtime/timerTrace.hpp" |
37 #include "runtime/timerTrace.hpp" |
38 #include "utilities/bitMap.inline.hpp" |
38 #include "utilities/bitMap.inline.hpp" |
39 #include "utilities/ostream.hpp" |
39 #include "utilities/ostream.hpp" |
40 |
40 |
2149 // The tons of extra code it would generate didn't seem worth the change. |
2149 // The tons of extra code it would generate didn't seem worth the change. |
2150 // |
2150 // |
2151 void GenerateOopMap::error_work(const char *format, va_list ap) { |
2151 void GenerateOopMap::error_work(const char *format, va_list ap) { |
2152 _got_error = true; |
2152 _got_error = true; |
2153 char msg_buffer[512]; |
2153 char msg_buffer[512]; |
2154 vsnprintf(msg_buffer, sizeof(msg_buffer), format, ap); |
2154 os::vsnprintf(msg_buffer, sizeof(msg_buffer), format, ap); |
2155 // Append method name |
2155 // Append method name |
2156 char msg_buffer2[512]; |
2156 char msg_buffer2[512]; |
2157 jio_snprintf(msg_buffer2, sizeof(msg_buffer2), "%s in method %s", msg_buffer, method()->name()->as_C_string()); |
2157 os::snprintf(msg_buffer2, sizeof(msg_buffer2), "%s in method %s", msg_buffer, method()->name()->as_C_string()); |
2158 if (Thread::current()->can_call_java()) { |
2158 if (Thread::current()->can_call_java()) { |
2159 _exception = Exceptions::new_exception(Thread::current(), |
2159 _exception = Exceptions::new_exception(Thread::current(), |
2160 vmSymbols::java_lang_LinkageError(), msg_buffer2); |
2160 vmSymbols::java_lang_LinkageError(), msg_buffer2); |
2161 } else { |
2161 } else { |
2162 // We cannot instantiate an exception object from a compiler thread. |
2162 // We cannot instantiate an exception object from a compiler thread. |