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 #include "vm/flags.h" | 5 #include "vm/flags.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
9 #include "vm/os.h" | 9 #include "vm/os.h" |
10 | 10 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 437 } |
438 } | 438 } |
439 if (FLAG_print_flags) { | 439 if (FLAG_print_flags) { |
440 PrintFlags(); | 440 PrintFlags(); |
441 } | 441 } |
442 | 442 |
443 initialized_ = true; | 443 initialized_ = true; |
444 return true; | 444 return true; |
445 } | 445 } |
446 | 446 |
| 447 |
447 bool Flags::SetFlag(const char* name, const char* value, const char** error) { | 448 bool Flags::SetFlag(const char* name, const char* value, const char** error) { |
448 Flag* flag = Lookup(name); | 449 Flag* flag = Lookup(name); |
449 if (flag == NULL) { | 450 if (flag == NULL) { |
450 *error = "Cannot set flag: flag not found"; | 451 *error = "Cannot set flag: flag not found"; |
451 return false; | 452 return false; |
452 } | 453 } |
453 if (!SetFlagFromString(flag, value)) { | 454 if (!SetFlagFromString(flag, value)) { |
454 *error = "Cannot set flag: invalid value"; | 455 *error = "Cannot set flag: invalid value"; |
455 return false; | 456 return false; |
456 } | 457 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 JSONObject jsobj(js); | 519 JSONObject jsobj(js); |
519 jsobj.AddProperty("type", "FlagList"); | 520 jsobj.AddProperty("type", "FlagList"); |
520 JSONArray jsarr(&jsobj, "flags"); | 521 JSONArray jsarr(&jsobj, "flags"); |
521 for (intptr_t i = 0; i < num_flags_; ++i) { | 522 for (intptr_t i = 0; i < num_flags_; ++i) { |
522 PrintFlagToJSONArray(&jsarr, flags_[i]); | 523 PrintFlagToJSONArray(&jsarr, flags_[i]); |
523 } | 524 } |
524 } | 525 } |
525 #endif // !PRODUCT | 526 #endif // !PRODUCT |
526 | 527 |
527 } // namespace dart | 528 } // namespace dart |
OLD | NEW |