Revision: 15359
Author:   [email protected]
Date:     Thu Jun 27 07:22:07 2013
Log:      Make sure HCallNewArray uses right ElementsKind

Close a small gc window that exists between when a HNewArrayCall instruction is
created and the ElementsKind type feedback for the construction function is
accesses.

[email protected]

Review URL: https://codereview.chromium.org/18059005
http://code.google.com/p/v8/source/detail?r=15359

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed Jun 26 10:37:55 2013 +++ /branches/bleeding_edge/src/hydrogen-instructions.h Thu Jun 27 07:22:07 2013
@@ -2488,12 +2488,10 @@
 class HCallNewArray: public HCallNew {
  public:
   HCallNewArray(HValue* context, HValue* constructor, int argument_count,
-                Handle<Cell> type_cell)
+                Handle<Cell> type_cell, ElementsKind elements_kind)
       : HCallNew(context, constructor, argument_count),
-        type_cell_(type_cell) {
-    elements_kind_ = static_cast<ElementsKind>(
-        Smi::cast(type_cell->value())->value());
-  }
+        elements_kind_(elements_kind),
+        type_cell_(type_cell) {}

   Handle<Cell> property_cell() const {
     return type_cell_;
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Thu Jun 27 06:15:10 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu Jun 27 07:22:07 2013
@@ -8873,7 +8873,7 @@
       Handle<Cell> cell = expr->allocation_info_cell();
AddInstruction(new(zone()) HCheckFunction(constructor, array_function)); call = new(zone()) HCallNewArray(context, constructor, argument_count,
-                                       cell);
+                                       cell, expr->elements_kind());
     } else {
       call = new(zone()) HCallNew(context, constructor, argument_count);
     }

--
--
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.


Reply via email to