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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 12114054: Supporting AllocationSiteInfo for Nested arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some updates Created 7 years, 10 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
OLDNEW
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 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1582 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1583 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); 1583 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
1584 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); 1584 __ mov(r2, Operand(Smi::FromInt(expr->literal_index())));
1585 __ mov(r1, Operand(constant_properties)); 1585 __ mov(r1, Operand(constant_properties));
1586 int flags = expr->fast_elements() 1586 int flags = expr->fast_elements()
1587 ? ObjectLiteral::kFastElements 1587 ? ObjectLiteral::kFastElements
1588 : ObjectLiteral::kNoFlags; 1588 : ObjectLiteral::kNoFlags;
1589 flags |= expr->has_function() 1589 flags |= expr->has_function()
1590 ? ObjectLiteral::kHasFunction 1590 ? ObjectLiteral::kHasFunction
1591 : ObjectLiteral::kNoFlags; 1591 : ObjectLiteral::kNoFlags;
1592
1593 if (FLAG_track_allocation_sites && !IsOneTimeCode()) {
1594 // Don't track global arrays that are never re-created
1595 flags |= ObjectLiteral::kAllocationSiteInfoAllowed;
1596 }
1597
1592 __ mov(r0, Operand(Smi::FromInt(flags))); 1598 __ mov(r0, Operand(Smi::FromInt(flags)));
1593 __ Push(r3, r2, r1, r0); 1599 __ Push(r3, r2, r1, r0);
1594 int properties_count = constant_properties->length() / 2; 1600 int properties_count = constant_properties->length() / 2;
1595 if (expr->depth() > 1) { 1601 if (expr->depth() > 1) {
1596 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); 1602 __ CallRuntime(Runtime::kCreateObjectLiteral, 4);
1597 } else if (flags != ObjectLiteral::kFastElements || 1603 } else if (flags != ObjectLiteral::kFastElements ||
1598 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { 1604 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) {
1599 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); 1605 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4);
1600 } else { 1606 } else {
1601 FastCloneShallowObjectStub stub(properties_count); 1607 FastCloneShallowObjectStub stub(properties_count);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 ZoneList<Expression*>* subexprs = expr->values(); 1710 ZoneList<Expression*>* subexprs = expr->values();
1705 int length = subexprs->length(); 1711 int length = subexprs->length();
1706 Handle<FixedArray> constant_elements = expr->constant_elements(); 1712 Handle<FixedArray> constant_elements = expr->constant_elements();
1707 ASSERT_EQ(2, constant_elements->length()); 1713 ASSERT_EQ(2, constant_elements->length());
1708 ElementsKind constant_elements_kind = 1714 ElementsKind constant_elements_kind =
1709 static_cast<ElementsKind>(Smi::cast(constant_elements->get(0))->value()); 1715 static_cast<ElementsKind>(Smi::cast(constant_elements->get(0))->value());
1710 bool has_fast_elements = IsFastObjectElementsKind(constant_elements_kind); 1716 bool has_fast_elements = IsFastObjectElementsKind(constant_elements_kind);
1711 Handle<FixedArrayBase> constant_elements_values( 1717 Handle<FixedArrayBase> constant_elements_values(
1712 FixedArrayBase::cast(constant_elements->get(1))); 1718 FixedArrayBase::cast(constant_elements->get(1)));
1713 1719
1720 AllocationSiteMode allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
1721 int flags = ArrayLiteral::kNoFlags;
1722 if (FLAG_track_allocation_sites && !IsOneTimeCode()) {
1723 // Don't track global arrays that are never re-created
1724 flags |= ArrayLiteral::kAllocationSiteInfoAllowed;
1725 allocation_site_mode = TRACK_ALLOCATION_SITE;
1726 }
1727
1728 ASSERT(((flags & ArrayLiteral::kAllocationSiteInfoAllowed) &&
1729 (allocation_site_mode == TRACK_ALLOCATION_SITE)) ||
1730 (((flags & ArrayLiteral::kAllocationSiteInfoAllowed) == 0) &&
1731 (allocation_site_mode == DONT_TRACK_ALLOCATION_SITE)));
1732
1714 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1733 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1715 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); 1734 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
1716 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); 1735 __ mov(r2, Operand(Smi::FromInt(expr->literal_index())));
1717 __ mov(r1, Operand(constant_elements)); 1736 __ mov(r1, Operand(constant_elements));
1737
1718 __ Push(r3, r2, r1); 1738 __ Push(r3, r2, r1);
1719 if (has_fast_elements && constant_elements_values->map() == 1739 if (has_fast_elements && constant_elements_values->map() ==
1720 isolate()->heap()->fixed_cow_array_map()) { 1740 isolate()->heap()->fixed_cow_array_map()) {
1721 FastCloneShallowArrayStub stub( 1741 FastCloneShallowArrayStub stub(
1722 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, 1742 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS,
1723 DONT_TRACK_ALLOCATION_SITE, 1743 DONT_TRACK_ALLOCATION_SITE,
1724 length); 1744 length);
1725 __ CallStub(&stub); 1745 __ CallStub(&stub);
1726 __ IncrementCounter( 1746 __ IncrementCounter(
1727 isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2); 1747 isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2);
1728 } else if (expr->depth() > 1) { 1748 } else if (expr->depth() > 1) {
1729 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); 1749 __ mov(r0, Operand(Smi::FromInt(flags)));
1750 __ push(r0);
1751 __ CallRuntime(Runtime::kCreateArrayLiteral, 4);
1730 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { 1752 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
1731 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); 1753 __ mov(r0, Operand(Smi::FromInt(flags)));
1754 __ push(r0);
1755 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 4);
1732 } else { 1756 } else {
1733 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || 1757 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
1734 FLAG_smi_only_arrays); 1758 FLAG_smi_only_arrays);
1735 FastCloneShallowArrayStub::Mode mode = 1759 FastCloneShallowArrayStub::Mode mode =
1736 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; 1760 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS;
1737 AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites
1738 ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE;
1739 1761
1740 if (has_fast_elements) { 1762 if (has_fast_elements) {
1741 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS; 1763 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS;
1742 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; 1764 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
1743 } 1765 }
1744 1766
1745 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); 1767 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length);
1746 __ CallStub(&stub); 1768 __ CallStub(&stub);
1747 } 1769 }
1748 1770
(...skipping 2813 matching lines...) Expand 10 before | Expand all | Expand 10 after
4562 *context_length = 0; 4584 *context_length = 0;
4563 return previous_; 4585 return previous_;
4564 } 4586 }
4565 4587
4566 4588
4567 #undef __ 4589 #undef __
4568 4590
4569 } } // namespace v8::internal 4591 } } // namespace v8::internal
4570 4592
4571 #endif // V8_TARGET_ARCH_ARM 4593 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698