| 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 3145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3156 // Pseudo-kinds. | 3156 // Pseudo-kinds. |
| 3157 REGEXP = BUILTIN, | 3157 REGEXP = BUILTIN, |
| 3158 FIRST_IC_KIND = LOAD_IC, | 3158 FIRST_IC_KIND = LOAD_IC, |
| 3159 LAST_IC_KIND = COMPARE_IC | 3159 LAST_IC_KIND = COMPARE_IC |
| 3160 }; | 3160 }; |
| 3161 | 3161 |
| 3162 enum { | 3162 enum { |
| 3163 NUMBER_OF_KINDS = LAST_IC_KIND + 1 | 3163 NUMBER_OF_KINDS = LAST_IC_KIND + 1 |
| 3164 }; | 3164 }; |
| 3165 | 3165 |
| 3166 typedef int ExtraICState; |
| 3167 |
| 3168 static const ExtraICState kNoExtraICState = 0; |
| 3169 |
| 3166 #ifdef ENABLE_DISASSEMBLER | 3170 #ifdef ENABLE_DISASSEMBLER |
| 3167 // Printing | 3171 // Printing |
| 3168 static const char* Kind2String(Kind kind); | 3172 static const char* Kind2String(Kind kind); |
| 3169 static const char* ICState2String(InlineCacheState state); | 3173 static const char* ICState2String(InlineCacheState state); |
| 3170 static const char* PropertyType2String(PropertyType type); | 3174 static const char* PropertyType2String(PropertyType type); |
| 3171 inline void Disassemble(const char* name) { | 3175 inline void Disassemble(const char* name) { |
| 3172 Disassemble(name, stdout); | 3176 Disassemble(name, stdout); |
| 3173 } | 3177 } |
| 3174 void Disassemble(const char* name, FILE* out); | 3178 void Disassemble(const char* name, FILE* out); |
| 3175 #endif // ENABLE_DISASSEMBLER | 3179 #endif // ENABLE_DISASSEMBLER |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 SafepointEntry GetSafepointEntry(Address pc); | 3279 SafepointEntry GetSafepointEntry(Address pc); |
| 3276 | 3280 |
| 3277 // Mark this code object as not having a stack check table. Assumes kind | 3281 // Mark this code object as not having a stack check table. Assumes kind |
| 3278 // is FUNCTION. | 3282 // is FUNCTION. |
| 3279 void SetNoStackCheckTable(); | 3283 void SetNoStackCheckTable(); |
| 3280 | 3284 |
| 3281 // Find the first map in an IC stub. | 3285 // Find the first map in an IC stub. |
| 3282 Map* FindFirstMap(); | 3286 Map* FindFirstMap(); |
| 3283 | 3287 |
| 3284 // Flags operations. | 3288 // Flags operations. |
| 3285 static inline Flags ComputeFlags(Kind kind, | 3289 static inline Flags ComputeFlags( |
| 3286 InLoopFlag in_loop = NOT_IN_LOOP, | 3290 Kind kind, |
| 3287 InlineCacheState ic_state = UNINITIALIZED, | 3291 InLoopFlag in_loop = NOT_IN_LOOP, |
| 3288 PropertyType type = NORMAL, | 3292 InlineCacheState ic_state = UNINITIALIZED, |
| 3289 int argc = -1, | 3293 ExtraICState extra_ic_state = kNoExtraICState, |
| 3290 InlineCacheHolderFlag holder = OWN_MAP); | 3294 PropertyType type = NORMAL, |
| 3295 int argc = -1, |
| 3296 InlineCacheHolderFlag holder = OWN_MAP); |
| 3291 | 3297 |
| 3292 static inline Flags ComputeMonomorphicFlags( | 3298 static inline Flags ComputeMonomorphicFlags( |
| 3293 Kind kind, | 3299 Kind kind, |
| 3294 PropertyType type, | 3300 PropertyType type, |
| 3301 ExtraICState extra_ic_state = kNoExtraICState, |
| 3295 InlineCacheHolderFlag holder = OWN_MAP, | 3302 InlineCacheHolderFlag holder = OWN_MAP, |
| 3296 InLoopFlag in_loop = NOT_IN_LOOP, | 3303 InLoopFlag in_loop = NOT_IN_LOOP, |
| 3297 int argc = -1); | 3304 int argc = -1); |
| 3298 | 3305 |
| 3299 static inline Kind ExtractKindFromFlags(Flags flags); | 3306 static inline Kind ExtractKindFromFlags(Flags flags); |
| 3300 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 3307 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
| 3308 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); |
| 3301 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); | 3309 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); |
| 3302 static inline PropertyType ExtractTypeFromFlags(Flags flags); | 3310 static inline PropertyType ExtractTypeFromFlags(Flags flags); |
| 3303 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 3311 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
| 3304 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 3312 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
| 3305 static inline Flags RemoveTypeFromFlags(Flags flags); | 3313 static inline Flags RemoveTypeFromFlags(Flags flags); |
| 3306 | 3314 |
| 3307 // Convert a target address into a code object. | 3315 // Convert a target address into a code object. |
| 3308 static inline Code* GetCodeFromTargetAddress(Address address); | 3316 static inline Code* GetCodeFromTargetAddress(Address address); |
| 3309 | 3317 |
| 3310 // Convert an entry address into an object. | 3318 // Convert an entry address into an object. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3411 | 3419 |
| 3412 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; | 3420 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; |
| 3413 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; | 3421 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; |
| 3414 | 3422 |
| 3415 // Flags layout. | 3423 // Flags layout. |
| 3416 static const int kFlagsICStateShift = 0; | 3424 static const int kFlagsICStateShift = 0; |
| 3417 static const int kFlagsICInLoopShift = 3; | 3425 static const int kFlagsICInLoopShift = 3; |
| 3418 static const int kFlagsTypeShift = 4; | 3426 static const int kFlagsTypeShift = 4; |
| 3419 static const int kFlagsKindShift = 7; | 3427 static const int kFlagsKindShift = 7; |
| 3420 static const int kFlagsICHolderShift = 11; | 3428 static const int kFlagsICHolderShift = 11; |
| 3421 static const int kFlagsArgumentsCountShift = 12; | 3429 static const int kFlagsExtraICStateShift = 12; |
| 3430 static const int kFlagsArgumentsCountShift = 14; |
| 3422 | 3431 |
| 3423 static const int kFlagsICStateMask = 0x00000007; // 00000000111 | 3432 static const int kFlagsICStateMask = 0x00000007; // 00000000111 |
| 3424 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 | 3433 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 |
| 3425 static const int kFlagsTypeMask = 0x00000070; // 00001110000 | 3434 static const int kFlagsTypeMask = 0x00000070; // 00001110000 |
| 3426 static const int kFlagsKindMask = 0x00000780; // 11110000000 | 3435 static const int kFlagsKindMask = 0x00000780; // 11110000000 |
| 3427 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; | 3436 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; |
| 3428 static const int kFlagsArgumentsCountMask = 0xFFFFF000; | 3437 static const int kFlagsExtraICStateMask = 0x00003000; |
| 3438 static const int kFlagsArgumentsCountMask = 0xFFFFC000; |
| 3429 | 3439 |
| 3430 static const int kFlagsNotUsedInLookup = | 3440 static const int kFlagsNotUsedInLookup = |
| 3431 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); | 3441 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); |
| 3432 | 3442 |
| 3433 private: | 3443 private: |
| 3434 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 3444 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
| 3435 }; | 3445 }; |
| 3436 | 3446 |
| 3437 | 3447 |
| 3438 // All heap objects have a Map that describes their structure. | 3448 // All heap objects have a Map that describes their structure. |
| (...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6393 } else { | 6403 } else { |
| 6394 value &= ~(1 << bit_position); | 6404 value &= ~(1 << bit_position); |
| 6395 } | 6405 } |
| 6396 return value; | 6406 return value; |
| 6397 } | 6407 } |
| 6398 }; | 6408 }; |
| 6399 | 6409 |
| 6400 } } // namespace v8::internal | 6410 } } // namespace v8::internal |
| 6401 | 6411 |
| 6402 #endif // V8_OBJECTS_H_ | 6412 #endif // V8_OBJECTS_H_ |
| OLD | NEW |