Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: runtime/vm/dart.cc

Issue 2715213008: VM: Allow configuring use_field_guards on the per-isolate basis and include it into snapshot featur… (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 const bool field_guards =
675 (isolate != NULL) ? isolate->use_field_guards() : FLAG_use_field_guards;
676 buffer.AddString(asserts ? " asserts" : " no-asserts");
677 buffer.AddString(type_checks ? " type-checks" : " no-type-checks");
678 buffer.AddString(field_guards ? "field-guards" : "no-field-guards");
673 679
674 // Generated code must match the host architecture and ABI. 680 // Generated code must match the host architecture and ABI.
675 #if defined(TARGET_ARCH_ARM) 681 #if defined(TARGET_ARCH_ARM)
676 #if defined(TARGET_ABI_IOS) 682 #if defined(TARGET_ABI_IOS)
677 buffer.AddString(" arm-ios"); 683 buffer.AddString(" arm-ios");
678 #elif defined(TARGET_ABI_EABI) 684 #elif defined(TARGET_ABI_EABI)
679 buffer.AddString(" arm-eabi"); 685 buffer.AddString(" arm-eabi");
680 #else 686 #else
681 #error Unknown ABI 687 #error Unknown ABI
682 #endif 688 #endif
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 return predefined_handles_->handles_.IsValidScopedHandle(address); 764 return predefined_handles_->handles_.IsValidScopedHandle(address);
759 } 765 }
760 766
761 767
762 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 768 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
763 ASSERT(predefined_handles_ != NULL); 769 ASSERT(predefined_handles_ != NULL);
764 return predefined_handles_->api_handles_.IsValidHandle(handle); 770 return predefined_handles_->api_handles_.IsValidHandle(handle);
765 } 771 }
766 772
767 } // namespace dart 773 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698