| 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 5832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5843 __ add(r3, r3, Operand(1)); | 5843 __ add(r3, r3, Operand(1)); |
| 5844 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); | 5844 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); |
| 5845 | 5845 |
| 5846 if (FLAG_debug_code) { | 5846 if (FLAG_debug_code) { |
| 5847 __ ldr(r5, FieldMemOperand(r5, 0)); | 5847 __ ldr(r5, FieldMemOperand(r5, 0)); |
| 5848 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); | 5848 __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); |
| 5849 __ Assert(eq, kExpectedAllocationSiteInCell); | 5849 __ Assert(eq, kExpectedAllocationSiteInCell); |
| 5850 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); | 5850 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); |
| 5851 } | 5851 } |
| 5852 | 5852 |
| 5853 // Save the resulting elements kind in type info | 5853 // Save the resulting elements kind in type info. We can't just store r3 |
| 5854 __ SmiTag(r3); | 5854 // in the AllocationSite::transition_info field because elements kind is |
| 5855 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); | 5855 // restricted to a portion of the field...upper bits need to be left alone. |
| 5856 __ str(r3, FieldMemOperand(r5, AllocationSite::kTransitionInfoOffset)); | 5856 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 5857 __ SmiUntag(r3); | 5857 __ ldr(r4, FieldMemOperand(r5, AllocationSite::kTransitionInfoOffset)); |
| 5858 __ add(r4, r4, Operand(Smi::FromInt(kFastElementsKindPackedToHoley))); |
| 5859 __ str(r4, FieldMemOperand(r5, AllocationSite::kTransitionInfoOffset)); |
| 5858 | 5860 |
| 5859 __ bind(&normal_sequence); | 5861 __ bind(&normal_sequence); |
| 5860 int last_index = GetSequenceIndexFromFastElementsKind( | 5862 int last_index = GetSequenceIndexFromFastElementsKind( |
| 5861 TERMINAL_FAST_ELEMENTS_KIND); | 5863 TERMINAL_FAST_ELEMENTS_KIND); |
| 5862 for (int i = 0; i <= last_index; ++i) { | 5864 for (int i = 0; i <= last_index; ++i) { |
| 5863 Label next; | 5865 Label next; |
| 5864 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 5866 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
| 5865 __ cmp(r3, Operand(kind)); | 5867 __ cmp(r3, Operand(kind)); |
| 5866 __ b(ne, &next); | 5868 __ b(ne, &next); |
| 5867 ArraySingleArgumentConstructorStub stub(kind); | 5869 ArraySingleArgumentConstructorStub stub(kind); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5989 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); | 5991 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); |
| 5990 | 5992 |
| 5991 // If the type cell is undefined, or contains anything other than an | 5993 // If the type cell is undefined, or contains anything other than an |
| 5992 // AllocationSite, call an array constructor that doesn't use AllocationSites. | 5994 // AllocationSite, call an array constructor that doesn't use AllocationSites. |
| 5993 __ ldr(r4, FieldMemOperand(r3, 0)); | 5995 __ ldr(r4, FieldMemOperand(r3, 0)); |
| 5994 __ CompareRoot(r4, Heap::kAllocationSiteMapRootIndex); | 5996 __ CompareRoot(r4, Heap::kAllocationSiteMapRootIndex); |
| 5995 __ b(ne, &no_info); | 5997 __ b(ne, &no_info); |
| 5996 | 5998 |
| 5997 __ ldr(r3, FieldMemOperand(r3, AllocationSite::kTransitionInfoOffset)); | 5999 __ ldr(r3, FieldMemOperand(r3, AllocationSite::kTransitionInfoOffset)); |
| 5998 __ SmiUntag(r3); | 6000 __ SmiUntag(r3); |
| 6001 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 6002 __ and_(r3, r3, Operand(AllocationSite::ElementsKindBits::kMask)); |
| 5999 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 6003 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
| 6000 | 6004 |
| 6001 __ bind(&no_info); | 6005 __ bind(&no_info); |
| 6002 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 6006 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
| 6003 } | 6007 } |
| 6004 | 6008 |
| 6005 | 6009 |
| 6006 void InternalArrayConstructorStub::GenerateCase( | 6010 void InternalArrayConstructorStub::GenerateCase( |
| 6007 MacroAssembler* masm, ElementsKind kind) { | 6011 MacroAssembler* masm, ElementsKind kind) { |
| 6008 Label not_zero_case, not_one_case; | 6012 Label not_zero_case, not_one_case; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6086 __ bind(&fast_elements_case); | 6090 __ bind(&fast_elements_case); |
| 6087 GenerateCase(masm, FAST_ELEMENTS); | 6091 GenerateCase(masm, FAST_ELEMENTS); |
| 6088 } | 6092 } |
| 6089 | 6093 |
| 6090 | 6094 |
| 6091 #undef __ | 6095 #undef __ |
| 6092 | 6096 |
| 6093 } } // namespace v8::internal | 6097 } } // namespace v8::internal |
| 6094 | 6098 |
| 6095 #endif // V8_TARGET_ARCH_ARM | 6099 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |