OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3002 // Dispatched behavior. | 3002 // Dispatched behavior. |
3003 int CodeSize() { return SizeFor(body_size()); } | 3003 int CodeSize() { return SizeFor(body_size()); } |
3004 inline void CodeIterateBody(ObjectVisitor* v); | 3004 inline void CodeIterateBody(ObjectVisitor* v); |
3005 | 3005 |
3006 template<typename StaticVisitor> | 3006 template<typename StaticVisitor> |
3007 inline void CodeIterateBody(); | 3007 inline void CodeIterateBody(); |
3008 #ifdef DEBUG | 3008 #ifdef DEBUG |
3009 void CodePrint(); | 3009 void CodePrint(); |
3010 void CodeVerify(); | 3010 void CodeVerify(); |
3011 #endif | 3011 #endif |
3012 // Code entry points are aligned to 32 bytes. | |
3013 static const int kCodeAlignmentBits = 5; | |
3014 static const int kCodeAlignment = 1 << kCodeAlignmentBits; | |
3015 static const int kCodeAlignmentMask = kCodeAlignment - 1; | |
3016 | |
3017 // Layout description. | 3012 // Layout description. |
3018 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 3013 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
3019 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 3014 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
3020 static const int kFlagsOffset = kRelocationInfoOffset + kPointerSize; | 3015 static const int kFlagsOffset = kRelocationInfoOffset + kPointerSize; |
3021 static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize; | 3016 static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize; |
3022 // Add padding to align the instruction start following right after | 3017 // Add padding to align the instruction start following right after |
3023 // the Code object header. | 3018 // the Code object header. |
3024 static const int kHeaderSize = | 3019 static const int kHeaderSize = |
3025 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & | 3020 CODE_POINTER_ALIGN(kKindSpecificFlagsOffset + kIntSize); |
3026 ~kCodeAlignmentMask; | |
3027 | 3021 |
3028 // Byte offsets within kKindSpecificFlagsOffset. | 3022 // Byte offsets within kKindSpecificFlagsOffset. |
3029 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; | 3023 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; |
3030 | 3024 |
3031 // Flags layout. | 3025 // Flags layout. |
3032 static const int kFlagsICStateShift = 0; | 3026 static const int kFlagsICStateShift = 0; |
3033 static const int kFlagsICInLoopShift = 3; | 3027 static const int kFlagsICInLoopShift = 3; |
3034 static const int kFlagsTypeShift = 4; | 3028 static const int kFlagsTypeShift = 4; |
3035 static const int kFlagsKindShift = 7; | 3029 static const int kFlagsKindShift = 7; |
3036 static const int kFlagsICHolderShift = 11; | 3030 static const int kFlagsICHolderShift = 11; |
(...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5712 } else { | 5706 } else { |
5713 value &= ~(1 << bit_position); | 5707 value &= ~(1 << bit_position); |
5714 } | 5708 } |
5715 return value; | 5709 return value; |
5716 } | 5710 } |
5717 }; | 5711 }; |
5718 | 5712 |
5719 } } // namespace v8::internal | 5713 } } // namespace v8::internal |
5720 | 5714 |
5721 #endif // V8_OBJECTS_H_ | 5715 #endif // V8_OBJECTS_H_ |
OLD | NEW |