diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-09-14 21:03:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 21:03:52 -0700 |
commit | ee12aaff992267334598c02b92eeaa78c6f9d284 (patch) | |
tree | c8a5912d793d31d0b2c1eaeec79225064d3a6d29 /src | |
parent | a125c235c58f935c7bca27c7b0616be2e647a7e1 (diff) | |
download | coreclr-ee12aaff992267334598c02b92eeaa78c6f9d284.tar.gz coreclr-ee12aaff992267334598c02b92eeaa78c6f9d284.tar.bz2 coreclr-ee12aaff992267334598c02b92eeaa78c6f9d284.zip |
Update logic in arm CodeGen::genCallInstruction to match xarch version (#13974)
This is makes it work for CoreRT, and faster for everybody (avoids JIT/EE call).
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/codegenarmarch.cpp | 49 | ||||
-rw-r--r-- | src/jit/codegenxarch.cpp | 8 |
2 files changed, 17 insertions, 40 deletions
diff --git a/src/jit/codegenarmarch.cpp b/src/jit/codegenarmarch.cpp index f9081e89c1..3883121221 100644 --- a/src/jit/codegenarmarch.cpp +++ b/src/jit/codegenarmarch.cpp @@ -2105,48 +2105,27 @@ void CodeGen::genCallInstruction(GenTreeCall* call) assert(callType == CT_HELPER || callType == CT_USER_FUNC); void* addr = nullptr; - if (callType == CT_HELPER) - { -// Direct call to a helper method. #ifdef FEATURE_READYTORUN_COMPILER - if (call->gtEntryPoint.addr != NULL) - { - addr = call->gtEntryPoint.addr; - assert(call->gtEntryPoint.accessType == IAT_VALUE); - } - else + if (call->gtEntryPoint.addr != NULL) + { + assert(call->gtEntryPoint.accessType == IAT_VALUE); + addr = call->gtEntryPoint.addr; + } + else #endif // FEATURE_READYTORUN_COMPILER - { - CorInfoHelpFunc helperNum = compiler->eeGetHelperNum(methHnd); - noway_assert(helperNum != CORINFO_HELP_UNDEF); - - void* pAddr = nullptr; - addr = compiler->compGetHelperFtn(helperNum, (void**)&pAddr); + if (callType == CT_HELPER) + { + CorInfoHelpFunc helperNum = compiler->eeGetHelperNum(methHnd); + noway_assert(helperNum != CORINFO_HELP_UNDEF); - if (addr == nullptr) - { - addr = pAddr; - } - } + void* pAddr = nullptr; + addr = compiler->compGetHelperFtn(helperNum, (void**)&pAddr); + assert(pAddr == nullptr); } else { // Direct call to a non-virtual user function. - CORINFO_ACCESS_FLAGS aflags = CORINFO_ACCESS_ANY; - if (call->IsSameThis()) - { - aflags = (CORINFO_ACCESS_FLAGS)(aflags | CORINFO_ACCESS_THIS); - } - - if ((call->NeedsNullCheck()) == 0) - { - aflags = (CORINFO_ACCESS_FLAGS)(aflags | CORINFO_ACCESS_NONNULL); - } - - CORINFO_CONST_LOOKUP addrInfo; - compiler->info.compCompHnd->getFunctionEntryPoint(methHnd, &addrInfo, aflags); - - addr = addrInfo.addr; + addr = call->gtDirectCallAddress; } assert(addr != nullptr); diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp index 8e772e2819..45bcdc2ef8 100644 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -5508,11 +5508,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) void* pAddr = nullptr; addr = compiler->compGetHelperFtn(helperNum, (void**)&pAddr); - - if (addr == nullptr) - { - addr = pAddr; - } + assert(pAddr == nullptr); // tracking of region protected by the monitor in synchronized methods if (compiler->info.compFlags & CORINFO_FLG_SYNCH) @@ -5526,6 +5522,8 @@ void CodeGen::genCallInstruction(GenTreeCall* call) addr = call->gtDirectCallAddress; } + assert(addr != nullptr); + // Non-virtual direct calls to known addresses // clang-format off |