jit

Does mprotect flush the instruction cache on ARM Linux?

£可爱£侵袭症+ 提交于 2019-12-12 11:02:01
问题 I am writing a JIT on ARM Linux that executes an instruction set that contains self-modifying code. The instruction set does not have any cache flush instructions (similar to x86 in that respect). If I write out some code to a page and then call mprotect on that page, is that sufficient to invalidate the instruction cache? Or do I also need to use the cacheflush syscall on those pages? 回答1: You'd expect that the mmap/mprotect syscalls would establish mappings that are updated immediately, and

Java: manually-unrolled loop is still faster than the original loop. Why?

风格不统一 提交于 2019-12-12 08:26:31
问题 Consider the following two snippets of code on an array of length 2: boolean isOK(int i) { for (int j = 0; j < filters.length; ++j) { if (!filters[j].isOK(i)) { return false; } } return true; } and boolean isOK(int i) { return filters[0].isOK(i) && filters[1].isOK(i); } I would assume that the performance of these two pieces should be similar after sufficient warm-up. I've checked this using JMH micro-benchmarking framework as described e.g. here and here and observed that the second snippet

Why is the default platform target for a WPF applications in Visual Studio x86 and not AnyCPU?

佐手、 提交于 2019-12-12 08:06:05
问题 When I create a new WPF application in Visual Studio 2012 the platform target and build configuration is set to x86 by default. Why is this the case? For a plain WPF application (without any references to mixed mode assemblies) is there any danger using AnyCPU so my WPF executable will be JITed to x64 code on my x64 machine and to x86 on a x86 machine? 回答1: Why is this the case? For most applications, building as 32bit is actually better. 64bit provides few benefits, and some significant

Handling calls to (potentially) far away ahead-of-time compiled functions from JITed code

荒凉一梦 提交于 2019-12-12 07:46:54
问题 This question was put on hold as too broad, presumably because of the research I included in an effort to "show my work" instead of asking a low effort question. To remedy this, allow me to summarize the entire question in a single sentence (credit to @PeterCordes for this phrase): How do I efficiently call (x86-64) ahead-of-time compiled functions (that I control, may be further than 2GB away) from JITed code (that I am generating)? This alone, I suspect, would be put on hold as "too broad."

which register used to pass the JNIEnv for JNI methods in solaris/linux?

醉酒当歌 提交于 2019-12-12 03:08:59
问题 We know the following calling conversation the this thread, What's the calling convention for the Java code in Linux platform? And also it explained that "You may notice that Java calling convention looks similar to C calling convention but shifted by one argument right. This is done intentionally to avoid extra register shuffling when calling JNI methods (you know, JNI methods have extra JNIEnv* argument prepended to method parameters)." So does it mean when we called the JNI function such

Linux equivalent for VirtualProtectEx?

断了今生、忘了曾经 提交于 2019-12-12 02:45:40
问题 I am doing some simple JITing, and use VirtualProtectEx under Windows to mark pages as executable. What would be the equivalent of that under Linux, and preferably, other POSIX/Unix-like OSes too? 回答1: You are looking for mprotect and probably also mmap. Note that, unlike with Windows, there is no way for process A to change process B's memory map (short of horrible tricks with ptrace). 来源: https://stackoverflow.com/questions/3800762/linux-equivalent-for-virtualprotectex

JITted machine instructions at program restart

早过忘川 提交于 2019-12-12 01:13:28
问题 What happens to the machine code/instructions that are generated by the JIT compiler when a program is terminated or restarted. Does the JIT compilation occur again? If so, why would it use this approach? To keep the scope simple, I would like to know specifically about .NET but for the benefit of others, answers about other implementations are welcome 回答1: Does the JIT compilation occur again? Yes, in general. If so, why would it use this approach? For one thing, it avoids questions about

Cannot coerce to or from object in nopython context: Error after python

做~自己de王妃 提交于 2019-12-11 16:31:47
问题 Following up from here, Numba is finally working (after weeks) on my machine, without any weird indentation errors. I've implemented it as in the solution to the linked question. However, I now get this string of errors from Numba, the last line being that it can't coerce to or from object in nopython context : Traceback (most recent call last): File "C:\Users\app\Documents\Python Scripts\gbc_classifier_train.py", line 19, in <module> import gentleboost_c_class_jit_v6_nolimit as gbc File "C:

How to use mscorlib.dll instead of mscorlib.ni.dll?

寵の児 提交于 2019-12-11 15:57:45
问题 I'm trying to connect my app to use APM (New Relic), but Non-IIS App is preventing me from connecting my app to new relic . When my app is running using "process explorer" and I notice mscorlib.ni.dll . From this article: https://discuss.newrelic.com/t/relic-solution-net-framework-agent-installation-issues-a-troubleshooting-guide/55166 I'm stuck at this part mscorlib.dll is missing - mscorlib.dll is required to be present. It’s presence is how the .NET Framework agent identifies your

How can I read IBM jit dump file

点点圈 提交于 2019-12-11 12:56:33
问题 I want to look into the jitdump.20160505.165247.149.0004.dmp file. Which is generated by IBM JVM 1.8 when it's crashing. Does anyone know how to read the dmp file? I tried to use jextract to analyze it, but it complaints as following: /opt/ibm/ibm-java-x86_64-80/jre/bin/jextract /tmp/jitdump.20160505.165247.149.0004.dmp -v Loading dump file... Error. Dump type not recognised, file: /tmp/jitdump.20160505.165247.149.0004.dmp When trying to open jitdump file via MAT+DTFJ, here is the error