OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_TYPE_FEEDBACK_VECTOR_H_ | 5 #ifndef V8_TYPE_FEEDBACK_VECTOR_H_ |
6 #define V8_TYPE_FEEDBACK_VECTOR_H_ | 6 #define V8_TYPE_FEEDBACK_VECTOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/checks.h" | 10 #include "src/checks.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 int ICSlots() const { | 115 int ICSlots() const { |
116 if (length() == 0) return 0; | 116 if (length() == 0) return 0; |
117 return length() - first_ic_slot_index(); | 117 return length() - first_ic_slot_index(); |
118 } | 118 } |
119 | 119 |
120 // Conversion from a slot or ic slot to an integer index to the underlying | 120 // Conversion from a slot or ic slot to an integer index to the underlying |
121 // array. | 121 // array. |
122 int GetIndex(FeedbackVectorSlot slot) const { | 122 int GetIndex(FeedbackVectorSlot slot) const { |
| 123 DCHECK(slot.ToInt() < first_ic_slot_index()); |
123 return kReservedIndexCount + ic_metadata_length() + slot.ToInt(); | 124 return kReservedIndexCount + ic_metadata_length() + slot.ToInt(); |
124 } | 125 } |
125 | 126 |
126 int GetIndex(FeedbackVectorICSlot slot) const { | 127 int GetIndex(FeedbackVectorICSlot slot) const { |
127 int first_ic_slot = first_ic_slot_index(); | 128 int first_ic_slot = first_ic_slot_index(); |
128 DCHECK(slot.ToInt() < ICSlots()); | 129 DCHECK(slot.ToInt() < ICSlots()); |
129 return first_ic_slot + slot.ToInt(); | 130 return first_ic_slot + slot.ToInt(); |
130 } | 131 } |
131 | 132 |
132 // Conversion from an integer index to either a slot or an ic slot. The caller | 133 // Conversion from an integer index to either a slot or an ic slot. The caller |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 int ExtractMaps(MapHandleList* maps) const OVERRIDE; | 359 int ExtractMaps(MapHandleList* maps) const OVERRIDE; |
359 MaybeHandle<Code> FindHandlerForMap(Handle<Map> map) const OVERRIDE; | 360 MaybeHandle<Code> FindHandlerForMap(Handle<Map> map) const OVERRIDE; |
360 virtual bool FindHandlers(CodeHandleList* code_list, | 361 virtual bool FindHandlers(CodeHandleList* code_list, |
361 int length = -1) const OVERRIDE; | 362 int length = -1) const OVERRIDE; |
362 Name* FindFirstName() const OVERRIDE; | 363 Name* FindFirstName() const OVERRIDE; |
363 }; | 364 }; |
364 } | 365 } |
365 } // namespace v8::internal | 366 } // namespace v8::internal |
366 | 367 |
367 #endif // V8_TRANSITIONS_H_ | 368 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |