# HG changeset patch # User redestad # Date 1498836845 -7200 # Fri Jun 30 17:34:05 2017 +0200 # Node ID 2e439471fd5ca1e9fbf021e3d3074daa4b5a7f37 # Parent effb29c2c58f77e0ec10e1c52778f919c78c157d 8183232: Avoid resolving method_kind in AbstractInterpreter::can_be_compiled Reviewed-by: coleenp, mdoerr, neliasso diff --git a/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp b/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp --- a/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp +++ b/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -53,27 +53,6 @@ return i; } -// These should never be compiled since the interpreter will prefer -// the compiled version to the intrinsic version. -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - switch (method_kind(m)) { - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : // fall thru - case Interpreter::java_lang_math_fmaD : // fall thru - case Interpreter::java_lang_math_fmaF : - return false; - default: - return true; - } -} - // How much stack a method activation needs in words. int AbstractInterpreter::size_top_interpreter_activation(Method* method) { const int entry_size = frame::interpreter_frame_monitor_size(); diff --git a/src/cpu/arm/vm/abstractInterpreter_arm.cpp b/src/cpu/arm/vm/abstractInterpreter_arm.cpp --- a/src/cpu/arm/vm/abstractInterpreter_arm.cpp +++ b/src/cpu/arm/vm/abstractInterpreter_arm.cpp @@ -68,23 +68,6 @@ return i; } -// These should never be compiled since the interpreter will prefer -// the compiled version to the intrinsic version. -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - switch (method_kind(m)) { - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : - return false; - default: - return true; - } -} - // How much stack a method activation needs in words. int AbstractInterpreter::size_top_interpreter_activation(Method* method) { const int stub_code = AARCH64_ONLY(24) NOT_AARCH64(12); // see generate_call_stub diff --git a/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp b/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp --- a/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp +++ b/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -51,27 +51,6 @@ return i; } -// These should never be compiled since the interpreter will prefer -// the compiled version to the intrinsic version. -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - switch (method_kind(m)) { - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : // fall thru - case Interpreter::java_lang_math_fmaD : // fall thru - case Interpreter::java_lang_math_fmaF : - return false; - default: - return true; - } -} - // How much stack a method activation needs in stack slots. // We must calc this exactly like in generate_fixed_frame. // Note: This returns the conservative size assuming maximum alignment. diff --git a/src/cpu/s390/vm/abstractInterpreter_s390.cpp b/src/cpu/s390/vm/abstractInterpreter_s390.cpp --- a/src/cpu/s390/vm/abstractInterpreter_s390.cpp +++ b/src/cpu/s390/vm/abstractInterpreter_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -51,11 +51,6 @@ return i; } -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - // No special entry points that preclude compilation. - return true; -} - // How much stack a method top interpreter activation needs in words. int AbstractInterpreter::size_top_interpreter_activation(Method* method) { diff --git a/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp b/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp --- a/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp +++ b/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp @@ -52,19 +52,6 @@ return i; } -// These should never be compiled since the interpreter will prefer the compiled -// version to the intrinsic version. -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - switch (method_kind(m)) { - case Interpreter::java_lang_math_fmaD: - case Interpreter::java_lang_math_fmaF: - return false; - default: - break; - } - return true; -} - static int size_activation_helper(int callee_extra_locals, int max_stack, int monitor_size) { // Figure out the size of an interpreter frame (in words) given that we have a fully allocated diff --git a/src/cpu/x86/vm/abstractInterpreter_x86.cpp b/src/cpu/x86/vm/abstractInterpreter_x86.cpp --- a/src/cpu/x86/vm/abstractInterpreter_x86.cpp +++ b/src/cpu/x86/vm/abstractInterpreter_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -160,27 +160,6 @@ } #endif // _LP64 -// These should never be compiled since the interpreter will prefer -// the compiled version to the intrinsic version. -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - switch (method_kind(m)) { - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : // fall thru - case Interpreter::java_lang_math_fmaD : // fall thru - case Interpreter::java_lang_math_fmaF : - return false; - default: - return true; - } -} - // How much stack a method activation needs in words. int AbstractInterpreter::size_top_interpreter_activation(Method* method) { const int entry_size = frame::interpreter_frame_monitor_size(); diff --git a/src/cpu/zero/vm/abstractInterpreter_zero.cpp b/src/cpu/zero/vm/abstractInterpreter_zero.cpp --- a/src/cpu/zero/vm/abstractInterpreter_zero.cpp +++ b/src/cpu/zero/vm/abstractInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,10 +29,6 @@ #include "runtime/frame.inline.hpp" #include "utilities/globalDefinitions.hpp" -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - return true; -} - int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; switch (type) { diff --git a/src/share/vm/interpreter/abstractInterpreter.hpp b/src/share/vm/interpreter/abstractInterpreter.hpp --- a/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,7 +150,26 @@ static void print_method_kind(MethodKind kind) PRODUCT_RETURN; - static bool can_be_compiled(methodHandle m); + // These should never be compiled since the interpreter will prefer + // the compiled version to the intrinsic version. + static bool can_be_compiled(const methodHandle& m) { + switch (m->intrinsic_id()) { + case vmIntrinsics::_dsin : // fall thru + case vmIntrinsics::_dcos : // fall thru + case vmIntrinsics::_dtan : // fall thru + case vmIntrinsics::_dabs : // fall thru + case vmIntrinsics::_dsqrt : // fall thru + case vmIntrinsics::_dlog : // fall thru + case vmIntrinsics::_dlog10: // fall thru + case vmIntrinsics::_dpow : // fall thru + case vmIntrinsics::_dexp : // fall thru + case vmIntrinsics::_fmaD : // fall thru + case vmIntrinsics::_fmaF : // fall thru + return false; + default: + return true; + } + } // Runtime support