OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/dart.h" | 5 #include "vm/dart.h" |
6 | 6 |
7 #include "vm/become.h" | 7 #include "vm/become.h" |
8 #include "vm/clustered_snapshot.h" | 8 #include "vm/clustered_snapshot.h" |
9 #include "vm/code_observers.h" | 9 #include "vm/code_observers.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 I->set_current_tag(default_tag); | 646 I->set_current_tag(default_tag); |
647 | 647 |
648 if (FLAG_keep_code) { | 648 if (FLAG_keep_code) { |
649 I->set_deoptimized_code_array( | 649 I->set_deoptimized_code_array( |
650 GrowableObjectArray::Handle(GrowableObjectArray::New())); | 650 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
651 } | 651 } |
652 return Error::null(); | 652 return Error::null(); |
653 } | 653 } |
654 | 654 |
655 | 655 |
656 const char* Dart::FeaturesString(Snapshot::Kind kind) { | 656 const char* Dart::FeaturesString(Isolate* isolate, Snapshot::Kind kind) { |
657 TextBuffer buffer(64); | 657 TextBuffer buffer(64); |
658 | 658 |
659 // Different fields are included for DEBUG/RELEASE/PRODUCT. | 659 // Different fields are included for DEBUG/RELEASE/PRODUCT. |
660 #if defined(DEBUG) | 660 #if defined(DEBUG) |
661 buffer.AddString("debug"); | 661 buffer.AddString("debug"); |
662 #elif defined(PRODUCT) | 662 #elif defined(PRODUCT) |
663 buffer.AddString("product"); | 663 buffer.AddString("product"); |
664 #else | 664 #else |
665 buffer.AddString("release"); | 665 buffer.AddString("release"); |
666 #endif | 666 #endif |
667 | 667 |
668 if (Snapshot::IncludesCode(kind)) { | 668 if (Snapshot::IncludesCode(kind)) { |
669 // Checked mode affects deopt ids. | 669 // Checked mode affects deopt ids. |
670 buffer.AddString(FLAG_enable_asserts ? " asserts" : " no-asserts"); | 670 const bool asserts = |
671 buffer.AddString(FLAG_enable_type_checks ? " type-checks" | 671 (isolate != NULL) ? isolate->asserts() : FLAG_enable_asserts; |
672 : " no-type-checks"); | 672 const bool type_checks = |
| 673 (isolate != NULL) ? isolate->type_checks() : FLAG_enable_type_checks; |
| 674 buffer.AddString(asserts ? " asserts" : " no-asserts"); |
| 675 buffer.AddString(type_checks ? " type-checks" : " no-type-checks"); |
673 | 676 |
674 // Generated code must match the host architecture and ABI. | 677 // Generated code must match the host architecture and ABI. |
675 #if defined(TARGET_ARCH_ARM) | 678 #if defined(TARGET_ARCH_ARM) |
676 #if defined(TARGET_ABI_IOS) | 679 #if defined(TARGET_ABI_IOS) |
677 buffer.AddString(" arm-ios"); | 680 buffer.AddString(" arm-ios"); |
678 #elif defined(TARGET_ABI_EABI) | 681 #elif defined(TARGET_ABI_EABI) |
679 buffer.AddString(" arm-eabi"); | 682 buffer.AddString(" arm-eabi"); |
680 #else | 683 #else |
681 #error Unknown ABI | 684 #error Unknown ABI |
682 #endif | 685 #endif |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 return predefined_handles_->handles_.IsValidScopedHandle(address); | 761 return predefined_handles_->handles_.IsValidScopedHandle(address); |
759 } | 762 } |
760 | 763 |
761 | 764 |
762 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 765 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
763 ASSERT(predefined_handles_ != NULL); | 766 ASSERT(predefined_handles_ != NULL); |
764 return predefined_handles_->api_handles_.IsValidHandle(handle); | 767 return predefined_handles_->api_handles_.IsValidHandle(handle); |
765 } | 768 } |
766 | 769 |
767 } // namespace dart | 770 } // namespace dart |
OLD | NEW |