src/share/vm/classfile/vmSymbols.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/classfile/vmSymbols.cpp Tue Oct 6 13:46:13 2015
--- new/src/share/vm/classfile/vmSymbols.cpp Tue Oct 6 13:46:13 2015
*** 20,31 ****
--- 20,34 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
+ #include <string.h>
+
#include "precompiled.hpp"
#include "classfile/vmSymbols.hpp"
+ #include "memory/allocation.hpp"
#include "memory/oopFactory.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "utilities/xmlstream.hpp"
*** 436,453 ****
--- 439,464 ----
// commoning reads from the referent field across safepoint since GC
// can change the referent field's value. See Compile::Compile()
// in src/share/vm/opto/compile.cpp or
// GraphBuilder::GraphBuilder() in src/share/vm/c1/c1_GraphBuilder.cpp
// for more details.
ccstr disable_intr = NULL;
if ((DisableIntrinsic[0] != '\0' && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) ||
(!compilation_context.is_null() &&
CompilerOracle::has_option_value(compilation_context, "DisableIntrinsic", disable_intr) &&
strstr(disable_intr, vmIntrinsics::name_at(id)) != NULL)
) {
+
+ /* Check if the intrinsic was disabled globally. */
+ if (DisableIntrinsic[0] != '\0') {
+ if (is_id_in_list(id, DisableIntrinsic)) {
return true;
}
+ }
+
+ /* Check if the intrinsic was disabled on a per-method level. */
+ ccstr option_value;
+ if (!compilation_context.is_null() &&
+ CompilerOracle::has_option_value(compilation_context, "DisableIntrinsic", option_value)) {
+ if (is_id_in_list(id, option_value)) {
+ return true;
+ }
+ }
// -XX:-InlineNatives disables nearly all intrinsics except the ones listed in
// the following switch statement.
if (!InlineNatives) {
switch (id) {
*** 783,792 ****
--- 794,819 ----
return vmIntrinsics::_none;
#undef VM_INTRINSIC_CASE
}
+ bool vmIntrinsics::is_id_in_list(vmIntrinsics::ID id, ccstr list) {
+ ResourceMark rm;
+ size_t length = strlen(list);
+ char* local_list = NEW_RESOURCE_ARRAY(char, length + 1);
+ strncpy(local_list, list, length + 1);
+
+ char* token = strtok(local_list, ",");
+ while (token != NULL) {
+ if (strcmp(token, vmIntrinsics::name_at(id)) == 0) {
+ return true;
+ } else {
+ token = strtok(NULL, ",");
+ }
+ }
+ return false;
+ }
const char* vmIntrinsics::short_name_as_C_string(vmIntrinsics::ID id, char* buf, int buflen) {
const char* str = name_at(id);
#ifndef PRODUCT
const char* kname = vmSymbols::name_for(class_for(id));
src/share/vm/classfile/vmSymbols.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File