Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/cpu/arm/c1_globals_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#ifndef COMPILER2 // avoid duplicated definitions, favoring C2 version
define_pd_global(bool, BackgroundCompilation, true );
define_pd_global(bool, InlineIntrinsics, false); // TODO: ARM
define_pd_global(bool, InlineIntrinsics, true );
define_pd_global(bool, PreferInterpreterNativeStubs, false);
define_pd_global(bool, ProfileTraps, false);
define_pd_global(bool, UseOnStackReplacement, true );
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/arm/c2_globals_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

define_pd_global(bool, BackgroundCompilation, true);
define_pd_global(bool, CICompileOSR, true);
define_pd_global(bool, InlineIntrinsics, false);
define_pd_global(bool, InlineIntrinsics, true);
define_pd_global(bool, PreferInterpreterNativeStubs, false);
define_pd_global(bool, ProfileTraps, true);
define_pd_global(bool, UseOnStackReplacement, true);
Expand Down
108 changes: 104 additions & 4 deletions src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,114 @@ address TemplateInterpreterGenerator::generate_abstract_entry(void) {
address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) {
if (!InlineIntrinsics) return NULL; // Generate a vanilla entry

// TODO: ARM
return NULL;
address entry_point = NULL;
Register continuation = LR;
bool use_runtime_call = false;
switch (kind) {
case Interpreter::java_lang_math_abs:
entry_point = __ pc();
#ifdef __SOFTFP__
use_runtime_call = true;
__ ldrd(R0, Address(SP));
#else // !__SOFTFP__
__ ldr_double(D0, Address(SP));
__ abs_double(D0, D0);
#endif // __SOFTFP__
break;
case Interpreter::java_lang_math_sqrt:
entry_point = __ pc();
#ifdef __SOFTFP__
use_runtime_call = true;
__ ldrd(R0, Address(SP));
#else // !__SOFTFP__
__ ldr_double(D0, Address(SP));
__ sqrt_double(D0, D0);
#endif // __SOFTFP__
break;
case Interpreter::java_lang_math_sin:
case Interpreter::java_lang_math_cos:
case Interpreter::java_lang_math_tan:
case Interpreter::java_lang_math_log:
case Interpreter::java_lang_math_log10:
case Interpreter::java_lang_math_exp:
entry_point = __ pc();
use_runtime_call = true;
#ifdef __SOFTFP__
__ ldrd(R0, Address(SP));
#else // !__SOFTFP__
__ ldr_double(D0, Address(SP));
#endif // __SOFTFP__
break;
case Interpreter::java_lang_math_pow:
entry_point = __ pc();
use_runtime_call = true;
#ifdef __SOFTFP__
__ ldrd(R0, Address(SP, 2 * Interpreter::stackElementSize));
__ ldrd(R2, Address(SP));
#else // !__SOFTFP__
__ ldr_double(D0, Address(SP, 2 * Interpreter::stackElementSize));
__ ldr_double(D1, Address(SP));
#endif // __SOFTFP__
break;
case Interpreter::java_lang_math_fmaD:
case Interpreter::java_lang_math_fmaF:
// TODO: Implement intrinsic
break;
default:
ShouldNotReachHere();
}

address entry_point = __ pc();
STOP("generate_math_entry");
if (entry_point != NULL) {
__ mov(SP, Rsender_sp);
if (use_runtime_call) {
__ mov(Rtmp_save0, LR);
continuation = Rtmp_save0;
generate_math_runtime_call(kind);
}
__ ret(continuation);
}
return entry_point;
}

void TemplateInterpreterGenerator::generate_math_runtime_call(AbstractInterpreter::MethodKind kind) {
address fn;
switch (kind) {
#ifdef __SOFTFP__
case Interpreter::java_lang_math_abs:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dabs);
break;
case Interpreter::java_lang_math_sqrt:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsqrt);
break;
#endif // __SOFTFP__
case Interpreter::java_lang_math_sin:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsin);
break;
case Interpreter::java_lang_math_cos:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dcos);
break;
case Interpreter::java_lang_math_tan:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dtan);
break;
case Interpreter::java_lang_math_log:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog);
break;
case Interpreter::java_lang_math_log10:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10);
break;
case Interpreter::java_lang_math_exp:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dexp);
break;
case Interpreter::java_lang_math_pow:
fn = CAST_FROM_FN_PTR(address, SharedRuntime::dpow);
break;
default:
ShouldNotReachHere();
fn = NULL; // silence "maybe uninitialized" compiler warnings
}
__ call_VM_leaf(fn);
}

address TemplateInterpreterGenerator::generate_StackOverflowError_handler() {
address entry = __ pc();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs);
#endif // AARCH64

#ifdef ARM32
void generate_math_runtime_call(AbstractInterpreter::MethodKind kind);
#endif // ARM32

#ifdef PPC
void lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded=false);
void generate_fixed_frame(bool native_call, Register Rsize_of_parameters, Register Rsize_of_locals);
Expand Down