| 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 2632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2643 (index * sizeof(RawContextScope::VariableDesc)); | 2643 (index * sizeof(RawContextScope::VariableDesc)); |
| 2644 return reinterpret_cast<RawContextScope::VariableDesc*>(raw_addr); | 2644 return reinterpret_cast<RawContextScope::VariableDesc*>(raw_addr); |
| 2645 } | 2645 } |
| 2646 | 2646 |
| 2647 HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object); | 2647 HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object); |
| 2648 friend class Class; | 2648 friend class Class; |
| 2649 }; | 2649 }; |
| 2650 | 2650 |
| 2651 | 2651 |
| 2652 // Object holding information about an IC: test classes and their | 2652 // Object holding information about an IC: test classes and their |
| 2653 // corresponding classes. | 2653 // corresponding targets. |
| 2654 class ICData : public Object { | 2654 class ICData : public Object { |
| 2655 public: | 2655 public: |
| 2656 RawFunction* function() const { | 2656 RawFunction* function() const { |
| 2657 return raw_ptr()->function_; | 2657 return raw_ptr()->function_; |
| 2658 } | 2658 } |
| 2659 | 2659 |
| 2660 RawString* target_name() const { | 2660 RawString* target_name() const { |
| 2661 return raw_ptr()->target_name_; | 2661 return raw_ptr()->target_name_; |
| 2662 } | 2662 } |
| 2663 | 2663 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2685 | 2685 |
| 2686 static intptr_t ic_data_offset() { | 2686 static intptr_t ic_data_offset() { |
| 2687 return OFFSET_OF(RawICData, ic_data_); | 2687 return OFFSET_OF(RawICData, ic_data_); |
| 2688 } | 2688 } |
| 2689 | 2689 |
| 2690 static intptr_t function_offset() { | 2690 static intptr_t function_offset() { |
| 2691 return OFFSET_OF(RawICData, function_); | 2691 return OFFSET_OF(RawICData, function_); |
| 2692 } | 2692 } |
| 2693 | 2693 |
| 2694 // Adds one more class test to ICData. Length of 'classes' must be equal to | 2694 // Adds one more class test to ICData. Length of 'classes' must be equal to |
| 2695 // the number of arguments tested. Use only for number_of_checks > 1. | 2695 // the number of arguments tested. Use only for num_args_tested > 1. |
| 2696 void AddCheck(const GrowableArray<intptr_t>& class_ids, | 2696 void AddCheck(const GrowableArray<intptr_t>& class_ids, |
| 2697 const Function& target) const; | 2697 const Function& target) const; |
| 2698 // Adds sorted so that Smi is the first class-id. Use only for | 2698 // Adds sorted so that Smi is the first class-id. Use only for |
| 2699 // number_of_checks == 1. | 2699 // num_args_tested == 1. |
| 2700 void AddReceiverCheck(intptr_t receiver_class_id, | 2700 void AddReceiverCheck(intptr_t receiver_class_id, |
| 2701 const Function& target) const; | 2701 const Function& target) const; |
| 2702 void GetCheckAt(intptr_t index, | 2702 void GetCheckAt(intptr_t index, |
| 2703 GrowableArray<intptr_t>* class_ids, | 2703 GrowableArray<intptr_t>* class_ids, |
| 2704 Function* target) const; | 2704 Function* target) const; |
| 2705 void GetOneClassCheckAt( | 2705 void GetOneClassCheckAt( |
| 2706 int index, intptr_t* class_id, Function* target) const; | 2706 int index, intptr_t* class_id, Function* target) const; |
| 2707 | 2707 |
| 2708 intptr_t GetReceiverClassIdAt(intptr_t index) const; | 2708 intptr_t GetReceiverClassIdAt(intptr_t index) const; |
| 2709 RawFunction* GetTargetAt(intptr_t index) const; | 2709 RawFunction* GetTargetAt(intptr_t index) const; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2723 return raw_ptr()->ic_data_; | 2723 return raw_ptr()->ic_data_; |
| 2724 } | 2724 } |
| 2725 | 2725 |
| 2726 void set_function(const Function& value) const; | 2726 void set_function(const Function& value) const; |
| 2727 void set_target_name(const String& value) const; | 2727 void set_target_name(const String& value) const; |
| 2728 void set_id(intptr_t value) const; | 2728 void set_id(intptr_t value) const; |
| 2729 void set_num_args_tested(intptr_t value) const; | 2729 void set_num_args_tested(intptr_t value) const; |
| 2730 void set_ic_data(const Array& value) const; | 2730 void set_ic_data(const Array& value) const; |
| 2731 | 2731 |
| 2732 intptr_t TestEntryLength() const; | 2732 intptr_t TestEntryLength() const; |
| 2733 void WriteSentinel() const; |
| 2733 | 2734 |
| 2734 HEAP_OBJECT_IMPLEMENTATION(ICData, Object); | 2735 HEAP_OBJECT_IMPLEMENTATION(ICData, Object); |
| 2735 friend class Class; | 2736 friend class Class; |
| 2736 }; | 2737 }; |
| 2737 | 2738 |
| 2738 | 2739 |
| 2739 class SubtypeTestCache : public Object { | 2740 class SubtypeTestCache : public Object { |
| 2740 public: | 2741 public: |
| 2741 enum Entries { | 2742 enum Entries { |
| 2742 kInstanceClassId = 0, | 2743 kInstanceClassId = 0, |
| (...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5205 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5206 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5206 return false; | 5207 return false; |
| 5207 } | 5208 } |
| 5208 } | 5209 } |
| 5209 return true; | 5210 return true; |
| 5210 } | 5211 } |
| 5211 | 5212 |
| 5212 } // namespace dart | 5213 } // namespace dart |
| 5213 | 5214 |
| 5214 #endif // VM_OBJECT_H_ | 5215 #endif // VM_OBJECT_H_ |
| OLD | NEW |