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

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

Issue 7929001: Initialize pre-allocated fields of JSObject with undefined. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added ARM port. Created 9 years, 3 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 | « no previous file | src/arm/macro-assembler-arm.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 __ str(r6, MemOperand(r5, kPointerSize, PostIndex)); 743 __ str(r6, MemOperand(r5, kPointerSize, PostIndex));
744 744
745 // Fill all the in-object properties with the appropriate filler. 745 // Fill all the in-object properties with the appropriate filler.
746 // r1: constructor function 746 // r1: constructor function
747 // r2: initial map 747 // r2: initial map
748 // r3: object size (in words) 748 // r3: object size (in words)
749 // r4: JSObject (not tagged) 749 // r4: JSObject (not tagged)
750 // r5: First in-object property of JSObject (not tagged) 750 // r5: First in-object property of JSObject (not tagged)
751 __ add(r6, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. 751 __ add(r6, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object.
752 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); 752 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize);
753 { Label loop, entry; 753 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex);
754 if (count_constructions) { 754 if (count_constructions) {
755 // To allow for truncation. 755 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset));
756 __ LoadRoot(r7, Heap::kOnePointerFillerMapRootIndex); 756 __ Ubfx(r0, r0, Map::kPreAllocatedPropertyFieldsByte * 8, 8);
757 } else { 757 __ add(r0, r5, Operand(r0, LSL, kPointerSizeLog2));
758 __ LoadRoot(r7, Heap::kUndefinedValueRootIndex); 758 // r0: offset of first field after pre-allocated fields
759 if (FLAG_debug_code) {
760 __ cmp(r0, r6);
761 __ Assert(le, "Unexpected number of pre-allocated property fields.");
759 } 762 }
760 __ b(&entry); 763 __ InitializeFieldsWithFiller(r5, r0, r7);
761 __ bind(&loop); 764 // To allow for truncation.
762 __ str(r7, MemOperand(r5, kPointerSize, PostIndex)); 765 __ LoadRoot(r7, Heap::kOnePointerFillerMapRootIndex);
763 __ bind(&entry);
764 __ cmp(r5, r6);
765 __ b(lt, &loop);
766 } 766 }
767 __ InitializeFieldsWithFiller(r5, r6, r7);
767 768
768 // Add the object tag to make the JSObject real, so that we can continue 769 // Add the object tag to make the JSObject real, so that we can continue
769 // and jump into the continuation code at any time from now on. Any 770 // and jump into the continuation code at any time from now on. Any
770 // failures need to undo the allocation, so that the heap is in a 771 // failures need to undo the allocation, so that the heap is in a
771 // consistent state and verifiable. 772 // consistent state and verifiable.
772 __ add(r4, r4, Operand(kHeapObjectTag)); 773 __ add(r4, r4, Operand(kHeapObjectTag));
773 774
774 // Check if a non-empty properties array is needed. Continue with 775 // Check if a non-empty properties array is needed. Continue with
775 // allocated object if not fall through to runtime call if it is. 776 // allocated object if not fall through to runtime call if it is.
776 // r1: constructor function 777 // r1: constructor function
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 __ bind(&dont_adapt_arguments); 1715 __ bind(&dont_adapt_arguments);
1715 __ Jump(r3); 1716 __ Jump(r3);
1716 } 1717 }
1717 1718
1718 1719
1719 #undef __ 1720 #undef __
1720 1721
1721 } } // namespace v8::internal 1722 } } // namespace v8::internal
1722 1723
1723 #endif // V8_TARGET_ARCH_ARM 1724 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698