| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 480 |
| 481 | 481 |
| 482 void Flags::PrintFlags() { | 482 void Flags::PrintFlags() { |
| 483 OS::Print("Flag settings:\n"); | 483 OS::Print("Flag settings:\n"); |
| 484 for (intptr_t i = 0; i < num_flags_; ++i) { | 484 for (intptr_t i = 0; i < num_flags_; ++i) { |
| 485 flags_[i]->Print(); | 485 flags_[i]->Print(); |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 | 488 |
| 489 | 489 |
| 490 #ifndef PRODUCT |
| 490 void Flags::PrintFlagToJSONArray(JSONArray* jsarr, const Flag* flag) { | 491 void Flags::PrintFlagToJSONArray(JSONArray* jsarr, const Flag* flag) { |
| 491 if (!FLAG_support_service) { | 492 if (!FLAG_support_service) { |
| 492 return; | 493 return; |
| 493 } | 494 } |
| 494 if (flag->IsUnrecognized() || flag->type_ == Flag::kFunc) { | 495 if (flag->IsUnrecognized() || flag->type_ == Flag::kFunc) { |
| 495 return; | 496 return; |
| 496 } | 497 } |
| 497 JSONObject jsflag(jsarr); | 498 JSONObject jsflag(jsarr); |
| 498 jsflag.AddProperty("name", flag->name_); | 499 jsflag.AddProperty("name", flag->name_); |
| 499 jsflag.AddProperty("comment", flag->comment_); | 500 jsflag.AddProperty("comment", flag->comment_); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 if (!FLAG_support_service) { | 536 if (!FLAG_support_service) { |
| 536 return; | 537 return; |
| 537 } | 538 } |
| 538 JSONObject jsobj(js); | 539 JSONObject jsobj(js); |
| 539 jsobj.AddProperty("type", "FlagList"); | 540 jsobj.AddProperty("type", "FlagList"); |
| 540 JSONArray jsarr(&jsobj, "flags"); | 541 JSONArray jsarr(&jsobj, "flags"); |
| 541 for (intptr_t i = 0; i < num_flags_; ++i) { | 542 for (intptr_t i = 0; i < num_flags_; ++i) { |
| 542 PrintFlagToJSONArray(&jsarr, flags_[i]); | 543 PrintFlagToJSONArray(&jsarr, flags_[i]); |
| 543 } | 544 } |
| 544 } | 545 } |
| 546 #endif // !PRODUCT |
| 545 | 547 |
| 546 } // namespace dart | 548 } // namespace dart |
| OLD | NEW |