--- old/src/share/vm/opto/output.cpp 2015-08-12 14:09:37.000000000 +0200 +++ new/src/share/vm/opto/output.cpp 2015-08-12 14:09:37.000000000 +0200 @@ -42,6 +42,7 @@ #include "opto/subnode.hpp" #include "opto/type.hpp" #include "runtime/handles.inline.hpp" +#include "runtime/sharedRuntime.hpp" #include "utilities/xmlstream.hpp" #ifndef PRODUCT @@ -1143,7 +1144,7 @@ // class HandlerImpl is platform-specific and defined in the *.ad files. int exception_handler_req = HandlerImpl::size_exception_handler() + MAX_stubs_size; // add marginal slop for handler int deopt_handler_req = HandlerImpl::size_deopt_handler() + MAX_stubs_size; // add marginal slop for handler - stub_req += MAX_stubs_size; // ensure per-stub margin + code_req += tls_table()->stub_size(); // ensure per-stub margin code_req += MAX_inst_size; // ensure per-instruction margin if (StressCodeBuffers) @@ -1634,6 +1635,9 @@ // Fill in exception table entries. FillExceptionTables(inct_cnt, call_returns, inct_starts, blk_labels); + // Fill in stubs for calling the runtime from safepoint polls. + tls_table()->emit(*cb, SharedRuntime::is_wide_vector(max_vector_size())); + // Only java methods have exception handlers and deopt handlers // class HandlerImpl is platform-specific and defined in the *.ad files. if (_method) {