OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(mythria): Remove this define after this flag is turned on globally | 5 // TODO(mythria): Remove this define after this flag is turned on globally |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 | 1433 |
1434 int object_size = my_map->instance_size(); | 1434 int object_size = my_map->instance_size(); |
1435 | 1435 |
1436 // Step 2: allocate a lot of objects so to almost fill new space: we need | 1436 // Step 2: allocate a lot of objects so to almost fill new space: we need |
1437 // just enough room to allocate JSObject and thus fill the newspace. | 1437 // just enough room to allocate JSObject and thus fill the newspace. |
1438 | 1438 |
1439 int allocation_amount = | 1439 int allocation_amount = |
1440 Min(FixedArray::kMaxSize, Page::kMaxRegularHeapObjectSize + kPointerSize); | 1440 Min(FixedArray::kMaxSize, Page::kMaxRegularHeapObjectSize + kPointerSize); |
1441 int allocation_len = LenFromSize(allocation_amount); | 1441 int allocation_len = LenFromSize(allocation_amount); |
1442 NewSpace* new_space = heap->new_space(); | 1442 NewSpace* new_space = heap->new_space(); |
| 1443 DisableInlineAllocationSteps(new_space); |
1443 Address* top_addr = new_space->allocation_top_address(); | 1444 Address* top_addr = new_space->allocation_top_address(); |
1444 Address* limit_addr = new_space->allocation_limit_address(); | 1445 Address* limit_addr = new_space->allocation_limit_address(); |
1445 while ((*limit_addr - *top_addr) > allocation_amount) { | 1446 while ((*limit_addr - *top_addr) > allocation_amount) { |
1446 CHECK(!heap->always_allocate()); | 1447 CHECK(!heap->always_allocate()); |
1447 Object* array = heap->AllocateFixedArray(allocation_len).ToObjectChecked(); | 1448 Object* array = heap->AllocateFixedArray(allocation_len).ToObjectChecked(); |
1448 CHECK(new_space->Contains(array)); | 1449 CHECK(new_space->Contains(array)); |
1449 } | 1450 } |
1450 | 1451 |
1451 // Step 3: now allocate fixed array and JSObject to fill the whole new space. | 1452 // Step 3: now allocate fixed array and JSObject to fill the whole new space. |
1452 int to_fill = static_cast<int>(*limit_addr - *top_addr - object_size); | 1453 int to_fill = static_cast<int>(*limit_addr - *top_addr - object_size); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 | 1688 |
1688 // TODO(ishell): add respective tests for property kind reconfiguring from | 1689 // TODO(ishell): add respective tests for property kind reconfiguring from |
1689 // accessor field to double, once accessor fields are supported by | 1690 // accessor field to double, once accessor fields are supported by |
1690 // Map::ReconfigureProperty(). | 1691 // Map::ReconfigureProperty(). |
1691 | 1692 |
1692 | 1693 |
1693 // TODO(ishell): add respective tests for fast property removal case once | 1694 // TODO(ishell): add respective tests for fast property removal case once |
1694 // Map::ReconfigureProperty() supports that. | 1695 // Map::ReconfigureProperty() supports that. |
1695 | 1696 |
1696 #endif | 1697 #endif |
OLD | NEW |