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

Side by Side Diff: runtime/vm/object.h

Issue 10796103: Use kIllegalObjectKind instead of NULL object to terminate ICData array (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2642 (index * sizeof(RawContextScope::VariableDesc)); 2642 (index * sizeof(RawContextScope::VariableDesc));
2643 return reinterpret_cast<RawContextScope::VariableDesc*>(raw_addr); 2643 return reinterpret_cast<RawContextScope::VariableDesc*>(raw_addr);
2644 } 2644 }
2645 2645
2646 HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object); 2646 HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object);
2647 friend class Class; 2647 friend class Class;
2648 }; 2648 };
2649 2649
2650 2650
2651 // Object holding information about an IC: test classes and their 2651 // Object holding information about an IC: test classes and their
2652 // corresponding classes. 2652 // corresponding targets.
2653 class ICData : public Object { 2653 class ICData : public Object {
2654 public: 2654 public:
2655 RawFunction* function() const { 2655 RawFunction* function() const {
2656 return raw_ptr()->function_; 2656 return raw_ptr()->function_;
2657 } 2657 }
2658 2658
2659 RawString* target_name() const { 2659 RawString* target_name() const {
2660 return raw_ptr()->target_name_; 2660 return raw_ptr()->target_name_;
2661 } 2661 }
2662 2662
(...skipping 21 matching lines...) Expand all
2684 2684
2685 static intptr_t ic_data_offset() { 2685 static intptr_t ic_data_offset() {
2686 return OFFSET_OF(RawICData, ic_data_); 2686 return OFFSET_OF(RawICData, ic_data_);
2687 } 2687 }
2688 2688
2689 static intptr_t function_offset() { 2689 static intptr_t function_offset() {
2690 return OFFSET_OF(RawICData, function_); 2690 return OFFSET_OF(RawICData, function_);
2691 } 2691 }
2692 2692
2693 // Adds one more class test to ICData. Length of 'classes' must be equal to 2693 // Adds one more class test to ICData. Length of 'classes' must be equal to
2694 // the number of arguments tested. Use only for number_of_checks > 1. 2694 // the number of arguments tested. Use only for num_args_tested > 1.
2695 void AddCheck(const GrowableArray<intptr_t>& class_ids, 2695 void AddCheck(const GrowableArray<intptr_t>& class_ids,
2696 const Function& target) const; 2696 const Function& target) const;
2697 // Adds sorted so that Smi is the first class-id. Use only for 2697 // Adds sorted so that Smi is the first class-id. Use only for
2698 // number_of_checks == 1. 2698 // num_args_tested == 1.
2699 void AddReceiverCheck(intptr_t receiver_class_id, 2699 void AddReceiverCheck(intptr_t receiver_class_id,
2700 const Function& target) const; 2700 const Function& target) const;
2701 void GetCheckAt(intptr_t index, 2701 void GetCheckAt(intptr_t index,
2702 GrowableArray<intptr_t>* class_ids, 2702 GrowableArray<intptr_t>* class_ids,
2703 Function* target) const; 2703 Function* target) const;
2704 void GetOneClassCheckAt( 2704 void GetOneClassCheckAt(
2705 int index, intptr_t* class_id, Function* target) const; 2705 int index, intptr_t* class_id, Function* target) const;
2706 2706
2707 intptr_t GetReceiverClassIdAt(intptr_t index) const; 2707 intptr_t GetReceiverClassIdAt(intptr_t index) const;
2708 RawFunction* GetTargetAt(intptr_t index) const; 2708 RawFunction* GetTargetAt(intptr_t index) const;
(...skipping 13 matching lines...) Expand all
2722 return raw_ptr()->ic_data_; 2722 return raw_ptr()->ic_data_;
2723 } 2723 }
2724 2724
2725 void set_function(const Function& value) const; 2725 void set_function(const Function& value) const;
2726 void set_target_name(const String& value) const; 2726 void set_target_name(const String& value) const;
2727 void set_id(intptr_t value) const; 2727 void set_id(intptr_t value) const;
2728 void set_num_args_tested(intptr_t value) const; 2728 void set_num_args_tested(intptr_t value) const;
2729 void set_ic_data(const Array& value) const; 2729 void set_ic_data(const Array& value) const;
2730 2730
2731 intptr_t TestEntryLength() const; 2731 intptr_t TestEntryLength() const;
2732 void WriteSentinel() const;
2732 2733
2733 HEAP_OBJECT_IMPLEMENTATION(ICData, Object); 2734 HEAP_OBJECT_IMPLEMENTATION(ICData, Object);
2734 friend class Class; 2735 friend class Class;
2735 }; 2736 };
2736 2737
2737 2738
2738 class SubtypeTestCache : public Object { 2739 class SubtypeTestCache : public Object {
2739 public: 2740 public:
2740 enum Entries { 2741 enum Entries {
2741 kInstanceClassId = 0, 2742 kInstanceClassId = 0,
(...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after
5210 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5211 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5211 return false; 5212 return false;
5212 } 5213 }
5213 } 5214 }
5214 return true; 5215 return true;
5215 } 5216 }
5216 5217
5217 } // namespace dart 5218 } // namespace dart
5218 5219
5219 #endif // VM_OBJECT_H_ 5220 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698