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 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 | 2608 |
2609 enum Kind { | 2609 enum Kind { |
2610 FUNCTION, | 2610 FUNCTION, |
2611 STUB, | 2611 STUB, |
2612 BUILTIN, | 2612 BUILTIN, |
2613 LOAD_IC, | 2613 LOAD_IC, |
2614 KEYED_LOAD_IC, | 2614 KEYED_LOAD_IC, |
2615 CALL_IC, | 2615 CALL_IC, |
2616 STORE_IC, | 2616 STORE_IC, |
2617 KEYED_STORE_IC, | 2617 KEYED_STORE_IC, |
2618 // No more than eight kinds. The value currently encoded in three bits in | 2618 BINARY_OP_IC, |
| 2619 // No more than 16 kinds. The value currently encoded in four bits in |
2619 // Flags. | 2620 // Flags. |
2620 | 2621 |
2621 // Pseudo-kinds. | 2622 // Pseudo-kinds. |
2622 REGEXP = BUILTIN, | 2623 REGEXP = BUILTIN, |
2623 FIRST_IC_KIND = LOAD_IC, | 2624 FIRST_IC_KIND = LOAD_IC, |
2624 LAST_IC_KIND = KEYED_STORE_IC | 2625 LAST_IC_KIND = BINARY_OP_IC |
2625 }; | 2626 }; |
2626 | 2627 |
2627 enum { | 2628 enum { |
2628 NUMBER_OF_KINDS = KEYED_STORE_IC + 1 | 2629 NUMBER_OF_KINDS = KEYED_STORE_IC + 1 |
2629 }; | 2630 }; |
2630 | 2631 |
2631 #ifdef ENABLE_DISASSEMBLER | 2632 #ifdef ENABLE_DISASSEMBLER |
2632 // Printing | 2633 // Printing |
2633 static const char* Kind2String(Kind kind); | 2634 static const char* Kind2String(Kind kind); |
2634 static const char* ICState2String(InlineCacheState state); | 2635 static const char* ICState2String(InlineCacheState state); |
(...skipping 25 matching lines...) Expand all Loading... |
2660 inline int arguments_count(); // Only valid for call IC stubs. | 2661 inline int arguments_count(); // Only valid for call IC stubs. |
2661 | 2662 |
2662 // Testers for IC stub kinds. | 2663 // Testers for IC stub kinds. |
2663 inline bool is_inline_cache_stub(); | 2664 inline bool is_inline_cache_stub(); |
2664 inline bool is_load_stub() { return kind() == LOAD_IC; } | 2665 inline bool is_load_stub() { return kind() == LOAD_IC; } |
2665 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 2666 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
2666 inline bool is_store_stub() { return kind() == STORE_IC; } | 2667 inline bool is_store_stub() { return kind() == STORE_IC; } |
2667 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 2668 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
2668 inline bool is_call_stub() { return kind() == CALL_IC; } | 2669 inline bool is_call_stub() { return kind() == CALL_IC; } |
2669 | 2670 |
2670 // [major_key]: For kind STUB, the major key. | 2671 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. |
2671 inline CodeStub::Major major_key(); | 2672 inline CodeStub::Major major_key(); |
2672 inline void set_major_key(CodeStub::Major major); | 2673 inline void set_major_key(CodeStub::Major major); |
2673 | 2674 |
2674 // Flags operations. | 2675 // Flags operations. |
2675 static inline Flags ComputeFlags(Kind kind, | 2676 static inline Flags ComputeFlags(Kind kind, |
2676 InLoopFlag in_loop = NOT_IN_LOOP, | 2677 InLoopFlag in_loop = NOT_IN_LOOP, |
2677 InlineCacheState ic_state = UNINITIALIZED, | 2678 InlineCacheState ic_state = UNINITIALIZED, |
2678 PropertyType type = NORMAL, | 2679 PropertyType type = NORMAL, |
2679 int argc = -1); | 2680 int argc = -1); |
2680 | 2681 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2767 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & | 2768 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & |
2768 ~kCodeAlignmentMask; | 2769 ~kCodeAlignmentMask; |
2769 | 2770 |
2770 // Byte offsets within kKindSpecificFlagsOffset. | 2771 // Byte offsets within kKindSpecificFlagsOffset. |
2771 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; | 2772 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; |
2772 | 2773 |
2773 // Flags layout. | 2774 // Flags layout. |
2774 static const int kFlagsICStateShift = 0; | 2775 static const int kFlagsICStateShift = 0; |
2775 static const int kFlagsICInLoopShift = 3; | 2776 static const int kFlagsICInLoopShift = 3; |
2776 static const int kFlagsKindShift = 4; | 2777 static const int kFlagsKindShift = 4; |
2777 static const int kFlagsTypeShift = 7; | 2778 static const int kFlagsTypeShift = 8; |
2778 static const int kFlagsArgumentsCountShift = 10; | 2779 static const int kFlagsArgumentsCountShift = 11; |
2779 | 2780 |
2780 static const int kFlagsICStateMask = 0x00000007; // 0000000111 | 2781 static const int kFlagsICStateMask = 0x00000007; // 00000000111 |
2781 static const int kFlagsICInLoopMask = 0x00000008; // 0000001000 | 2782 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 |
2782 static const int kFlagsKindMask = 0x00000070; // 0001110000 | 2783 static const int kFlagsKindMask = 0x000000F0; // 00011110000 |
2783 static const int kFlagsTypeMask = 0x00000380; // 1110000000 | 2784 static const int kFlagsTypeMask = 0x00000700; // 11100000000 |
2784 static const int kFlagsArgumentsCountMask = 0xFFFFFC00; | 2785 static const int kFlagsArgumentsCountMask = 0xFFFFF800; |
2785 | 2786 |
2786 static const int kFlagsNotUsedInLookup = | 2787 static const int kFlagsNotUsedInLookup = |
2787 (kFlagsICInLoopMask | kFlagsTypeMask); | 2788 (kFlagsICInLoopMask | kFlagsTypeMask); |
2788 | 2789 |
2789 private: | 2790 private: |
2790 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 2791 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
2791 }; | 2792 }; |
2792 | 2793 |
2793 | 2794 |
2794 // All heap objects have a Map that describes their structure. | 2795 // All heap objects have a Map that describes their structure. |
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4976 } else { | 4977 } else { |
4977 value &= ~(1 << bit_position); | 4978 value &= ~(1 << bit_position); |
4978 } | 4979 } |
4979 return value; | 4980 return value; |
4980 } | 4981 } |
4981 }; | 4982 }; |
4982 | 4983 |
4983 } } // namespace v8::internal | 4984 } } // namespace v8::internal |
4984 | 4985 |
4985 #endif // V8_OBJECTS_H_ | 4986 #endif // V8_OBJECTS_H_ |
OLD | NEW |