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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // It is very common to have a reference to objects at certain offsets in the | 140 // It is very common to have a reference to objects at certain offsets in the |
141 // heap. These offsets have been determined experimentally. We code | 141 // heap. These offsets have been determined experimentally. We code |
142 // references to such objects in a single byte that encodes the way the pointer | 142 // references to such objects in a single byte that encodes the way the pointer |
143 // is written (only plain pointers allowed), the space number and the offset. | 143 // is written (only plain pointers allowed), the space number and the offset. |
144 // This only works for objects in the first page of a space. Don't use this for | 144 // This only works for objects in the first page of a space. Don't use this for |
145 // things in newspace since it bypasses the write barrier. | 145 // things in newspace since it bypasses the write barrier. |
146 | 146 |
147 static const int k64 = (sizeof(uintptr_t) - 4) / 4; | 147 static const int k64 = (sizeof(uintptr_t) - 4) / 4; |
148 | 148 |
149 #define COMMON_REFERENCE_PATTERNS(f) \ | 149 #define COMMON_REFERENCE_PATTERNS(f) \ |
150 f(kNumberOfSpaces, 2, 11 - k64) \ | 150 f(kNumberOfSpaces, 2, (11 - k64)) \ |
151 f(kNumberOfSpaces + 1, 2, 0) \ | 151 f(kNumberOfSpaces + 1, 2, 0) \ |
152 f(kNumberOfSpaces + 2, 2, 142 - 16 * k64) \ | 152 f(kNumberOfSpaces + 2, 2, (142 - 16 * k64)) \ |
153 f(kNumberOfSpaces + 3, 2, 74 - 15 * k64) \ | 153 f(kNumberOfSpaces + 3, 2, (74 - 15 * k64)) \ |
154 f(kNumberOfSpaces + 4, 2, 5) \ | 154 f(kNumberOfSpaces + 4, 2, 5) \ |
155 f(kNumberOfSpaces + 5, 1, 135) \ | 155 f(kNumberOfSpaces + 5, 1, 135) \ |
156 f(kNumberOfSpaces + 6, 2, 228 - 39 * k64) | 156 f(kNumberOfSpaces + 6, 2, (228 - 39 * k64)) |
157 | 157 |
158 #define COMMON_RAW_LENGTHS(f) \ | 158 #define COMMON_RAW_LENGTHS(f) \ |
159 f(1, 1) \ | 159 f(1, 1) \ |
160 f(2, 2) \ | 160 f(2, 2) \ |
161 f(3, 3) \ | 161 f(3, 3) \ |
162 f(4, 4) \ | 162 f(4, 4) \ |
163 f(5, 5) \ | 163 f(5, 5) \ |
164 f(6, 6) \ | 164 f(6, 6) \ |
165 f(7, 7) \ | 165 f(7, 7) \ |
166 f(8, 8) \ | 166 f(8, 8) \ |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } | 572 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } |
573 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 573 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
574 return false; | 574 return false; |
575 } | 575 } |
576 }; | 576 }; |
577 | 577 |
578 | 578 |
579 } } // namespace v8::internal | 579 } } // namespace v8::internal |
580 | 580 |
581 #endif // V8_SERIALIZE_H_ | 581 #endif // V8_SERIALIZE_H_ |
OLD | NEW |