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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 I->set_current_tag(default_tag); | 630 I->set_current_tag(default_tag); |
631 | 631 |
632 if (FLAG_keep_code) { | 632 if (FLAG_keep_code) { |
633 I->set_deoptimized_code_array( | 633 I->set_deoptimized_code_array( |
634 GrowableObjectArray::Handle(GrowableObjectArray::New())); | 634 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
635 } | 635 } |
636 return Error::null(); | 636 return Error::null(); |
637 } | 637 } |
638 | 638 |
639 | 639 |
640 const char* Dart::FeaturesString(Snapshot::Kind kind) { | |
641 TextBuffer buffer(64); | |
642 | |
643 // Different fields are included for DEBUG/RELEASE/PRODUCT. | |
644 #if defined(DEBUG) | |
645 buffer.AddString("debug"); | |
646 #elif defined(PRODUCT) | |
647 buffer.AddString("product"); | |
648 #else | |
649 buffer.AddString("release"); | |
650 #endif | |
651 | |
652 if (Snapshot::IncludesCode(kind)) { | |
653 // Checked mode affects deopt ids. | |
654 buffer.AddString(FLAG_enable_asserts ? " asserts" : " no-asserts"); | |
655 buffer.AddString(FLAG_enable_type_checks ? " type-checks" | |
656 : " no-type-checks"); | |
657 | |
658 // Generated code must match the host architecture and ABI. | |
659 #if defined(TARGET_ARCH_ARM) | |
660 #if defined(TARGET_ABI_IOS) | |
661 buffer.AddString(" arm-ios"); | |
662 #elif defined(TARGET_ABI_EABI) | |
663 buffer.AddString(" arm-eabi"); | |
664 #else | |
665 #error Unknown ABI | |
666 #endif | |
667 buffer.AddString(TargetCPUFeatures::hardfp_supported() ? " hardfp" | |
668 : " softfp"); | |
669 #elif defined(TARGET_ARCH_ARM64) | |
670 buffer.AddString(" arm64"); | |
671 #elif defined(TARGET_ARCH_MIPS) | |
672 buffer.AddString(" mips"); | |
673 #elif defined(TARGET_ARCH_IA32) | |
674 buffer.AddString(" ia32"); | |
675 #elif defined(TARGET_ARCH_X64) | |
676 #if defined(_WIN64) | |
677 buffer.AddString(" x64-win"); | |
678 #else | |
679 buffer.AddString(" x64-sysv"); | |
680 #endif | |
681 #elif defined(TARGET_ARCH_DBC) | |
682 buffer.AddString(" dbc"); | |
683 #elif defined(TARGET_ARCH_DBC64) | |
684 buffer.AddString(" dbc64"); | |
685 #endif | |
686 } | |
687 | |
688 return buffer.Steal(); | |
689 } | |
690 | |
691 | |
692 void Dart::RunShutdownCallback() { | 640 void Dart::RunShutdownCallback() { |
693 Isolate* isolate = Isolate::Current(); | 641 Isolate* isolate = Isolate::Current(); |
694 void* callback_data = isolate->init_callback_data(); | 642 void* callback_data = isolate->init_callback_data(); |
695 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 643 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
696 if (callback != NULL) { | 644 if (callback != NULL) { |
697 (callback)(callback_data); | 645 (callback)(callback_data); |
698 } | 646 } |
699 } | 647 } |
700 | 648 |
701 | 649 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 return predefined_handles_->handles_.IsValidScopedHandle(address); | 690 return predefined_handles_->handles_.IsValidScopedHandle(address); |
743 } | 691 } |
744 | 692 |
745 | 693 |
746 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 694 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
747 ASSERT(predefined_handles_ != NULL); | 695 ASSERT(predefined_handles_ != NULL); |
748 return predefined_handles_->api_handles_.IsValidHandle(handle); | 696 return predefined_handles_->api_handles_.IsValidHandle(handle); |
749 } | 697 } |
750 | 698 |
751 } // namespace dart | 699 } // namespace dart |
OLD | NEW |