| 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 15 matching lines...) Expand all Loading... |
| 3191 | 3195 |
| 3192 inline int relocation_size(); | 3196 inline int relocation_size(); |
| 3193 | 3197 |
| 3194 // [flags]: Various code flags. | 3198 // [flags]: Various code flags. |
| 3195 inline Flags flags(); | 3199 inline Flags flags(); |
| 3196 inline void set_flags(Flags flags); | 3200 inline void set_flags(Flags flags); |
| 3197 | 3201 |
| 3198 // [flags]: Access to specific code flags. | 3202 // [flags]: Access to specific code flags. |
| 3199 inline Kind kind(); | 3203 inline Kind kind(); |
| 3200 inline InlineCacheState ic_state(); // Only valid for IC stubs. | 3204 inline InlineCacheState ic_state(); // Only valid for IC stubs. |
| 3205 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. |
| 3201 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs. | 3206 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs. |
| 3202 inline PropertyType type(); // Only valid for monomorphic IC stubs. | 3207 inline PropertyType type(); // Only valid for monomorphic IC stubs. |
| 3203 inline int arguments_count(); // Only valid for call IC stubs. | 3208 inline int arguments_count(); // Only valid for call IC stubs. |
| 3204 | 3209 |
| 3205 // Testers for IC stub kinds. | 3210 // Testers for IC stub kinds. |
| 3206 inline bool is_inline_cache_stub(); | 3211 inline bool is_inline_cache_stub(); |
| 3207 inline bool is_load_stub() { return kind() == LOAD_IC; } | 3212 inline bool is_load_stub() { return kind() == LOAD_IC; } |
| 3208 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 3213 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
| 3209 inline bool is_store_stub() { return kind() == STORE_IC; } | 3214 inline bool is_store_stub() { return kind() == STORE_IC; } |
| 3210 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 3215 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 SafepointEntry GetSafepointEntry(Address pc); | 3280 SafepointEntry GetSafepointEntry(Address pc); |
| 3276 | 3281 |
| 3277 // Mark this code object as not having a stack check table. Assumes kind | 3282 // Mark this code object as not having a stack check table. Assumes kind |
| 3278 // is FUNCTION. | 3283 // is FUNCTION. |
| 3279 void SetNoStackCheckTable(); | 3284 void SetNoStackCheckTable(); |
| 3280 | 3285 |
| 3281 // Find the first map in an IC stub. | 3286 // Find the first map in an IC stub. |
| 3282 Map* FindFirstMap(); | 3287 Map* FindFirstMap(); |
| 3283 | 3288 |
| 3284 // Flags operations. | 3289 // Flags operations. |
| 3285 static inline Flags ComputeFlags(Kind kind, | 3290 static inline Flags ComputeFlags( |
| 3286 InLoopFlag in_loop = NOT_IN_LOOP, | 3291 Kind kind, |
| 3287 InlineCacheState ic_state = UNINITIALIZED, | 3292 InLoopFlag in_loop = NOT_IN_LOOP, |
| 3288 PropertyType type = NORMAL, | 3293 InlineCacheState ic_state = UNINITIALIZED, |
| 3289 int argc = -1, | 3294 ExtraICState extra_ic_state = kNoExtraICState, |
| 3290 InlineCacheHolderFlag holder = OWN_MAP); | 3295 PropertyType type = NORMAL, |
| 3296 int argc = -1, |
| 3297 InlineCacheHolderFlag holder = OWN_MAP); |
| 3291 | 3298 |
| 3292 static inline Flags ComputeMonomorphicFlags( | 3299 static inline Flags ComputeMonomorphicFlags( |
| 3293 Kind kind, | 3300 Kind kind, |
| 3294 PropertyType type, | 3301 PropertyType type, |
| 3302 ExtraICState extra_ic_state = kNoExtraICState, |
| 3295 InlineCacheHolderFlag holder = OWN_MAP, | 3303 InlineCacheHolderFlag holder = OWN_MAP, |
| 3296 InLoopFlag in_loop = NOT_IN_LOOP, | 3304 InLoopFlag in_loop = NOT_IN_LOOP, |
| 3297 int argc = -1); | 3305 int argc = -1); |
| 3298 | 3306 |
| 3299 static inline Kind ExtractKindFromFlags(Flags flags); | 3307 static inline Kind ExtractKindFromFlags(Flags flags); |
| 3300 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 3308 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
| 3309 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); |
| 3301 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); | 3310 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); |
| 3302 static inline PropertyType ExtractTypeFromFlags(Flags flags); | 3311 static inline PropertyType ExtractTypeFromFlags(Flags flags); |
| 3303 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 3312 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
| 3304 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 3313 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
| 3305 static inline Flags RemoveTypeFromFlags(Flags flags); | 3314 static inline Flags RemoveTypeFromFlags(Flags flags); |
| 3306 | 3315 |
| 3307 // Convert a target address into a code object. | 3316 // Convert a target address into a code object. |
| 3308 static inline Code* GetCodeFromTargetAddress(Address address); | 3317 static inline Code* GetCodeFromTargetAddress(Address address); |
| 3309 | 3318 |
| 3310 // Convert an entry address into an object. | 3319 // Convert an entry address into an object. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3411 | 3420 |
| 3412 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; | 3421 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; |
| 3413 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; | 3422 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; |
| 3414 | 3423 |
| 3415 // Flags layout. | 3424 // Flags layout. |
| 3416 static const int kFlagsICStateShift = 0; | 3425 static const int kFlagsICStateShift = 0; |
| 3417 static const int kFlagsICInLoopShift = 3; | 3426 static const int kFlagsICInLoopShift = 3; |
| 3418 static const int kFlagsTypeShift = 4; | 3427 static const int kFlagsTypeShift = 4; |
| 3419 static const int kFlagsKindShift = 7; | 3428 static const int kFlagsKindShift = 7; |
| 3420 static const int kFlagsICHolderShift = 11; | 3429 static const int kFlagsICHolderShift = 11; |
| 3421 static const int kFlagsArgumentsCountShift = 12; | 3430 static const int kFlagsExtraICStateShift = 12; |
| 3431 static const int kFlagsArgumentsCountShift = 14; |
| 3422 | 3432 |
| 3423 static const int kFlagsICStateMask = 0x00000007; // 00000000111 | 3433 static const int kFlagsICStateMask = 0x00000007; // 00000000111 |
| 3424 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 | 3434 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 |
| 3425 static const int kFlagsTypeMask = 0x00000070; // 00001110000 | 3435 static const int kFlagsTypeMask = 0x00000070; // 00001110000 |
| 3426 static const int kFlagsKindMask = 0x00000780; // 11110000000 | 3436 static const int kFlagsKindMask = 0x00000780; // 11110000000 |
| 3427 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; | 3437 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; |
| 3428 static const int kFlagsArgumentsCountMask = 0xFFFFF000; | 3438 static const int kFlagsExtraICStateMask = 0x00003000; |
| 3439 static const int kFlagsArgumentsCountMask = 0xFFFFC000; |
| 3429 | 3440 |
| 3430 static const int kFlagsNotUsedInLookup = | 3441 static const int kFlagsNotUsedInLookup = |
| 3431 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); | 3442 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); |
| 3432 | 3443 |
| 3433 private: | 3444 private: |
| 3434 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 3445 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
| 3435 }; | 3446 }; |
| 3436 | 3447 |
| 3437 | 3448 |
| 3438 // All heap objects have a Map that describes their structure. | 3449 // 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 { | 6404 } else { |
| 6394 value &= ~(1 << bit_position); | 6405 value &= ~(1 << bit_position); |
| 6395 } | 6406 } |
| 6396 return value; | 6407 return value; |
| 6397 } | 6408 } |
| 6398 }; | 6409 }; |
| 6399 | 6410 |
| 6400 } } // namespace v8::internal | 6411 } } // namespace v8::internal |
| 6401 | 6412 |
| 6402 #endif // V8_OBJECTS_H_ | 6413 #endif // V8_OBJECTS_H_ |
| OLD | NEW |