| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 // Get the value at the masked, scaled index. | 1184 // Get the value at the masked, scaled index. |
| 1185 const int kValueOffset = | 1185 const int kValueOffset = |
| 1186 SeededNumberDictionary::kElementsStartOffset + kPointerSize; | 1186 SeededNumberDictionary::kElementsStartOffset + kPointerSize; |
| 1187 mov(result, FieldOperand(elements, r2, times_pointer_size, kValueOffset)); | 1187 mov(result, FieldOperand(elements, r2, times_pointer_size, kValueOffset)); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 | 1190 |
| 1191 void MacroAssembler::LoadAllocationTopHelper(Register result, | 1191 void MacroAssembler::LoadAllocationTopHelper(Register result, |
| 1192 Register scratch, | 1192 Register scratch, |
| 1193 AllocationFlags flags) { | 1193 AllocationFlags flags) { |
| 1194 ExternalReference new_space_allocation_top = | 1194 ExternalReference allocation_top = ((flags & PRETENURE) != 0) ? |
| 1195 ExternalReference::old_pointer_space_allocation_top_address(isolate()) : |
| 1195 ExternalReference::new_space_allocation_top_address(isolate()); | 1196 ExternalReference::new_space_allocation_top_address(isolate()); |
| 1196 | 1197 |
| 1197 // Just return if allocation top is already known. | 1198 // Just return if allocation top is already known. |
| 1198 if ((flags & RESULT_CONTAINS_TOP) != 0) { | 1199 if ((flags & RESULT_CONTAINS_TOP) != 0) { |
| 1199 // No use of scratch if allocation top is provided. | 1200 // No use of scratch if allocation top is provided. |
| 1200 ASSERT(scratch.is(no_reg)); | 1201 ASSERT(scratch.is(no_reg)); |
| 1201 #ifdef DEBUG | 1202 #ifdef DEBUG |
| 1202 // Assert that result actually contains top on entry. | 1203 // Assert that result actually contains top on entry. |
| 1203 cmp(result, Operand::StaticVariable(new_space_allocation_top)); | 1204 cmp(result, Operand::StaticVariable(allocation_top)); |
| 1204 Check(equal, "Unexpected allocation top"); | 1205 Check(equal, "Unexpected allocation top"); |
| 1205 #endif | 1206 #endif |
| 1206 return; | 1207 return; |
| 1207 } | 1208 } |
| 1208 | 1209 |
| 1209 // Move address of new object to result. Use scratch register if available. | 1210 // Move address of new object to result. Use scratch register if available. |
| 1210 if (scratch.is(no_reg)) { | 1211 if (scratch.is(no_reg)) { |
| 1211 mov(result, Operand::StaticVariable(new_space_allocation_top)); | 1212 mov(result, Operand::StaticVariable(allocation_top)); |
| 1212 } else { | 1213 } else { |
| 1213 mov(scratch, Immediate(new_space_allocation_top)); | 1214 mov(scratch, Immediate(allocation_top)); |
| 1214 mov(result, Operand(scratch, 0)); | 1215 mov(result, Operand(scratch, 0)); |
| 1215 } | 1216 } |
| 1216 } | 1217 } |
| 1217 | 1218 |
| 1218 | 1219 |
| 1219 void MacroAssembler::UpdateAllocationTopHelper(Register result_end, | 1220 void MacroAssembler::UpdateAllocationTopHelper(Register result_end, |
| 1220 Register scratch) { | 1221 Register scratch, |
| 1222 AllocationFlags flags) { |
| 1221 if (emit_debug_code()) { | 1223 if (emit_debug_code()) { |
| 1222 test(result_end, Immediate(kObjectAlignmentMask)); | 1224 test(result_end, Immediate(kObjectAlignmentMask)); |
| 1223 Check(zero, "Unaligned allocation in new space"); | 1225 Check(zero, "Unaligned allocation in new space"); |
| 1224 } | 1226 } |
| 1225 | 1227 |
| 1226 ExternalReference new_space_allocation_top = | 1228 ExternalReference allocation_top = ((flags & PRETENURE) != 0) ? |
| 1229 ExternalReference::old_pointer_space_allocation_top_address(isolate()) : |
| 1227 ExternalReference::new_space_allocation_top_address(isolate()); | 1230 ExternalReference::new_space_allocation_top_address(isolate()); |
| 1228 | 1231 |
| 1229 // Update new top. Use scratch if available. | 1232 // Update new top. Use scratch if available. |
| 1230 if (scratch.is(no_reg)) { | 1233 if (scratch.is(no_reg)) { |
| 1231 mov(Operand::StaticVariable(new_space_allocation_top), result_end); | 1234 mov(Operand::StaticVariable(allocation_top), result_end); |
| 1232 } else { | 1235 } else { |
| 1233 mov(Operand(scratch, 0), result_end); | 1236 mov(Operand(scratch, 0), result_end); |
| 1234 } | 1237 } |
| 1235 } | 1238 } |
| 1236 | 1239 |
| 1237 | 1240 |
| 1238 void MacroAssembler::AllocateInNewSpace(int object_size, | 1241 void MacroAssembler::Allocate(int object_size, |
| 1239 Register result, | 1242 Register result, |
| 1240 Register result_end, | 1243 Register result_end, |
| 1241 Register scratch, | 1244 Register scratch, |
| 1242 Label* gc_required, | 1245 Label* gc_required, |
| 1243 AllocationFlags flags) { | 1246 AllocationFlags flags) { |
| 1244 ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0); | 1247 ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0); |
| 1245 if (!FLAG_inline_new) { | 1248 if (!FLAG_inline_new) { |
| 1246 if (emit_debug_code()) { | 1249 if (emit_debug_code()) { |
| 1247 // Trash the registers to simulate an allocation failure. | 1250 // Trash the registers to simulate an allocation failure. |
| 1248 mov(result, Immediate(0x7091)); | 1251 mov(result, Immediate(0x7091)); |
| 1249 if (result_end.is_valid()) { | 1252 if (result_end.is_valid()) { |
| 1250 mov(result_end, Immediate(0x7191)); | 1253 mov(result_end, Immediate(0x7191)); |
| 1251 } | 1254 } |
| 1252 if (scratch.is_valid()) { | 1255 if (scratch.is_valid()) { |
| 1253 mov(scratch, Immediate(0x7291)); | 1256 mov(scratch, Immediate(0x7291)); |
| 1254 } | 1257 } |
| 1255 } | 1258 } |
| 1256 jmp(gc_required); | 1259 jmp(gc_required); |
| 1257 return; | 1260 return; |
| 1258 } | 1261 } |
| 1259 ASSERT(!result.is(result_end)); | 1262 ASSERT(!result.is(result_end)); |
| 1260 | 1263 |
| 1261 // Load address of new object into result. | 1264 // Load address of new object into result. |
| 1262 LoadAllocationTopHelper(result, scratch, flags); | 1265 LoadAllocationTopHelper(result, scratch, flags); |
| 1263 | 1266 |
| 1264 // Align the next allocation. Storing the filler map without checking top is | 1267 // Align the next allocation. Storing the filler map without checking top is |
| 1265 // always safe because the limit of the heap is always aligned. | 1268 // always safe because the limit of the heap is always aligned. |
| 1266 if ((flags & DOUBLE_ALIGNMENT) != 0) { | 1269 if (((flags & PRETENURE) == 0) && ((flags & DOUBLE_ALIGNMENT) != 0)) { |
| 1267 ASSERT(kPointerAlignment * 2 == kDoubleAlignment); | 1270 ASSERT(kPointerAlignment * 2 == kDoubleAlignment); |
| 1268 Label aligned; | 1271 Label aligned; |
| 1269 test(result, Immediate(kDoubleAlignmentMask)); | 1272 test(result, Immediate(kDoubleAlignmentMask)); |
| 1270 j(zero, &aligned, Label::kNear); | 1273 j(zero, &aligned, Label::kNear); |
| 1271 mov(Operand(result, 0), | 1274 mov(Operand(result, 0), |
| 1272 Immediate(isolate()->factory()->one_pointer_filler_map())); | 1275 Immediate(isolate()->factory()->one_pointer_filler_map())); |
| 1273 add(result, Immediate(kDoubleSize / 2)); | 1276 add(result, Immediate(kDoubleSize / 2)); |
| 1274 bind(&aligned); | 1277 bind(&aligned); |
| 1275 } | 1278 } |
| 1276 | 1279 |
| 1277 Register top_reg = result_end.is_valid() ? result_end : result; | 1280 Register top_reg = result_end.is_valid() ? result_end : result; |
| 1278 | 1281 |
| 1279 // Calculate new top and bail out if new space is exhausted. | 1282 // Calculate new top and bail out if space is exhausted. |
| 1280 ExternalReference new_space_allocation_limit = | 1283 ExternalReference allocation_limit = ((flags & PRETENURE) != 0) ? |
| 1284 ExternalReference::old_pointer_space_allocation_limit_address( |
| 1285 isolate()) : |
| 1281 ExternalReference::new_space_allocation_limit_address(isolate()); | 1286 ExternalReference::new_space_allocation_limit_address(isolate()); |
| 1282 | 1287 |
| 1283 if (!top_reg.is(result)) { | 1288 if (!top_reg.is(result)) { |
| 1284 mov(top_reg, result); | 1289 mov(top_reg, result); |
| 1285 } | 1290 } |
| 1286 add(top_reg, Immediate(object_size)); | 1291 add(top_reg, Immediate(object_size)); |
| 1287 j(carry, gc_required); | 1292 j(carry, gc_required); |
| 1288 cmp(top_reg, Operand::StaticVariable(new_space_allocation_limit)); | 1293 cmp(top_reg, Operand::StaticVariable(allocation_limit)); |
| 1289 j(above, gc_required); | 1294 j(above, gc_required); |
| 1290 | 1295 |
| 1291 // Update allocation top. | 1296 // Update allocation top. |
| 1292 UpdateAllocationTopHelper(top_reg, scratch); | 1297 UpdateAllocationTopHelper(top_reg, scratch, flags); |
| 1293 | 1298 |
| 1294 // Tag result if requested. | 1299 // Tag result if requested. |
| 1295 bool tag_result = (flags & TAG_OBJECT) != 0; | 1300 bool tag_result = (flags & TAG_OBJECT) != 0; |
| 1296 if (top_reg.is(result)) { | 1301 if (top_reg.is(result)) { |
| 1297 if (tag_result) { | 1302 if (tag_result) { |
| 1298 sub(result, Immediate(object_size - kHeapObjectTag)); | 1303 sub(result, Immediate(object_size - kHeapObjectTag)); |
| 1299 } else { | 1304 } else { |
| 1300 sub(result, Immediate(object_size)); | 1305 sub(result, Immediate(object_size)); |
| 1301 } | 1306 } |
| 1302 } else if (tag_result) { | 1307 } else if (tag_result) { |
| 1303 ASSERT(kHeapObjectTag == 1); | 1308 ASSERT(kHeapObjectTag == 1); |
| 1304 inc(result); | 1309 inc(result); |
| 1305 } | 1310 } |
| 1306 } | 1311 } |
| 1307 | 1312 |
| 1308 | 1313 |
| 1309 void MacroAssembler::AllocateInNewSpace( | 1314 void MacroAssembler::AllocateInNewSpace( |
| 1310 int header_size, | 1315 int header_size, |
| 1311 ScaleFactor element_size, | 1316 ScaleFactor element_size, |
| 1312 Register element_count, | 1317 Register element_count, |
| 1313 RegisterValueType element_count_type, | 1318 RegisterValueType element_count_type, |
| 1314 Register result, | 1319 Register result, |
| 1315 Register result_end, | 1320 Register result_end, |
| 1316 Register scratch, | 1321 Register scratch, |
| 1317 Label* gc_required, | 1322 Label* gc_required, |
| 1318 AllocationFlags flags) { | 1323 AllocationFlags flags) { |
| 1319 ASSERT((flags & SIZE_IN_WORDS) == 0); | 1324 ASSERT((flags & SIZE_IN_WORDS) == 0); |
| 1325 ASSERT((flags & PRETENURE) == 0); |
| 1320 if (!FLAG_inline_new) { | 1326 if (!FLAG_inline_new) { |
| 1321 if (emit_debug_code()) { | 1327 if (emit_debug_code()) { |
| 1322 // Trash the registers to simulate an allocation failure. | 1328 // Trash the registers to simulate an allocation failure. |
| 1323 mov(result, Immediate(0x7091)); | 1329 mov(result, Immediate(0x7091)); |
| 1324 mov(result_end, Immediate(0x7191)); | 1330 mov(result_end, Immediate(0x7191)); |
| 1325 if (scratch.is_valid()) { | 1331 if (scratch.is_valid()) { |
| 1326 mov(scratch, Immediate(0x7291)); | 1332 mov(scratch, Immediate(0x7291)); |
| 1327 } | 1333 } |
| 1328 // Register element_count is not modified by the function. | 1334 // Register element_count is not modified by the function. |
| 1329 } | 1335 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 j(carry, gc_required); | 1375 j(carry, gc_required); |
| 1370 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); | 1376 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); |
| 1371 j(above, gc_required); | 1377 j(above, gc_required); |
| 1372 | 1378 |
| 1373 if ((flags & TAG_OBJECT) != 0) { | 1379 if ((flags & TAG_OBJECT) != 0) { |
| 1374 ASSERT(kHeapObjectTag == 1); | 1380 ASSERT(kHeapObjectTag == 1); |
| 1375 inc(result); | 1381 inc(result); |
| 1376 } | 1382 } |
| 1377 | 1383 |
| 1378 // Update allocation top. | 1384 // Update allocation top. |
| 1379 UpdateAllocationTopHelper(result_end, scratch); | 1385 UpdateAllocationTopHelper(result_end, scratch, flags); |
| 1380 } | 1386 } |
| 1381 | 1387 |
| 1382 | 1388 |
| 1383 void MacroAssembler::AllocateInNewSpace(Register object_size, | 1389 void MacroAssembler::AllocateInNewSpace(Register object_size, |
| 1384 Register result, | 1390 Register result, |
| 1385 Register result_end, | 1391 Register result_end, |
| 1386 Register scratch, | 1392 Register scratch, |
| 1387 Label* gc_required, | 1393 Label* gc_required, |
| 1388 AllocationFlags flags) { | 1394 AllocationFlags flags) { |
| 1389 ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0); | 1395 ASSERT((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0); |
| 1396 ASSERT((flags & PRETENURE) == 0); |
| 1390 if (!FLAG_inline_new) { | 1397 if (!FLAG_inline_new) { |
| 1391 if (emit_debug_code()) { | 1398 if (emit_debug_code()) { |
| 1392 // Trash the registers to simulate an allocation failure. | 1399 // Trash the registers to simulate an allocation failure. |
| 1393 mov(result, Immediate(0x7091)); | 1400 mov(result, Immediate(0x7091)); |
| 1394 mov(result_end, Immediate(0x7191)); | 1401 mov(result_end, Immediate(0x7191)); |
| 1395 if (scratch.is_valid()) { | 1402 if (scratch.is_valid()) { |
| 1396 mov(scratch, Immediate(0x7291)); | 1403 mov(scratch, Immediate(0x7291)); |
| 1397 } | 1404 } |
| 1398 // object_size is left unchanged by this function. | 1405 // object_size is left unchanged by this function. |
| 1399 } | 1406 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1429 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); | 1436 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); |
| 1430 j(above, gc_required); | 1437 j(above, gc_required); |
| 1431 | 1438 |
| 1432 // Tag result if requested. | 1439 // Tag result if requested. |
| 1433 if ((flags & TAG_OBJECT) != 0) { | 1440 if ((flags & TAG_OBJECT) != 0) { |
| 1434 ASSERT(kHeapObjectTag == 1); | 1441 ASSERT(kHeapObjectTag == 1); |
| 1435 inc(result); | 1442 inc(result); |
| 1436 } | 1443 } |
| 1437 | 1444 |
| 1438 // Update allocation top. | 1445 // Update allocation top. |
| 1439 UpdateAllocationTopHelper(result_end, scratch); | 1446 UpdateAllocationTopHelper(result_end, scratch, flags); |
| 1440 } | 1447 } |
| 1441 | 1448 |
| 1442 | 1449 |
| 1443 void MacroAssembler::UndoAllocationInNewSpace(Register object) { | 1450 void MacroAssembler::UndoAllocationInNewSpace(Register object) { |
| 1444 ExternalReference new_space_allocation_top = | 1451 ExternalReference new_space_allocation_top = |
| 1445 ExternalReference::new_space_allocation_top_address(isolate()); | 1452 ExternalReference::new_space_allocation_top_address(isolate()); |
| 1446 | 1453 |
| 1447 // Make sure the object has no tag before resetting top. | 1454 // Make sure the object has no tag before resetting top. |
| 1448 and_(object, Immediate(~kHeapObjectTagMask)); | 1455 and_(object, Immediate(~kHeapObjectTagMask)); |
| 1449 #ifdef DEBUG | 1456 #ifdef DEBUG |
| 1450 cmp(object, Operand::StaticVariable(new_space_allocation_top)); | 1457 cmp(object, Operand::StaticVariable(new_space_allocation_top)); |
| 1451 Check(below, "Undo allocation of non allocated memory"); | 1458 Check(below, "Undo allocation of non allocated memory"); |
| 1452 #endif | 1459 #endif |
| 1453 mov(Operand::StaticVariable(new_space_allocation_top), object); | 1460 mov(Operand::StaticVariable(new_space_allocation_top), object); |
| 1454 } | 1461 } |
| 1455 | 1462 |
| 1456 | 1463 |
| 1457 void MacroAssembler::AllocateHeapNumber(Register result, | 1464 void MacroAssembler::AllocateHeapNumber(Register result, |
| 1458 Register scratch1, | 1465 Register scratch1, |
| 1459 Register scratch2, | 1466 Register scratch2, |
| 1460 Label* gc_required) { | 1467 Label* gc_required) { |
| 1461 // Allocate heap number in new space. | 1468 // Allocate heap number in new space. |
| 1462 AllocateInNewSpace(HeapNumber::kSize, | 1469 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
| 1463 result, | 1470 TAG_OBJECT); |
| 1464 scratch1, | |
| 1465 scratch2, | |
| 1466 gc_required, | |
| 1467 TAG_OBJECT); | |
| 1468 | 1471 |
| 1469 // Set the map. | 1472 // Set the map. |
| 1470 mov(FieldOperand(result, HeapObject::kMapOffset), | 1473 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1471 Immediate(isolate()->factory()->heap_number_map())); | 1474 Immediate(isolate()->factory()->heap_number_map())); |
| 1472 } | 1475 } |
| 1473 | 1476 |
| 1474 | 1477 |
| 1475 void MacroAssembler::AllocateTwoByteString(Register result, | 1478 void MacroAssembler::AllocateTwoByteString(Register result, |
| 1476 Register length, | 1479 Register length, |
| 1477 Register scratch1, | 1480 Register scratch1, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 | 1548 |
| 1546 | 1549 |
| 1547 void MacroAssembler::AllocateAsciiString(Register result, | 1550 void MacroAssembler::AllocateAsciiString(Register result, |
| 1548 int length, | 1551 int length, |
| 1549 Register scratch1, | 1552 Register scratch1, |
| 1550 Register scratch2, | 1553 Register scratch2, |
| 1551 Label* gc_required) { | 1554 Label* gc_required) { |
| 1552 ASSERT(length > 0); | 1555 ASSERT(length > 0); |
| 1553 | 1556 |
| 1554 // Allocate ASCII string in new space. | 1557 // Allocate ASCII string in new space. |
| 1555 AllocateInNewSpace(SeqOneByteString::SizeFor(length), | 1558 Allocate(SeqOneByteString::SizeFor(length), result, scratch1, scratch2, |
| 1556 result, | 1559 gc_required, TAG_OBJECT); |
| 1557 scratch1, | |
| 1558 scratch2, | |
| 1559 gc_required, | |
| 1560 TAG_OBJECT); | |
| 1561 | 1560 |
| 1562 // Set the map, length and hash field. | 1561 // Set the map, length and hash field. |
| 1563 mov(FieldOperand(result, HeapObject::kMapOffset), | 1562 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1564 Immediate(isolate()->factory()->ascii_string_map())); | 1563 Immediate(isolate()->factory()->ascii_string_map())); |
| 1565 mov(FieldOperand(result, String::kLengthOffset), | 1564 mov(FieldOperand(result, String::kLengthOffset), |
| 1566 Immediate(Smi::FromInt(length))); | 1565 Immediate(Smi::FromInt(length))); |
| 1567 mov(FieldOperand(result, String::kHashFieldOffset), | 1566 mov(FieldOperand(result, String::kHashFieldOffset), |
| 1568 Immediate(String::kEmptyHashField)); | 1567 Immediate(String::kEmptyHashField)); |
| 1569 } | 1568 } |
| 1570 | 1569 |
| 1571 | 1570 |
| 1572 void MacroAssembler::AllocateTwoByteConsString(Register result, | 1571 void MacroAssembler::AllocateTwoByteConsString(Register result, |
| 1573 Register scratch1, | 1572 Register scratch1, |
| 1574 Register scratch2, | 1573 Register scratch2, |
| 1575 Label* gc_required) { | 1574 Label* gc_required) { |
| 1576 // Allocate heap number in new space. | 1575 // Allocate heap number in new space. |
| 1577 AllocateInNewSpace(ConsString::kSize, | 1576 Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required, |
| 1578 result, | 1577 TAG_OBJECT); |
| 1579 scratch1, | |
| 1580 scratch2, | |
| 1581 gc_required, | |
| 1582 TAG_OBJECT); | |
| 1583 | 1578 |
| 1584 // Set the map. The other fields are left uninitialized. | 1579 // Set the map. The other fields are left uninitialized. |
| 1585 mov(FieldOperand(result, HeapObject::kMapOffset), | 1580 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1586 Immediate(isolate()->factory()->cons_string_map())); | 1581 Immediate(isolate()->factory()->cons_string_map())); |
| 1587 } | 1582 } |
| 1588 | 1583 |
| 1589 | 1584 |
| 1590 void MacroAssembler::AllocateAsciiConsString(Register result, | 1585 void MacroAssembler::AllocateAsciiConsString(Register result, |
| 1591 Register scratch1, | 1586 Register scratch1, |
| 1592 Register scratch2, | 1587 Register scratch2, |
| 1593 Label* gc_required) { | 1588 Label* gc_required) { |
| 1594 // Allocate heap number in new space. | 1589 // Allocate heap number in new space. |
| 1595 AllocateInNewSpace(ConsString::kSize, | 1590 Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required, |
| 1596 result, | 1591 TAG_OBJECT); |
| 1597 scratch1, | |
| 1598 scratch2, | |
| 1599 gc_required, | |
| 1600 TAG_OBJECT); | |
| 1601 | 1592 |
| 1602 // Set the map. The other fields are left uninitialized. | 1593 // Set the map. The other fields are left uninitialized. |
| 1603 mov(FieldOperand(result, HeapObject::kMapOffset), | 1594 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1604 Immediate(isolate()->factory()->cons_ascii_string_map())); | 1595 Immediate(isolate()->factory()->cons_ascii_string_map())); |
| 1605 } | 1596 } |
| 1606 | 1597 |
| 1607 | 1598 |
| 1608 void MacroAssembler::AllocateTwoByteSlicedString(Register result, | 1599 void MacroAssembler::AllocateTwoByteSlicedString(Register result, |
| 1609 Register scratch1, | 1600 Register scratch1, |
| 1610 Register scratch2, | 1601 Register scratch2, |
| 1611 Label* gc_required) { | 1602 Label* gc_required) { |
| 1612 // Allocate heap number in new space. | 1603 // Allocate heap number in new space. |
| 1613 AllocateInNewSpace(SlicedString::kSize, | 1604 Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required, |
| 1614 result, | 1605 TAG_OBJECT); |
| 1615 scratch1, | |
| 1616 scratch2, | |
| 1617 gc_required, | |
| 1618 TAG_OBJECT); | |
| 1619 | 1606 |
| 1620 // Set the map. The other fields are left uninitialized. | 1607 // Set the map. The other fields are left uninitialized. |
| 1621 mov(FieldOperand(result, HeapObject::kMapOffset), | 1608 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1622 Immediate(isolate()->factory()->sliced_string_map())); | 1609 Immediate(isolate()->factory()->sliced_string_map())); |
| 1623 } | 1610 } |
| 1624 | 1611 |
| 1625 | 1612 |
| 1626 void MacroAssembler::AllocateAsciiSlicedString(Register result, | 1613 void MacroAssembler::AllocateAsciiSlicedString(Register result, |
| 1627 Register scratch1, | 1614 Register scratch1, |
| 1628 Register scratch2, | 1615 Register scratch2, |
| 1629 Label* gc_required) { | 1616 Label* gc_required) { |
| 1630 // Allocate heap number in new space. | 1617 // Allocate heap number in new space. |
| 1631 AllocateInNewSpace(SlicedString::kSize, | 1618 Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required, |
| 1632 result, | 1619 TAG_OBJECT); |
| 1633 scratch1, | |
| 1634 scratch2, | |
| 1635 gc_required, | |
| 1636 TAG_OBJECT); | |
| 1637 | 1620 |
| 1638 // Set the map. The other fields are left uninitialized. | 1621 // Set the map. The other fields are left uninitialized. |
| 1639 mov(FieldOperand(result, HeapObject::kMapOffset), | 1622 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1640 Immediate(isolate()->factory()->sliced_ascii_string_map())); | 1623 Immediate(isolate()->factory()->sliced_ascii_string_map())); |
| 1641 } | 1624 } |
| 1642 | 1625 |
| 1643 | 1626 |
| 1644 // Copy memory, byte-by-byte, from source to destination. Not optimized for | 1627 // Copy memory, byte-by-byte, from source to destination. Not optimized for |
| 1645 // long or aligned copies. The contents of scratch and length are destroyed. | 1628 // long or aligned copies. The contents of scratch and length are destroyed. |
| 1646 // Source and destination are incremented by length. | 1629 // Source and destination are incremented by length. |
| (...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3081 j(greater, &no_info_available); | 3064 j(greater, &no_info_available); |
| 3082 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 3065 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
| 3083 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3066 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
| 3084 bind(&no_info_available); | 3067 bind(&no_info_available); |
| 3085 } | 3068 } |
| 3086 | 3069 |
| 3087 | 3070 |
| 3088 } } // namespace v8::internal | 3071 } } // namespace v8::internal |
| 3089 | 3072 |
| 3090 #endif // V8_TARGET_ARCH_IA32 | 3073 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |