OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 | 1317 |
1318 // Load address of new object into result. | 1318 // Load address of new object into result. |
1319 LoadAllocationTopHelper(result, scratch, flags); | 1319 LoadAllocationTopHelper(result, scratch, flags); |
1320 | 1320 |
1321 ExternalReference allocation_limit = | 1321 ExternalReference allocation_limit = |
1322 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1322 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
1323 | 1323 |
1324 // Align the next allocation. Storing the filler map without checking top is | 1324 // Align the next allocation. Storing the filler map without checking top is |
1325 // safe in new-space because the limit of the heap is aligned there. | 1325 // safe in new-space because the limit of the heap is aligned there. |
1326 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1326 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1327 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); |
1327 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1328 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
1328 Label aligned; | 1329 Label aligned; |
1329 test(result, Immediate(kDoubleAlignmentMask)); | 1330 test(result, Immediate(kDoubleAlignmentMask)); |
1330 j(zero, &aligned, Label::kNear); | 1331 j(zero, &aligned, Label::kNear); |
1331 if ((flags & PRETENURE) != 0) { | 1332 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { |
1332 cmp(result, Operand::StaticVariable(allocation_limit)); | 1333 cmp(result, Operand::StaticVariable(allocation_limit)); |
1333 j(above_equal, gc_required); | 1334 j(above_equal, gc_required); |
1334 } | 1335 } |
1335 mov(Operand(result, 0), | 1336 mov(Operand(result, 0), |
1336 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1337 Immediate(isolate()->factory()->one_pointer_filler_map())); |
1337 add(result, Immediate(kDoubleSize / 2)); | 1338 add(result, Immediate(kDoubleSize / 2)); |
1338 bind(&aligned); | 1339 bind(&aligned); |
1339 } | 1340 } |
1340 | 1341 |
1341 // Calculate new top and bail out if space is exhausted. | 1342 // Calculate new top and bail out if space is exhausted. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 | 1394 |
1394 // Load address of new object into result. | 1395 // Load address of new object into result. |
1395 LoadAllocationTopHelper(result, scratch, flags); | 1396 LoadAllocationTopHelper(result, scratch, flags); |
1396 | 1397 |
1397 ExternalReference allocation_limit = | 1398 ExternalReference allocation_limit = |
1398 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1399 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
1399 | 1400 |
1400 // Align the next allocation. Storing the filler map without checking top is | 1401 // Align the next allocation. Storing the filler map without checking top is |
1401 // safe in new-space because the limit of the heap is aligned there. | 1402 // safe in new-space because the limit of the heap is aligned there. |
1402 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1403 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1404 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); |
1403 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1405 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
1404 Label aligned; | 1406 Label aligned; |
1405 test(result, Immediate(kDoubleAlignmentMask)); | 1407 test(result, Immediate(kDoubleAlignmentMask)); |
1406 j(zero, &aligned, Label::kNear); | 1408 j(zero, &aligned, Label::kNear); |
1407 if ((flags & PRETENURE) != 0) { | 1409 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { |
1408 cmp(result, Operand::StaticVariable(allocation_limit)); | 1410 cmp(result, Operand::StaticVariable(allocation_limit)); |
1409 j(above_equal, gc_required); | 1411 j(above_equal, gc_required); |
1410 } | 1412 } |
1411 mov(Operand(result, 0), | 1413 mov(Operand(result, 0), |
1412 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1414 Immediate(isolate()->factory()->one_pointer_filler_map())); |
1413 add(result, Immediate(kDoubleSize / 2)); | 1415 add(result, Immediate(kDoubleSize / 2)); |
1414 bind(&aligned); | 1416 bind(&aligned); |
1415 } | 1417 } |
1416 | 1418 |
1417 // Calculate new top and bail out if space is exhausted. | 1419 // Calculate new top and bail out if space is exhausted. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 | 1469 |
1468 // Load address of new object into result. | 1470 // Load address of new object into result. |
1469 LoadAllocationTopHelper(result, scratch, flags); | 1471 LoadAllocationTopHelper(result, scratch, flags); |
1470 | 1472 |
1471 ExternalReference allocation_limit = | 1473 ExternalReference allocation_limit = |
1472 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1474 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
1473 | 1475 |
1474 // Align the next allocation. Storing the filler map without checking top is | 1476 // Align the next allocation. Storing the filler map without checking top is |
1475 // safe in new-space because the limit of the heap is aligned there. | 1477 // safe in new-space because the limit of the heap is aligned there. |
1476 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1478 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1479 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); |
1477 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1480 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
1478 Label aligned; | 1481 Label aligned; |
1479 test(result, Immediate(kDoubleAlignmentMask)); | 1482 test(result, Immediate(kDoubleAlignmentMask)); |
1480 j(zero, &aligned, Label::kNear); | 1483 j(zero, &aligned, Label::kNear); |
1481 if ((flags & PRETENURE) != 0) { | 1484 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { |
1482 cmp(result, Operand::StaticVariable(allocation_limit)); | 1485 cmp(result, Operand::StaticVariable(allocation_limit)); |
1483 j(above_equal, gc_required); | 1486 j(above_equal, gc_required); |
1484 } | 1487 } |
1485 mov(Operand(result, 0), | 1488 mov(Operand(result, 0), |
1486 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1489 Immediate(isolate()->factory()->one_pointer_filler_map())); |
1487 add(result, Immediate(kDoubleSize / 2)); | 1490 add(result, Immediate(kDoubleSize / 2)); |
1488 bind(&aligned); | 1491 bind(&aligned); |
1489 } | 1492 } |
1490 | 1493 |
1491 // Calculate new top and bail out if space is exhausted. | 1494 // Calculate new top and bail out if space is exhausted. |
(...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3222 if (mag.shift > 0) sar(edx, mag.shift); | 3225 if (mag.shift > 0) sar(edx, mag.shift); |
3223 mov(eax, dividend); | 3226 mov(eax, dividend); |
3224 shr(eax, 31); | 3227 shr(eax, 31); |
3225 add(edx, eax); | 3228 add(edx, eax); |
3226 } | 3229 } |
3227 | 3230 |
3228 | 3231 |
3229 } } // namespace v8::internal | 3232 } } // namespace v8::internal |
3230 | 3233 |
3231 #endif // V8_TARGET_ARCH_IA32 | 3234 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |