| 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 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1720   ElementsKind constant_elements_kind = | 1720   ElementsKind constant_elements_kind = | 
| 1721       static_cast<ElementsKind>(Smi::cast(constant_elements->get(0))->value()); | 1721       static_cast<ElementsKind>(Smi::cast(constant_elements->get(0))->value()); | 
| 1722   bool has_fast_elements = IsFastObjectElementsKind(constant_elements_kind); | 1722   bool has_fast_elements = IsFastObjectElementsKind(constant_elements_kind); | 
| 1723   Handle<FixedArrayBase> constant_elements_values( | 1723   Handle<FixedArrayBase> constant_elements_values( | 
| 1724       FixedArrayBase::cast(constant_elements->get(1))); | 1724       FixedArrayBase::cast(constant_elements->get(1))); | 
| 1725 | 1725 | 
| 1726   __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1726   __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 
| 1727   __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); | 1727   __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); | 
| 1728   __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); | 1728   __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); | 
| 1729   __ mov(r1, Operand(constant_elements)); | 1729   __ mov(r1, Operand(constant_elements)); | 
| 1730   __ Push(r3, r2, r1); |  | 
| 1731   if (has_fast_elements && constant_elements_values->map() == | 1730   if (has_fast_elements && constant_elements_values->map() == | 
| 1732       isolate()->heap()->fixed_cow_array_map()) { | 1731       isolate()->heap()->fixed_cow_array_map()) { | 
| 1733     FastCloneShallowArrayStub stub( | 1732     FastCloneShallowArrayStub stub( | 
| 1734         FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1733         FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 
| 1735         DONT_TRACK_ALLOCATION_SITE, | 1734         DONT_TRACK_ALLOCATION_SITE, | 
| 1736         length); | 1735         length); | 
| 1737     __ CallStub(&stub); | 1736     __ CallStub(&stub); | 
| 1738     __ IncrementCounter( | 1737     __ IncrementCounter( | 
| 1739         isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2); | 1738         isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2); | 
| 1740   } else if (expr->depth() > 1) { | 1739   } else if (expr->depth() > 1) { | 
|  | 1740     __ Push(r3, r2, r1); | 
| 1741     __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 1741     __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 
| 1742   } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1742   } else if (Serializer::enabled() || | 
|  | 1743       length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 
|  | 1744     __ Push(r3, r2, r1); | 
| 1743     __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | 1745     __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | 
| 1744   } else { | 1746   } else { | 
| 1745     ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1747     ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 
| 1746            FLAG_smi_only_arrays); | 1748            FLAG_smi_only_arrays); | 
| 1747     FastCloneShallowArrayStub::Mode mode = | 1749     FastCloneShallowArrayStub::Mode mode = | 
| 1748         FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1750         FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 
| 1749     AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites | 1751     AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites | 
| 1750         ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; | 1752         ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; | 
| 1751 | 1753 | 
| 1752     if (has_fast_elements) { | 1754     if (has_fast_elements) { | 
| (...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4580   *context_length = 0; | 4582   *context_length = 0; | 
| 4581   return previous_; | 4583   return previous_; | 
| 4582 } | 4584 } | 
| 4583 | 4585 | 
| 4584 | 4586 | 
| 4585 #undef __ | 4587 #undef __ | 
| 4586 | 4588 | 
| 4587 } }  // namespace v8::internal | 4589 } }  // namespace v8::internal | 
| 4588 | 4590 | 
| 4589 #endif  // V8_TARGET_ARCH_ARM | 4591 #endif  // V8_TARGET_ARCH_ARM | 
| OLD | NEW | 
|---|