OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 class CallICBase: public IC { | 196 class CallICBase: public IC { |
197 public: | 197 public: |
198 class Contextual: public BitField<bool, 0, 1> {}; | 198 class Contextual: public BitField<bool, 0, 1> {}; |
199 class StringStubState: public BitField<StringStubFeedback, 1, 1> {}; | 199 class StringStubState: public BitField<StringStubFeedback, 1, 1> {}; |
200 | 200 |
201 protected: | 201 protected: |
202 CallICBase(Code::Kind kind, Isolate* isolate) | 202 CallICBase(Code::Kind kind, Isolate* isolate) |
203 : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} | 203 : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} |
204 | 204 |
205 public: | 205 public: |
| 206 // Returns a JSFunction or a Failure. |
206 MUST_USE_RESULT MaybeObject* LoadFunction(State state, | 207 MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
207 Code::ExtraICState extra_ic_state, | 208 Code::ExtraICState extra_ic_state, |
208 Handle<Object> object, | 209 Handle<Object> object, |
209 Handle<String> name); | 210 Handle<String> name); |
210 | 211 |
211 protected: | 212 protected: |
212 Code::Kind kind_; | 213 Code::Kind kind_; |
213 | 214 |
214 bool TryUpdateExtraICState(LookupResult* lookup, | 215 bool TryUpdateExtraICState(LookupResult* lookup, |
215 Handle<Object> object, | 216 Handle<Object> object, |
216 Code::ExtraICState* extra_ic_state); | 217 Code::ExtraICState* extra_ic_state); |
217 | 218 |
218 MUST_USE_RESULT MaybeObject* ComputeMonomorphicStub( | 219 MUST_USE_RESULT MaybeObject* ComputeMonomorphicStub( |
219 LookupResult* lookup, | 220 LookupResult* lookup, |
220 State state, | 221 State state, |
221 Code::ExtraICState extra_ic_state, | 222 Code::ExtraICState extra_ic_state, |
222 Handle<Object> object, | 223 Handle<Object> object, |
223 Handle<String> name); | 224 Handle<String> name); |
224 | 225 |
225 // Update the inline cache and the global stub cache based on the | 226 // Update the inline cache and the global stub cache based on the lookup |
226 // lookup result. | 227 // result. |
227 void UpdateCaches(LookupResult* lookup, | 228 void UpdateCaches(LookupResult* lookup, |
228 State state, | 229 State state, |
229 Code::ExtraICState extra_ic_state, | 230 Code::ExtraICState extra_ic_state, |
230 Handle<Object> object, | 231 Handle<Object> object, |
231 Handle<String> name); | 232 Handle<String> name); |
232 | 233 |
233 // Returns a JSFunction if the object can be called as a function, | 234 // Returns a JSFunction if the object can be called as a function, and |
234 // and patches the stack to be ready for the call. | 235 // patches the stack to be ready for the call. Otherwise, it returns the |
235 // Otherwise, it returns the undefined value. | 236 // undefined value. |
236 Object* TryCallAsFunction(Object* object); | 237 Handle<Object> TryCallAsFunction(Handle<Object> object); |
237 | 238 |
238 void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object); | 239 void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object); |
239 | 240 |
240 static void Clear(Address address, Code* target); | 241 static void Clear(Address address, Code* target); |
241 | 242 |
242 friend class IC; | 243 friend class IC; |
243 }; | 244 }; |
244 | 245 |
245 | 246 |
246 class CallIC: public CallICBase { | 247 class CallIC: public CallICBase { |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 void patch(Code* code); | 736 void patch(Code* code); |
736 }; | 737 }; |
737 | 738 |
738 | 739 |
739 // Helper for BinaryOpIC and CompareIC. | 740 // Helper for BinaryOpIC and CompareIC. |
740 void PatchInlinedSmiCode(Address address); | 741 void PatchInlinedSmiCode(Address address); |
741 | 742 |
742 } } // namespace v8::internal | 743 } } // namespace v8::internal |
743 | 744 |
744 #endif // V8_IC_H_ | 745 #endif // V8_IC_H_ |
OLD | NEW |