Reviewers: mvstanton,

Message:
Hey Michael,
This is the CL we're talking about offline.
PTAL
-- Benedikt

Description:
Use HType::NonPrimitive() for array backing store allocations.

Please review this at https://codereview.chromium.org/291153003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+11, -13 lines):
  M src/hydrogen.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index afd9416567bac14fc23b4a47f165cc78021b6433..697111db9c8fa12e3552e45e9266887489145fc6 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2269,6 +2269,7 @@ HValue* HGraphBuilder::BuildAllocateArrayFromLength(
   return array_builder->AllocateArray(capacity, length);
 }

+
 HValue* HGraphBuilder::BuildAllocateElements(ElementsKind kind,
                                              HValue* capacity) {
   int elements_size;
@@ -2293,8 +2294,8 @@ HValue* HGraphBuilder::BuildAllocateElements(ElementsKind kind,
   PretenureFlag pretenure_flag = !FLAG_allocation_site_pretenuring ?
       isolate()->heap()->GetPretenureMode() : NOT_TENURED;

-  return Add<HAllocate>(total_size, HType::Tagged(), pretenure_flag,
-      instance_type);
+  return Add<HAllocate>(total_size, HType::NonPrimitive(),
+                        pretenure_flag, instance_type);
 }


@@ -8794,7 +8795,7 @@ HValue* HOptimizedGraphBuilder::BuildAllocateExternalElements(
   HValue* elements =
       Add<HAllocate>(
           Add<HConstant>(ExternalArray::kAlignedSize),
-          HType::Tagged(),
+          HType::NonPrimitive(),
           NOT_TENURED,
           external_array_map->instance_type());

@@ -8851,9 +8852,8 @@ HValue* HOptimizedGraphBuilder::BuildAllocateFixedTypedArray(
   Handle<Map> fixed_typed_array_map(
       isolate()->heap()->MapForFixedTypedArray(array_type));
   HValue* elements =
-      Add<HAllocate>(total_size, HType::Tagged(),
-          NOT_TENURED,
-          fixed_typed_array_map->instance_type());
+      Add<HAllocate>(total_size, HType::NonPrimitive(),
+                     NOT_TENURED, fixed_typed_array_map->instance_type());
   AddStoreMapConstant(elements, fixed_typed_array_map);

   Add<HStoreNamedField>(elements,
@@ -10292,13 +10292,11 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
   HInstruction* object_elements = NULL;
   if (elements_size > 0) {
     HValue* object_elements_size = Add<HConstant>(elements_size);
-    if (boilerplate_object->HasFastDoubleElements()) {
- object_elements = Add<HAllocate>(object_elements_size, HType::Tagged(), - pretenure_flag, FIXED_DOUBLE_ARRAY_TYPE, site_context->current());
-    } else {
- object_elements = Add<HAllocate>(object_elements_size, HType::Tagged(),
-          pretenure_flag, FIXED_ARRAY_TYPE, site_context->current());
-    }
+ InstanceType instance_type = boilerplate_object->HasFastDoubleElements()
+        ? FIXED_DOUBLE_ARRAY_TYPE : FIXED_ARRAY_TYPE;
+    object_elements = Add<HAllocate>(
+        object_elements_size, HType::NonPrimitive(),
+        pretenure_flag, instance_type, site_context->current());
   }
BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements);



--
--
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/d/optout.

Reply via email to