opcode

What is faster: JMP or string of NOPs?

[亡魂溺海] 提交于 2019-11-29 06:14:53
I'm implementing binary translation and have to deal with sequences of NOPs (0x90) with length about 16 opcodes. Is it better for performance to place JMP (to the end) at start of such sequences? The Intel Architecture Software developer's guide, volume 2B (instructions N-Z) contains the following table (pg 4-12) about NOP : Table 4-9. Recommended Multi-Byte Sequence of NOP Instruction Length Assembly Byte Sequence ================================================================================= 2 bytes 66 NOP 66 90H 3 bytes NOP DWORD ptr [EAX] 0F 1F 00H 4 bytes NOP DWORD ptr [EAX + 00H] 0F 1F

Opcode (APC/XCache), Zend, Doctrine, and Autoloaders

删除回忆录丶 提交于 2019-11-29 02:20:34
I am trying to use either APC or XCache as an opcode to cache my php pages. I am using it with Zend and Doctrine and it's having a problem with the autoloader. If I try with APC, I get the following: Fatal error: spl_autoload() [<a href='function.spl-autoload'>function.spl-autoload</a>]: Class Doctrine_Event could not be loaded in C:\\[mydir]\\library\\doctrine\\Doctrine\\Record.php on line 777 If I try with XCache I get the following: PHP Fatal error: Cannot redeclare class Zend_Registry in C:\\[mydir]\\library\\zendframework\\Zend\\Registry.php on line 0 I'm running Zend 1.9.1, Doctrine 1.1

Why are JSR/RET deprecated Java bytecode?

有些话、适合烂在心里 提交于 2019-11-29 01:57:34
Does anyone know why the JSR/RET bytecode pair is deprecated in Java 6? The only meaningful explanation I found on the net was that they made code analysis by the runtime harder and slower to perform. Does anyone know another reason? Trent Gray-Donald JSR and RET make bytecode verification a lot more difficult than it might otherwise be due to the relaxation of some normal bytecode constraints (such as having a consistent stack shape on entry to a JSR). The upside is very minor (potentially slightly smaller methods in some cases) and the continuing difficulties in the verifier dealing with odd

What are the semantics of ADRP and ADRL instructions in ARM assembly?

筅森魡賤 提交于 2019-11-28 21:56:15
ADRP Address of 4KB page at a PC-relative offset. ADRL Load a PC-relative address into a register. It is similar to the ADR instruction. ADRL can load a wider range of addresses than ADR because it generates two data processing instructions. Specifically, ADRL assembles to two instructions, an ADRP followed by ADD. If the assembler cannot construct the address in two instructions, it generates a relocation. The linker then generates the correct offsets. ADRL produces position-independent code, because the address is calculated relative to PC. What do ADRP and ADRL instructions do? More

what is the easiest way for opcode caching with PHP/Apache?

有些话、适合烂在心里 提交于 2019-11-28 08:52:44
问题 I was thinking to use opcode caching for performance profit what is the easiest way for opcode caching with PHP/Apache ? and what are the performance improvements ? I have read about xDebug but I was wondering if there are more options ? 回答1: I use the APC extension as an opcode cache on both my personnal server, and on the servers we are using at work -- and I've almost never run into any kind of trouble with it. Installation is pretty easy : depending on your Linux distribution, you might

How to read the Intel Opcode notation

a 夏天 提交于 2019-11-28 07:35:51
I am reading some material about Intel Opcodes of assembly instructions, but I cannot understand what does it mean that follows the opcode byte. For example: "cw", "cd", "/2", "cp", "/3". Please give me a hint what does it mean or where can I find the complete reference ? Thanks in advance! E8 cw CALL rel16 Call near, relative, displacement relative to next instruction E8 cd CALL rel32 Call near, relative, displacement relative to next instruction FF /2 CALL r/m16 Call near, absolute indirect, address given in r/m16 FF /2 CALL r/m32 Call near, absolute indirect, address given in r/m32 9A cd

What Java code will force javac 1.6 to use the 'swap' and 'nop' opcodes?

馋奶兔 提交于 2019-11-28 07:25:03
问题 I'm working on an amateur JVM implementation, and I'm trying to make sure I have test coverage for all of the opcodes in the spec. I've gotten it down to the last few, but nop and swap have been eluding me. For example, here's a simple function that might use swap : static int do_swap() { int a = 56; int b = 32; return b%a; } But the bytecode produced by javac 1.6 avoids swapping in lieu of local storage: static int do_swap(); Code: 0: bipush 56 2: istore_0 3: bipush 32 5: istore_1 6: iload_1

Non-invocable member '' cannot be used like a method

爷,独闯天下 提交于 2019-11-28 02:25:19
I'm facing a problem right naw. So i'll put the code right away; public static List<ushort> blockedOpcodes = new List<ushort>(); public static bool isOpcodeAllowed(ushort opcode) { lock (locker) { if (blockedOpcodes.Contains(opcode)) { Log1.LogMsg("Oops! Someone tried to send a blocked packet: 0x{" + opcode + ":X}"); return false; } return true; } } public static void Load() { lock (locker) { StreamReader reader; using (reader = new StreamReader("filter.txt")) { string str = null; while ((str = reader.ReadLine()) != null) { blockedOpcodes.Add(Convert.ToUInt16(str)); } } Log1.LogMsg("Opcode

Why are JSR/RET deprecated Java bytecode?

邮差的信 提交于 2019-11-27 21:51:30
问题 Does anyone know why the JSR/RET bytecode pair is deprecated in Java 6? The only meaningful explanation I found on the net was that they made code analysis by the runtime harder and slower to perform. Does anyone know another reason? 回答1: JSR and RET make bytecode verification a lot more difficult than it might otherwise be due to the relaxation of some normal bytecode constraints (such as having a consistent stack shape on entry to a JSR). The upside is very minor (potentially slightly

How to get opcodes of PHP?

你说的曾经没有我的故事 提交于 2019-11-27 17:14:21
<?php $show_value = 123; echo 'sing_quote'.$show_value; echo "double_quote{$show_value}"; ?> Its opcode is: 1: <?php 2: $show_value = 123; 0 ASSIGN !0, 123 3: echo 'sing_quote'.$show_value; 1 CONCAT 'sing_quote', !0 =>RES[~1] 2 ECHO ~1 4: echo "double_quote{$show_value}"; 3 ADD_STRING 'double_quote' =>RES[~2] 4 ADD_VAR ~2, !0 =>RES[~2] 5 ECHO ~2 6 RETURN 1 Paul Dixon Check out the Vulcan Logic Disassembler PECL extension - see author's home page for more info. The Vulcan Logic Disassembler hooks into the Zend Engine and dumps all the opcodes (execution units) of a script. It was written as as