Chromium Code Reviews| 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 5987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5998 __ Addu(a3, a3, Operand(1)); | 5998 __ Addu(a3, a3, Operand(1)); |
| 5999 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 5999 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); |
| 6000 | 6000 |
| 6001 if (FLAG_debug_code) { | 6001 if (FLAG_debug_code) { |
| 6002 __ lw(t1, FieldMemOperand(t1, 0)); | 6002 __ lw(t1, FieldMemOperand(t1, 0)); |
| 6003 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 6003 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
| 6004 __ Assert(eq, kExpectedAllocationSiteInCell, t1, Operand(at)); | 6004 __ Assert(eq, kExpectedAllocationSiteInCell, t1, Operand(at)); |
| 6005 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 6005 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); |
| 6006 } | 6006 } |
| 6007 | 6007 |
| 6008 // Save the resulting elements kind in type info | 6008 // Save the resulting elements kind in type info. We can't just store r3 |
|
Paul Lind
2013/11/14 18:36:15
comment nit: register a3
| |
| 6009 __ SmiTag(a3); | 6009 // in the AllocationSite::transition_info field because elements kind is |
| 6010 __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 6010 // restricted to a portion of the field...upper bits need to be left alone. |
| 6011 __ sw(a3, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); | 6011 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 6012 __ SmiUntag(a3); | 6012 __ lw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); |
| 6013 __ Addu(t0, t0, Operand(Smi::FromInt(kFastElementsKindPackedToHoley))); | |
| 6014 __ sw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); | |
| 6015 | |
| 6013 | 6016 |
| 6014 __ bind(&normal_sequence); | 6017 __ bind(&normal_sequence); |
| 6015 int last_index = GetSequenceIndexFromFastElementsKind( | 6018 int last_index = GetSequenceIndexFromFastElementsKind( |
| 6016 TERMINAL_FAST_ELEMENTS_KIND); | 6019 TERMINAL_FAST_ELEMENTS_KIND); |
| 6017 for (int i = 0; i <= last_index; ++i) { | 6020 for (int i = 0; i <= last_index; ++i) { |
| 6018 Label next; | 6021 Label next; |
| 6019 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 6022 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
| 6020 __ Branch(&next, ne, a3, Operand(kind)); | 6023 __ Branch(&next, ne, a3, Operand(kind)); |
| 6021 ArraySingleArgumentConstructorStub stub(kind); | 6024 ArraySingleArgumentConstructorStub stub(kind); |
| 6022 __ TailCallStub(&stub); | 6025 __ TailCallStub(&stub); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6144 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); | 6147 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); |
| 6145 | 6148 |
| 6146 // If the type cell is undefined, or contains anything other than an | 6149 // If the type cell is undefined, or contains anything other than an |
| 6147 // AllocationSite, call an array constructor that doesn't use AllocationSites. | 6150 // AllocationSite, call an array constructor that doesn't use AllocationSites. |
| 6148 __ lw(t0, FieldMemOperand(a3, 0)); | 6151 __ lw(t0, FieldMemOperand(a3, 0)); |
| 6149 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 6152 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
| 6150 __ Branch(&no_info, ne, t0, Operand(at)); | 6153 __ Branch(&no_info, ne, t0, Operand(at)); |
| 6151 | 6154 |
| 6152 __ lw(a3, FieldMemOperand(a3, AllocationSite::kTransitionInfoOffset)); | 6155 __ lw(a3, FieldMemOperand(a3, AllocationSite::kTransitionInfoOffset)); |
| 6153 __ SmiUntag(a3); | 6156 __ SmiUntag(a3); |
| 6157 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | |
| 6158 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); | |
| 6154 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 6159 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
| 6155 | 6160 |
| 6156 __ bind(&no_info); | 6161 __ bind(&no_info); |
| 6157 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 6162 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
| 6158 } | 6163 } |
| 6159 | 6164 |
| 6160 | 6165 |
| 6161 void InternalArrayConstructorStub::GenerateCase( | 6166 void InternalArrayConstructorStub::GenerateCase( |
| 6162 MacroAssembler* masm, ElementsKind kind) { | 6167 MacroAssembler* masm, ElementsKind kind) { |
| 6163 Label not_zero_case, not_one_case; | 6168 Label not_zero_case, not_one_case; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6239 __ bind(&fast_elements_case); | 6244 __ bind(&fast_elements_case); |
| 6240 GenerateCase(masm, FAST_ELEMENTS); | 6245 GenerateCase(masm, FAST_ELEMENTS); |
| 6241 } | 6246 } |
| 6242 | 6247 |
| 6243 | 6248 |
| 6244 #undef __ | 6249 #undef __ |
| 6245 | 6250 |
| 6246 } } // namespace v8::internal | 6251 } } // namespace v8::internal |
| 6247 | 6252 |
| 6248 #endif // V8_TARGET_ARCH_MIPS | 6253 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |