OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Should be a recognizable hex value tagged as a failure. | 72 // Should be a recognizable hex value tagged as a failure. |
73 #ifdef V8_HOST_ARCH_64_BIT | 73 #ifdef V8_HOST_ARCH_64_BIT |
74 const Address kZapValue = | 74 const Address kZapValue = |
75 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef)); | 75 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef)); |
76 const Address kHandleZapValue = | 76 const Address kHandleZapValue = |
77 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf)); | 77 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf)); |
78 const Address kFromSpaceZapValue = | 78 const Address kFromSpaceZapValue = |
79 reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdaf)); | 79 reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdaf)); |
80 const uint64_t kDebugZapValue = V8_UINT64_C(0xbadbaddbbadbaddb); | 80 const uint64_t kDebugZapValue = V8_UINT64_C(0xbadbaddbbadbaddb); |
81 const uint64_t kSlotsZapValue = V8_UINT64_C(0xbeefdeadbeefdeef); | 81 const uint64_t kSlotsZapValue = V8_UINT64_C(0xbeefdeadbeefdeef); |
| 82 const uint64_t kFreeListZapValue = 0xfeed1eaffeed1eaf; |
82 #else | 83 #else |
83 const Address kZapValue = reinterpret_cast<Address>(0xdeadbeef); | 84 const Address kZapValue = reinterpret_cast<Address>(0xdeadbeef); |
84 const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf); | 85 const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf); |
85 const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf); | 86 const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf); |
86 const uint32_t kSlotsZapValue = 0xbeefdeef; | 87 const uint32_t kSlotsZapValue = 0xbeefdeef; |
87 const uint32_t kDebugZapValue = 0xbadbaddb; | 88 const uint32_t kDebugZapValue = 0xbadbaddb; |
| 89 const uint32_t kFreeListZapValue = 0xfeed1eaf; |
88 #endif | 90 #endif |
89 | 91 |
90 | 92 |
91 // Number of bits to represent the page size for paged spaces. The value of 13 | 93 // Number of bits to represent the page size for paged spaces. The value of 20 |
92 // gives 8K bytes per page. | 94 // gives 1Mb bytes per page. |
93 const int kPageSizeBits = 13; | 95 const int kPageSizeBits = 20; |
94 | 96 |
95 // On Intel architecture, cache line size is 64 bytes. | 97 // On Intel architecture, cache line size is 64 bytes. |
96 // On ARM it may be less (32 bytes), but as far this constant is | 98 // On ARM it may be less (32 bytes), but as far this constant is |
97 // used for aligning data, it doesn't hurt to align on a greater value. | 99 // used for aligning data, it doesn't hurt to align on a greater value. |
98 const int kProcessorCacheLineSize = 64; | 100 const int kProcessorCacheLineSize = 64; |
99 | 101 |
100 // Constants relevant to double precision floating point numbers. | 102 // Constants relevant to double precision floating point numbers. |
101 | |
102 // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no | |
103 // other bits set. | |
104 const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51; | |
105 // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30. | 103 // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30. |
106 const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32); | 104 const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32); |
107 | 105 |
108 | 106 |
109 // ----------------------------------------------------------------------------- | 107 // ----------------------------------------------------------------------------- |
110 // Forward declarations for frequently used classes | 108 // Forward declarations for frequently used classes |
111 // (sorted alphabetically) | 109 // (sorted alphabetically) |
112 | 110 |
113 class AccessorInfo; | 111 class AccessorInfo; |
114 class Allocation; | 112 class Allocation; |
115 class Arguments; | 113 class Arguments; |
116 class Assembler; | 114 class Assembler; |
117 class AssertNoAllocation; | 115 class AssertNoAllocation; |
118 class BreakableStatement; | 116 class BreakableStatement; |
119 class Code; | 117 class Code; |
120 class CodeGenerator; | 118 class CodeGenerator; |
121 class CodeStub; | 119 class CodeStub; |
122 class Context; | 120 class Context; |
123 class Debug; | 121 class Debug; |
124 class Debugger; | 122 class Debugger; |
125 class DebugInfo; | 123 class DebugInfo; |
126 class Descriptor; | 124 class Descriptor; |
127 class DescriptorArray; | 125 class DescriptorArray; |
128 class Expression; | 126 class Expression; |
129 class ExternalReference; | 127 class ExternalReference; |
130 class FixedArray; | 128 class FixedArray; |
131 class FunctionEntry; | 129 class FunctionEntry; |
132 class FunctionLiteral; | 130 class FunctionLiteral; |
133 class FunctionTemplateInfo; | 131 class FunctionTemplateInfo; |
| 132 class MemoryChunk; |
134 class NumberDictionary; | 133 class NumberDictionary; |
135 class StringDictionary; | 134 class StringDictionary; |
136 template <typename T> class Handle; | 135 template <typename T> class Handle; |
137 class Heap; | 136 class Heap; |
138 class HeapObject; | 137 class HeapObject; |
139 class IC; | 138 class IC; |
140 class InterceptorInfo; | 139 class InterceptorInfo; |
141 class IterationStatement; | 140 class IterationStatement; |
142 class JSArray; | 141 class JSArray; |
143 class JSFunction; | 142 class JSFunction; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 246 |
248 struct CodeDesc { | 247 struct CodeDesc { |
249 byte* buffer; | 248 byte* buffer; |
250 int buffer_size; | 249 int buffer_size; |
251 int instr_size; | 250 int instr_size; |
252 int reloc_size; | 251 int reloc_size; |
253 Assembler* origin; | 252 Assembler* origin; |
254 }; | 253 }; |
255 | 254 |
256 | 255 |
257 // Callback function on object slots, used for iterating heap object slots in | |
258 // HeapObjects, global pointers to heap objects, etc. The callback allows the | |
259 // callback function to change the value of the slot. | |
260 typedef void (*ObjectSlotCallback)(HeapObject** pointer); | |
261 | |
262 | |
263 // Callback function used for iterating objects in heap spaces, | 256 // Callback function used for iterating objects in heap spaces, |
264 // for example, scanning heap objects. | 257 // for example, scanning heap objects. |
265 typedef int (*HeapObjectCallback)(HeapObject* obj); | 258 typedef int (*HeapObjectCallback)(HeapObject* obj); |
266 | 259 |
267 | 260 |
268 // Callback function used for checking constraints when copying/relocating | 261 // Callback function used for checking constraints when copying/relocating |
269 // objects. Returns true if an object can be copied/relocated from its | 262 // objects. Returns true if an object can be copied/relocated from its |
270 // old_addr to a new_addr. | 263 // old_addr to a new_addr. |
271 typedef bool (*ConstraintCallback)(Address new_addr, Address old_addr); | 264 typedef bool (*ConstraintCallback)(Address new_addr, Address old_addr); |
272 | 265 |
(...skipping 26 matching lines...) Expand all Loading... |
299 STRING_CHECK, | 292 STRING_CHECK, |
300 NUMBER_CHECK, | 293 NUMBER_CHECK, |
301 BOOLEAN_CHECK | 294 BOOLEAN_CHECK |
302 }; | 295 }; |
303 | 296 |
304 | 297 |
305 enum CallFunctionFlags { | 298 enum CallFunctionFlags { |
306 NO_CALL_FUNCTION_FLAGS = 0, | 299 NO_CALL_FUNCTION_FLAGS = 0, |
307 // Receiver might implicitly be the global objects. If it is, the | 300 // Receiver might implicitly be the global objects. If it is, the |
308 // hole is passed to the call function stub. | 301 // hole is passed to the call function stub. |
309 RECEIVER_MIGHT_BE_IMPLICIT = 1 << 0 | 302 RECEIVER_MIGHT_BE_IMPLICIT = 1 << 0, |
| 303 // The call target is cached in the instruction stream. |
| 304 RECORD_CALL_TARGET = 1 << 1 |
310 }; | 305 }; |
311 | 306 |
312 | 307 |
313 enum InlineCacheHolderFlag { | 308 enum InlineCacheHolderFlag { |
314 OWN_MAP, // For fast properties objects. | 309 OWN_MAP, // For fast properties objects. |
315 PROTOTYPE_MAP // For slow properties objects (except GlobalObjects). | 310 PROTOTYPE_MAP // For slow properties objects (except GlobalObjects). |
316 }; | 311 }; |
317 | 312 |
318 | 313 |
| 314 // The Store Buffer (GC). |
| 315 typedef enum { |
| 316 kStoreBufferFullEvent, |
| 317 kStoreBufferStartScanningPagesEvent, |
| 318 kStoreBufferScanningPageEvent |
| 319 } StoreBufferEvent; |
| 320 |
| 321 |
| 322 typedef void (*StoreBufferCallback)(Heap* heap, |
| 323 MemoryChunk* page, |
| 324 StoreBufferEvent event); |
| 325 |
| 326 |
319 // Type of properties. | 327 // Type of properties. |
320 // Order of properties is significant. | 328 // Order of properties is significant. |
321 // Must fit in the BitField PropertyDetails::TypeField. | 329 // Must fit in the BitField PropertyDetails::TypeField. |
322 // A copy of this is in mirror-debugger.js. | 330 // A copy of this is in mirror-debugger.js. |
323 enum PropertyType { | 331 enum PropertyType { |
324 NORMAL = 0, // only in slow mode | 332 NORMAL = 0, // only in slow mode |
325 FIELD = 1, // only in fast mode | 333 FIELD = 1, // only in fast mode |
326 CONSTANT_FUNCTION = 2, // only in fast mode | 334 CONSTANT_FUNCTION = 2, // only in fast mode |
327 CALLBACKS = 3, | 335 CALLBACKS = 3, |
328 HANDLER = 4, // only in lookup results, not in descriptors | 336 HANDLER = 4, // only in lookup results, not in descriptors |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 static const uint32_t kNaNOrInfinityLowerBoundUpper32 = 0x7FF00000; | 514 static const uint32_t kNaNOrInfinityLowerBoundUpper32 = 0x7FF00000; |
507 | 515 |
508 const uint64_t kHoleNanInt64 = | 516 const uint64_t kHoleNanInt64 = |
509 (static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32; | 517 (static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32; |
510 const uint64_t kLastNonNaNInt64 = | 518 const uint64_t kLastNonNaNInt64 = |
511 (static_cast<uint64_t>(kNaNOrInfinityLowerBoundUpper32) << 32); | 519 (static_cast<uint64_t>(kNaNOrInfinityLowerBoundUpper32) << 32); |
512 | 520 |
513 } } // namespace v8::internal | 521 } } // namespace v8::internal |
514 | 522 |
515 #endif // V8_V8GLOBALS_H_ | 523 #endif // V8_V8GLOBALS_H_ |
OLD | NEW |