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 | |
448 bool Flags::SetFlag(const char* name, const char* value, const char** error) { | 447 bool Flags::SetFlag(const char* name, const char* value, const char** error) { |
449 Flag* flag = Lookup(name); | 448 Flag* flag = Lookup(name); |
450 if (flag == NULL) { | 449 if (flag == NULL) { |
451 *error = "Cannot set flag: flag not found"; | 450 *error = "Cannot set flag: flag not found"; |
452 return false; | 451 return false; |
453 } | 452 } |
454 if (!SetFlagFromString(flag, value)) { | 453 if (!SetFlagFromString(flag, value)) { |
455 *error = "Cannot set flag: invalid value"; | 454 *error = "Cannot set flag: invalid value"; |
456 return false; | 455 return false; |
457 } | 456 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 JSONObject jsobj(js); | 518 JSONObject jsobj(js); |
520 jsobj.AddProperty("type", "FlagList"); | 519 jsobj.AddProperty("type", "FlagList"); |
521 JSONArray jsarr(&jsobj, "flags"); | 520 JSONArray jsarr(&jsobj, "flags"); |
522 for (intptr_t i = 0; i < num_flags_; ++i) { | 521 for (intptr_t i = 0; i < num_flags_; ++i) { |
523 PrintFlagToJSONArray(&jsarr, flags_[i]); | 522 PrintFlagToJSONArray(&jsarr, flags_[i]); |
524 } | 523 } |
525 } | 524 } |
526 #endif // !PRODUCT | 525 #endif // !PRODUCT |
527 | 526 |
528 } // namespace dart | 527 } // namespace dart |
OLD | NEW |