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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 Handle<String> name, | 384 Handle<String> name, |
385 Handle<Object> value); | 385 Handle<Object> value); |
386 | 386 |
387 // Code generators for stub routines. Only called once at startup. | 387 // Code generators for stub routines. Only called once at startup. |
388 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 388 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
389 static void GenerateMiss(MacroAssembler* masm); | 389 static void GenerateMiss(MacroAssembler* masm); |
390 static void GenerateMegamorphic(MacroAssembler* masm); | 390 static void GenerateMegamorphic(MacroAssembler* masm); |
391 static void GenerateArrayLength(MacroAssembler* masm); | 391 static void GenerateArrayLength(MacroAssembler* masm); |
392 static void GenerateNormal(MacroAssembler* masm); | 392 static void GenerateNormal(MacroAssembler* masm); |
393 | 393 |
| 394 // Clear the use of an inlined version. |
| 395 static void ClearInlinedVersion(Address address); |
| 396 |
| 397 // The offset from the inlined patch site to the start of the |
| 398 // inlined store instruction. |
| 399 static const int kOffsetToStoreInstruction; |
| 400 |
394 private: | 401 private: |
395 // Update the inline cache and the global stub cache based on the | 402 // Update the inline cache and the global stub cache based on the |
396 // lookup result. | 403 // lookup result. |
397 void UpdateCaches(LookupResult* lookup, | 404 void UpdateCaches(LookupResult* lookup, |
398 State state, Handle<JSObject> receiver, | 405 State state, Handle<JSObject> receiver, |
399 Handle<String> name, | 406 Handle<String> name, |
400 Handle<Object> value); | 407 Handle<Object> value); |
401 | 408 |
402 // Stub accessors. | 409 // Stub accessors. |
403 static Code* megamorphic_stub() { | 410 static Code* megamorphic_stub() { |
404 return Builtins::builtin(Builtins::StoreIC_Megamorphic); | 411 return Builtins::builtin(Builtins::StoreIC_Megamorphic); |
405 } | 412 } |
406 static Code* initialize_stub() { | 413 static Code* initialize_stub() { |
407 return Builtins::builtin(Builtins::StoreIC_Initialize); | 414 return Builtins::builtin(Builtins::StoreIC_Initialize); |
408 } | 415 } |
409 | 416 |
410 static void Clear(Address address, Code* target); | 417 static void Clear(Address address, Code* target); |
| 418 |
| 419 // Support for patching the index and the map that is checked in an |
| 420 // inlined version of the named store. |
| 421 static bool PatchInlinedStore(Address address, Object* map, int index); |
| 422 |
411 friend class IC; | 423 friend class IC; |
412 }; | 424 }; |
413 | 425 |
414 | 426 |
415 class KeyedStoreIC: public IC { | 427 class KeyedStoreIC: public IC { |
416 public: | 428 public: |
417 KeyedStoreIC() : IC(NO_EXTRA_FRAME) { } | 429 KeyedStoreIC() : IC(NO_EXTRA_FRAME) { } |
418 | 430 |
419 Object* Store(State state, | 431 Object* Store(State state, |
420 Handle<Object> object, | 432 Handle<Object> object, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 static const char* GetName(TypeInfo type_info); | 506 static const char* GetName(TypeInfo type_info); |
495 | 507 |
496 static State ToState(TypeInfo type_info); | 508 static State ToState(TypeInfo type_info); |
497 | 509 |
498 static TypeInfo GetTypeInfo(Object* left, Object* right); | 510 static TypeInfo GetTypeInfo(Object* left, Object* right); |
499 }; | 511 }; |
500 | 512 |
501 } } // namespace v8::internal | 513 } } // namespace v8::internal |
502 | 514 |
503 #endif // V8_IC_H_ | 515 #endif // V8_IC_H_ |
OLD | NEW |