externals: Update Xbyak to v5.51

Xbyak now supports multi-byte nops
This commit is contained in:
MerryMage 2017-08-17 21:34:54 +01:00
parent 1613846ab0
commit 568b52d4ba
3 changed files with 1 additions and 41 deletions

2
externals/xbyak vendored

@ -1 +1 @@
Subproject commit d62f6fb28f3c7b3fafb201b2ce65b653b547659c
Subproject commit b633c68b53654154699e2780449c47d3049c4420

View file

@ -207,45 +207,6 @@ void BlockOfCode::SwitchToNearCode() {
SetCodePtr(near_code_ptr);
}
void BlockOfCode::nop(size_t size) {
switch (size) {
case 0:
return;
case 1:
db(0x90);
return;
case 2:
db(0x66); db(0x90);
return;
case 3:
db(0x0f); db(0x1f); db(0x00);
return;
case 4:
db(0x0f); db(0x1f); db(0x40); db(0x00);
return;
case 5:
db(0x0f); db(0x1f); db(0x44); db(0x00); db(0x00);
return;
case 6:
db(0x66); db(0x0f); db(0x1f); db(0x44); db(0x00); db(0x00);
return;
case 7:
db(0x0f); db(0x1f); db(0x80); db(0x00); db(0x00); db(0x00); db(0x00);
return;
case 8:
db(0x0f); db(0x1f); db(0x84); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00);
return;
case 9:
db(0x66); db(0x0f); db(0x1f); db(0x84); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00);
return;
case 10:
default:
db(0x66); db(0x2e); db(0x0f); db(0x1f); db(0x84); db(0x00); db(0x00); db(0x00); db(0x00); db(0x00);
nop(size - 10);
return;
}
}
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) {
if (size_ + alloc_size >= maxSize_) {
throw Xbyak::Error(Xbyak::ERR_CODE_IS_TOO_BIG);

View file

@ -103,7 +103,6 @@ public:
}
void int3() { db(0xCC); }
void nop(size_t size = 1);
/// Allocate memory of `size` bytes from the same block of memory the code is in.
/// This is useful for objects that need to be placed close to or within code.