 Chromium Code Reviews
 Chromium Code Reviews Issue 72893003:
  MIPS: Inline zero argument array constructor.  (Closed) 
  Base URL: https://github.com/v8/v8.git@gbl
    
  
    Issue 72893003:
  MIPS: Inline zero argument array constructor.  (Closed) 
  Base URL: https://github.com/v8/v8.git@gbl| Index: src/mips/code-stubs-mips.cc | 
| diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc | 
| index 1982c647ebc7e37cc2daaf45428dc561e19cd6a8..0b6a89fec2e02cc6327395b00731b1c5999cd7f1 100644 | 
| --- a/src/mips/code-stubs-mips.cc | 
| +++ b/src/mips/code-stubs-mips.cc | 
| @@ -6005,11 +6005,14 @@ static void CreateArrayDispatchOneArgument(MacroAssembler* masm, | 
| __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 
| } | 
| - // Save the resulting elements kind in type info | 
| - __ SmiTag(a3); | 
| - __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset)); | 
| - __ sw(a3, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); | 
| - __ SmiUntag(a3); | 
| + // 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
 | 
| + // in the AllocationSite::transition_info field because elements kind is | 
| + // restricted to a portion of the field...upper bits need to be left alone. | 
| + STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | 
| + __ lw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); | 
| + __ Addu(t0, t0, Operand(Smi::FromInt(kFastElementsKindPackedToHoley))); | 
| + __ sw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset)); | 
| + | 
| __ bind(&normal_sequence); | 
| int last_index = GetSequenceIndexFromFastElementsKind( | 
| @@ -6151,6 +6154,8 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { | 
| __ lw(a3, FieldMemOperand(a3, AllocationSite::kTransitionInfoOffset)); | 
| __ SmiUntag(a3); | 
| + STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | 
| + __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); | 
| GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 
| __ bind(&no_info); |