| 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 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2245 // [sinfo_size]: Size of scope information. | 2245 // [sinfo_size]: Size of scope information. |
| 2246 inline int sinfo_size(); | 2246 inline int sinfo_size(); |
| 2247 inline void set_sinfo_size(int value); | 2247 inline void set_sinfo_size(int value); |
| 2248 | 2248 |
| 2249 // [flags]: Various code flags. | 2249 // [flags]: Various code flags. |
| 2250 inline Flags flags(); | 2250 inline Flags flags(); |
| 2251 inline void set_flags(Flags flags); | 2251 inline void set_flags(Flags flags); |
| 2252 | 2252 |
| 2253 // [flags]: Access to specific code flags. | 2253 // [flags]: Access to specific code flags. |
| 2254 inline Kind kind(); | 2254 inline Kind kind(); |
| 2255 inline InlineCacheState ic_state(); // only valid for IC stubs | 2255 inline InlineCacheState ic_state(); // Only valid for IC stubs. |
| 2256 inline PropertyType type(); // only valid for monomorphic IC stubs | 2256 inline InlineCacheInLoop ic_in_loop(); // Only valid for IC stubs.. |
| 2257 inline int arguments_count(); // only valid for call IC stubs | 2257 inline PropertyType type(); // Only valid for monomorphic IC stubs. |
| 2258 inline int arguments_count(); // Only valid for call IC stubs. |
| 2258 | 2259 |
| 2259 // Testers for IC stub kinds. | 2260 // Testers for IC stub kinds. |
| 2260 inline bool is_inline_cache_stub(); | 2261 inline bool is_inline_cache_stub(); |
| 2261 inline bool is_load_stub() { return kind() == LOAD_IC; } | 2262 inline bool is_load_stub() { return kind() == LOAD_IC; } |
| 2262 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 2263 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
| 2263 inline bool is_store_stub() { return kind() == STORE_IC; } | 2264 inline bool is_store_stub() { return kind() == STORE_IC; } |
| 2264 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 2265 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
| 2265 inline bool is_call_stub() { return kind() == CALL_IC; } | 2266 inline bool is_call_stub() { return kind() == CALL_IC; } |
| 2266 | 2267 |
| 2267 // [ic_flag]: State of inline cache targets. The flag is set to the | 2268 // [ic_flag]: State of inline cache targets. The flag is set to the |
| 2268 // object variant in ConvertICTargetsFromAddressToObject, and set to | 2269 // object variant in ConvertICTargetsFromAddressToObject, and set to |
| 2269 // the address variant in ConvertICTargetsFromObjectToAddress. | 2270 // the address variant in ConvertICTargetsFromObjectToAddress. |
| 2270 inline ICTargetState ic_flag(); | 2271 inline ICTargetState ic_flag(); |
| 2271 inline void set_ic_flag(ICTargetState value); | 2272 inline void set_ic_flag(ICTargetState value); |
| 2272 | 2273 |
| 2273 // [major_key]: For kind STUB, the major key. | 2274 // [major_key]: For kind STUB, the major key. |
| 2274 inline CodeStub::Major major_key(); | 2275 inline CodeStub::Major major_key(); |
| 2275 inline void set_major_key(CodeStub::Major major); | 2276 inline void set_major_key(CodeStub::Major major); |
| 2276 | 2277 |
| 2277 // Flags operations. | 2278 // Flags operations. |
| 2278 static inline Flags ComputeFlags(Kind kind, | 2279 static inline Flags ComputeFlags(Kind kind, |
| 2280 InlineCacheInLoop in_loop = NOT_IN_LOOP, |
| 2279 InlineCacheState ic_state = UNINITIALIZED, | 2281 InlineCacheState ic_state = UNINITIALIZED, |
| 2280 PropertyType type = NORMAL, | 2282 PropertyType type = NORMAL, |
| 2281 int argc = -1); | 2283 int argc = -1); |
| 2282 | 2284 |
| 2283 static inline Flags ComputeMonomorphicFlags(Kind kind, | 2285 static inline Flags ComputeMonomorphicFlags( |
| 2284 PropertyType type, | 2286 Kind kind, |
| 2285 int argc = -1); | 2287 PropertyType type, |
| 2288 InlineCacheInLoop in_loop = NOT_IN_LOOP, |
| 2289 int argc = -1); |
| 2286 | 2290 |
| 2287 static inline Kind ExtractKindFromFlags(Flags flags); | 2291 static inline Kind ExtractKindFromFlags(Flags flags); |
| 2288 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 2292 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
| 2293 static inline InlineCacheInLoop ExtractICInLoopFromFlags(Flags flags); |
| 2289 static inline PropertyType ExtractTypeFromFlags(Flags flags); | 2294 static inline PropertyType ExtractTypeFromFlags(Flags flags); |
| 2290 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 2295 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
| 2291 static inline Flags RemoveTypeFromFlags(Flags flags); | 2296 static inline Flags RemoveTypeFromFlags(Flags flags); |
| 2292 | 2297 |
| 2293 // Convert a target address into a code object. | 2298 // Convert a target address into a code object. |
| 2294 static inline Code* GetCodeFromTargetAddress(Address address); | 2299 static inline Code* GetCodeFromTargetAddress(Address address); |
| 2295 | 2300 |
| 2296 // Returns the address of the first instruction. | 2301 // Returns the address of the first instruction. |
| 2297 inline byte* instruction_start(); | 2302 inline byte* instruction_start(); |
| 2298 | 2303 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2370 static const int kHeaderSize = | 2375 static const int kHeaderSize = |
| 2371 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & | 2376 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & |
| 2372 ~kCodeAlignmentMask; | 2377 ~kCodeAlignmentMask; |
| 2373 | 2378 |
| 2374 // Byte offsets within kKindSpecificFlagsOffset. | 2379 // Byte offsets within kKindSpecificFlagsOffset. |
| 2375 static const int kICFlagOffset = kKindSpecificFlagsOffset + 0; | 2380 static const int kICFlagOffset = kKindSpecificFlagsOffset + 0; |
| 2376 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; | 2381 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; |
| 2377 | 2382 |
| 2378 // Flags layout. | 2383 // Flags layout. |
| 2379 static const int kFlagsICStateShift = 0; | 2384 static const int kFlagsICStateShift = 0; |
| 2380 static const int kFlagsKindShift = 3; | 2385 static const int kFlagsICInLoopShift = 3; |
| 2381 static const int kFlagsTypeShift = 6; | 2386 static const int kFlagsKindShift = 4; |
| 2382 static const int kFlagsArgumentsCountShift = 9; | 2387 static const int kFlagsTypeShift = 7; |
| 2388 static const int kFlagsArgumentsCountShift = 10; |
| 2383 | 2389 |
| 2384 static const int kFlagsICStateMask = 0x00000007; // 000000111 | 2390 static const int kFlagsICStateMask = 0x00000007; // 0000000111 |
| 2385 static const int kFlagsKindMask = 0x00000038; // 000111000 | 2391 static const int kFlagsICInLoopMask = 0x00000008; // 0000001000 |
| 2386 static const int kFlagsTypeMask = 0x000001C0; // 111000000 | 2392 static const int kFlagsKindMask = 0x00000070; // 0001110000 |
| 2387 static const int kFlagsArgumentsCountMask = 0xFFFFFE00; | 2393 static const int kFlagsTypeMask = 0x00000380; // 1110000000 |
| 2394 static const int kFlagsArgumentsCountMask = 0xFFFFFC00; |
| 2388 | 2395 |
| 2389 private: | 2396 private: |
| 2390 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 2397 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
| 2391 }; | 2398 }; |
| 2392 | 2399 |
| 2393 | 2400 |
| 2394 // All heap objects have a Map that describes their structure. | 2401 // All heap objects have a Map that describes their structure. |
| 2395 // A Map contains information about: | 2402 // A Map contains information about: |
| 2396 // - Size information about the object | 2403 // - Size information about the object |
| 2397 // - How to iterate over an object (for garbage collection) | 2404 // - How to iterate over an object (for garbage collection) |
| (...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4397 } else { | 4404 } else { |
| 4398 value &= ~(1 << bit_position); | 4405 value &= ~(1 << bit_position); |
| 4399 } | 4406 } |
| 4400 return value; | 4407 return value; |
| 4401 } | 4408 } |
| 4402 }; | 4409 }; |
| 4403 | 4410 |
| 4404 } } // namespace v8::internal | 4411 } } // namespace v8::internal |
| 4405 | 4412 |
| 4406 #endif // V8_OBJECTS_H_ | 4413 #endif // V8_OBJECTS_H_ |
| OLD | NEW |