OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4171 public: | 4171 public: |
4172 // Opaque data type for encapsulating code flags like kind, inline | 4172 // Opaque data type for encapsulating code flags like kind, inline |
4173 // cache state, and arguments count. | 4173 // cache state, and arguments count. |
4174 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that | 4174 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that |
4175 // enumeration type has correct value range (see Issue 830 for more details). | 4175 // enumeration type has correct value range (see Issue 830 for more details). |
4176 enum Flags { | 4176 enum Flags { |
4177 FLAGS_MIN_VALUE = kMinInt, | 4177 FLAGS_MIN_VALUE = kMinInt, |
4178 FLAGS_MAX_VALUE = kMaxInt | 4178 FLAGS_MAX_VALUE = kMaxInt |
4179 }; | 4179 }; |
4180 | 4180 |
| 4181 #define CODE_KIND_LIST(V) \ |
| 4182 V(FUNCTION) \ |
| 4183 V(OPTIMIZED_FUNCTION) \ |
| 4184 V(STUB) \ |
| 4185 V(BUILTIN) \ |
| 4186 V(LOAD_IC) \ |
| 4187 V(KEYED_LOAD_IC) \ |
| 4188 V(CALL_IC) \ |
| 4189 V(KEYED_CALL_IC) \ |
| 4190 V(STORE_IC) \ |
| 4191 V(KEYED_STORE_IC) \ |
| 4192 V(UNARY_OP_IC) \ |
| 4193 V(BINARY_OP_IC) \ |
| 4194 V(COMPARE_IC) \ |
| 4195 V(TO_BOOLEAN_IC) |
| 4196 |
4181 enum Kind { | 4197 enum Kind { |
4182 FUNCTION, | 4198 #define DEFINE_CODE_KIND_ENUM(name) name, |
4183 OPTIMIZED_FUNCTION, | 4199 CODE_KIND_LIST(DEFINE_CODE_KIND_ENUM) |
4184 STUB, | 4200 #undef DEFINE_CODE_KIND_ENUM |
4185 BUILTIN, | |
4186 LOAD_IC, | |
4187 KEYED_LOAD_IC, | |
4188 CALL_IC, | |
4189 KEYED_CALL_IC, | |
4190 STORE_IC, | |
4191 KEYED_STORE_IC, | |
4192 UNARY_OP_IC, | |
4193 BINARY_OP_IC, | |
4194 COMPARE_IC, | |
4195 TO_BOOLEAN_IC, | |
4196 // No more than 16 kinds. The value currently encoded in four bits in | |
4197 // Flags. | |
4198 | 4201 |
4199 // Pseudo-kinds. | 4202 // Pseudo-kinds. |
| 4203 LAST_CODE_KIND = TO_BOOLEAN_IC, |
4200 REGEXP = BUILTIN, | 4204 REGEXP = BUILTIN, |
4201 FIRST_IC_KIND = LOAD_IC, | 4205 FIRST_IC_KIND = LOAD_IC, |
4202 LAST_IC_KIND = TO_BOOLEAN_IC | 4206 LAST_IC_KIND = TO_BOOLEAN_IC |
4203 }; | 4207 }; |
4204 | 4208 |
| 4209 // No more than 16 kinds. The value is currently encoded in four bits in |
| 4210 // Flags. |
| 4211 STATIC_ASSERT(LAST_CODE_KIND < 16); |
| 4212 |
4205 // Types of stubs. | 4213 // Types of stubs. |
4206 enum StubType { | 4214 enum StubType { |
4207 NORMAL, | 4215 NORMAL, |
4208 FIELD, | 4216 FIELD, |
4209 CONSTANT_FUNCTION, | 4217 CONSTANT_FUNCTION, |
4210 CALLBACKS, | 4218 CALLBACKS, |
4211 INTERCEPTOR, | 4219 INTERCEPTOR, |
4212 MAP_TRANSITION, | 4220 MAP_TRANSITION, |
4213 NONEXISTENT | 4221 NONEXISTENT |
4214 }; | 4222 }; |
(...skipping 4662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8877 } else { | 8885 } else { |
8878 value &= ~(1 << bit_position); | 8886 value &= ~(1 << bit_position); |
8879 } | 8887 } |
8880 return value; | 8888 return value; |
8881 } | 8889 } |
8882 }; | 8890 }; |
8883 | 8891 |
8884 } } // namespace v8::internal | 8892 } } // namespace v8::internal |
8885 | 8893 |
8886 #endif // V8_OBJECTS_H_ | 8894 #endif // V8_OBJECTS_H_ |
OLD | NEW |