OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void RecordCodeGeneration(Code* code, MacroAssembler* masm); | 130 void RecordCodeGeneration(Code* code, MacroAssembler* masm); |
131 | 131 |
132 // Returns information for computing the number key. | 132 // Returns information for computing the number key. |
133 virtual Major MajorKey() = 0; | 133 virtual Major MajorKey() = 0; |
134 virtual int MinorKey() = 0; | 134 virtual int MinorKey() = 0; |
135 | 135 |
136 // The CallFunctionStub needs to override this so it can encode whether a | 136 // The CallFunctionStub needs to override this so it can encode whether a |
137 // lazily generated function should be fully optimized or not. | 137 // lazily generated function should be fully optimized or not. |
138 virtual InLoopFlag InLoop() { return NOT_IN_LOOP; } | 138 virtual InLoopFlag InLoop() { return NOT_IN_LOOP; } |
139 | 139 |
| 140 // GenericBinaryOpStub needs to override this. |
| 141 virtual int GetCodeKind(); |
| 142 |
| 143 // GenericBinaryOpStub needs to override this. |
| 144 virtual int GetICState(); |
| 145 |
140 // Returns a name for logging/debugging purposes. | 146 // Returns a name for logging/debugging purposes. |
141 virtual const char* GetName() { return MajorName(MajorKey()); } | 147 virtual const char* GetName() { return MajorName(MajorKey()); } |
142 | 148 |
143 #ifdef DEBUG | 149 #ifdef DEBUG |
144 virtual void Print() { PrintF("%s\n", GetName()); } | 150 virtual void Print() { PrintF("%s\n", GetName()); } |
145 #endif | 151 #endif |
146 | 152 |
147 // Computes the key based on major and minor. | 153 // Computes the key based on major and minor. |
148 uint32_t GetKey() { | 154 uint32_t GetKey() { |
149 ASSERT(static_cast<int>(MajorKey()) < NUMBER_OF_IDS); | 155 ASSERT(static_cast<int>(MajorKey()) < NUMBER_OF_IDS); |
150 return MinorKeyBits::encode(MinorKey()) | | 156 return MinorKeyBits::encode(MinorKey()) | |
151 MajorKeyBits::encode(MajorKey()); | 157 MajorKeyBits::encode(MajorKey()); |
152 } | 158 } |
153 | 159 |
154 bool AllowsStubCalls() { return MajorKey() <= RecordWrite; } | 160 bool AllowsStubCalls() { return MajorKey() <= RecordWrite; } |
155 | 161 |
156 class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {}; | 162 class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {}; |
157 class MinorKeyBits: public BitField<uint32_t, kMajorBits, kMinorBits> {}; | 163 class MinorKeyBits: public BitField<uint32_t, kMajorBits, kMinorBits> {}; |
158 | 164 |
159 friend class BreakPointIterator; | 165 friend class BreakPointIterator; |
160 }; | 166 }; |
161 | 167 |
162 } } // namespace v8::internal | 168 } } // namespace v8::internal |
163 | 169 |
164 #endif // V8_CODE_STUBS_H_ | 170 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |