OLD | NEW |
---|---|
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1393 // ----------------------------------- | 1393 // ----------------------------------- |
1394 | 1394 |
1395 // Push receiver, key and value for runtime call. | 1395 // Push receiver, key and value for runtime call. |
1396 __ Push(r2, r1, r0); | 1396 __ Push(r2, r1, r0); |
1397 | 1397 |
1398 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); | 1398 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); |
1399 __ TailCallExternalReference(ref, 3, 1); | 1399 __ TailCallExternalReference(ref, 3, 1); |
1400 } | 1400 } |
1401 | 1401 |
1402 | 1402 |
1403 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) { | 1403 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, |
1404 StrictModeFlag strict_mode) { | |
1404 // ---------- S t a t e -------------- | 1405 // ---------- S t a t e -------------- |
1405 // -- r0 : value | 1406 // -- r0 : value |
1406 // -- r1 : key | 1407 // -- r1 : key |
1407 // -- r2 : receiver | 1408 // -- r2 : receiver |
1408 // -- lr : return address | 1409 // -- lr : return address |
1409 // ----------------------------------- | 1410 // ----------------------------------- |
1410 | 1411 |
1411 // Push receiver, key and value for runtime call. | 1412 // Push receiver, key and value for runtime call. |
1412 __ Push(r2, r1, r0); | 1413 __ Push(r2, r1, r0); |
1413 | 1414 |
1414 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); | 1415 __ mov(r1, Operand(Smi::FromInt(NONE))); // PropertyAttributes |
1416 __ mov(r0, Operand(Smi::FromInt(strict_mode))); // Strict mode. | |
1417 __ push(r1, r0); | |
1418 | |
Martin Maly
2011/02/24 06:33:34
Once I merge strict flag into PropertyAttributes t
Lasse Reichstein
2011/02/24 12:37:54
While I appreciate saving a parameter, beging stri
| |
1419 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); | |
1415 } | 1420 } |
1416 | 1421 |
1417 | 1422 |
1418 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { | 1423 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
1424 StrictModeFlag strict_mode) { | |
1419 // ---------- S t a t e -------------- | 1425 // ---------- S t a t e -------------- |
1420 // -- r0 : value | 1426 // -- r0 : value |
1421 // -- r1 : key | 1427 // -- r1 : key |
1422 // -- r2 : receiver | 1428 // -- r2 : receiver |
1423 // -- lr : return address | 1429 // -- lr : return address |
1424 // ----------------------------------- | 1430 // ----------------------------------- |
1425 Label slow, fast, array, extra, check_pixel_array; | 1431 Label slow, fast, array, extra, check_pixel_array; |
1426 | 1432 |
1427 // Register usage. | 1433 // Register usage. |
1428 Register value = r0; | 1434 Register value = r0; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1463 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 1469 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
1464 __ cmp(key, Operand(ip)); | 1470 __ cmp(key, Operand(ip)); |
1465 __ b(lo, &fast); | 1471 __ b(lo, &fast); |
1466 | 1472 |
1467 // Slow case, handle jump to runtime. | 1473 // Slow case, handle jump to runtime. |
1468 __ bind(&slow); | 1474 __ bind(&slow); |
1469 // Entry registers are intact. | 1475 // Entry registers are intact. |
1470 // r0: value. | 1476 // r0: value. |
1471 // r1: key. | 1477 // r1: key. |
1472 // r2: receiver. | 1478 // r2: receiver. |
1473 GenerateRuntimeSetProperty(masm); | 1479 GenerateRuntimeSetProperty(masm, strict_mode); |
1474 | 1480 |
1475 // Check whether the elements is a pixel array. | 1481 // Check whether the elements is a pixel array. |
1476 // r4: elements map. | 1482 // r4: elements map. |
1477 __ bind(&check_pixel_array); | 1483 __ bind(&check_pixel_array); |
1478 GenerateFastPixelArrayStore(masm, | 1484 GenerateFastPixelArrayStore(masm, |
1479 r2, | 1485 r2, |
1480 r1, | 1486 r1, |
1481 r0, | 1487 r0, |
1482 elements, | 1488 elements, |
1483 r4, | 1489 r4, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1639 GenerateDictionaryStore(masm, &miss, r3, r2, r0, r4, r5); | 1645 GenerateDictionaryStore(masm, &miss, r3, r2, r0, r4, r5); |
1640 __ IncrementCounter(&Counters::store_normal_hit, 1, r4, r5); | 1646 __ IncrementCounter(&Counters::store_normal_hit, 1, r4, r5); |
1641 __ Ret(); | 1647 __ Ret(); |
1642 | 1648 |
1643 __ bind(&miss); | 1649 __ bind(&miss); |
1644 __ IncrementCounter(&Counters::store_normal_miss, 1, r4, r5); | 1650 __ IncrementCounter(&Counters::store_normal_miss, 1, r4, r5); |
1645 GenerateMiss(masm); | 1651 GenerateMiss(masm); |
1646 } | 1652 } |
1647 | 1653 |
1648 | 1654 |
1649 void StoreIC::GenerateGlobalProxy(MacroAssembler* masm) { | 1655 void StoreIC::GenerateGlobalProxy(MacroAssembler* masm, StrictModeFlag strict) { |
1650 // ----------- S t a t e ------------- | 1656 // ----------- S t a t e ------------- |
1651 // -- r0 : value | 1657 // -- r0 : value |
1652 // -- r1 : receiver | 1658 // -- r1 : receiver |
1653 // -- r2 : name | 1659 // -- r2 : name |
1654 // -- lr : return address | 1660 // -- lr : return address |
1655 // ----------------------------------- | 1661 // ----------------------------------- |
1656 | 1662 |
1657 __ Push(r1, r2, r0); | 1663 __ Push(r1, r2, r0); |
1658 | 1664 |
1665 __ mov(r1, Operand(Smi::FromInt(NONE))); // PropertyAttributes | |
1666 __ mov(r0, Operand(Smi::FromInt(strict))); | |
1667 __ Push(r1, r0); | |
1668 | |
1659 // Do tail-call to runtime routine. | 1669 // Do tail-call to runtime routine. |
1660 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); | 1670 __ TailCallRuntime(Runtime::kSetProperty, 5, 1); |
1661 } | 1671 } |
1662 | 1672 |
1663 | 1673 |
1664 #undef __ | 1674 #undef __ |
1665 | 1675 |
1666 | 1676 |
1667 Condition CompareIC::ComputeCondition(Token::Value op) { | 1677 Condition CompareIC::ComputeCondition(Token::Value op) { |
1668 switch (op) { | 1678 switch (op) { |
1669 case Token::EQ_STRICT: | 1679 case Token::EQ_STRICT: |
1670 case Token::EQ: | 1680 case Token::EQ: |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1779 Register reg = Assembler::GetRn(instr_at_patch); | 1789 Register reg = Assembler::GetRn(instr_at_patch); |
1780 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1790 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
1781 patcher.EmitCondition(eq); | 1791 patcher.EmitCondition(eq); |
1782 } | 1792 } |
1783 } | 1793 } |
1784 | 1794 |
1785 | 1795 |
1786 } } // namespace v8::internal | 1796 } } // namespace v8::internal |
1787 | 1797 |
1788 #endif // V8_TARGET_ARCH_ARM | 1798 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |