| 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 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 3561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3572 } | 3572 } |
| 3573 | 3573 |
| 3574 // Note: only deopts with reasons before Unknown in this list are recorded in | 3574 // Note: only deopts with reasons before Unknown in this list are recorded in |
| 3575 // the ICData. All other reasons are used purely for informational messages | 3575 // the ICData. All other reasons are used purely for informational messages |
| 3576 // printed during deoptimization itself. | 3576 // printed during deoptimization itself. |
| 3577 #define DEOPT_REASONS(V) \ | 3577 #define DEOPT_REASONS(V) \ |
| 3578 V(BinarySmiOp) \ | 3578 V(BinarySmiOp) \ |
| 3579 V(BinaryMintOp) \ | 3579 V(BinaryMintOp) \ |
| 3580 V(DoubleToSmi) \ | 3580 V(DoubleToSmi) \ |
| 3581 V(Unknown) \ | 3581 V(Unknown) \ |
| 3582 V(InstanceGetter) \ | |
| 3583 V(PolymorphicInstanceCallTestFail) \ | 3582 V(PolymorphicInstanceCallTestFail) \ |
| 3584 V(InstanceCallNoICData) \ | |
| 3585 V(IntegerToDouble) \ | |
| 3586 V(UnaryMintOp) \ | 3583 V(UnaryMintOp) \ |
| 3587 V(BinaryDoubleOp) \ | 3584 V(BinaryDoubleOp) \ |
| 3588 V(InstanceSetter) \ | |
| 3589 V(Equality) \ | |
| 3590 V(RelationalOp) \ | |
| 3591 V(EqualityClassCheck) \ | |
| 3592 V(NoTypeFeedback) \ | |
| 3593 V(UnaryOp) \ | 3585 V(UnaryOp) \ |
| 3594 V(UnboxInteger) \ | 3586 V(UnboxInteger) \ |
| 3595 V(CheckClass) \ | 3587 V(CheckClass) \ |
| 3596 V(CheckSmi) \ | 3588 V(CheckSmi) \ |
| 3597 V(CheckArrayBound) \ | 3589 V(CheckArrayBound) \ |
| 3598 V(AtCall) \ | 3590 V(AtCall) \ |
| 3599 V(Int32Load) \ | |
| 3600 V(Uint32Load) \ | 3591 V(Uint32Load) \ |
| 3601 V(GuardField) \ | 3592 V(GuardField) \ |
| 3602 V(TestCids) \ | 3593 V(TestCids) \ |
| 3603 V(NumReasons) \ | 3594 V(NumReasons) \ |
| 3604 | 3595 |
| 3605 enum DeoptReasonId { | 3596 enum DeoptReasonId { |
| 3606 #define DEFINE_ENUM_LIST(name) kDeopt##name, | 3597 #define DEFINE_ENUM_LIST(name) kDeopt##name, |
| 3607 DEOPT_REASONS(DEFINE_ENUM_LIST) | 3598 DEOPT_REASONS(DEFINE_ENUM_LIST) |
| 3608 #undef DEFINE_ENUM_LIST | 3599 #undef DEFINE_ENUM_LIST |
| 3609 }; | 3600 }; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3708 intptr_t GetCountAt(intptr_t index) const; | 3699 intptr_t GetCountAt(intptr_t index) const; |
| 3709 intptr_t AggregateCount() const; | 3700 intptr_t AggregateCount() const; |
| 3710 | 3701 |
| 3711 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise | 3702 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise |
| 3712 // returns a new ICData object containing only unique arg_nr checks. | 3703 // returns a new ICData object containing only unique arg_nr checks. |
| 3713 // Returns only used entries. | 3704 // Returns only used entries. |
| 3714 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const; | 3705 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const; |
| 3715 RawICData* AsUnaryClassChecks() const { | 3706 RawICData* AsUnaryClassChecks() const { |
| 3716 return AsUnaryClassChecksForArgNr(0); | 3707 return AsUnaryClassChecksForArgNr(0); |
| 3717 } | 3708 } |
| 3709 RawICData* AsUnaryClassChecksForCid( |
| 3710 intptr_t cid, const Function& target) const; |
| 3718 | 3711 |
| 3719 // Consider only used entries. | 3712 // Consider only used entries. |
| 3720 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const; | 3713 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const; |
| 3721 bool AllReceiversAreNumbers() const; | 3714 bool AllReceiversAreNumbers() const; |
| 3722 bool HasOneTarget() const; | 3715 bool HasOneTarget() const; |
| 3723 bool HasReceiverClassId(intptr_t class_id) const; | 3716 bool HasReceiverClassId(intptr_t class_id) const; |
| 3724 | 3717 |
| 3725 static RawICData* New(const Function& owner, | 3718 static RawICData* New(const Function& owner, |
| 3726 const String& target_name, | 3719 const String& target_name, |
| 3727 const Array& arguments_descriptor, | 3720 const Array& arguments_descriptor, |
| 3728 intptr_t deopt_id, | 3721 intptr_t deopt_id, |
| 3729 intptr_t num_args_tested); | 3722 intptr_t num_args_tested); |
| 3723 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested); |
| 3730 | 3724 |
| 3731 static intptr_t TestEntryLengthFor(intptr_t num_args); | 3725 static intptr_t TestEntryLengthFor(intptr_t num_args); |
| 3732 | 3726 |
| 3733 static intptr_t TargetIndexFor(intptr_t num_args) { | 3727 static intptr_t TargetIndexFor(intptr_t num_args) { |
| 3734 return num_args; | 3728 return num_args; |
| 3735 } | 3729 } |
| 3736 | 3730 |
| 3737 static intptr_t CountIndexFor(intptr_t num_args) { | 3731 static intptr_t CountIndexFor(intptr_t num_args) { |
| 3738 return (num_args + 1); | 3732 return (num_args + 1); |
| 3739 } | 3733 } |
| (...skipping 4009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7749 | 7743 |
| 7750 | 7744 |
| 7751 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7745 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7752 intptr_t index) { | 7746 intptr_t index) { |
| 7753 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7747 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7754 } | 7748 } |
| 7755 | 7749 |
| 7756 } // namespace dart | 7750 } // namespace dart |
| 7757 | 7751 |
| 7758 #endif // VM_OBJECT_H_ | 7752 #endif // VM_OBJECT_H_ |
| OLD | NEW |