Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: src/trusted/validator/x86/x86_insts.c

Issue 7980021: Speed up x86-64 validator by inlining heavily called routines. Speeds up (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/validator/x86/x86_insts.h ('k') | src/trusted/validator/x86/x86_insts_inl.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator/x86/x86_insts.c
===================================================================
--- src/trusted/validator/x86/x86_insts.c (revision 6742)
+++ src/trusted/validator/x86/x86_insts.c (working copy)
@@ -6,6 +6,8 @@
#include "native_client/src/trusted/validator/x86/x86_insts.h"
+#include "native_client/src/trusted/validator/x86/x86_insts_inl.c"
+
/* Defines the range of possible (initial) opcodes for x87 instructions. */
const uint8_t kFirstX87Opcode = 0xd8;
const uint8_t kLastX87Opcode = 0xdf;
@@ -20,11 +22,22 @@
const int kMaxPrefixBytes = 4;
/* Accessors for the ModRm byte. */
-uint8_t modrm_mod(uint8_t modrm) { return ((modrm >> 6) & 0x03);}
-uint8_t modrm_rm(uint8_t modrm) { return (modrm & 0x07); }
-uint8_t modrm_reg(uint8_t modrm) { return ((modrm >> 3) & 0x07); }
-uint8_t modrm_opcode(uint8_t modrm) { return modrm_reg(modrm); }
+uint8_t modrm_mod(uint8_t modrm) {
+ return modrm_modInline(modrm);
+}
+uint8_t modrm_rm(uint8_t modrm) {
+ return modrm_rmInline(modrm);
+}
+
+uint8_t modrm_reg(uint8_t modrm) {
+ return modrm_regInline(modrm);
+}
+
+uint8_t modrm_opcode(uint8_t modrm) {
+ return modrm_opcodeInline(modrm);
+}
+
/* Accessors for the Sib byte. */
uint8_t sib_ss(uint8_t sib) { return ((sib >> 6) & 0x03); }
uint8_t sib_index(uint8_t sib) { return ((sib >> 3) & 0x07); }
« no previous file with comments | « src/trusted/validator/x86/x86_insts.h ('k') | src/trusted/validator/x86/x86_insts_inl.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698