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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 // Returns a JSFunction if the object can be called as a function, and | 230 // Returns a JSFunction if the object can be called as a function, and |
231 // patches the stack to be ready for the call. Otherwise, it returns the | 231 // patches the stack to be ready for the call. Otherwise, it returns the |
232 // undefined value. | 232 // undefined value. |
233 Handle<Object> TryCallAsFunction(Handle<Object> object); | 233 Handle<Object> TryCallAsFunction(Handle<Object> object); |
234 | 234 |
235 void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object); | 235 void ReceiverToObjectIfRequired(Handle<Object> callee, Handle<Object> object); |
236 | 236 |
237 static void Clear(Address address, Code* target); | 237 static void Clear(Address address, Code* target); |
238 | 238 |
239 // Platform-specific generation of misses for call and keyed call. | 239 // Platform-specific code generation functions used by both call and |
| 240 // keyed call. |
240 static void GenerateMiss(MacroAssembler* masm, | 241 static void GenerateMiss(MacroAssembler* masm, |
241 int argc, | 242 int argc, |
242 IC::UtilityId id, | 243 IC::UtilityId id, |
243 Code::ExtraICState extra_state); | 244 Code::ExtraICState extra_state); |
244 | 245 |
| 246 static void GenerateNormal(MacroAssembler* masm, int argc); |
| 247 |
245 Code::Kind kind_; | 248 Code::Kind kind_; |
246 | 249 |
247 friend class IC; | 250 friend class IC; |
248 }; | 251 }; |
249 | 252 |
250 | 253 |
251 class CallIC: public CallICBase { | 254 class CallIC: public CallICBase { |
252 public: | 255 public: |
253 explicit CallIC(Isolate* isolate) : CallICBase(Code::CALL_IC, isolate) { | 256 explicit CallIC(Isolate* isolate) : CallICBase(Code::CALL_IC, isolate) { |
254 ASSERT(target()->is_call_stub()); | 257 ASSERT(target()->is_call_stub()); |
255 } | 258 } |
256 | 259 |
257 // Code generator routines. | 260 // Code generator routines. |
258 static void GenerateInitialize(MacroAssembler* masm, | 261 static void GenerateInitialize(MacroAssembler* masm, |
259 int argc, | 262 int argc, |
260 Code::ExtraICState extra_state) { | 263 Code::ExtraICState extra_state) { |
261 GenerateMiss(masm, argc, extra_state); | 264 GenerateMiss(masm, argc, extra_state); |
262 } | 265 } |
263 | 266 |
264 static void GenerateMiss(MacroAssembler* masm, | 267 static void GenerateMiss(MacroAssembler* masm, |
265 int argc, | 268 int argc, |
266 Code::ExtraICState extra_state) { | 269 Code::ExtraICState extra_state) { |
267 CallICBase::GenerateMiss(masm, argc, IC::kCallIC_Miss, extra_state); | 270 CallICBase::GenerateMiss(masm, argc, IC::kCallIC_Miss, extra_state); |
268 } | 271 } |
269 | 272 |
270 static void GenerateMegamorphic(MacroAssembler* masm, | 273 static void GenerateMegamorphic(MacroAssembler* masm, |
271 int argc, | 274 int argc, |
272 Code::ExtraICState extra_ic_state); | 275 Code::ExtraICState extra_ic_state); |
273 | 276 |
274 static void GenerateNormal(MacroAssembler* masm, int argc); | 277 static void GenerateNormal(MacroAssembler* masm, int argc) { |
| 278 CallICBase::GenerateNormal(masm, argc); |
| 279 GenerateMiss(masm, argc, Code::kNoExtraICState); |
| 280 } |
275 }; | 281 }; |
276 | 282 |
277 | 283 |
278 class KeyedCallIC: public CallICBase { | 284 class KeyedCallIC: public CallICBase { |
279 public: | 285 public: |
280 explicit KeyedCallIC(Isolate* isolate) | 286 explicit KeyedCallIC(Isolate* isolate) |
281 : CallICBase(Code::KEYED_CALL_IC, isolate) { | 287 : CallICBase(Code::KEYED_CALL_IC, isolate) { |
282 ASSERT(target()->is_keyed_call_stub()); | 288 ASSERT(target()->is_keyed_call_stub()); |
283 } | 289 } |
284 | 290 |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 void patch(Code* code); | 750 void patch(Code* code); |
745 }; | 751 }; |
746 | 752 |
747 | 753 |
748 // Helper for BinaryOpIC and CompareIC. | 754 // Helper for BinaryOpIC and CompareIC. |
749 void PatchInlinedSmiCode(Address address); | 755 void PatchInlinedSmiCode(Address address); |
750 | 756 |
751 } } // namespace v8::internal | 757 } } // namespace v8::internal |
752 | 758 |
753 #endif // V8_IC_H_ | 759 #endif // V8_IC_H_ |
OLD | NEW |