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 #include <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #if V8_TARGET_ARCH_PPC | 10 #if V8_TARGET_ARCH_PPC |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 cmp(result, ip); | 1361 cmp(result, ip); |
1362 Check(eq, kUnexpectedAllocationTop); | 1362 Check(eq, kUnexpectedAllocationTop); |
1363 } | 1363 } |
1364 // Load allocation limit into ip. Result already contains allocation top. | 1364 // Load allocation limit into ip. Result already contains allocation top. |
1365 LoadP(ip, MemOperand(topaddr, limit - top), r0); | 1365 LoadP(ip, MemOperand(topaddr, limit - top), r0); |
1366 } | 1366 } |
1367 | 1367 |
1368 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1368 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
1369 // Align the next allocation. Storing the filler map without checking top is | 1369 // Align the next allocation. Storing the filler map without checking top is |
1370 // safe in new-space because the limit of the heap is aligned there. | 1370 // safe in new-space because the limit of the heap is aligned there. |
1371 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | 1371 DCHECK((flags & PRETENURE_OLD_SPACE) == 0); |
1372 #if V8_TARGET_ARCH_PPC64 | 1372 #if V8_TARGET_ARCH_PPC64 |
1373 STATIC_ASSERT(kPointerAlignment == kDoubleAlignment); | 1373 STATIC_ASSERT(kPointerAlignment == kDoubleAlignment); |
1374 #else | 1374 #else |
1375 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment); | 1375 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment); |
1376 andi(scratch2, result, Operand(kDoubleAlignmentMask)); | 1376 andi(scratch2, result, Operand(kDoubleAlignmentMask)); |
1377 Label aligned; | 1377 Label aligned; |
1378 beq(&aligned, cr0); | 1378 beq(&aligned, cr0); |
1379 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1379 if ((flags & PRETENURE) != 0) { |
1380 cmpl(result, ip); | 1380 cmpl(result, ip); |
1381 bge(gc_required); | 1381 bge(gc_required); |
1382 } | 1382 } |
1383 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); | 1383 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); |
1384 stw(scratch2, MemOperand(result)); | 1384 stw(scratch2, MemOperand(result)); |
1385 addi(result, result, Operand(kDoubleSize / 2)); | 1385 addi(result, result, Operand(kDoubleSize / 2)); |
1386 bind(&aligned); | 1386 bind(&aligned); |
1387 #endif | 1387 #endif |
1388 } | 1388 } |
1389 | 1389 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 cmp(result, ip); | 1460 cmp(result, ip); |
1461 Check(eq, kUnexpectedAllocationTop); | 1461 Check(eq, kUnexpectedAllocationTop); |
1462 } | 1462 } |
1463 // Load allocation limit into ip. Result already contains allocation top. | 1463 // Load allocation limit into ip. Result already contains allocation top. |
1464 LoadP(ip, MemOperand(topaddr, limit - top)); | 1464 LoadP(ip, MemOperand(topaddr, limit - top)); |
1465 } | 1465 } |
1466 | 1466 |
1467 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1467 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
1468 // Align the next allocation. Storing the filler map without checking top is | 1468 // Align the next allocation. Storing the filler map without checking top is |
1469 // safe in new-space because the limit of the heap is aligned there. | 1469 // safe in new-space because the limit of the heap is aligned there. |
1470 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | 1470 DCHECK((flags & PRETENURE_OLD_SPACE) == 0); |
1471 #if V8_TARGET_ARCH_PPC64 | 1471 #if V8_TARGET_ARCH_PPC64 |
1472 STATIC_ASSERT(kPointerAlignment == kDoubleAlignment); | 1472 STATIC_ASSERT(kPointerAlignment == kDoubleAlignment); |
1473 #else | 1473 #else |
1474 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment); | 1474 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment); |
1475 andi(scratch2, result, Operand(kDoubleAlignmentMask)); | 1475 andi(scratch2, result, Operand(kDoubleAlignmentMask)); |
1476 Label aligned; | 1476 Label aligned; |
1477 beq(&aligned, cr0); | 1477 beq(&aligned, cr0); |
1478 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1478 if ((flags & PRETENURE) != 0) { |
1479 cmpl(result, ip); | 1479 cmpl(result, ip); |
1480 bge(gc_required); | 1480 bge(gc_required); |
1481 } | 1481 } |
1482 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); | 1482 mov(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); |
1483 stw(scratch2, MemOperand(result)); | 1483 stw(scratch2, MemOperand(result)); |
1484 addi(result, result, Operand(kDoubleSize / 2)); | 1484 addi(result, result, Operand(kDoubleSize / 2)); |
1485 bind(&aligned); | 1485 bind(&aligned); |
1486 #endif | 1486 #endif |
1487 } | 1487 } |
1488 | 1488 |
(...skipping 3037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4526 } | 4526 } |
4527 if (mag.shift > 0) srawi(result, result, mag.shift); | 4527 if (mag.shift > 0) srawi(result, result, mag.shift); |
4528 ExtractBit(r0, dividend, 31); | 4528 ExtractBit(r0, dividend, 31); |
4529 add(result, result, r0); | 4529 add(result, result, r0); |
4530 } | 4530 } |
4531 | 4531 |
4532 } // namespace internal | 4532 } // namespace internal |
4533 } // namespace v8 | 4533 } // namespace v8 |
4534 | 4534 |
4535 #endif // V8_TARGET_ARCH_PPC | 4535 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |