OLD | NEW |
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 Address address_; | 184 Address address_; |
185 IC::UtilityId id_; | 185 IC::UtilityId id_; |
186 }; | 186 }; |
187 | 187 |
188 | 188 |
189 class CallICBase: public IC { | 189 class CallICBase: public IC { |
190 protected: | 190 protected: |
191 explicit CallICBase(Code::Kind kind) : IC(EXTRA_CALL_FRAME), kind_(kind) {} | 191 explicit CallICBase(Code::Kind kind) : IC(EXTRA_CALL_FRAME), kind_(kind) {} |
192 | 192 |
193 public: | 193 public: |
194 Object* LoadFunction(State state, Handle<Object> object, Handle<String> name); | 194 MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
| 195 Handle<Object> object, |
| 196 Handle<String> name); |
195 | 197 |
196 protected: | 198 protected: |
197 Code::Kind kind_; | 199 Code::Kind kind_; |
198 | 200 |
199 // Update the inline cache and the global stub cache based on the | 201 // Update the inline cache and the global stub cache based on the |
200 // lookup result. | 202 // lookup result. |
201 void UpdateCaches(LookupResult* lookup, | 203 void UpdateCaches(LookupResult* lookup, |
202 State state, | 204 State state, |
203 Handle<Object> object, | 205 Handle<Object> object, |
204 Handle<String> name); | 206 Handle<String> name); |
(...skipping 23 matching lines...) Expand all Loading... |
228 static void GenerateNormal(MacroAssembler* masm, int argc); | 230 static void GenerateNormal(MacroAssembler* masm, int argc); |
229 }; | 231 }; |
230 | 232 |
231 | 233 |
232 class KeyedCallIC: public CallICBase { | 234 class KeyedCallIC: public CallICBase { |
233 public: | 235 public: |
234 KeyedCallIC() : CallICBase(Code::KEYED_CALL_IC) { | 236 KeyedCallIC() : CallICBase(Code::KEYED_CALL_IC) { |
235 ASSERT(target()->is_keyed_call_stub()); | 237 ASSERT(target()->is_keyed_call_stub()); |
236 } | 238 } |
237 | 239 |
238 Object* LoadFunction(State state, Handle<Object> object, Handle<Object> key); | 240 MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
| 241 Handle<Object> object, |
| 242 Handle<Object> key); |
239 | 243 |
240 // Code generator routines. | 244 // Code generator routines. |
241 static void GenerateInitialize(MacroAssembler* masm, int argc) { | 245 static void GenerateInitialize(MacroAssembler* masm, int argc) { |
242 GenerateMiss(masm, argc); | 246 GenerateMiss(masm, argc); |
243 } | 247 } |
244 static void GenerateMiss(MacroAssembler* masm, int argc); | 248 static void GenerateMiss(MacroAssembler* masm, int argc); |
245 static void GenerateMegamorphic(MacroAssembler* masm, int argc); | 249 static void GenerateMegamorphic(MacroAssembler* masm, int argc); |
246 static void GenerateNormal(MacroAssembler* masm, int argc); | 250 static void GenerateNormal(MacroAssembler* masm, int argc); |
247 }; | 251 }; |
248 | 252 |
249 | 253 |
250 class LoadIC: public IC { | 254 class LoadIC: public IC { |
251 public: | 255 public: |
252 LoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_load_stub()); } | 256 LoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_load_stub()); } |
253 | 257 |
254 Object* Load(State state, Handle<Object> object, Handle<String> name); | 258 MUST_USE_RESULT MaybeObject* Load(State state, |
| 259 Handle<Object> object, |
| 260 Handle<String> name); |
255 | 261 |
256 // Code generator routines. | 262 // Code generator routines. |
257 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 263 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
258 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 264 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
259 GenerateMiss(masm); | 265 GenerateMiss(masm); |
260 } | 266 } |
261 static void GenerateMiss(MacroAssembler* masm); | 267 static void GenerateMiss(MacroAssembler* masm); |
262 static void GenerateMegamorphic(MacroAssembler* masm); | 268 static void GenerateMegamorphic(MacroAssembler* masm); |
263 static void GenerateNormal(MacroAssembler* masm); | 269 static void GenerateNormal(MacroAssembler* masm); |
264 | 270 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 bool is_dont_delete); | 310 bool is_dont_delete); |
305 | 311 |
306 friend class IC; | 312 friend class IC; |
307 }; | 313 }; |
308 | 314 |
309 | 315 |
310 class KeyedLoadIC: public IC { | 316 class KeyedLoadIC: public IC { |
311 public: | 317 public: |
312 KeyedLoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_keyed_load_stub()); } | 318 KeyedLoadIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_keyed_load_stub()); } |
313 | 319 |
314 Object* Load(State state, Handle<Object> object, Handle<Object> key); | 320 MUST_USE_RESULT MaybeObject* Load(State state, |
| 321 Handle<Object> object, |
| 322 Handle<Object> key); |
315 | 323 |
316 // Code generator routines. | 324 // Code generator routines. |
317 static void GenerateMiss(MacroAssembler* masm); | 325 static void GenerateMiss(MacroAssembler* masm); |
318 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 326 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
319 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 327 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
320 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 328 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
321 GenerateMiss(masm); | 329 GenerateMiss(masm); |
322 } | 330 } |
323 static void GenerateGeneric(MacroAssembler* masm); | 331 static void GenerateGeneric(MacroAssembler* masm); |
324 static void GenerateString(MacroAssembler* masm); | 332 static void GenerateString(MacroAssembler* masm); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 static bool PatchInlinedLoad(Address address, Object* map); | 385 static bool PatchInlinedLoad(Address address, Object* map); |
378 | 386 |
379 friend class IC; | 387 friend class IC; |
380 }; | 388 }; |
381 | 389 |
382 | 390 |
383 class StoreIC: public IC { | 391 class StoreIC: public IC { |
384 public: | 392 public: |
385 StoreIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_store_stub()); } | 393 StoreIC() : IC(NO_EXTRA_FRAME) { ASSERT(target()->is_store_stub()); } |
386 | 394 |
387 Object* Store(State state, | 395 MUST_USE_RESULT MaybeObject* Store(State state, |
388 Handle<Object> object, | 396 Handle<Object> object, |
389 Handle<String> name, | 397 Handle<String> name, |
390 Handle<Object> value); | 398 Handle<Object> value); |
391 | 399 |
392 // Code generators for stub routines. Only called once at startup. | 400 // Code generators for stub routines. Only called once at startup. |
393 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 401 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
394 static void GenerateMiss(MacroAssembler* masm); | 402 static void GenerateMiss(MacroAssembler* masm); |
395 static void GenerateMegamorphic(MacroAssembler* masm); | 403 static void GenerateMegamorphic(MacroAssembler* masm); |
396 static void GenerateArrayLength(MacroAssembler* masm); | 404 static void GenerateArrayLength(MacroAssembler* masm); |
397 static void GenerateNormal(MacroAssembler* masm); | 405 static void GenerateNormal(MacroAssembler* masm); |
398 | 406 |
399 // Clear the use of an inlined version. | 407 // Clear the use of an inlined version. |
400 static void ClearInlinedVersion(Address address); | 408 static void ClearInlinedVersion(Address address); |
(...skipping 25 matching lines...) Expand all Loading... |
426 static bool PatchInlinedStore(Address address, Object* map, int index); | 434 static bool PatchInlinedStore(Address address, Object* map, int index); |
427 | 435 |
428 friend class IC; | 436 friend class IC; |
429 }; | 437 }; |
430 | 438 |
431 | 439 |
432 class KeyedStoreIC: public IC { | 440 class KeyedStoreIC: public IC { |
433 public: | 441 public: |
434 KeyedStoreIC() : IC(NO_EXTRA_FRAME) { } | 442 KeyedStoreIC() : IC(NO_EXTRA_FRAME) { } |
435 | 443 |
436 Object* Store(State state, | 444 MUST_USE_RESULT MaybeObject* Store(State state, |
437 Handle<Object> object, | 445 Handle<Object> object, |
438 Handle<Object> name, | 446 Handle<Object> name, |
439 Handle<Object> value); | 447 Handle<Object> value); |
440 | 448 |
441 // Code generators for stub routines. Only called once at startup. | 449 // Code generators for stub routines. Only called once at startup. |
442 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 450 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
443 static void GenerateMiss(MacroAssembler* masm); | 451 static void GenerateMiss(MacroAssembler* masm); |
444 static void GenerateRuntimeSetProperty(MacroAssembler* masm); | 452 static void GenerateRuntimeSetProperty(MacroAssembler* masm); |
445 static void GenerateGeneric(MacroAssembler* masm); | 453 static void GenerateGeneric(MacroAssembler* masm); |
446 | 454 |
447 // Generators for external array types. See objects.h. | 455 // Generators for external array types. See objects.h. |
448 // These are similar to the generic IC; they optimize the case of | 456 // These are similar to the generic IC; they optimize the case of |
449 // operating upon external array types but fall back to the runtime | 457 // operating upon external array types but fall back to the runtime |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 static const char* GetName(TypeInfo type_info); | 519 static const char* GetName(TypeInfo type_info); |
512 | 520 |
513 static State ToState(TypeInfo type_info); | 521 static State ToState(TypeInfo type_info); |
514 | 522 |
515 static TypeInfo GetTypeInfo(Object* left, Object* right); | 523 static TypeInfo GetTypeInfo(Object* left, Object* right); |
516 }; | 524 }; |
517 | 525 |
518 } } // namespace v8::internal | 526 } } // namespace v8::internal |
519 | 527 |
520 #endif // V8_IC_H_ | 528 #endif // V8_IC_H_ |
OLD | NEW |