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

Side by Side Diff: src/ic.h

Issue 6344005: Introduce extra IC state to record additional feedback from IC-s. (Closed)
Patch Set: Use the extra state in string IC stubs Created 9 years, 11 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/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | src/ic.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 IC::UtilityId id_; 186 IC::UtilityId id_;
187 }; 187 };
188 188
189 189
190 class CallICBase: public IC { 190 class CallICBase: public IC {
191 protected: 191 protected:
192 explicit CallICBase(Code::Kind kind) : IC(EXTRA_CALL_FRAME), kind_(kind) {} 192 explicit CallICBase(Code::Kind kind) : IC(EXTRA_CALL_FRAME), kind_(kind) {}
193 193
194 public: 194 public:
195 MUST_USE_RESULT MaybeObject* LoadFunction(State state, 195 MUST_USE_RESULT MaybeObject* LoadFunction(State state,
196 Code::ExtraICState extra_ic_state,
196 Handle<Object> object, 197 Handle<Object> object,
197 Handle<String> name); 198 Handle<String> name);
198 199
199 protected: 200 protected:
200 Code::Kind kind_; 201 Code::Kind kind_;
201 202
202 // Update the inline cache and the global stub cache based on the 203 // Update the inline cache and the global stub cache based on the
203 // lookup result. 204 // lookup result.
204 void UpdateCaches(LookupResult* lookup, 205 void UpdateCaches(LookupResult* lookup,
205 State state, 206 State state,
207 Code::ExtraICState extra_ic_state,
206 Handle<Object> object, 208 Handle<Object> object,
207 Handle<String> name); 209 Handle<String> name);
208 210
209 // Returns a JSFunction if the object can be called as a function, 211 // Returns a JSFunction if the object can be called as a function,
210 // and patches the stack to be ready for the call. 212 // and patches the stack to be ready for the call.
211 // Otherwise, it returns the undefined value. 213 // Otherwise, it returns the undefined value.
212 Object* TryCallAsFunction(Object* object); 214 Object* TryCallAsFunction(Object* object);
213 215
214 void ReceiverToObject(Handle<Object> object); 216 void ReceiverToObject(Handle<Object> object);
215 217
216 static void Clear(Address address, Code* target); 218 static void Clear(Address address, Code* target);
217 friend class IC; 219 friend class IC;
218 }; 220 };
219 221
220 222
221 class CallIC: public CallICBase { 223 class CallIC: public CallICBase {
222 public: 224 public:
223 CallIC() : CallICBase(Code::CALL_IC) { ASSERT(target()->is_call_stub()); } 225 CallIC() : CallICBase(Code::CALL_IC) { ASSERT(target()->is_call_stub()); }
224 226
225 // Code generator routines. 227 // Code generator routines.
226 static void GenerateInitialize(MacroAssembler* masm, int argc) { 228 static void GenerateInitialize(MacroAssembler* masm, int argc) {
227 GenerateMiss(masm, argc); 229 GenerateMiss(masm, Code::kNoExtraICState, argc);
228 } 230 }
229 static void GenerateMiss(MacroAssembler* masm, int argc); 231 static void GenerateMiss(MacroAssembler* masm,
232 Code::ExtraICState extra_ic_state,
233 int argc);
230 static void GenerateMegamorphic(MacroAssembler* masm, int argc); 234 static void GenerateMegamorphic(MacroAssembler* masm, int argc);
231 static void GenerateNormal(MacroAssembler* masm, int argc); 235 static void GenerateNormal(MacroAssembler* masm, int argc);
232 }; 236 };
233 237
234 238
235 class KeyedCallIC: public CallICBase { 239 class KeyedCallIC: public CallICBase {
236 public: 240 public:
237 KeyedCallIC() : CallICBase(Code::KEYED_CALL_IC) { 241 KeyedCallIC() : CallICBase(Code::KEYED_CALL_IC) {
238 ASSERT(target()->is_keyed_call_stub()); 242 ASSERT(target()->is_keyed_call_stub());
239 } 243 }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 595
592 Token::Value op_; 596 Token::Value op_;
593 }; 597 };
594 598
595 // Helper for TRBinaryOpIC and CompareIC. 599 // Helper for TRBinaryOpIC and CompareIC.
596 void PatchInlinedSmiCode(Address address); 600 void PatchInlinedSmiCode(Address address);
597 601
598 } } // namespace v8::internal 602 } } // namespace v8::internal
599 603
600 #endif // V8_IC_H_ 604 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ic.cc » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698