Revision: 17028
Author: [email protected]
Date: Tue Oct 1 08:22:01 2013 UTC
Log: In crankshafted code, we were creating allocation mementos for
shallow
SMI array literals when we shouldn't. The idea is that we should have
learned
by this point what type of array we'll end up with.
[email protected]
Review URL: https://codereview.chromium.org/25146007
http://code.google.com/p/v8/source/detail?r=17028
Modified:
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/hydrogen.h
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Mon Sep 30 17:42:58 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Tue Oct 1 08:22:01 2013 UTC
@@ -4321,9 +4321,7 @@
&max_properties)) {
Handle<JSObject> boilerplate_object =
Handle<JSObject>::cast(boilerplate);
- literal = BuildFastLiteral(boilerplate_object,
- Handle<Object>::null(),
- DONT_TRACK_ALLOCATION_SITE);
+ literal = BuildFastLiteral(boilerplate_object);
} else {
NoObservableSideEffectsScope no_effects(this);
Handle<FixedArray> closure_literals(closure->literals(), isolate());
@@ -4467,22 +4465,7 @@
if (IsFastLiteral(boilerplate_object,
kMaxFastLiteralDepth,
&max_properties)) {
- // TODO(mvstanton): This heuristic is only a temporary solution. In
the
- // end, we want to quit creating allocation site info after a certain
number
- // of GCs for a call site.
- AllocationSiteMode mode = AllocationSite::GetMode(
- boilerplate_elements_kind);
-
- // it doesn't make sense to create allocation mementos if we are going
to
- // create in old space.
- if (mode == TRACK_ALLOCATION_SITE &&
- isolate()->heap()->GetPretenureMode() == TENURED) {
- mode = DONT_TRACK_ALLOCATION_SITE;
- }
-
- literal = BuildFastLiteral(boilerplate_object,
- site,
- mode);
+ literal = BuildFastLiteral(boilerplate_object);
} else {
NoObservableSideEffectsScope no_effects(this);
// Boilerplate already exists and constant elements are never accessed,
@@ -8379,44 +8362,21 @@
HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
- Handle<JSObject> boilerplate_object,
- Handle<Object> allocation_site_object,
- AllocationSiteMode mode) {
+ Handle<JSObject> boilerplate_object) {
NoObservableSideEffectsScope no_effects(this);
-
- Handle<FixedArrayBase> elements(boilerplate_object->elements());
- int object_size = boilerplate_object->map()->instance_size();
- int object_offset = object_size;
-
InstanceType instance_type = boilerplate_object->map()->instance_type();
- bool create_allocation_site_info = mode == TRACK_ALLOCATION_SITE;
+ ASSERT(instance_type == JS_ARRAY_TYPE || instance_type ==
JS_OBJECT_TYPE);
- // If using allocation sites, then
- // 1) the payload on the site should already be filled in as a valid
- // (boilerplate) array, and
- // 2) we shouldn't be pretenuring the allocations.
- ASSERT(!create_allocation_site_info ||
- (AllocationSite::cast(*allocation_site_object)->IsLiteralSite() &&
- isolate()->heap()->GetPretenureMode() == NOT_TENURED));
-
- if (create_allocation_site_info) {
- object_size += AllocationMemento::kSize;
- }
-
- ASSERT(instance_type == JS_ARRAY_TYPE || instance_type ==
JS_OBJECT_TYPE);
HType type = instance_type == JS_ARRAY_TYPE
? HType::JSArray() : HType::JSObject();
- HValue* object_size_constant = Add<HConstant>(object_size);
+ HValue* object_size_constant = Add<HConstant>(
+ boilerplate_object->map()->instance_size());
HInstruction* object = Add<HAllocate>(object_size_constant, type,
isolate()->heap()->GetPretenureMode(), instance_type);
BuildEmitObjectHeader(boilerplate_object, object);
- if (create_allocation_site_info) {
- HInstruction* allocation_site = Add<HConstant>(allocation_site_object);
- BuildCreateAllocationMemento(object, object_offset, allocation_site);
- }
-
+ Handle<FixedArrayBase> elements(boilerplate_object->elements());
int elements_size = (elements->length() > 0 &&
elements->map() != isolate()->heap()->fixed_cow_array_map()) ?
elements->Size() : 0;
@@ -8518,9 +8478,7 @@
if (value->IsJSObject()) {
Handle<JSObject> value_object = Handle<JSObject>::cast(value);
- HInstruction* result =
- BuildFastLiteral(value_object,
- Handle<Object>::null(), DONT_TRACK_ALLOCATION_SITE);
+ HInstruction* result = BuildFastLiteral(value_object);
Add<HStoreNamedField>(object, access, result);
} else {
Representation representation = details.representation();
@@ -8606,9 +8564,7 @@
HValue* key_constant = Add<HConstant>(i);
if (value->IsJSObject()) {
Handle<JSObject> value_object = Handle<JSObject>::cast(value);
- HInstruction* result =
- BuildFastLiteral(value_object,
- Handle<Object>::null(), DONT_TRACK_ALLOCATION_SITE);
+ HInstruction* result = BuildFastLiteral(value_object);
Add<HStoreKeyed>(object_elements, key_constant, result, kind);
} else {
HInstruction* value_instruction =
=======================================
--- /branches/bleeding_edge/src/hydrogen.h Fri Sep 27 13:38:04 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.h Tue Oct 1 08:22:01 2013 UTC
@@ -2244,9 +2244,7 @@
HInstruction* BuildThisFunction();
- HInstruction* BuildFastLiteral(Handle<JSObject> boilerplate_object,
- Handle<Object> allocation_site,
- AllocationSiteMode mode);
+ HInstruction* BuildFastLiteral(Handle<JSObject> boilerplate_object);
void BuildEmitObjectHeader(Handle<JSObject> boilerplate_object,
HInstruction* object);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.