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

Side by Side Diff: src/trusted/validator/x86/ncval_reg_sfi/nc_cpu_checks.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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. 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 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * Checks that CPU ID features match instructions found in executable. 8 * Checks that CPU ID features match instructions found in executable.
9 */ 9 */
10 10
11 #include <stdlib.h> 11 #include <stdlib.h>
12 #include <string.h> 12 #include <string.h>
13 13
14 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/nc_cpu_checks.h" 14 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/nc_cpu_checks.h"
15 15
16 #include "native_client/src/shared/platform/nacl_log.h" 16 #include "native_client/src/shared/platform/nacl_log.h"
17 #include "native_client/src/trusted/validator/x86/nacl_cpuid.h" 17 #include "native_client/src/trusted/validator/x86/nacl_cpuid.h"
18 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_iter.h" 18 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_iter_inl.h"
19 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state.h" 19 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state.h"
20 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state_internal .h" 20 #include "native_client/src/trusted/validator/x86/decoder/nc_inst_state_internal .h"
21 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter. h" 21 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter. h"
22 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter_ internal.h" 22 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter_ internal.h"
23 #include "native_client/src/trusted/validator/x86/nc_segment.h" 23 #include "native_client/src/trusted/validator/x86/nc_segment.h"
24 24
25 typedef struct NaClCpuCheckState { 25 typedef struct NaClCpuCheckState {
26 /* The standard CPU features. */ 26 /* The standard CPU features. */
27 CPUFeatures cpu_features; 27 CPUFeatures cpu_features;
28 /* Check that both f_CMOV and f_x87 is defined. */ 28 /* Check that both f_CMOV and f_x87 is defined. */
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 NACL_CHECK_FEATURE(f_SSE2, "SSE2"); 164 NACL_CHECK_FEATURE(f_SSE2, "SSE2");
165 break; 165 break;
166 default: 166 default:
167 break; 167 break;
168 } 168 }
169 if (state->cur_inst->flags & NACL_IFLAG(LongMode)) { 169 if (state->cur_inst->flags & NACL_IFLAG(LongMode)) {
170 NACL_CHECK_FEATURE(f_LM, "LM"); 170 NACL_CHECK_FEATURE(f_LM, "LM");
171 } 171 }
172 if (squash_me) { 172 if (squash_me) {
173 /* Replace all bytes with the stop instruction. */ 173 /* Replace all bytes with the stop instruction. */
174 memset(NaClInstIterGetInstMemory(iter), kNaClFullStop, 174 memset(NaClInstIterGetInstMemoryInline(iter), kNaClFullStop,
175 NaClInstStateLength(inst_state)); 175 NaClInstStateLength(inst_state));
176 } 176 }
177 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698