Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: src/arm/ic-arm.cc

Issue 11896091: Replace store array length builtin with codestub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Only inform of updating IC after actually updating it. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 1531
1532 __ Push(r1, r2, r0); 1532 __ Push(r1, r2, r0);
1533 1533
1534 // Perform tail call to the entry. 1534 // Perform tail call to the entry.
1535 ExternalReference ref = 1535 ExternalReference ref =
1536 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); 1536 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
1537 __ TailCallExternalReference(ref, 3, 1); 1537 __ TailCallExternalReference(ref, 3, 1);
1538 } 1538 }
1539 1539
1540 1540
1541 void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
1542 // ----------- S t a t e -------------
1543 // -- r0 : value
1544 // -- r1 : receiver
1545 // -- r2 : name
1546 // -- lr : return address
1547 // -----------------------------------
1548 //
1549 // This accepts as a receiver anything JSArray::SetElementsLength accepts
1550 // (currently anything except for external arrays which means anything with
1551 // elements of FixedArray type). Value must be a number, but only smis are
1552 // accepted as the most common case.
1553
1554 Label miss;
1555
1556 Register receiver = r1;
1557 Register value = r0;
1558 Register scratch = r3;
1559
1560 // Check that the receiver isn't a smi.
1561 __ JumpIfSmi(receiver, &miss);
1562
1563 // Check that the object is a JS array.
1564 __ CompareObjectType(receiver, scratch, scratch, JS_ARRAY_TYPE);
1565 __ b(ne, &miss);
1566
1567 // Check that elements are FixedArray.
1568 // We rely on StoreIC_ArrayLength below to deal with all types of
1569 // fast elements (including COW).
1570 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset));
1571 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE);
1572 __ b(ne, &miss);
1573
1574 // Check that the array has fast properties, otherwise the length
1575 // property might have been redefined.
1576 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kPropertiesOffset));
1577 __ ldr(scratch, FieldMemOperand(scratch, FixedArray::kMapOffset));
1578 __ CompareRoot(scratch, Heap::kHashTableMapRootIndex);
1579 __ b(eq, &miss);
1580
1581 // Check that value is a smi.
1582 __ JumpIfNotSmi(value, &miss);
1583
1584 // Prepare tail call to StoreIC_ArrayLength.
1585 __ Push(receiver, value);
1586
1587 ExternalReference ref =
1588 ExternalReference(IC_Utility(kStoreIC_ArrayLength), masm->isolate());
1589 __ TailCallExternalReference(ref, 2, 1);
1590
1591 __ bind(&miss);
1592
1593 GenerateMiss(masm);
1594 }
1595
1596
1597 void StoreIC::GenerateNormal(MacroAssembler* masm) { 1541 void StoreIC::GenerateNormal(MacroAssembler* masm) {
1598 // ----------- S t a t e ------------- 1542 // ----------- S t a t e -------------
1599 // -- r0 : value 1543 // -- r0 : value
1600 // -- r1 : receiver 1544 // -- r1 : receiver
1601 // -- r2 : name 1545 // -- r2 : name
1602 // -- lr : return address 1546 // -- lr : return address
1603 // ----------------------------------- 1547 // -----------------------------------
1604 Label miss; 1548 Label miss;
1605 1549
1606 GenerateStringDictionaryReceiverCheck(masm, r1, r3, r4, r5, &miss); 1550 GenerateStringDictionaryReceiverCheck(masm, r1, r3, r4, r5, &miss);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 } else { 1676 } else {
1733 ASSERT(Assembler::GetCondition(branch_instr) == ne); 1677 ASSERT(Assembler::GetCondition(branch_instr) == ne);
1734 patcher.EmitCondition(eq); 1678 patcher.EmitCondition(eq);
1735 } 1679 }
1736 } 1680 }
1737 1681
1738 1682
1739 } } // namespace v8::internal 1683 } } // namespace v8::internal
1740 1684
1741 #endif // V8_TARGET_ARCH_ARM 1685 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698