Chromium Code Reviews| 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 662 #if defined(DEBUG) | 662 #if defined(DEBUG) |
| 663 buffer.AddString("debug"); | 663 buffer.AddString("debug"); |
| 664 #elif defined(PRODUCT) | 664 #elif defined(PRODUCT) |
| 665 buffer.AddString("product"); | 665 buffer.AddString("product"); |
| 666 #else | 666 #else |
| 667 buffer.AddString("release"); | 667 buffer.AddString("release"); |
| 668 #endif | 668 #endif |
| 669 | 669 |
| 670 if (Snapshot::IncludesCode(kind)) { | 670 if (Snapshot::IncludesCode(kind)) { |
| 671 // Checked mode affects deopt ids. | 671 // Checked mode affects deopt ids. |
| 672 const bool asserts = | 672 #define ADD_FLAG(name, isolate_flag, flag) \ |
| 673 (isolate != NULL) ? isolate->asserts() : FLAG_enable_asserts; | 673 do { \ |
| 674 const bool type_checks = | 674 const bool name = (isolate != NULL) ? isolate->name() : flag; \ |
| 675 (isolate != NULL) ? isolate->type_checks() : FLAG_enable_type_checks; | 675 buffer.AddString(name ? (" " #name) : (" no-" #name)); \ |
| 676 const bool field_guards = | 676 } while (0); |
| 677 (isolate != NULL) ? isolate->use_field_guards() : FLAG_use_field_guards; | 677 ISOLATE_FLAG_LIST(ADD_FLAG); |
|
rmacnak
2017/03/03 17:45:15
The snapshot should still work even if FLAG_error_
| |
| 678 buffer.AddString(asserts ? " asserts" : " no-asserts"); | 678 #undef ADD_FLAG |
| 679 buffer.AddString(type_checks ? " type-checks" : " no-type-checks"); | |
| 680 buffer.AddString(field_guards ? "field-guards" : "no-field-guards"); | |
| 681 | 679 |
| 682 // Generated code must match the host architecture and ABI. | 680 // Generated code must match the host architecture and ABI. |
| 683 #if defined(TARGET_ARCH_ARM) | 681 #if defined(TARGET_ARCH_ARM) |
| 684 #if defined(TARGET_ABI_IOS) | 682 #if defined(TARGET_ABI_IOS) |
| 685 buffer.AddString(" arm-ios"); | 683 buffer.AddString(" arm-ios"); |
| 686 #elif defined(TARGET_ABI_EABI) | 684 #elif defined(TARGET_ABI_EABI) |
| 687 buffer.AddString(" arm-eabi"); | 685 buffer.AddString(" arm-eabi"); |
| 688 #else | 686 #else |
| 689 #error Unknown ABI | 687 #error Unknown ABI |
| 690 #endif | 688 #endif |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 766 return predefined_handles_->handles_.IsValidScopedHandle(address); | 764 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 767 } | 765 } |
| 768 | 766 |
| 769 | 767 |
| 770 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 768 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 771 ASSERT(predefined_handles_ != NULL); | 769 ASSERT(predefined_handles_ != NULL); |
| 772 return predefined_handles_->api_handles_.IsValidHandle(handle); | 770 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 773 } | 771 } |
| 774 | 772 |
| 775 } // namespace dart | 773 } // namespace dart |
| OLD | NEW |