| 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 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 | 1303 |
| 1304 // Load address of new object into result. | 1304 // Load address of new object into result. |
| 1305 LoadAllocationTopHelper(result, scratch, flags); | 1305 LoadAllocationTopHelper(result, scratch, flags); |
| 1306 | 1306 |
| 1307 ExternalReference allocation_limit = | 1307 ExternalReference allocation_limit = |
| 1308 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1308 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
| 1309 | 1309 |
| 1310 // Align the next allocation. Storing the filler map without checking top is | 1310 // Align the next allocation. Storing the filler map without checking top is |
| 1311 // safe in new-space because the limit of the heap is aligned there. | 1311 // safe in new-space because the limit of the heap is aligned there. |
| 1312 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1312 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1313 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
| 1314 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1313 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
| 1315 Label aligned; | 1314 Label aligned; |
| 1316 test(result, Immediate(kDoubleAlignmentMask)); | 1315 test(result, Immediate(kDoubleAlignmentMask)); |
| 1317 j(zero, &aligned, Label::kNear); | 1316 j(zero, &aligned, Label::kNear); |
| 1318 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1317 if ((flags & PRETENURE) != 0) { |
| 1319 cmp(result, Operand::StaticVariable(allocation_limit)); | 1318 cmp(result, Operand::StaticVariable(allocation_limit)); |
| 1320 j(above_equal, gc_required); | 1319 j(above_equal, gc_required); |
| 1321 } | 1320 } |
| 1322 mov(Operand(result, 0), | 1321 mov(Operand(result, 0), |
| 1323 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1322 Immediate(isolate()->factory()->one_pointer_filler_map())); |
| 1324 add(result, Immediate(kDoubleSize / 2)); | 1323 add(result, Immediate(kDoubleSize / 2)); |
| 1325 bind(&aligned); | 1324 bind(&aligned); |
| 1326 } | 1325 } |
| 1327 | 1326 |
| 1328 // Calculate new top and bail out if space is exhausted. | 1327 // Calculate new top and bail out if space is exhausted. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 | 1379 |
| 1381 // Load address of new object into result. | 1380 // Load address of new object into result. |
| 1382 LoadAllocationTopHelper(result, scratch, flags); | 1381 LoadAllocationTopHelper(result, scratch, flags); |
| 1383 | 1382 |
| 1384 ExternalReference allocation_limit = | 1383 ExternalReference allocation_limit = |
| 1385 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1384 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
| 1386 | 1385 |
| 1387 // Align the next allocation. Storing the filler map without checking top is | 1386 // Align the next allocation. Storing the filler map without checking top is |
| 1388 // safe in new-space because the limit of the heap is aligned there. | 1387 // safe in new-space because the limit of the heap is aligned there. |
| 1389 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1388 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1390 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
| 1391 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1389 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
| 1392 Label aligned; | 1390 Label aligned; |
| 1393 test(result, Immediate(kDoubleAlignmentMask)); | 1391 test(result, Immediate(kDoubleAlignmentMask)); |
| 1394 j(zero, &aligned, Label::kNear); | 1392 j(zero, &aligned, Label::kNear); |
| 1395 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1393 if ((flags & PRETENURE) != 0) { |
| 1396 cmp(result, Operand::StaticVariable(allocation_limit)); | 1394 cmp(result, Operand::StaticVariable(allocation_limit)); |
| 1397 j(above_equal, gc_required); | 1395 j(above_equal, gc_required); |
| 1398 } | 1396 } |
| 1399 mov(Operand(result, 0), | 1397 mov(Operand(result, 0), |
| 1400 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1398 Immediate(isolate()->factory()->one_pointer_filler_map())); |
| 1401 add(result, Immediate(kDoubleSize / 2)); | 1399 add(result, Immediate(kDoubleSize / 2)); |
| 1402 bind(&aligned); | 1400 bind(&aligned); |
| 1403 } | 1401 } |
| 1404 | 1402 |
| 1405 // Calculate new top and bail out if space is exhausted. | 1403 // Calculate new top and bail out if space is exhausted. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 | 1453 |
| 1456 // Load address of new object into result. | 1454 // Load address of new object into result. |
| 1457 LoadAllocationTopHelper(result, scratch, flags); | 1455 LoadAllocationTopHelper(result, scratch, flags); |
| 1458 | 1456 |
| 1459 ExternalReference allocation_limit = | 1457 ExternalReference allocation_limit = |
| 1460 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1458 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
| 1461 | 1459 |
| 1462 // Align the next allocation. Storing the filler map without checking top is | 1460 // Align the next allocation. Storing the filler map without checking top is |
| 1463 // safe in new-space because the limit of the heap is aligned there. | 1461 // safe in new-space because the limit of the heap is aligned there. |
| 1464 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1462 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
| 1465 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
| 1466 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1463 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
| 1467 Label aligned; | 1464 Label aligned; |
| 1468 test(result, Immediate(kDoubleAlignmentMask)); | 1465 test(result, Immediate(kDoubleAlignmentMask)); |
| 1469 j(zero, &aligned, Label::kNear); | 1466 j(zero, &aligned, Label::kNear); |
| 1470 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1467 if ((flags & PRETENURE) != 0) { |
| 1471 cmp(result, Operand::StaticVariable(allocation_limit)); | 1468 cmp(result, Operand::StaticVariable(allocation_limit)); |
| 1472 j(above_equal, gc_required); | 1469 j(above_equal, gc_required); |
| 1473 } | 1470 } |
| 1474 mov(Operand(result, 0), | 1471 mov(Operand(result, 0), |
| 1475 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1472 Immediate(isolate()->factory()->one_pointer_filler_map())); |
| 1476 add(result, Immediate(kDoubleSize / 2)); | 1473 add(result, Immediate(kDoubleSize / 2)); |
| 1477 bind(&aligned); | 1474 bind(&aligned); |
| 1478 } | 1475 } |
| 1479 | 1476 |
| 1480 // Calculate new top and bail out if space is exhausted. | 1477 // Calculate new top and bail out if space is exhausted. |
| (...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3222 if (mag.shift > 0) sar(edx, mag.shift); | 3219 if (mag.shift > 0) sar(edx, mag.shift); |
| 3223 mov(eax, dividend); | 3220 mov(eax, dividend); |
| 3224 shr(eax, 31); | 3221 shr(eax, 31); |
| 3225 add(edx, eax); | 3222 add(edx, eax); |
| 3226 } | 3223 } |
| 3227 | 3224 |
| 3228 | 3225 |
| 3229 } } // namespace v8::internal | 3226 } } // namespace v8::internal |
| 3230 | 3227 |
| 3231 #endif // V8_TARGET_ARCH_IA32 | 3228 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |