OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 3150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3161 // Pseudo-kinds. | 3161 // Pseudo-kinds. |
3162 REGEXP = BUILTIN, | 3162 REGEXP = BUILTIN, |
3163 FIRST_IC_KIND = LOAD_IC, | 3163 FIRST_IC_KIND = LOAD_IC, |
3164 LAST_IC_KIND = COMPARE_IC | 3164 LAST_IC_KIND = COMPARE_IC |
3165 }; | 3165 }; |
3166 | 3166 |
3167 enum { | 3167 enum { |
3168 NUMBER_OF_KINDS = LAST_IC_KIND + 1 | 3168 NUMBER_OF_KINDS = LAST_IC_KIND + 1 |
3169 }; | 3169 }; |
3170 | 3170 |
| 3171 typedef int ExtraICState; |
| 3172 |
| 3173 static const ExtraICState kNoExtraICState = 0; |
| 3174 |
3171 #ifdef ENABLE_DISASSEMBLER | 3175 #ifdef ENABLE_DISASSEMBLER |
3172 // Printing | 3176 // Printing |
3173 static const char* Kind2String(Kind kind); | 3177 static const char* Kind2String(Kind kind); |
3174 static const char* ICState2String(InlineCacheState state); | 3178 static const char* ICState2String(InlineCacheState state); |
3175 static const char* PropertyType2String(PropertyType type); | 3179 static const char* PropertyType2String(PropertyType type); |
3176 inline void Disassemble(const char* name) { | 3180 inline void Disassemble(const char* name) { |
3177 Disassemble(name, stdout); | 3181 Disassemble(name, stdout); |
3178 } | 3182 } |
3179 void Disassemble(const char* name, FILE* out); | 3183 void Disassemble(const char* name, FILE* out); |
3180 #endif // ENABLE_DISASSEMBLER | 3184 #endif // ENABLE_DISASSEMBLER |
(...skipping 15 matching lines...) Expand all Loading... |
3196 | 3200 |
3197 inline int relocation_size(); | 3201 inline int relocation_size(); |
3198 | 3202 |
3199 // [flags]: Various code flags. | 3203 // [flags]: Various code flags. |
3200 inline Flags flags(); | 3204 inline Flags flags(); |
3201 inline void set_flags(Flags flags); | 3205 inline void set_flags(Flags flags); |
3202 | 3206 |
3203 // [flags]: Access to specific code flags. | 3207 // [flags]: Access to specific code flags. |
3204 inline Kind kind(); | 3208 inline Kind kind(); |
3205 inline InlineCacheState ic_state(); // Only valid for IC stubs. | 3209 inline InlineCacheState ic_state(); // Only valid for IC stubs. |
| 3210 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. |
3206 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs. | 3211 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs. |
3207 inline PropertyType type(); // Only valid for monomorphic IC stubs. | 3212 inline PropertyType type(); // Only valid for monomorphic IC stubs. |
3208 inline int arguments_count(); // Only valid for call IC stubs. | 3213 inline int arguments_count(); // Only valid for call IC stubs. |
3209 | 3214 |
3210 // Testers for IC stub kinds. | 3215 // Testers for IC stub kinds. |
3211 inline bool is_inline_cache_stub(); | 3216 inline bool is_inline_cache_stub(); |
3212 inline bool is_load_stub() { return kind() == LOAD_IC; } | 3217 inline bool is_load_stub() { return kind() == LOAD_IC; } |
3213 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 3218 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
3214 inline bool is_store_stub() { return kind() == STORE_IC; } | 3219 inline bool is_store_stub() { return kind() == STORE_IC; } |
3215 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 3220 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3280 SafepointEntry GetSafepointEntry(Address pc); | 3285 SafepointEntry GetSafepointEntry(Address pc); |
3281 | 3286 |
3282 // Mark this code object as not having a stack check table. Assumes kind | 3287 // Mark this code object as not having a stack check table. Assumes kind |
3283 // is FUNCTION. | 3288 // is FUNCTION. |
3284 void SetNoStackCheckTable(); | 3289 void SetNoStackCheckTable(); |
3285 | 3290 |
3286 // Find the first map in an IC stub. | 3291 // Find the first map in an IC stub. |
3287 Map* FindFirstMap(); | 3292 Map* FindFirstMap(); |
3288 | 3293 |
3289 // Flags operations. | 3294 // Flags operations. |
3290 static inline Flags ComputeFlags(Kind kind, | 3295 static inline Flags ComputeFlags( |
3291 InLoopFlag in_loop = NOT_IN_LOOP, | 3296 Kind kind, |
3292 InlineCacheState ic_state = UNINITIALIZED, | 3297 InLoopFlag in_loop = NOT_IN_LOOP, |
3293 PropertyType type = NORMAL, | 3298 InlineCacheState ic_state = UNINITIALIZED, |
3294 int argc = -1, | 3299 ExtraICState extra_ic_state = kNoExtraICState, |
3295 InlineCacheHolderFlag holder = OWN_MAP); | 3300 PropertyType type = NORMAL, |
| 3301 int argc = -1, |
| 3302 InlineCacheHolderFlag holder = OWN_MAP); |
3296 | 3303 |
3297 static inline Flags ComputeMonomorphicFlags( | 3304 static inline Flags ComputeMonomorphicFlags( |
3298 Kind kind, | 3305 Kind kind, |
3299 PropertyType type, | 3306 PropertyType type, |
| 3307 ExtraICState extra_ic_state = kNoExtraICState, |
3300 InlineCacheHolderFlag holder = OWN_MAP, | 3308 InlineCacheHolderFlag holder = OWN_MAP, |
3301 InLoopFlag in_loop = NOT_IN_LOOP, | 3309 InLoopFlag in_loop = NOT_IN_LOOP, |
3302 int argc = -1); | 3310 int argc = -1); |
3303 | 3311 |
3304 static inline Kind ExtractKindFromFlags(Flags flags); | 3312 static inline Kind ExtractKindFromFlags(Flags flags); |
3305 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 3313 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
| 3314 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); |
3306 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); | 3315 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); |
3307 static inline PropertyType ExtractTypeFromFlags(Flags flags); | 3316 static inline PropertyType ExtractTypeFromFlags(Flags flags); |
3308 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 3317 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
3309 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 3318 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
3310 static inline Flags RemoveTypeFromFlags(Flags flags); | 3319 static inline Flags RemoveTypeFromFlags(Flags flags); |
3311 | 3320 |
3312 // Convert a target address into a code object. | 3321 // Convert a target address into a code object. |
3313 static inline Code* GetCodeFromTargetAddress(Address address); | 3322 static inline Code* GetCodeFromTargetAddress(Address address); |
3314 | 3323 |
3315 // Convert an entry address into an object. | 3324 // Convert an entry address into an object. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3416 | 3425 |
3417 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; | 3426 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; |
3418 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; | 3427 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; |
3419 | 3428 |
3420 // Flags layout. | 3429 // Flags layout. |
3421 static const int kFlagsICStateShift = 0; | 3430 static const int kFlagsICStateShift = 0; |
3422 static const int kFlagsICInLoopShift = 3; | 3431 static const int kFlagsICInLoopShift = 3; |
3423 static const int kFlagsTypeShift = 4; | 3432 static const int kFlagsTypeShift = 4; |
3424 static const int kFlagsKindShift = 7; | 3433 static const int kFlagsKindShift = 7; |
3425 static const int kFlagsICHolderShift = 11; | 3434 static const int kFlagsICHolderShift = 11; |
3426 static const int kFlagsArgumentsCountShift = 12; | 3435 static const int kFlagsExtraICStateShift = 12; |
| 3436 static const int kFlagsArgumentsCountShift = 14; |
3427 | 3437 |
3428 static const int kFlagsICStateMask = 0x00000007; // 00000000111 | 3438 static const int kFlagsICStateMask = 0x00000007; // 00000000111 |
3429 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 | 3439 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 |
3430 static const int kFlagsTypeMask = 0x00000070; // 00001110000 | 3440 static const int kFlagsTypeMask = 0x00000070; // 00001110000 |
3431 static const int kFlagsKindMask = 0x00000780; // 11110000000 | 3441 static const int kFlagsKindMask = 0x00000780; // 11110000000 |
3432 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; | 3442 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; |
3433 static const int kFlagsArgumentsCountMask = 0xFFFFF000; | 3443 static const int kFlagsExtraICStateMask = 0x00003000; |
| 3444 static const int kFlagsArgumentsCountMask = 0xFFFFC000; |
3434 | 3445 |
3435 static const int kFlagsNotUsedInLookup = | 3446 static const int kFlagsNotUsedInLookup = |
3436 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); | 3447 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); |
3437 | 3448 |
3438 private: | 3449 private: |
3439 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 3450 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
3440 }; | 3451 }; |
3441 | 3452 |
3442 | 3453 |
3443 // All heap objects have a Map that describes their structure. | 3454 // All heap objects have a Map that describes their structure. |
(...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6398 } else { | 6409 } else { |
6399 value &= ~(1 << bit_position); | 6410 value &= ~(1 << bit_position); |
6400 } | 6411 } |
6401 return value; | 6412 return value; |
6402 } | 6413 } |
6403 }; | 6414 }; |
6404 | 6415 |
6405 } } // namespace v8::internal | 6416 } } // namespace v8::internal |
6406 | 6417 |
6407 #endif // V8_OBJECTS_H_ | 6418 #endif // V8_OBJECTS_H_ |
OLD | NEW |