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 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 const char* name_; | 2357 const char* name_; |
2358 }; | 2358 }; |
2359 | 2359 |
2360 | 2360 |
2361 // ----------------------------------------------------------------------------- | 2361 // ----------------------------------------------------------------------------- |
2362 // Old space for all map objects | 2362 // Old space for all map objects |
2363 | 2363 |
2364 class MapSpace : public FixedSpace { | 2364 class MapSpace : public FixedSpace { |
2365 public: | 2365 public: |
2366 // Creates a map space object with a maximum capacity. | 2366 // Creates a map space object with a maximum capacity. |
2367 MapSpace(Heap* heap, | 2367 MapSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id) |
2368 intptr_t max_capacity, | |
2369 int max_map_space_pages, | |
2370 AllocationSpace id) | |
2371 : FixedSpace(heap, max_capacity, id, Map::kSize, "map"), | 2368 : FixedSpace(heap, max_capacity, id, Map::kSize, "map"), |
2372 max_map_space_pages_(max_map_space_pages) { | 2369 max_map_space_pages_(kMaxMapPageIndex - 1) { |
2373 } | 2370 } |
2374 | 2371 |
2375 // Given an index, returns the page address. | 2372 // Given an index, returns the page address. |
2376 // TODO(1600): this limit is artifical just to keep code compilable | 2373 // TODO(1600): this limit is artifical just to keep code compilable |
2377 static const int kMaxMapPageIndex = 1 << 16; | 2374 static const int kMaxMapPageIndex = 1 << 16; |
2378 | 2375 |
2379 virtual int RoundSizeDownToObjectAlignment(int size) { | 2376 virtual int RoundSizeDownToObjectAlignment(int size) { |
2380 if (IsPowerOf2(Map::kSize)) { | 2377 if (IsPowerOf2(Map::kSize)) { |
2381 return RoundDown(size, Map::kSize); | 2378 return RoundDown(size, Map::kSize); |
2382 } else { | 2379 } else { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2614 } | 2611 } |
2615 // Must be small, since an iteration is used for lookup. | 2612 // Must be small, since an iteration is used for lookup. |
2616 static const int kMaxComments = 64; | 2613 static const int kMaxComments = 64; |
2617 }; | 2614 }; |
2618 #endif | 2615 #endif |
2619 | 2616 |
2620 | 2617 |
2621 } } // namespace v8::internal | 2618 } } // namespace v8::internal |
2622 | 2619 |
2623 #endif // V8_SPACES_H_ | 2620 #endif // V8_SPACES_H_ |
OLD | NEW |