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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 void Flags::PrintFlagToJSONArray(JSONArray* jsarr, const Flag* flag) { | 423 void Flags::PrintFlagToJSONArray(JSONArray* jsarr, const Flag* flag) { |
424 if (flag->IsUnrecognized() || flag->type_ == Flag::kFunc) { | 424 if (flag->IsUnrecognized() || flag->type_ == Flag::kFunc) { |
425 return; | 425 return; |
426 } | 426 } |
427 JSONObject jsflag(jsarr); | 427 JSONObject jsflag(jsarr); |
428 jsflag.AddProperty("name", flag->name_); | 428 jsflag.AddProperty("name", flag->name_); |
429 jsflag.AddProperty("comment", flag->comment_); | 429 jsflag.AddProperty("comment", flag->comment_); |
430 switch (flag->type_) { | 430 switch (flag->type_) { |
431 case Flag::kBoolean: { | 431 case Flag::kBoolean: { |
432 jsflag.AddProperty("flagType", "bool"); | 432 jsflag.AddProperty("_flagType", "Bool"); |
433 jsflag.AddProperty("valueAsString", | 433 jsflag.AddProperty("valueAsString", |
434 (*flag->bool_ptr_ ? "true" : "false")); | 434 (*flag->bool_ptr_ ? "true" : "false")); |
435 break; | 435 break; |
436 } | 436 } |
437 case Flag::kInteger: { | 437 case Flag::kInteger: { |
438 jsflag.AddProperty("flagType", "int"); | 438 jsflag.AddProperty("_flagType", "Int"); |
439 jsflag.AddPropertyF("valueAsString", "%d", *flag->int_ptr_); | 439 jsflag.AddPropertyF("valueAsString", "%d", *flag->int_ptr_); |
440 break; | 440 break; |
441 } | 441 } |
442 case Flag::kUint64: { | 442 case Flag::kUint64: { |
443 jsflag.AddProperty("flagType", "uint64_t"); | 443 jsflag.AddProperty("_flagType", "UInt64"); |
444 jsflag.AddPropertyF("valueAsString", "%" Pu64, *flag->uint64_ptr_); | 444 jsflag.AddPropertyF("valueAsString", "%" Pu64, *flag->uint64_ptr_); |
445 break; | 445 break; |
446 } | 446 } |
447 case Flag::kString: { | 447 case Flag::kString: { |
448 jsflag.AddProperty("flagType", "string"); | 448 jsflag.AddProperty("_flagType", "String"); |
449 if (flag->charp_ptr_ != NULL) { | 449 if (flag->charp_ptr_ != NULL) { |
450 jsflag.AddPropertyF("valueAsString", "%s", *flag->charp_ptr_); | 450 jsflag.AddPropertyF("valueAsString", "%s", *flag->charp_ptr_); |
451 } else { | 451 } else { |
452 // valueAsString missing means NULL. | 452 // valueAsString missing means NULL. |
453 } | 453 } |
454 break; | 454 break; |
455 } | 455 } |
456 default: | 456 default: |
457 UNREACHABLE(); | 457 UNREACHABLE(); |
458 break; | 458 break; |
(...skipping 18 matching lines...) Expand all Loading... |
477 for (intptr_t i = 0; i < num_flags_; ++i) { | 477 for (intptr_t i = 0; i < num_flags_; ++i) { |
478 Flag* flag = flags_[i]; | 478 Flag* flag = flags_[i]; |
479 if (flag->changed_) { | 479 if (flag->changed_) { |
480 PrintFlagToJSONArray(&jsarr, flag); | 480 PrintFlagToJSONArray(&jsarr, flag); |
481 } | 481 } |
482 } | 482 } |
483 } | 483 } |
484 } | 484 } |
485 | 485 |
486 } // namespace dart | 486 } // namespace dart |
OLD | NEW |