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