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

Side by Side Diff: src/flag-definitions.h

Issue 585523002: The --optimize-for-size flag should imply a small semi-space (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file defines all of the flags. It is separated into different section, 5 // This file defines all of the flags. It is separated into different section,
6 // for Debug, Release, Logging and Profiling, etc. To add a new flag, find the 6 // for Debug, Release, Logging and Profiling, etc. To add a new flag, find the
7 // correct section, and use one of the DEFINE_ macros, without a trailing ';'. 7 // correct section, and use one of the DEFINE_ macros, without a trailing ';'.
8 // 8 //
9 // This include does not have a guard, because it is a template-style include, 9 // This include does not have a guard, because it is a template-style include,
10 // which can be included multiple times in different modes. It expects to have 10 // which can be included multiple times in different modes. It expects to have
11 // a mode defined before it's included. The modes are FLAG_MODE_... below: 11 // a mode defined before it's included. The modes are FLAG_MODE_... below:
12 12
13 #define DEFINE_IMPLICATION(whenflag, thenflag) \
14 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, true)
15
16 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \
17 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false)
18
13 // We want to declare the names of the variables for the header file. Normally 19 // We want to declare the names of the variables for the header file. Normally
14 // this will just be an extern declaration, but for a readonly flag we let the 20 // this will just be an extern declaration, but for a readonly flag we let the
15 // compiler make better optimizations by giving it the value. 21 // compiler make better optimizations by giving it the value.
16 #if defined(FLAG_MODE_DECLARE) 22 #if defined(FLAG_MODE_DECLARE)
17 #define FLAG_FULL(ftype, ctype, nam, def, cmt) extern ctype FLAG_##nam; 23 #define FLAG_FULL(ftype, ctype, nam, def, cmt) extern ctype FLAG_##nam;
18 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ 24 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \
19 static ctype const FLAG_##nam = def; 25 static ctype const FLAG_##nam = def;
20 26
21 // We want to supply the actual storage and value for the flag variable in the 27 // We want to supply the actual storage and value for the flag variable in the
22 // .cc file. We only do this for writable flags. 28 // .cc file. We only do this for writable flags.
(...skipping 15 matching lines...) Expand all
38 , 44 ,
39 #define FLAG_ALIAS(ftype, ctype, alias, nam) \ 45 #define FLAG_ALIAS(ftype, ctype, alias, nam) \
40 { \ 46 { \
41 Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \ 47 Flag::TYPE_##ftype, #alias, &FLAG_##nam, &FLAGDEFAULT_##nam, \
42 "alias for --" #nam, false \ 48 "alias for --" #nam, false \
43 } \ 49 } \
44 , 50 ,
45 51
46 // We produce the code to set flags when it is implied by another flag. 52 // We produce the code to set flags when it is implied by another flag.
47 #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS) 53 #elif defined(FLAG_MODE_DEFINE_IMPLICATIONS)
48 #define DEFINE_IMPLICATION(whenflag, thenflag) \ 54 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \
49 if (FLAG_##whenflag) FLAG_##thenflag = true; 55 if (FLAG_##whenflag) FLAG_##thenflag = value;
50
51 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \
52 if (FLAG_##whenflag) FLAG_##thenflag = false;
53 56
54 #else 57 #else
55 #error No mode supplied when including flags.defs 58 #error No mode supplied when including flags.defs
56 #endif 59 #endif
57 60
58 // Dummy defines for modes where it is not relevant. 61 // Dummy defines for modes where it is not relevant.
59 #ifndef FLAG_FULL 62 #ifndef FLAG_FULL
60 #define FLAG_FULL(ftype, ctype, nam, def, cmt) 63 #define FLAG_FULL(ftype, ctype, nam, def, cmt)
61 #endif 64 #endif
62 65
63 #ifndef FLAG_READONLY 66 #ifndef FLAG_READONLY
64 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) 67 #define FLAG_READONLY(ftype, ctype, nam, def, cmt)
65 #endif 68 #endif
66 69
67 #ifndef FLAG_ALIAS 70 #ifndef FLAG_ALIAS
68 #define FLAG_ALIAS(ftype, ctype, alias, nam) 71 #define FLAG_ALIAS(ftype, ctype, alias, nam)
69 #endif 72 #endif
70 73
71 #ifndef DEFINE_IMPLICATION 74 #ifndef DEFINE_VALUE_IMPLICATION
72 #define DEFINE_IMPLICATION(whenflag, thenflag) 75 #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value)
73 #endif
74
75 #ifndef DEFINE_NEG_IMPLICATION
76 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag)
77 #endif 76 #endif
78 77
79 #define COMMA , 78 #define COMMA ,
80 79
81 #ifdef FLAG_MODE_DECLARE 80 #ifdef FLAG_MODE_DECLARE
82 // Structure used to hold a collection of arguments to the JavaScript code. 81 // Structure used to hold a collection of arguments to the JavaScript code.
83 struct JSArguments { 82 struct JSArguments {
84 public: 83 public:
85 inline const char*& operator[](int idx) const { return argv[idx]; } 84 inline const char*& operator[](int idx) const { return argv[idx]; }
86 static JSArguments Create(int argc, const char** argv) { 85 static JSArguments Create(int argc, const char** argv) {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 DEFINE_IMPLICATION(track_field_types, track_fields) 206 DEFINE_IMPLICATION(track_field_types, track_fields)
208 DEFINE_IMPLICATION(track_field_types, track_heap_object_fields) 207 DEFINE_IMPLICATION(track_field_types, track_heap_object_fields)
209 DEFINE_BOOL(smi_binop, true, "support smi representation in binary operations") 208 DEFINE_BOOL(smi_binop, true, "support smi representation in binary operations")
210 DEFINE_BOOL(vector_ics, false, "support vector-based ics") 209 DEFINE_BOOL(vector_ics, false, "support vector-based ics")
211 210
212 // Flags for optimization types. 211 // Flags for optimization types.
213 DEFINE_BOOL(optimize_for_size, false, 212 DEFINE_BOOL(optimize_for_size, false,
214 "Enables optimizations which favor memory size over execution " 213 "Enables optimizations which favor memory size over execution "
215 "speed.") 214 "speed.")
216 215
216 DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1)
217
217 // Flags for data representation optimizations 218 // Flags for data representation optimizations
218 DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles") 219 DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
219 DEFINE_BOOL(string_slices, true, "use string slices") 220 DEFINE_BOOL(string_slices, true, "use string slices")
220 221
221 // Flags for Crankshaft. 222 // Flags for Crankshaft.
222 DEFINE_BOOL(crankshaft, true, "use crankshaft") 223 DEFINE_BOOL(crankshaft, true, "use crankshaft")
223 DEFINE_STRING(hydrogen_filter, "*", "optimization filter") 224 DEFINE_STRING(hydrogen_filter, "*", "optimization filter")
224 DEFINE_BOOL(use_gvn, true, "use hydrogen global value numbering") 225 DEFINE_BOOL(use_gvn, true, "use hydrogen global value numbering")
225 DEFINE_INT(gvn_iterations, 3, "maximum number of GVN fix-point iterations") 226 DEFINE_INT(gvn_iterations, 3, "maximum number of GVN fix-point iterations")
226 DEFINE_BOOL(use_canonicalizing, true, "use hydrogen instruction canonicalizing") 227 DEFINE_BOOL(use_canonicalizing, true, "use hydrogen instruction canonicalizing")
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 #undef FLAG_ALIAS 923 #undef FLAG_ALIAS
923 924
924 #undef DEFINE_BOOL 925 #undef DEFINE_BOOL
925 #undef DEFINE_MAYBE_BOOL 926 #undef DEFINE_MAYBE_BOOL
926 #undef DEFINE_INT 927 #undef DEFINE_INT
927 #undef DEFINE_STRING 928 #undef DEFINE_STRING
928 #undef DEFINE_FLOAT 929 #undef DEFINE_FLOAT
929 #undef DEFINE_ARGS 930 #undef DEFINE_ARGS
930 #undef DEFINE_IMPLICATION 931 #undef DEFINE_IMPLICATION
931 #undef DEFINE_NEG_IMPLICATION 932 #undef DEFINE_NEG_IMPLICATION
933 #undef DEFINE_VALUE_IMPLICATION
932 #undef DEFINE_ALIAS_BOOL 934 #undef DEFINE_ALIAS_BOOL
933 #undef DEFINE_ALIAS_INT 935 #undef DEFINE_ALIAS_INT
934 #undef DEFINE_ALIAS_STRING 936 #undef DEFINE_ALIAS_STRING
935 #undef DEFINE_ALIAS_FLOAT 937 #undef DEFINE_ALIAS_FLOAT
936 #undef DEFINE_ALIAS_ARGS 938 #undef DEFINE_ALIAS_ARGS
937 939
938 #undef FLAG_MODE_DECLARE 940 #undef FLAG_MODE_DECLARE
939 #undef FLAG_MODE_DEFINE 941 #undef FLAG_MODE_DEFINE
940 #undef FLAG_MODE_DEFINE_DEFAULTS 942 #undef FLAG_MODE_DEFINE_DEFAULTS
941 #undef FLAG_MODE_META 943 #undef FLAG_MODE_META
942 #undef FLAG_MODE_DEFINE_IMPLICATIONS 944 #undef FLAG_MODE_DEFINE_IMPLICATIONS
943 945
944 #undef COMMA 946 #undef COMMA
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698