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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 | 1267 |
1268 // Load address of new object into result. | 1268 // Load address of new object into result. |
1269 LoadAllocationTopHelper(result, scratch, flags); | 1269 LoadAllocationTopHelper(result, scratch, flags); |
1270 | 1270 |
1271 ExternalReference allocation_limit = | 1271 ExternalReference allocation_limit = |
1272 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1272 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
1273 | 1273 |
1274 // Align the next allocation. Storing the filler map without checking top is | 1274 // Align the next allocation. Storing the filler map without checking top is |
1275 // safe in new-space because the limit of the heap is aligned there. | 1275 // safe in new-space because the limit of the heap is aligned there. |
1276 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1276 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
1277 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
1278 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1277 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
1279 Label aligned; | 1278 Label aligned; |
1280 test(result, Immediate(kDoubleAlignmentMask)); | 1279 test(result, Immediate(kDoubleAlignmentMask)); |
1281 j(zero, &aligned, Label::kNear); | 1280 j(zero, &aligned, Label::kNear); |
1282 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1281 if ((flags & PRETENURE) != 0) { |
1283 cmp(result, Operand::StaticVariable(allocation_limit)); | 1282 cmp(result, Operand::StaticVariable(allocation_limit)); |
1284 j(above_equal, gc_required); | 1283 j(above_equal, gc_required); |
1285 } | 1284 } |
1286 mov(Operand(result, 0), | 1285 mov(Operand(result, 0), |
1287 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1286 Immediate(isolate()->factory()->one_pointer_filler_map())); |
1288 add(result, Immediate(kDoubleSize / 2)); | 1287 add(result, Immediate(kDoubleSize / 2)); |
1289 bind(&aligned); | 1288 bind(&aligned); |
1290 } | 1289 } |
1291 | 1290 |
1292 // Calculate new top and bail out if space is exhausted. | 1291 // Calculate new top and bail out if space is exhausted. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 | 1343 |
1345 // Load address of new object into result. | 1344 // Load address of new object into result. |
1346 LoadAllocationTopHelper(result, scratch, flags); | 1345 LoadAllocationTopHelper(result, scratch, flags); |
1347 | 1346 |
1348 ExternalReference allocation_limit = | 1347 ExternalReference allocation_limit = |
1349 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1348 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
1350 | 1349 |
1351 // Align the next allocation. Storing the filler map without checking top is | 1350 // Align the next allocation. Storing the filler map without checking top is |
1352 // safe in new-space because the limit of the heap is aligned there. | 1351 // safe in new-space because the limit of the heap is aligned there. |
1353 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1352 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
1354 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
1355 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1353 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
1356 Label aligned; | 1354 Label aligned; |
1357 test(result, Immediate(kDoubleAlignmentMask)); | 1355 test(result, Immediate(kDoubleAlignmentMask)); |
1358 j(zero, &aligned, Label::kNear); | 1356 j(zero, &aligned, Label::kNear); |
1359 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1357 if ((flags & PRETENURE) != 0) { |
1360 cmp(result, Operand::StaticVariable(allocation_limit)); | 1358 cmp(result, Operand::StaticVariable(allocation_limit)); |
1361 j(above_equal, gc_required); | 1359 j(above_equal, gc_required); |
1362 } | 1360 } |
1363 mov(Operand(result, 0), | 1361 mov(Operand(result, 0), |
1364 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1362 Immediate(isolate()->factory()->one_pointer_filler_map())); |
1365 add(result, Immediate(kDoubleSize / 2)); | 1363 add(result, Immediate(kDoubleSize / 2)); |
1366 bind(&aligned); | 1364 bind(&aligned); |
1367 } | 1365 } |
1368 | 1366 |
1369 // Calculate new top and bail out if space is exhausted. | 1367 // Calculate new top and bail out if space is exhausted. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 | 1417 |
1420 // Load address of new object into result. | 1418 // Load address of new object into result. |
1421 LoadAllocationTopHelper(result, scratch, flags); | 1419 LoadAllocationTopHelper(result, scratch, flags); |
1422 | 1420 |
1423 ExternalReference allocation_limit = | 1421 ExternalReference allocation_limit = |
1424 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 1422 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
1425 | 1423 |
1426 // Align the next allocation. Storing the filler map without checking top is | 1424 // Align the next allocation. Storing the filler map without checking top is |
1427 // safe in new-space because the limit of the heap is aligned there. | 1425 // safe in new-space because the limit of the heap is aligned there. |
1428 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1426 if ((flags & DOUBLE_ALIGNMENT) != 0) { |
1429 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); | |
1430 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 1427 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
1431 Label aligned; | 1428 Label aligned; |
1432 test(result, Immediate(kDoubleAlignmentMask)); | 1429 test(result, Immediate(kDoubleAlignmentMask)); |
1433 j(zero, &aligned, Label::kNear); | 1430 j(zero, &aligned, Label::kNear); |
1434 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { | 1431 if ((flags & PRETENURE) != 0) { |
1435 cmp(result, Operand::StaticVariable(allocation_limit)); | 1432 cmp(result, Operand::StaticVariable(allocation_limit)); |
1436 j(above_equal, gc_required); | 1433 j(above_equal, gc_required); |
1437 } | 1434 } |
1438 mov(Operand(result, 0), | 1435 mov(Operand(result, 0), |
1439 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1436 Immediate(isolate()->factory()->one_pointer_filler_map())); |
1440 add(result, Immediate(kDoubleSize / 2)); | 1437 add(result, Immediate(kDoubleSize / 2)); |
1441 bind(&aligned); | 1438 bind(&aligned); |
1442 } | 1439 } |
1443 | 1440 |
1444 // Calculate new top and bail out if space is exhausted. | 1441 // Calculate new top and bail out if space is exhausted. |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3101 if (mag.shift > 0) sar(edx, mag.shift); | 3098 if (mag.shift > 0) sar(edx, mag.shift); |
3102 mov(eax, dividend); | 3099 mov(eax, dividend); |
3103 shr(eax, 31); | 3100 shr(eax, 31); |
3104 add(edx, eax); | 3101 add(edx, eax); |
3105 } | 3102 } |
3106 | 3103 |
3107 | 3104 |
3108 } } // namespace v8::internal | 3105 } } // namespace v8::internal |
3109 | 3106 |
3110 #endif // V8_TARGET_ARCH_X87 | 3107 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |