Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: src/objects.h

Issue 551093: Implementing inline caches for GenericBinaryOpStub. ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/ic.cc ('K') | « src/log.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after
2598 2598
2599 enum Kind { 2599 enum Kind {
2600 FUNCTION, 2600 FUNCTION,
2601 STUB, 2601 STUB,
2602 BUILTIN, 2602 BUILTIN,
2603 LOAD_IC, 2603 LOAD_IC,
2604 KEYED_LOAD_IC, 2604 KEYED_LOAD_IC,
2605 CALL_IC, 2605 CALL_IC,
2606 STORE_IC, 2606 STORE_IC,
2607 KEYED_STORE_IC, 2607 KEYED_STORE_IC,
2608 // No more than eight kinds. The value currently encoded in three bits in 2608 BINARY_OP_IC,
2609 // No more than 16 kinds. The value currently encoded in four bits in
2609 // Flags. 2610 // Flags.
2610 2611
2611 // Pseudo-kinds. 2612 // Pseudo-kinds.
2612 REGEXP = BUILTIN, 2613 REGEXP = BUILTIN,
2613 FIRST_IC_KIND = LOAD_IC, 2614 FIRST_IC_KIND = LOAD_IC,
2614 LAST_IC_KIND = KEYED_STORE_IC 2615 LAST_IC_KIND = BINARY_OP_IC
2615 }; 2616 };
2616 2617
2617 enum { 2618 enum {
2618 NUMBER_OF_KINDS = KEYED_STORE_IC + 1 2619 NUMBER_OF_KINDS = KEYED_STORE_IC + 1
2619 }; 2620 };
2620 2621
2621 #ifdef ENABLE_DISASSEMBLER 2622 #ifdef ENABLE_DISASSEMBLER
2622 // Printing 2623 // Printing
2623 static const char* Kind2String(Kind kind); 2624 static const char* Kind2String(Kind kind);
2624 static const char* ICState2String(InlineCacheState state); 2625 static const char* ICState2String(InlineCacheState state);
(...skipping 25 matching lines...) Expand all
2650 inline int arguments_count(); // Only valid for call IC stubs. 2651 inline int arguments_count(); // Only valid for call IC stubs.
2651 2652
2652 // Testers for IC stub kinds. 2653 // Testers for IC stub kinds.
2653 inline bool is_inline_cache_stub(); 2654 inline bool is_inline_cache_stub();
2654 inline bool is_load_stub() { return kind() == LOAD_IC; } 2655 inline bool is_load_stub() { return kind() == LOAD_IC; }
2655 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } 2656 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; }
2656 inline bool is_store_stub() { return kind() == STORE_IC; } 2657 inline bool is_store_stub() { return kind() == STORE_IC; }
2657 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } 2658 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; }
2658 inline bool is_call_stub() { return kind() == CALL_IC; } 2659 inline bool is_call_stub() { return kind() == CALL_IC; }
2659 2660
2660 // [major_key]: For kind STUB, the major key. 2661 // [major_key]: For kind STUB or BINARY_OP_IC, the major key.
2661 inline CodeStub::Major major_key(); 2662 inline CodeStub::Major major_key();
2662 inline void set_major_key(CodeStub::Major major); 2663 inline void set_major_key(CodeStub::Major major);
2663 2664
2664 // Flags operations. 2665 // Flags operations.
2665 static inline Flags ComputeFlags(Kind kind, 2666 static inline Flags ComputeFlags(Kind kind,
2666 InLoopFlag in_loop = NOT_IN_LOOP, 2667 InLoopFlag in_loop = NOT_IN_LOOP,
2667 InlineCacheState ic_state = UNINITIALIZED, 2668 InlineCacheState ic_state = UNINITIALIZED,
2668 PropertyType type = NORMAL, 2669 PropertyType type = NORMAL,
2669 int argc = -1); 2670 int argc = -1);
2670 2671
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & 2758 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) &
2758 ~kCodeAlignmentMask; 2759 ~kCodeAlignmentMask;
2759 2760
2760 // Byte offsets within kKindSpecificFlagsOffset. 2761 // Byte offsets within kKindSpecificFlagsOffset.
2761 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; 2762 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1;
2762 2763
2763 // Flags layout. 2764 // Flags layout.
2764 static const int kFlagsICStateShift = 0; 2765 static const int kFlagsICStateShift = 0;
2765 static const int kFlagsICInLoopShift = 3; 2766 static const int kFlagsICInLoopShift = 3;
2766 static const int kFlagsKindShift = 4; 2767 static const int kFlagsKindShift = 4;
2767 static const int kFlagsTypeShift = 7; 2768 static const int kFlagsTypeShift = 8;
2768 static const int kFlagsArgumentsCountShift = 10; 2769 static const int kFlagsArgumentsCountShift = 11;
2769 2770
2770 static const int kFlagsICStateMask = 0x00000007; // 0000000111 2771 static const int kFlagsICStateMask = 0x00000007; // 00000000111
2771 static const int kFlagsICInLoopMask = 0x00000008; // 0000001000 2772 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000
2772 static const int kFlagsKindMask = 0x00000070; // 0001110000 2773 static const int kFlagsKindMask = 0x000000F0; // 00011110000
2773 static const int kFlagsTypeMask = 0x00000380; // 1110000000 2774 static const int kFlagsTypeMask = 0x00000700; // 11100000000
2774 static const int kFlagsArgumentsCountMask = 0xFFFFFC00; 2775 static const int kFlagsArgumentsCountMask = 0xFFFFF800;
2775 2776
2776 static const int kFlagsNotUsedInLookup = 2777 static const int kFlagsNotUsedInLookup =
2777 (kFlagsICInLoopMask | kFlagsTypeMask); 2778 (kFlagsICInLoopMask | kFlagsTypeMask);
2778 2779
2779 private: 2780 private:
2780 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); 2781 DISALLOW_IMPLICIT_CONSTRUCTORS(Code);
2781 }; 2782 };
2782 2783
2783 2784
2784 // All heap objects have a Map that describes their structure. 2785 // All heap objects have a Map that describes their structure.
(...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
4951 } else { 4952 } else {
4952 value &= ~(1 << bit_position); 4953 value &= ~(1 << bit_position);
4953 } 4954 }
4954 return value; 4955 return value;
4955 } 4956 }
4956 }; 4957 };
4957 4958
4958 } } // namespace v8::internal 4959 } } // namespace v8::internal
4959 4960
4960 #endif // V8_OBJECTS_H_ 4961 #endif // V8_OBJECTS_H_
OLDNEW
« src/ic.cc ('K') | « src/log.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698