1103 }
1104
1105 // Setup compiler entrypoint. This is made eagerly, so we do not need
1106 // special handling of vtables. An alternative is to make adapters more
1107 // lazily by calling make_adapter() from from_compiled_entry() for the
1108 // normal calls. For vtable calls life gets more complicated. When a
1109 // call-site goes mega-morphic we need adapters in all methods which can be
1110 // called from the vtable. We need adapters on such methods that get loaded
1111 // later. Ditto for mega-morphic itable calls. If this proves to be a
1112 // problem we'll make these lazily later.
1113 (void) make_adapters(h_method, CHECK);
1114
1115 // ONLY USE the h_method now as make_adapter may have blocked
1116
1117 }
1118
1119 address Method::make_adapters(const methodHandle& mh, TRAPS) {
1120 // Adapters for compiled code are made eagerly here. They are fairly
1121 // small (generally < 100 bytes) and quick to make (and cached and shared)
1122 // so making them eagerly shouldn't be too expensive.
1123 AdapterHandlerEntry* adapter = AdapterHandlerLibrary::get_adapter(mh);
1124 if (adapter == NULL ) {
1125 if (!is_init_completed()) {
1126 // Don't throw exceptions during VM initialization because java.lang.* classes
1127 // might not have been initialized, causing problems when constructing the
1128 // Java exception object.
1129 vm_exit_during_initialization("Out of space in CodeCache for adapters");
1130 } else {
1131 THROW_MSG_NULL(vmSymbols::java_lang_VirtualMachineError(), "Out of space in CodeCache for adapters");
1132 }
1133 }
1134
1135 if (mh->is_shared()) {
1136 assert(mh->adapter() == adapter, "must be");
1137 assert(mh->_from_compiled_entry != NULL, "must be");
1138 } else {
1139 mh->set_adapter_entry(adapter);
1140 mh->_from_compiled_entry = adapter->get_c2i_entry();
1141 }
1142 return adapter->get_c2i_entry();
1143 }
|
1103 }
1104
1105 // Setup compiler entrypoint. This is made eagerly, so we do not need
1106 // special handling of vtables. An alternative is to make adapters more
1107 // lazily by calling make_adapter() from from_compiled_entry() for the
1108 // normal calls. For vtable calls life gets more complicated. When a
1109 // call-site goes mega-morphic we need adapters in all methods which can be
1110 // called from the vtable. We need adapters on such methods that get loaded
1111 // later. Ditto for mega-morphic itable calls. If this proves to be a
1112 // problem we'll make these lazily later.
1113 (void) make_adapters(h_method, CHECK);
1114
1115 // ONLY USE the h_method now as make_adapter may have blocked
1116
1117 }
1118
1119 address Method::make_adapters(const methodHandle& mh, TRAPS) {
1120 // Adapters for compiled code are made eagerly here. They are fairly
1121 // small (generally < 100 bytes) and quick to make (and cached and shared)
1122 // so making them eagerly shouldn't be too expensive.
1123 AdapterHandlerEntry* adapter = AdapterHandlerLibrary::get_adapter(mh, CHECK_0);
1124 if (adapter == NULL ) {
1125 if (!is_init_completed()) {
1126 // Don't throw exceptions during VM initialization because java.lang.* classes
1127 // might not have been initialized, causing problems when constructing the
1128 // Java exception object.
1129 vm_exit_during_initialization("Out of space in CodeCache for adapters");
1130 } else {
1131 THROW_MSG_NULL(vmSymbols::java_lang_VirtualMachineError(), "Out of space in CodeCache for adapters");
1132 }
1133 }
1134
1135 if (mh->is_shared()) {
1136 assert(mh->adapter() == adapter, "must be");
1137 assert(mh->_from_compiled_entry != NULL, "must be");
1138 } else {
1139 mh->set_adapter_entry(adapter);
1140 mh->_from_compiled_entry = adapter->get_c2i_entry();
1141 }
1142 return adapter->get_c2i_entry();
1143 }
|