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

Side by Side Diff: src/type-feedback-vector-inl.h

Issue 1670813005: Revert of Type Feedback Vector lives in the closure (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « src/type-feedback-vector.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_INL_H_ 5 #ifndef V8_TYPE_FEEDBACK_VECTOR_INL_H_
6 #define V8_TYPE_FEEDBACK_VECTOR_INL_H_ 6 #define V8_TYPE_FEEDBACK_VECTOR_INL_H_
7 7
8 #include "src/type-feedback-vector.h" 8 #include "src/type-feedback-vector.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 : TypeFeedbackMetadata::cast(get(kMetadataIndex)); 73 : TypeFeedbackMetadata::cast(get(kMetadataIndex));
74 } 74 }
75 75
76 76
77 FeedbackVectorSlotKind TypeFeedbackVector::GetKind( 77 FeedbackVectorSlotKind TypeFeedbackVector::GetKind(
78 FeedbackVectorSlot slot) const { 78 FeedbackVectorSlot slot) const {
79 DCHECK(!is_empty()); 79 DCHECK(!is_empty());
80 return metadata()->GetKind(slot); 80 return metadata()->GetKind(slot);
81 } 81 }
82 82
83 // static 83
84 int TypeFeedbackVector::GetIndex(FeedbackVectorSlot slot) { 84 int TypeFeedbackVector::GetIndex(FeedbackVectorSlot slot) const {
85 DCHECK(slot.ToInt() < slot_count());
85 return kReservedIndexCount + slot.ToInt(); 86 return kReservedIndexCount + slot.ToInt();
86 } 87 }
87 88
88 89
89 // Conversion from an integer index to either a slot or an ic slot. The caller 90 // Conversion from an integer index to either a slot or an ic slot. The caller
90 // should know what kind she expects. 91 // should know what kind she expects.
91 // static 92 FeedbackVectorSlot TypeFeedbackVector::ToSlot(int index) const {
92 FeedbackVectorSlot TypeFeedbackVector::ToSlot(int index) { 93 DCHECK(index >= kReservedIndexCount && index < length());
93 DCHECK(index >= kReservedIndexCount);
94 return FeedbackVectorSlot(index - kReservedIndexCount); 94 return FeedbackVectorSlot(index - kReservedIndexCount);
95 } 95 }
96 96
97 97
98 Object* TypeFeedbackVector::Get(FeedbackVectorSlot slot) const { 98 Object* TypeFeedbackVector::Get(FeedbackVectorSlot slot) const {
99 return get(GetIndex(slot)); 99 return get(GetIndex(slot));
100 } 100 }
101 101
102 102
103 void TypeFeedbackVector::Set(FeedbackVectorSlot slot, Object* value, 103 void TypeFeedbackVector::Set(FeedbackVectorSlot slot, Object* value,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 int index = vector()->GetIndex(slot()) + 1; 181 int index = vector()->GetIndex(slot()) + 1;
182 vector()->set(index, feedback_extra, mode); 182 vector()->set(index, feedback_extra, mode);
183 } 183 }
184 184
185 185
186 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); } 186 Isolate* FeedbackNexus::GetIsolate() const { return vector()->GetIsolate(); }
187 } // namespace internal 187 } // namespace internal
188 } // namespace v8 188 } // namespace v8
189 189
190 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_ 190 #endif // V8_TYPE_FEEDBACK_VECTOR_INL_H_
OLDNEW
« no previous file with comments | « src/type-feedback-vector.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698