Transactions: move loops inside

Rewrite loops in assembler (minor optimization)
This commit is contained in:
Nekotekina
2018-05-18 18:51:48 +03:00
parent f6f45b8699
commit 33a1c743a4
4 changed files with 81 additions and 106 deletions
+2 -1
View File
@@ -7,7 +7,7 @@ asmjit::JitRuntime& asmjit::get_global_runtime()
return g_rt;
}
void asmjit::build_transaction_enter(asmjit::X86Assembler& c, asmjit::Label fallback)
asmjit::Label asmjit::build_transaction_enter(asmjit::X86Assembler& c, asmjit::Label fallback)
{
Label fall = c.newLabel();
Label begin = c.newLabel();
@@ -18,6 +18,7 @@ void asmjit::build_transaction_enter(asmjit::X86Assembler& c, asmjit::Label fall
c.align(kAlignCode, 16);
c.bind(begin);
c.xbegin(fall);
return begin;
}
void asmjit::build_transaction_abort(asmjit::X86Assembler& c, unsigned char code)
+2 -2
View File
@@ -12,8 +12,8 @@ namespace asmjit
// Should only be used to build global functions
JitRuntime& get_global_runtime();
// Emit xbegin and adjacent loop
void build_transaction_enter(X86Assembler& c, Label fallback);
// Emit xbegin and adjacent loop, return label at xbegin
Label build_transaction_enter(X86Assembler& c, Label fallback);
// Emit xabort
void build_transaction_abort(X86Assembler& c, unsigned char code);