| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 // Desired alignment for maps. | 208 // Desired alignment for maps. |
| 209 #if V8_HOST_ARCH_64_BIT | 209 #if V8_HOST_ARCH_64_BIT |
| 210 const intptr_t kMapAlignmentBits = kObjectAlignmentBits; | 210 const intptr_t kMapAlignmentBits = kObjectAlignmentBits; |
| 211 #else | 211 #else |
| 212 const intptr_t kMapAlignmentBits = kObjectAlignmentBits + 3; | 212 const intptr_t kMapAlignmentBits = kObjectAlignmentBits + 3; |
| 213 #endif | 213 #endif |
| 214 const intptr_t kMapAlignment = (1 << kMapAlignmentBits); | 214 const intptr_t kMapAlignment = (1 << kMapAlignmentBits); |
| 215 const intptr_t kMapAlignmentMask = kMapAlignment - 1; | 215 const intptr_t kMapAlignmentMask = kMapAlignment - 1; |
| 216 | 216 |
| 217 // Desired alignment for generated code. |
| 218 // Code entry points are aligned to 32 bytes (cache line size in some CPUs). |
| 219 const int kCodeAlignmentBits = 5; |
| 220 const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits; |
| 221 const intptr_t kCodeAlignmentMask = kCodeAlignment - 1; |
| 222 |
| 217 // Tag information for Failure. | 223 // Tag information for Failure. |
| 218 const int kFailureTag = 3; | 224 const int kFailureTag = 3; |
| 219 const int kFailureTagSize = 2; | 225 const int kFailureTagSize = 2; |
| 220 const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1; | 226 const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1; |
| 221 | 227 |
| 222 | 228 |
| 223 const int kBitsPerByte = 8; | 229 const int kBitsPerByte = 8; |
| 224 const int kBitsPerByteLog2 = 3; | 230 const int kBitsPerByteLog2 = 3; |
| 225 const int kBitsPerPointer = kPointerSize * kBitsPerByte; | 231 const int kBitsPerPointer = kPointerSize * kBitsPerByte; |
| 226 const int kBitsPerInt = kIntSize * kBitsPerByte; | 232 const int kBitsPerInt = kIntSize * kBitsPerByte; |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask) | 588 (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask) |
| 583 | 589 |
| 584 // POINTER_SIZE_ALIGN returns the value aligned as a pointer. | 590 // POINTER_SIZE_ALIGN returns the value aligned as a pointer. |
| 585 #define POINTER_SIZE_ALIGN(value) \ | 591 #define POINTER_SIZE_ALIGN(value) \ |
| 586 (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask) | 592 (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask) |
| 587 | 593 |
| 588 // MAP_POINTER_ALIGN returns the value aligned as a map pointer. | 594 // MAP_POINTER_ALIGN returns the value aligned as a map pointer. |
| 589 #define MAP_POINTER_ALIGN(value) \ | 595 #define MAP_POINTER_ALIGN(value) \ |
| 590 (((value) + kMapAlignmentMask) & ~kMapAlignmentMask) | 596 (((value) + kMapAlignmentMask) & ~kMapAlignmentMask) |
| 591 | 597 |
| 598 // CODE_POINTER_ALIGN returns the value aligned as a generated code segment. |
| 599 #define CODE_POINTER_ALIGN(value) \ |
| 600 (((value) + kCodeAlignmentMask) & ~kCodeAlignmentMask) |
| 601 |
| 592 // The expression OFFSET_OF(type, field) computes the byte-offset | 602 // The expression OFFSET_OF(type, field) computes the byte-offset |
| 593 // of the specified field relative to the containing type. This | 603 // of the specified field relative to the containing type. This |
| 594 // corresponds to 'offsetof' (in stddef.h), except that it doesn't | 604 // corresponds to 'offsetof' (in stddef.h), except that it doesn't |
| 595 // use 0 or NULL, which causes a problem with the compiler warnings | 605 // use 0 or NULL, which causes a problem with the compiler warnings |
| 596 // we have enabled (which is also why 'offsetof' doesn't seem to work). | 606 // we have enabled (which is also why 'offsetof' doesn't seem to work). |
| 597 // Here we simply use the non-zero value 4, which seems to work. | 607 // Here we simply use the non-zero value 4, which seems to work. |
| 598 #define OFFSET_OF(type, field) \ | 608 #define OFFSET_OF(type, field) \ |
| 599 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4) | 609 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4) |
| 600 | 610 |
| 601 | 611 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 CMOV = 15, // x86 | 709 CMOV = 15, // x86 |
| 700 RDTSC = 4, // x86 | 710 RDTSC = 4, // x86 |
| 701 CPUID = 10, // x86 | 711 CPUID = 10, // x86 |
| 702 VFP3 = 1, // ARM | 712 VFP3 = 1, // ARM |
| 703 ARMv7 = 2, // ARM | 713 ARMv7 = 2, // ARM |
| 704 SAHF = 0}; // x86 | 714 SAHF = 0}; // x86 |
| 705 | 715 |
| 706 } } // namespace v8::internal | 716 } } // namespace v8::internal |
| 707 | 717 |
| 708 #endif // V8_GLOBALS_H_ | 718 #endif // V8_GLOBALS_H_ |
| OLD | NEW |