Index: vm/gc_gen/src/gen/gen_adapt.cpp =================================================================== --- vm/gc_gen/src/gen/gen_adapt.cpp (revision 507876) +++ vm/gc_gen/src/gen/gen_adapt.cpp (working copy) @@ -318,6 +318,12 @@ return TRUE;; } +// this function is added to disambiguate on windows/em64t calls to asm() below +POINTER_SIZE_SINT abs(POINTER_SIZE_SINT x) +{ + return x<0?-x:x; +} + #ifndef STATIC_NOS_MAPPING void gc_gen_adapt(GC_Gen* gc, int64 pause_time) Index: vm/port/include/port_atomic.h =================================================================== --- vm/port/include/port_atomic.h (revision 507876) +++ vm/port/include/port_atomic.h (working copy) @@ -75,6 +75,17 @@ APR_DECLARE(uint64) port_atomic_cas64(volatile uint64 * data, uint64 value, uint64 comp); +#elif defined(_EM64T_) + +APR_DECLARE(uint8) port_atomic_cas8(volatile uint8 * data, + uint8 value, uint8 comp); + +APR_DECLARE(uint16) port_atomic_cas16(volatile uint16 * data, + uint16 value, uint16 comp); + +APR_DECLARE(uint64) port_atomic_cas64(volatile uint64 * data, + uint64 value, uint64 comp); + #elif defined( WIN32 ) INLINE uint8 port_atomic_cas8(volatile uint8 * data , uint8 value, uint8 comp) { Index: vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp =================================================================== --- vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp (revision 507876) +++ vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp (working copy) @@ -803,7 +803,7 @@ assert(src->kind == LLK_Gr || src->kind == LLK_GStk); const Tmp_GR_Opnd tmp_reg(context, ic); - const R_Opnd & dest_reg = dest->kind == LLK_Gr ? get_r_opnd(dest) : tmp_reg; + const R_Opnd & dest_reg = (dest->kind == LLK_Gr ? get_r_opnd(dest) : tmp_reg); switch (o) { case LO_Neg: Index: vm/port/src/thread/win/apr_thread_ext.c =================================================================== --- vm/port/src/thread/win/apr_thread_ext.c (revision 507876) +++ vm/port/src/thread/win/apr_thread_ext.c (working copy) @@ -24,6 +24,9 @@ #include "apr_thread_ext.h" #include +#if defined(_EM64T_) && defined(_WIN64) +#include +#endif APR_DECLARE(apr_status_t) apr_thread_set_priority(apr_thread_t *thread, apr_int32_t priority) @@ -81,7 +84,11 @@ } APR_DECLARE(void) apr_memory_rw_barrier() { +#if defined(_EM64T_) && defined(_WIN64) + _ReadWriteBarrier(); +#else __asm mfence; +#endif } APR_DECLARE(apr_status_t) apr_thread_times(apr_thread_t *thread, Index: vm/vmcore/src/jni/jni.cpp =================================================================== --- vm/vmcore/src/jni/jni.cpp (revision 507876) +++ vm/vmcore/src/jni/jni.cpp (working copy) @@ -657,7 +657,7 @@ Global_Env * vm_env = jni_get_vm_env(jni_env); if (exn_raised()) return NULL; - char *ch = strchr(name, '.'); + char *ch = (char *)strchr(name, '.'); if (NULL != ch) { ThrowNew_Quick(jni_env, vm_env->JavaLangNoClassDefFoundError_String->bytes, name); Index: vm/vmcore/src/jvmti/jvmti.cpp =================================================================== --- vm/vmcore/src/jvmti/jvmti.cpp (revision 507876) +++ vm/vmcore/src/jvmti/jvmti.cpp (working copy) @@ -406,7 +406,7 @@ { int cmd_length = strlen(option_str); const char *lib_name = str + cmd_length; - char *opts_start = strchr(lib_name, option_separator); + char *opts_start = (char *)strchr(lib_name, option_separator); int lib_name_length; if (NULL == opts_start) Index: vm/vmcore/src/jvmti/jvmti_break_intf.cpp =================================================================== --- vm/vmcore/src/jvmti/jvmti_break_intf.cpp (revision 507876) +++ vm/vmcore/src/jvmti/jvmti_break_intf.cpp (working copy) @@ -1328,7 +1328,7 @@ ti->vm_brpt->process_native_breakpoint(); } -#ifdef _WIN32 +#if defined (_WIN32) && !defined(_EM64T_) static void __declspec(naked) asm_process_native_breakpoint_event() { @@ -1369,7 +1369,7 @@ // Copy original registers to TLS vm_thread->jvmti_saved_exception_registers = *regs; // Set return address for exception handler -#if PLATFORM_POSIX +#if defined (PLATFORM_POSIX) || defined(_EM64T_) regs->set_ip((void*)process_native_breakpoint_event); #else // PLATFORM_POSIX regs->set_ip((void*)asm_process_native_breakpoint_event); Index: vm/vmcore/src/verifier/ver_utils.cpp =================================================================== --- vm/vmcore/src/verifier/ver_utils.cpp (revision 507876) +++ vm/vmcore/src/verifier/ver_utils.cpp (working copy) @@ -795,7 +795,7 @@ // interfaces have methods with the same name const char *sig1 = method_get_descriptor( method1 ); const char *sig2 = method_get_descriptor( method2 ); - char *end_params = strrchr( sig1, ')' ); + char *end_params = (char *)strrchr( sig1, ')' ); unsigned len = end_params - sig1 + 1; if( !memcmp( sig1, sig2, len ) ) { // methods arguments are the same Index: vm/vmcore/src/util/em64t/base/ini_em64t.cpp =================================================================== --- vm/vmcore/src/util/em64t/base/ini_em64t.cpp (revision 507876) +++ vm/vmcore/src/util/em64t/base/ini_em64t.cpp (working copy) @@ -36,6 +36,7 @@ #include "port_malloc.h" #include "tl/memory_pool.h" #include "encoder.h" +#include "ini.h" #include "lil_code_generator_utils.h" #define LOG_DOMAIN "vm.helpers" Index: vm/gc_cc/src/gc_for_vm.cpp =================================================================== --- vm/gc_cc/src/gc_for_vm.cpp (revision 507876) +++ vm/gc_cc/src/gc_for_vm.cpp (working copy) @@ -467,6 +467,7 @@ Managed_Object_Handle gc_get_next_live_object(void *iterator) { TRACE2("gc.iter", "gc_get_next_live_object - NOT IMPLEMENTED"); abort(); + return 0; } unsigned int gc_time_since_last_gc() { Index: vm/interpreter/src/interp_exports.cpp =================================================================== --- vm/interpreter/src/interp_exports.cpp (revision 507876) +++ vm/interpreter/src/interp_exports.cpp (working copy) @@ -56,9 +56,9 @@ EXPORT void JIT_get_root_set_for_thread_dump(JIT_Handle, Method_Handle, GC_Enumeration_Handle, JitFrameContext *) {return;} EXPORT Boolean JIT_can_enumerate(JIT_Handle, Method_Handle, NativeCodePtr) { abort(); return true; } EXPORT void JIT_fix_handler_context(JIT_Handle, Method_Handle, JitFrameContext *) { abort(); } -EXPORT void * JIT_get_address_of_this(JIT_Handle, Method_Handle, const JitFrameContext *) { abort(); } +EXPORT void * JIT_get_address_of_this(JIT_Handle, Method_Handle, const JitFrameContext *) { abort(); return 0;} EXPORT Boolean JIT_call_returns_a_reference(JIT_Handle, Method_Handle, const JitFrameContext *) { abort(); return true; } -EXPORT JIT_Result JIT_gen_method_info(JIT_Handle,Compile_Handle, Method_Handle, JIT_Flags) { abort(); } +EXPORT JIT_Result JIT_gen_method_info(JIT_Handle,Compile_Handle, Method_Handle, JIT_Flags) { abort(); return (JIT_Result)0;} EXPORT void JIT_init_with_data(JIT_Handle, void *) { abort(); } Index: vm/thread/src/thread_private.h =================================================================== --- vm/thread/src/thread_private.h (revision 507876) +++ vm/thread/src/thread_private.h (working copy) @@ -52,7 +52,7 @@ #endif // !defined (_IPF_) -#ifdef WIN32 +#if defined(WIN32) && !defined (_EM64T_) //use optimized asm monitor enter and exit helpers #define ASM_MONITOR_HELPER // FS14_TLS_USE define turns on windows specific TLS access optimization Index: vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp (revision 507876) +++ vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp (working copy) @@ -287,12 +287,12 @@ config->counters[num].name = line.substr(pos1+1, pos2-pos1-1); } if((int)line.find(".Title=")!=-1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; config->counters[num].title=std::string(val); } else if (((int)line.find(".IsOR=")!=-1) && ((int)line.find("true")!=-1)) { config->counters[num].filter.isOR=true; } else if ((int)line.find(std::string(config->counters[num].name)+"=")!=-1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; for(uint32 i = 0; i < config->counters.size(); i++) { if(std::string(config->counters[i].name) == val) { config->counters[num].filter = config->counters[i].filter; @@ -300,7 +300,7 @@ } } } else if((int)line.find(".Mnemonic")!=-1) { - char * mnem = std::strstr(line.c_str(),"=")+1; + char * mnem = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(mnem) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.mnemonic.isNegative=true; } else { @@ -309,7 +309,7 @@ config->counters[num].filter.mnemonic.isInitialized=true; } } else if (std::strstr(line.c_str(), ".OpndNumber")) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.operandNumber.isNegative=true; } else { @@ -318,7 +318,7 @@ config->counters[num].filter.operandNumber.isInitialized=true; } } else if ((int)line.find(".Operand.") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; int pos = int(line.find(".Operand.")+9); std::string v = line.substr(pos, line.find_first_of(".", pos)-pos); int opNum; @@ -368,7 +368,7 @@ } } } else if ((int)line.find(".RuntimeInfo.Kind") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.rtKind.isNegative=true; } else { @@ -381,7 +381,7 @@ config->counters[num].filter.rtKind.isInitialized=true; } } else if ((int)line.find(".RuntimeInfo.HelperID") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.rtHelperID.isNegative=true; } else { @@ -390,7 +390,7 @@ config->counters[num].filter.rtHelperID.isInitialized=true; } } else if ((int)line.find(".RuntimeInfo.IntHelperName") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.rtIntHelperName.isNegative=true; } else { @@ -399,7 +399,7 @@ config->counters[num].filter.rtIntHelperName.isInitialized=true; } } else if ((int)line.find(".isNative") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isNative.isNegative=true; } else { @@ -408,7 +408,7 @@ config->counters[num].filter.isNative.isInitialized=true; } } else if ((int)line.find(".isStatic") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isStatic.isNegative=true; } else { @@ -417,7 +417,7 @@ config->counters[num].filter.isStatic.isInitialized=true; } } else if ((int)line.find(".isSynchronized") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isSynchronized.isNegative=true; } else { @@ -426,7 +426,7 @@ config->counters[num].filter.isSynchronized.isInitialized=true; } } else if ((int)line.find(".isNoInlining") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isNoInlining.isNegative=true; } else { @@ -435,7 +435,7 @@ config->counters[num].filter.isNoInlining.isInitialized=true; } } else if ((int)line.find(".isInstance") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isInstance.isNegative=true; } else { @@ -444,7 +444,7 @@ config->counters[num].filter.isInstance.isInitialized=true; } } else if ((int)line.find(".isFinal") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isFinal.isNegative=true; } else { @@ -453,7 +453,7 @@ config->counters[num].filter.isFinal.isInitialized=true; } } else if ((int)line.find(".isVirtual") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isVirtual.isNegative=true; } else { @@ -462,7 +462,7 @@ config->counters[num].filter.isVirtual.isInitialized=true; } } else if ((int)line.find(".isAbstract") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isAbstract.isNegative=true; } else { @@ -471,7 +471,7 @@ config->counters[num].filter.isAbstract.isInitialized=true; } } else if ((int)line.find(".isClassInitializer") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isClassInitializer.isNegative=true; } else { @@ -480,7 +480,7 @@ config->counters[num].filter.isClassInitializer.isInitialized=true; } } else if ((int)line.find(".isInstanceInitializer") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isInstanceInitializer.isNegative=true; } else { @@ -489,7 +489,7 @@ config->counters[num].filter.isInstanceInitializer.isInitialized=true; } } else if ((int)line.find(".isStrict") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isStrict.isNegative=true; } else { @@ -498,7 +498,7 @@ config->counters[num].filter.isStrict.isInitialized=true; } } else if ((int)line.find(".isRequireSecObject") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isRequireSecObject.isNegative=true; } else { @@ -507,7 +507,7 @@ config->counters[num].filter.isRequireSecObject.isInitialized=true; } } else if ((int)line.find(".isInitLocals") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isInitLocals.isNegative=true; } else { @@ -516,7 +516,7 @@ config->counters[num].filter.isInitLocals.isInitialized=true; } } else if ((int)line.find(".isOverridden") != -1) { - char * val = std::strstr(line.c_str(),"=")+1; + char * val = (char *)std::strstr(line.c_str(),"=")+1; if ((std::string(val) == "true") && (std::strstr(line.c_str(), "IsNegative"))) { config->counters[num].filter.isOverridden.isNegative=true; } else {