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

Side by Side Diff: src/trusted/validator/x86/decoder/ncopcode_desc_inl.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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 /*
8 * ncopcode_desc_inl.c - Holds inline routines for commonly used (simple)
9 * functions in ncopcode_desc.h. Used to speed up code. Inlined routines
10 * correspond to the following functions in ncopcode_desc.h, but with
11 * an 'Inline' suffix:
12 *
13 * NaClGetInstNumberOperands
14 * NaClGetInstOperand
15 */
16 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NCOPCODE_DESC_INL_H_
17 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NCOPCODE_DESC_INL_H_
18
19 #include <assert.h>
20 #include "native_client/src/trusted/validator/x86/decoder/ncopcode_desc.h"
21 #include "native_client/src/trusted/validator/x86/decoder/nc_decode_tables.h"
22
23 /* Returns the number of logical operands an instruction has. That is,
24 * returns field num_operands unless the first operand is
25 * a special encoding that extends the opcode.
26 */
27 static uint8_t NaClGetInstNumberOperandsInline(const NaClInst* inst) {
28 return inst->num_operands;
29 }
30
31 /* Returns the indexed logical operand for the instruction. That is,
32 * returns the index-th operand unless the first operand is
33 * a special encoding that extends the opcode. In the latter
34 * case, the (index+1)-th operand is returned.
35 */
36 static const INLINE NaClOp* NaClGetInstOperandInline(
37 const NaClDecodeTables* tables,
38 const NaClInst* inst, uint8_t index) {
39 assert(index < inst->num_operands);
40 return &tables->operands_table[inst->operands_offset + index];
41 }
42
43 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_DECODER_NCOPCODE_DESC_INL_H_ */
OLDNEW
« no previous file with comments | « src/trusted/validator/x86/decoder/ncopcode_desc.c ('k') | src/trusted/validator/x86/decoder/ncopcode_desc_verbose.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698