| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/flags.h" | 5 #include "vm/flags.h" |
| 6 | 6 |
| 7 #include "vm/assert.h" | 7 #include "vm/assert.h" |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 static bool IsValidFlag(const char* name, | 219 static bool IsValidFlag(const char* name, |
| 220 const char* prefix, | 220 const char* prefix, |
| 221 intptr_t prefix_length) { | 221 intptr_t prefix_length) { |
| 222 intptr_t name_length = strlen(name); | 222 intptr_t name_length = strlen(name); |
| 223 return ((name_length > prefix_length) && | 223 return ((name_length > prefix_length) && |
| 224 (strncmp(name, prefix, prefix_length) == 0)); | 224 (strncmp(name, prefix, prefix_length) == 0)); |
| 225 } | 225 } |
| 226 | 226 |
| 227 | 227 |
| 228 void Flags::ProcessCommandLineFlags(int number_of_vm_flags, char** vm_flags) { | 228 void Flags::ProcessCommandLineFlags(int number_of_vm_flags, |
| 229 const char** vm_flags) { |
| 229 const char* kPrefix = "--"; | 230 const char* kPrefix = "--"; |
| 230 const intptr_t kPrefixLen = strlen(kPrefix); | 231 const intptr_t kPrefixLen = strlen(kPrefix); |
| 231 | 232 |
| 232 int i = 0; | 233 int i = 0; |
| 233 while ((i < number_of_vm_flags) && | 234 while ((i < number_of_vm_flags) && |
| 234 IsValidFlag(vm_flags[i], kPrefix, kPrefixLen)) { | 235 IsValidFlag(vm_flags[i], kPrefix, kPrefixLen)) { |
| 235 const char* option = vm_flags[i] + kPrefixLen; | 236 const char* option = vm_flags[i] + kPrefixLen; |
| 236 Parse(option); | 237 Parse(option); |
| 237 i++; | 238 i++; |
| 238 } | 239 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 260 OS::Print("Flag settings:\n"); | 261 OS::Print("Flag settings:\n"); |
| 261 Flag* flag = Flags::flags_; | 262 Flag* flag = Flags::flags_; |
| 262 while (flag != NULL) { | 263 while (flag != NULL) { |
| 263 flag->Print(); | 264 flag->Print(); |
| 264 flag = flag->next_; | 265 flag = flag->next_; |
| 265 } | 266 } |
| 266 } | 267 } |
| 267 } | 268 } |
| 268 | 269 |
| 269 } // namespace dart | 270 } // namespace dart |
| OLD | NEW |