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

Unified Diff: src/x64/full-codegen-x64.cc

Issue 12114054: Supporting AllocationSiteInfo for Nested arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing a port compile failure Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 8ff12df36143ca9863dfb50d35ffd55eaec34272..0ac5652b672b485d7065ca1b3f0e25a093099e04 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -1558,6 +1558,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
flags |= expr->has_function()
? ObjectLiteral::kHasFunction
: ObjectLiteral::kNoFlags;
+
+ if (FLAG_track_allocation_sites && !IsOneTimeCode()) {
+ // Don't track global arrays that are never re-created
+ flags |= ObjectLiteral::kCreateAllocationSiteInfos;
+ }
+
int properties_count = constant_properties->length() / 2;
if (expr->depth() > 1) {
__ movq(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
@@ -1695,6 +1701,19 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<FixedArrayBase> constant_elements_values(
FixedArrayBase::cast(constant_elements->get(1)));
+ AllocationSiteMode allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
+ int flags = ArrayLiteral::kNoFlags;
+ if (FLAG_track_allocation_sites && !IsOneTimeCode()) {
+ // Don't track global arrays that are never re-created
+ flags |= ArrayLiteral::kCreateAllocationSiteInfos;
+ allocation_site_mode = TRACK_ALLOCATION_SITE;
+ }
+
+ ASSERT(((flags & ArrayLiteral::kCreateAllocationSiteInfos) &&
+ (allocation_site_mode == TRACK_ALLOCATION_SITE)) ||
+ (((flags & ArrayLiteral::kCreateAllocationSiteInfos) == 0) &&
+ (allocation_site_mode == DONT_TRACK_ALLOCATION_SITE)));
+
__ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
__ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
__ Push(Smi::FromInt(expr->literal_index()));
@@ -1711,16 +1730,16 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
length);
__ CallStub(&stub);
} else if (expr->depth() > 1) {
- __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
+ __ Push(Smi::FromInt(flags));
+ __ CallRuntime(Runtime::kCreateArrayLiteral, 4);
} else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
- __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
+ __ Push(Smi::FromInt(flags));
+ __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 4);
} else {
ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
FLAG_smi_only_arrays);
FastCloneShallowArrayStub::Mode mode =
FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS;
- AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites
- ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE;
// If the elements are already FAST_*_ELEMENTS, the boilerplate cannot
// change, so it's possible to specialize the stub in advance.
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698