| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors[. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_FLAGS_H_ | 5 #ifndef VM_FLAGS_H_ |
| 6 #define VM_FLAGS_H_ | 6 #define VM_FLAGS_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/flag_list.h" | 9 #include "vm/flag_list.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| 11 | 11 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const char* comment); | 60 const char* comment); |
| 61 | 61 |
| 62 static bool ProcessCommandLineFlags(int argc, const char** argv); | 62 static bool ProcessCommandLineFlags(int argc, const char** argv); |
| 63 | 63 |
| 64 static Flag* Lookup(const char* name); | 64 static Flag* Lookup(const char* name); |
| 65 | 65 |
| 66 static bool IsSet(const char* name); | 66 static bool IsSet(const char* name); |
| 67 | 67 |
| 68 static bool Initialized() { return initialized_; } | 68 static bool Initialized() { return initialized_; } |
| 69 | 69 |
| 70 #ifndef PRODUCT |
| 70 static void PrintJSON(JSONStream* js); | 71 static void PrintJSON(JSONStream* js); |
| 72 #endif // !PRODUCT |
| 71 | 73 |
| 72 static bool SetFlag(const char* name, | 74 static bool SetFlag(const char* name, |
| 73 const char* value, | 75 const char* value, |
| 74 const char** error); | 76 const char** error); |
| 75 | 77 |
| 76 private: | 78 private: |
| 77 static Flag** flags_; | 79 static Flag** flags_; |
| 78 static intptr_t capacity_; | 80 static intptr_t capacity_; |
| 79 static intptr_t num_flags_; | 81 static intptr_t num_flags_; |
| 80 | 82 |
| 81 static bool initialized_; | 83 static bool initialized_; |
| 82 | 84 |
| 83 static void AddFlag(Flag* flag); | 85 static void AddFlag(Flag* flag); |
| 84 | 86 |
| 85 static bool SetFlagFromString(Flag* flag, const char* argument); | 87 static bool SetFlagFromString(Flag* flag, const char* argument); |
| 86 | 88 |
| 87 static void Parse(const char* option); | 89 static void Parse(const char* option); |
| 88 | 90 |
| 89 static int CompareFlagNames(const void* left, const void* right); | 91 static int CompareFlagNames(const void* left, const void* right); |
| 90 | 92 |
| 91 static void PrintFlags(); | 93 static void PrintFlags(); |
| 92 | 94 |
| 95 #ifndef PRODUCT |
| 93 static void PrintFlagToJSONArray(JSONArray* jsarr, const Flag* flag); | 96 static void PrintFlagToJSONArray(JSONArray* jsarr, const Flag* flag); |
| 97 #endif // !PRODUCT |
| 94 | 98 |
| 95 // Testing needs direct access to private methods. | 99 // Testing needs direct access to private methods. |
| 96 friend void Dart_TestParseFlags(); | 100 friend void Dart_TestParseFlags(); |
| 97 | 101 |
| 98 DISALLOW_ALLOCATION(); | 102 DISALLOW_ALLOCATION(); |
| 99 DISALLOW_IMPLICIT_CONSTRUCTORS(Flags); | 103 DISALLOW_IMPLICIT_CONSTRUCTORS(Flags); |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 #define PRODUCT_FLAG_MARCO(name, type, default_value, comment) \ | 106 #define PRODUCT_FLAG_MARCO(name, type, default_value, comment) \ |
| 103 extern type FLAG_##name; | 107 extern type FLAG_##name; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 PRECOMPILE_FLAG_MARCO) | 151 PRECOMPILE_FLAG_MARCO) |
| 148 | 152 |
| 149 #undef RELEASE_FLAG_MARCO | 153 #undef RELEASE_FLAG_MARCO |
| 150 #undef DEBUG_FLAG_MARCO | 154 #undef DEBUG_FLAG_MARCO |
| 151 #undef PRODUCT_FLAG_MARCO | 155 #undef PRODUCT_FLAG_MARCO |
| 152 #undef PRECOMPILE_FLAG_MARCO | 156 #undef PRECOMPILE_FLAG_MARCO |
| 153 | 157 |
| 154 } // namespace dart | 158 } // namespace dart |
| 155 | 159 |
| 156 #endif // VM_FLAGS_H_ | 160 #endif // VM_FLAGS_H_ |
| OLD | NEW |