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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 ICU(SharedStoreIC_ExtendStorage) \ | 46 ICU(SharedStoreIC_ExtendStorage) \ |
47 ICU(KeyedStoreIC_Miss) \ | 47 ICU(KeyedStoreIC_Miss) \ |
48 /* Utilities for IC stubs. */ \ | 48 /* Utilities for IC stubs. */ \ |
49 ICU(LoadCallbackProperty) \ | 49 ICU(LoadCallbackProperty) \ |
50 ICU(StoreCallbackProperty) \ | 50 ICU(StoreCallbackProperty) \ |
51 ICU(LoadPropertyWithInterceptorOnly) \ | 51 ICU(LoadPropertyWithInterceptorOnly) \ |
52 ICU(LoadPropertyWithInterceptorForLoad) \ | 52 ICU(LoadPropertyWithInterceptorForLoad) \ |
53 ICU(LoadPropertyWithInterceptorForCall) \ | 53 ICU(LoadPropertyWithInterceptorForCall) \ |
54 ICU(KeyedLoadPropertyWithInterceptor) \ | 54 ICU(KeyedLoadPropertyWithInterceptor) \ |
55 ICU(StoreInterceptorProperty) \ | 55 ICU(StoreInterceptorProperty) \ |
56 ICU(BinaryOp_Patch) \ | |
57 ICU(TypeRecordingBinaryOp_Patch) \ | 56 ICU(TypeRecordingBinaryOp_Patch) \ |
58 ICU(CompareIC_Miss) | 57 ICU(CompareIC_Miss) |
59 // | 58 // |
60 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, | 59 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, |
61 // and KeyedStoreIC. | 60 // and KeyedStoreIC. |
62 // | 61 // |
63 class IC { | 62 class IC { |
64 public: | 63 public: |
65 | 64 |
66 // The ids for utility called from the generated code. | 65 // The ids for utility called from the generated code. |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 // The address is the patch point for the IC call | 569 // The address is the patch point for the IC call |
571 // (Assembler::kCallTargetAddressOffset before the end of | 570 // (Assembler::kCallTargetAddressOffset before the end of |
572 // the call/return address). | 571 // the call/return address). |
573 // The map is the new map that the inlined code should check against. | 572 // The map is the new map that the inlined code should check against. |
574 static bool PatchInlinedStore(Address address, Object* map); | 573 static bool PatchInlinedStore(Address address, Object* map); |
575 | 574 |
576 friend class IC; | 575 friend class IC; |
577 }; | 576 }; |
578 | 577 |
579 | 578 |
580 class BinaryOpIC: public IC { | |
581 public: | |
582 | |
583 enum TypeInfo { | |
584 UNINIT_OR_SMI, | |
585 DEFAULT, // Initial state. When first executed, patches to one | |
586 // of the following states depending on the operands types. | |
587 HEAP_NUMBERS, // Both arguments are HeapNumbers. | |
588 STRINGS, // At least one of the arguments is String. | |
589 GENERIC // Non-specialized case (processes any type combination). | |
590 }; | |
591 | |
592 explicit BinaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { } | |
593 | |
594 void patch(Code* code); | |
595 | |
596 static const char* GetName(TypeInfo type_info); | |
597 | |
598 static State ToState(TypeInfo type_info); | |
599 | |
600 static TypeInfo GetTypeInfo(Object* left, Object* right); | |
601 }; | |
602 | |
603 | |
604 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. | 579 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. |
605 class TRBinaryOpIC: public IC { | 580 class TRBinaryOpIC: public IC { |
606 public: | 581 public: |
607 | 582 |
608 enum TypeInfo { | 583 enum TypeInfo { |
609 UNINITIALIZED, | 584 UNINITIALIZED, |
610 SMI, | 585 SMI, |
611 INT32, | 586 INT32, |
612 HEAP_NUMBER, | 587 HEAP_NUMBER, |
613 ODDBALL, | 588 ODDBALL, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 | 641 |
667 Token::Value op_; | 642 Token::Value op_; |
668 }; | 643 }; |
669 | 644 |
670 // Helper for TRBinaryOpIC and CompareIC. | 645 // Helper for TRBinaryOpIC and CompareIC. |
671 void PatchInlinedSmiCode(Address address); | 646 void PatchInlinedSmiCode(Address address); |
672 | 647 |
673 } } // namespace v8::internal | 648 } } // namespace v8::internal |
674 | 649 |
675 #endif // V8_IC_H_ | 650 #endif // V8_IC_H_ |
OLD | NEW |