22
22
#include " runtimehandles.h"
23
23
#include " vars.hpp"
24
24
#include " cycletimer.h"
25
+ #include < math.h>
26
+ #include < inttypes.h>
27
+
28
+ #ifndef _I64_MIN
29
+ #define _I64_MIN LLONG_MIN
30
+ #endif
31
+
32
+ #ifndef _I64_MAX
33
+ #define _I64_MAX LLONG_MAX
34
+ #endif
35
+
36
+ #ifndef _UI64_MAX
37
+ #define _UI64_MAX ULLONG_MAX
38
+ #endif
25
39
26
40
inline CORINFO_CALLINFO_FLAGS combine (CORINFO_CALLINFO_FLAGS flag1, CORINFO_CALLINFO_FLAGS flag2)
27
41
{
@@ -6521,7 +6535,7 @@ void Interpreter::CkFinite()
6521
6535
break ;
6522
6536
}
6523
6537
6524
- if (!isfinite (val))
6538
+ if (!std:: isfinite (val))
6525
6539
ThrowSysArithException ();
6526
6540
}
6527
6541
@@ -6843,17 +6857,6 @@ void Interpreter::SetILInstrCategories()
6843
6857
}
6844
6858
#endif // INTERP_ILINSTR_PROFILE
6845
6859
6846
- #ifndef TARGET_WINDOWS
6847
- namespace
6848
- {
6849
- bool isnan (float val)
6850
- {
6851
- UINT32 bits = *reinterpret_cast <UINT32*>(&val);
6852
- return (bits & 0x7FFFFFFFU ) > 0x7F800000U ;
6853
- }
6854
- }
6855
- #endif
6856
-
6857
6860
template <int op>
6858
6861
void Interpreter::CompareOp ()
6859
6862
{
@@ -7160,7 +7163,7 @@ INT32 Interpreter::CompareOpRes(unsigned op1idx)
7160
7163
else if (op == CO_GT_UN)
7161
7164
{
7162
7165
// Check for NAN's here: if either is a NAN, they're unordered, so this comparison returns true.
7163
- if (isnan (val1) || isnan (val2)) res = 1 ;
7166
+ if (std:: isnan (val1) || std:: isnan (val2)) res = 1 ;
7164
7167
else if (val1 > val2) res = 1 ;
7165
7168
}
7166
7169
else if (op == CO_LT)
@@ -7171,7 +7174,7 @@ INT32 Interpreter::CompareOpRes(unsigned op1idx)
7171
7174
{
7172
7175
_ASSERTE (op == CO_LT_UN);
7173
7176
// Check for NAN's here: if either is a NAN, they're unordered, so this comparison returns true.
7174
- if (isnan (val1) || isnan (val2)) res = 1 ;
7177
+ if (std:: isnan (val1) || std:: isnan (val2)) res = 1 ;
7175
7178
else if (val1 < val2) res = 1 ;
7176
7179
}
7177
7180
}
@@ -7202,7 +7205,7 @@ INT32 Interpreter::CompareOpRes(unsigned op1idx)
7202
7205
else if (op == CO_GT_UN)
7203
7206
{
7204
7207
// Check for NAN's here: if either is a NAN, they're unordered, so this comparison returns true.
7205
- if (isnan (val1) || isnan (val2)) res = 1 ;
7208
+ if (std:: isnan (val1) || std:: isnan (val2)) res = 1 ;
7206
7209
else if (val1 > val2) res = 1 ;
7207
7210
}
7208
7211
else if (op == CO_LT)
@@ -7213,7 +7216,7 @@ INT32 Interpreter::CompareOpRes(unsigned op1idx)
7213
7216
{
7214
7217
_ASSERTE (op == CO_LT_UN);
7215
7218
// Check for NAN's here: if either is a NAN, they're unordered, so this comparison returns true.
7216
- if (isnan (val1) || isnan (val2)) res = 1 ;
7219
+ if (std:: isnan (val1) || std:: isnan (val2)) res = 1 ;
7217
7220
else if (val1 < val2) res = 1 ;
7218
7221
}
7219
7222
}
@@ -11917,10 +11920,6 @@ void Interpreter::OpStackNormalize()
11917
11920
m_orOfPushedInterpreterTypes = 0 ;
11918
11921
}
11919
11922
11920
- #if INTERP_TRACING
11921
-
11922
- // Code copied from eeinterface.cpp in "compiler". Should be common...
11923
-
11924
11923
static const char * CorInfoTypeNames[] = {
11925
11924
" undef" ,
11926
11925
" void" ,
@@ -12036,6 +12035,10 @@ const char* Interpreter::getMethodName(CEEInfo* info, CORINFO_METHOD_HANDLE hnd,
12036
12035
return info->getMethodNameFromMetadata (hnd, className, namespaceName, nullptr , 0 );
12037
12036
}
12038
12037
12038
+ #if INTERP_TRACING
12039
+
12040
+ // Code copied from eeinterface.cpp in "compiler". Should be common...
12041
+
12039
12042
const char * eeGetMethodFullName (CEEInfo* info, CORINFO_METHOD_HANDLE hnd, const char ** clsName)
12040
12043
{
12041
12044
CONTRACTL {
@@ -12316,13 +12319,13 @@ void Interpreter::PrintValue(InterpreterType it, BYTE* valAddr)
12316
12319
case CORINFO_TYPE_NATIVEINT:
12317
12320
{
12318
12321
INT64 val = static_cast <INT64>(*reinterpret_cast <NativeInt*>(valAddr));
12319
- fprintf (GetLogFile (), " %lld (= 0x%llx )" , val, val);
12322
+ fprintf (GetLogFile (), " %" PRId64 " (= 0x%" PRIx64 " )" , val, val);
12320
12323
}
12321
12324
break ;
12322
12325
case CORINFO_TYPE_NATIVEUINT:
12323
12326
{
12324
12327
UINT64 val = static_cast <UINT64>(*reinterpret_cast <NativeUInt*>(valAddr));
12325
- fprintf (GetLogFile (), " %lld (= 0x%llx )" , val, val);
12328
+ fprintf (GetLogFile (), " %" PRIu64 " (= 0x%" PRIx64 " )" , val, val);
12326
12329
}
12327
12330
break ;
12328
12331
@@ -12333,11 +12336,11 @@ void Interpreter::PrintValue(InterpreterType it, BYTE* valAddr)
12333
12336
case CORINFO_TYPE_LONG:
12334
12337
{
12335
12338
INT64 val = *reinterpret_cast <INT64*>(valAddr);
12336
- fprintf (GetLogFile (), " %lld (= 0x%llx )" , val, val);
12339
+ fprintf (GetLogFile (), " %" PRId64 " (= 0x%" PRIx64 " )" , val, val);
12337
12340
}
12338
12341
break ;
12339
12342
case CORINFO_TYPE_ULONG:
12340
- fprintf (GetLogFile (), " %lld " , *reinterpret_cast <UINT64*>(valAddr));
12343
+ fprintf (GetLogFile (), " %" PRIu64 " " , *reinterpret_cast <UINT64*>(valAddr));
12341
12344
break ;
12342
12345
12343
12346
case CORINFO_TYPE_CLASS:
0 commit comments