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

Side by Side Diff: src/ic-inl.h

Issue 445943002: CallIC must update type feedback info correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code comments. Created 6 years, 4 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 | « src/ic.cc ('k') | no next file » | 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_IC_INL_H_ 5 #ifndef V8_IC_INL_H_
6 #define V8_IC_INL_H_ 6 #define V8_IC_INL_H_
7 7
8 #include "src/ic.h" 8 #include "src/ic.h"
9 9
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 Context* native_context = *isolate->native_context(); 161 Context* native_context = *isolate->native_context();
162 JSFunction* builtin_ctor = GetRootConstructor(type, native_context); 162 JSFunction* builtin_ctor = GetRootConstructor(type, native_context);
163 if (builtin_ctor != NULL) { 163 if (builtin_ctor != NULL) {
164 *flag = kCacheOnPrototype; 164 *flag = kCacheOnPrototype;
165 return handle(builtin_ctor->initial_map()); 165 return handle(builtin_ctor->initial_map());
166 } 166 }
167 *flag = kCacheOnReceiver; 167 *flag = kCacheOnReceiver;
168 return TypeToMap(type, isolate); 168 return TypeToMap(type, isolate);
169 } 169 }
170 170
171
172 IC::State CallIC::FeedbackObjectToState(Object* feedback) const {
173 IC::State state = UNINITIALIZED;
174
175 if (feedback == *TypeFeedbackInfo::MegamorphicSentinel(isolate())) {
176 state = GENERIC;
177 } else if (feedback->IsAllocationSite() || feedback->IsJSFunction()) {
178 state = MONOMORPHIC;
179 } else {
180 CHECK(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate()));
181 }
182
183 return state;
184 }
171 } } // namespace v8::internal 185 } } // namespace v8::internal
172 186
173 #endif // V8_IC_INL_H_ 187 #endif // V8_IC_INL_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698