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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 __ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset)); | 563 __ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset)); |
564 | 564 |
565 // Check that it has indexed interceptor and access checks | 565 // Check that it has indexed interceptor and access checks |
566 // are not enabled for this object. | 566 // are not enabled for this object. |
567 __ movb(rcx, FieldOperand(rcx, Map::kBitFieldOffset)); | 567 __ movb(rcx, FieldOperand(rcx, Map::kBitFieldOffset)); |
568 __ andb(rcx, Immediate(kSlowCaseBitFieldMask)); | 568 __ andb(rcx, Immediate(kSlowCaseBitFieldMask)); |
569 __ cmpb(rcx, Immediate(1 << Map::kHasIndexedInterceptor)); | 569 __ cmpb(rcx, Immediate(1 << Map::kHasIndexedInterceptor)); |
570 __ j(not_zero, &slow); | 570 __ j(not_zero, &slow); |
571 | 571 |
572 // Everything is fine, call runtime. | 572 // Everything is fine, call runtime. |
573 __ PopReturnAddressTo(rcx); | 573 __ pop(rcx); |
574 __ push(rdx); // receiver | 574 __ push(rdx); // receiver |
575 __ push(rax); // key | 575 __ push(rax); // key |
576 __ PushReturnAddressFrom(rcx); | 576 __ push(rcx); // return address |
577 | 577 |
578 // Perform tail call to the entry. | 578 // Perform tail call to the entry. |
579 __ TailCallExternalReference( | 579 __ TailCallExternalReference( |
580 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 580 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
581 masm->isolate()), | 581 masm->isolate()), |
582 2, | 582 2, |
583 1); | 583 1); |
584 | 584 |
585 __ bind(&slow); | 585 __ bind(&slow); |
586 GenerateMiss(masm, MISS); | 586 GenerateMiss(masm, MISS); |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 1362 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
1363 // ----------- S t a t e ------------- | 1363 // ----------- S t a t e ------------- |
1364 // -- rax : receiver | 1364 // -- rax : receiver |
1365 // -- rcx : name | 1365 // -- rcx : name |
1366 // -- rsp[0] : return address | 1366 // -- rsp[0] : return address |
1367 // ----------------------------------- | 1367 // ----------------------------------- |
1368 | 1368 |
1369 Counters* counters = masm->isolate()->counters(); | 1369 Counters* counters = masm->isolate()->counters(); |
1370 __ IncrementCounter(counters->load_miss(), 1); | 1370 __ IncrementCounter(counters->load_miss(), 1); |
1371 | 1371 |
1372 __ PopReturnAddressTo(rbx); | 1372 __ pop(rbx); |
1373 __ push(rax); // receiver | 1373 __ push(rax); // receiver |
1374 __ push(rcx); // name | 1374 __ push(rcx); // name |
1375 __ PushReturnAddressFrom(rbx); | 1375 __ push(rbx); // return address |
1376 | 1376 |
1377 // Perform tail call to the entry. | 1377 // Perform tail call to the entry. |
1378 ExternalReference ref = | 1378 ExternalReference ref = |
1379 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | 1379 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); |
1380 __ TailCallExternalReference(ref, 2, 1); | 1380 __ TailCallExternalReference(ref, 2, 1); |
1381 } | 1381 } |
1382 | 1382 |
1383 | 1383 |
1384 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1384 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
1385 // ----------- S t a t e ------------- | 1385 // ----------- S t a t e ------------- |
1386 // -- rax : receiver | 1386 // -- rax : receiver |
1387 // -- rcx : name | 1387 // -- rcx : name |
1388 // -- rsp[0] : return address | 1388 // -- rsp[0] : return address |
1389 // ----------------------------------- | 1389 // ----------------------------------- |
1390 | 1390 |
1391 __ PopReturnAddressTo(rbx); | 1391 __ pop(rbx); |
1392 __ push(rax); // receiver | 1392 __ push(rax); // receiver |
1393 __ push(rcx); // name | 1393 __ push(rcx); // name |
1394 __ PushReturnAddressFrom(rbx); | 1394 __ push(rbx); // return address |
1395 | 1395 |
1396 // Perform tail call to the entry. | 1396 // Perform tail call to the entry. |
1397 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); | 1397 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
1398 } | 1398 } |
1399 | 1399 |
1400 | 1400 |
1401 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { | 1401 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { |
1402 // ----------- S t a t e ------------- | 1402 // ----------- S t a t e ------------- |
1403 // -- rax : key | 1403 // -- rax : key |
1404 // -- rdx : receiver | 1404 // -- rdx : receiver |
1405 // -- rsp[0] : return address | 1405 // -- rsp[0] : return address |
1406 // ----------------------------------- | 1406 // ----------------------------------- |
1407 | 1407 |
1408 Counters* counters = masm->isolate()->counters(); | 1408 Counters* counters = masm->isolate()->counters(); |
1409 __ IncrementCounter(counters->keyed_load_miss(), 1); | 1409 __ IncrementCounter(counters->keyed_load_miss(), 1); |
1410 | 1410 |
1411 __ PopReturnAddressTo(rbx); | 1411 __ pop(rbx); |
1412 __ push(rdx); // receiver | 1412 __ push(rdx); // receiver |
1413 __ push(rax); // name | 1413 __ push(rax); // name |
1414 __ PushReturnAddressFrom(rbx); | 1414 __ push(rbx); // return address |
1415 | 1415 |
1416 // Perform tail call to the entry. | 1416 // Perform tail call to the entry. |
1417 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC | 1417 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC |
1418 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), | 1418 ? ExternalReference(IC_Utility(kKeyedLoadIC_MissForceGeneric), |
1419 masm->isolate()) | 1419 masm->isolate()) |
1420 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 1420 : ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
1421 __ TailCallExternalReference(ref, 2, 1); | 1421 __ TailCallExternalReference(ref, 2, 1); |
1422 } | 1422 } |
1423 | 1423 |
1424 | 1424 |
1425 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1425 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
1426 // ----------- S t a t e ------------- | 1426 // ----------- S t a t e ------------- |
1427 // -- rax : key | 1427 // -- rax : key |
1428 // -- rdx : receiver | 1428 // -- rdx : receiver |
1429 // -- rsp[0] : return address | 1429 // -- rsp[0] : return address |
1430 // ----------------------------------- | 1430 // ----------------------------------- |
1431 | 1431 |
1432 __ PopReturnAddressTo(rbx); | 1432 __ pop(rbx); |
1433 __ push(rdx); // receiver | 1433 __ push(rdx); // receiver |
1434 __ push(rax); // name | 1434 __ push(rax); // name |
1435 __ PushReturnAddressFrom(rbx); | 1435 __ push(rbx); // return address |
1436 | 1436 |
1437 // Perform tail call to the entry. | 1437 // Perform tail call to the entry. |
1438 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); | 1438 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
1439 } | 1439 } |
1440 | 1440 |
1441 | 1441 |
1442 void StoreIC::GenerateMegamorphic(MacroAssembler* masm, | 1442 void StoreIC::GenerateMegamorphic(MacroAssembler* masm, |
1443 StrictModeFlag strict_mode) { | 1443 StrictModeFlag strict_mode) { |
1444 // ----------- S t a t e ------------- | 1444 // ----------- S t a t e ------------- |
1445 // -- rax : value | 1445 // -- rax : value |
(...skipping 15 matching lines...) Expand all Loading... |
1461 | 1461 |
1462 | 1462 |
1463 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 1463 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
1464 // ----------- S t a t e ------------- | 1464 // ----------- S t a t e ------------- |
1465 // -- rax : value | 1465 // -- rax : value |
1466 // -- rcx : name | 1466 // -- rcx : name |
1467 // -- rdx : receiver | 1467 // -- rdx : receiver |
1468 // -- rsp[0] : return address | 1468 // -- rsp[0] : return address |
1469 // ----------------------------------- | 1469 // ----------------------------------- |
1470 | 1470 |
1471 __ PopReturnAddressTo(rbx); | 1471 __ pop(rbx); |
1472 __ push(rdx); // receiver | 1472 __ push(rdx); // receiver |
1473 __ push(rcx); // name | 1473 __ push(rcx); // name |
1474 __ push(rax); // value | 1474 __ push(rax); // value |
1475 __ PushReturnAddressFrom(rbx); | 1475 __ push(rbx); // return address |
1476 | 1476 |
1477 // Perform tail call to the entry. | 1477 // Perform tail call to the entry. |
1478 ExternalReference ref = | 1478 ExternalReference ref = |
1479 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); | 1479 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); |
1480 __ TailCallExternalReference(ref, 3, 1); | 1480 __ TailCallExternalReference(ref, 3, 1); |
1481 } | 1481 } |
1482 | 1482 |
1483 | 1483 |
1484 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 1484 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
1485 // ----------- S t a t e ------------- | 1485 // ----------- S t a t e ------------- |
(...skipping 19 matching lines...) Expand all Loading... |
1505 | 1505 |
1506 | 1506 |
1507 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | 1507 void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
1508 StrictModeFlag strict_mode) { | 1508 StrictModeFlag strict_mode) { |
1509 // ----------- S t a t e ------------- | 1509 // ----------- S t a t e ------------- |
1510 // -- rax : value | 1510 // -- rax : value |
1511 // -- rcx : name | 1511 // -- rcx : name |
1512 // -- rdx : receiver | 1512 // -- rdx : receiver |
1513 // -- rsp[0] : return address | 1513 // -- rsp[0] : return address |
1514 // ----------------------------------- | 1514 // ----------------------------------- |
1515 __ PopReturnAddressTo(rbx); | 1515 __ pop(rbx); |
1516 __ push(rdx); | 1516 __ push(rdx); |
1517 __ push(rcx); | 1517 __ push(rcx); |
1518 __ push(rax); | 1518 __ push(rax); |
1519 __ Push(Smi::FromInt(NONE)); // PropertyAttributes | 1519 __ Push(Smi::FromInt(NONE)); // PropertyAttributes |
1520 __ Push(Smi::FromInt(strict_mode)); | 1520 __ Push(Smi::FromInt(strict_mode)); |
1521 __ PushReturnAddressFrom(rbx); | 1521 __ push(rbx); // return address |
1522 | 1522 |
1523 // Do tail-call to runtime routine. | 1523 // Do tail-call to runtime routine. |
1524 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); | 1524 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); |
1525 } | 1525 } |
1526 | 1526 |
1527 | 1527 |
1528 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, | 1528 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
1529 StrictModeFlag strict_mode) { | 1529 StrictModeFlag strict_mode) { |
1530 // ----------- S t a t e ------------- | 1530 // ----------- S t a t e ------------- |
1531 // -- rax : value | 1531 // -- rax : value |
1532 // -- rcx : key | 1532 // -- rcx : key |
1533 // -- rdx : receiver | 1533 // -- rdx : receiver |
1534 // -- rsp[0] : return address | 1534 // -- rsp[0] : return address |
1535 // ----------------------------------- | 1535 // ----------------------------------- |
1536 | 1536 |
1537 __ PopReturnAddressTo(rbx); | 1537 __ pop(rbx); |
1538 __ push(rdx); // receiver | 1538 __ push(rdx); // receiver |
1539 __ push(rcx); // key | 1539 __ push(rcx); // key |
1540 __ push(rax); // value | 1540 __ push(rax); // value |
1541 __ Push(Smi::FromInt(NONE)); // PropertyAttributes | 1541 __ Push(Smi::FromInt(NONE)); // PropertyAttributes |
1542 __ Push(Smi::FromInt(strict_mode)); // Strict mode. | 1542 __ Push(Smi::FromInt(strict_mode)); // Strict mode. |
1543 __ PushReturnAddressFrom(rbx); | 1543 __ push(rbx); // return address |
1544 | 1544 |
1545 // Do tail-call to runtime routine. | 1545 // Do tail-call to runtime routine. |
1546 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); | 1546 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); |
1547 } | 1547 } |
1548 | 1548 |
1549 | 1549 |
1550 void StoreIC::GenerateSlow(MacroAssembler* masm) { | 1550 void StoreIC::GenerateSlow(MacroAssembler* masm) { |
1551 // ----------- S t a t e ------------- | 1551 // ----------- S t a t e ------------- |
1552 // -- rax : value | 1552 // -- rax : value |
1553 // -- rcx : key | 1553 // -- rcx : key |
1554 // -- rdx : receiver | 1554 // -- rdx : receiver |
1555 // -- rsp[0] : return address | 1555 // -- rsp[0] : return address |
1556 // ----------------------------------- | 1556 // ----------------------------------- |
1557 | 1557 |
1558 __ PopReturnAddressTo(rbx); | 1558 __ pop(rbx); |
1559 __ push(rdx); // receiver | 1559 __ push(rdx); // receiver |
1560 __ push(rcx); // key | 1560 __ push(rcx); // key |
1561 __ push(rax); // value | 1561 __ push(rax); // value |
1562 __ PushReturnAddressFrom(rbx); | 1562 __ push(rbx); // return address |
1563 | 1563 |
1564 // Do tail-call to runtime routine. | 1564 // Do tail-call to runtime routine. |
1565 ExternalReference ref(IC_Utility(kStoreIC_Slow), masm->isolate()); | 1565 ExternalReference ref(IC_Utility(kStoreIC_Slow), masm->isolate()); |
1566 __ TailCallExternalReference(ref, 3, 1); | 1566 __ TailCallExternalReference(ref, 3, 1); |
1567 } | 1567 } |
1568 | 1568 |
1569 | 1569 |
1570 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { | 1570 void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { |
1571 // ----------- S t a t e ------------- | 1571 // ----------- S t a t e ------------- |
1572 // -- rax : value | 1572 // -- rax : value |
1573 // -- rcx : key | 1573 // -- rcx : key |
1574 // -- rdx : receiver | 1574 // -- rdx : receiver |
1575 // -- rsp[0] : return address | 1575 // -- rsp[0] : return address |
1576 // ----------------------------------- | 1576 // ----------------------------------- |
1577 | 1577 |
1578 __ PopReturnAddressTo(rbx); | 1578 __ pop(rbx); |
1579 __ push(rdx); // receiver | 1579 __ push(rdx); // receiver |
1580 __ push(rcx); // key | 1580 __ push(rcx); // key |
1581 __ push(rax); // value | 1581 __ push(rax); // value |
1582 __ PushReturnAddressFrom(rbx); | 1582 __ push(rbx); // return address |
1583 | 1583 |
1584 // Do tail-call to runtime routine. | 1584 // Do tail-call to runtime routine. |
1585 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); | 1585 ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate()); |
1586 __ TailCallExternalReference(ref, 3, 1); | 1586 __ TailCallExternalReference(ref, 3, 1); |
1587 } | 1587 } |
1588 | 1588 |
1589 | 1589 |
1590 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { | 1590 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm, ICMissMode miss_mode) { |
1591 // ----------- S t a t e ------------- | 1591 // ----------- S t a t e ------------- |
1592 // -- rax : value | 1592 // -- rax : value |
1593 // -- rcx : key | 1593 // -- rcx : key |
1594 // -- rdx : receiver | 1594 // -- rdx : receiver |
1595 // -- rsp[0] : return address | 1595 // -- rsp[0] : return address |
1596 // ----------------------------------- | 1596 // ----------------------------------- |
1597 | 1597 |
1598 __ PopReturnAddressTo(rbx); | 1598 __ pop(rbx); |
1599 __ push(rdx); // receiver | 1599 __ push(rdx); // receiver |
1600 __ push(rcx); // key | 1600 __ push(rcx); // key |
1601 __ push(rax); // value | 1601 __ push(rax); // value |
1602 __ PushReturnAddressFrom(rbx); | 1602 __ push(rbx); // return address |
1603 | 1603 |
1604 // Do tail-call to runtime routine. | 1604 // Do tail-call to runtime routine. |
1605 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC | 1605 ExternalReference ref = miss_mode == MISS_FORCE_GENERIC |
1606 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), | 1606 ? ExternalReference(IC_Utility(kKeyedStoreIC_MissForceGeneric), |
1607 masm->isolate()) | 1607 masm->isolate()) |
1608 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 1608 : ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
1609 __ TailCallExternalReference(ref, 3, 1); | 1609 __ TailCallExternalReference(ref, 3, 1); |
1610 } | 1610 } |
1611 | 1611 |
1612 | 1612 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1677 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1677 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
1678 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1678 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
1679 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1679 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
1680 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1680 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1681 } | 1681 } |
1682 | 1682 |
1683 | 1683 |
1684 } } // namespace v8::internal | 1684 } } // namespace v8::internal |
1685 | 1685 |
1686 #endif // V8_TARGET_ARCH_X64 | 1686 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |