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

Unified Diff: src/trusted/validator/x86/decoder/ncop_exps.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
Index: src/trusted/validator/x86/decoder/ncop_exps.c
===================================================================
--- src/trusted/validator/x86/decoder/ncop_exps.c (revision 6742)
+++ src/trusted/validator/x86/decoder/ncop_exps.c (working copy)
@@ -31,6 +31,9 @@
#include "native_client/src/shared/utils/debugging.h"
+#include "native_client/src/trusted/validator/x86/decoder/ncopcode_desc_inl.c"
+#include "native_client/src/trusted/validator/x86/decoder/ncop_exps_inl.c"
+
void NaClPrintExpFlags(struct Gio* file, NaClExpFlags flags) {
if (flags == 0) {
gprintf(file, "0");
@@ -76,8 +79,7 @@
/* Returns the register defined by the given node. */
NaClOpKind NaClGetExpRegister(NaClExp* node) {
- assert(node->kind == ExprRegister);
- return (NaClOpKind) node->value;
+ return NaClGetExpRegisterInline(node);
}
/* Returns the name of the register defined by the indexed node in the
@@ -85,7 +87,7 @@
*/
NaClOpKind NaClGetExpVectorRegister(NaClExpVector* vector,
int node) {
- return NaClGetExpRegister(&vector->node[node]);
+ return NaClGetExpRegisterInline(&vector->node[node]);
}
static int NaClPrintDisassembledExp(struct Gio* file,
@@ -168,7 +170,7 @@
}
static INLINE void NaClPrintDisassembledReg(struct Gio* file, NaClExp* node) {
- NaClPrintDisassembledRegKind(file, NaClGetExpRegister(node));
+ NaClPrintDisassembledRegKind(file, NaClGetExpRegisterInline(node));
}
void NaClExpVectorPrint(struct Gio* file, NaClExpVector* vector) {
@@ -306,7 +308,7 @@
int seg_index = seg_addr_index + 1;
NaClExp* node = &vector->node[seg_index];
if ((ExprRegister == node->kind) &&
- (seg_reg != NaClGetExpRegister(node))) {
+ (seg_reg != NaClGetExpRegisterInline(node))) {
return TRUE;
}
}
@@ -395,8 +397,9 @@
*/
if (NaClHasBit(inst->flags, NACL_IFLAG(PartialInstruction)) &&
node->kind == OperandReference) {
- const NaClOp* op = NaClGetInstOperand(state->decoder_tables,
- inst, (uint8_t) node->value);
+ const NaClOp* op =
+ NaClGetInstOperandInline(state->decoder_tables,
+ inst, (uint8_t) node->value);
if (NaClHasBit(op->flags, (NACL_OPFLAG(OpSet) |
NACL_OPFLAG(OpUse) |
NACL_OPFLAG(OperandZeroExtends_v)))) {
@@ -607,3 +610,10 @@
}
return FALSE;
}
+
+/* Dummy routine to allow unreferenced NaClGetInstNumberOperandsInline
+ * inline.
+ */
+uint8_t NaClNcopExpsDummyNaClGetInstNumberOperands(const NaClInst* inst) {
+ return NaClGetInstNumberOperandsInline(inst);
+}
« no previous file with comments | « src/trusted/validator/x86/decoder/nc_inst_trans.c ('k') | src/trusted/validator/x86/decoder/ncop_exps_inl.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698