Commit 3b60d6de authored by danno@chromium.org's avatar danno@chromium.org

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.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/18059005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15359 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6aed5267
...@@ -2488,12 +2488,10 @@ class HCallNew: public HBinaryCall { ...@@ -2488,12 +2488,10 @@ class HCallNew: public HBinaryCall {
class HCallNewArray: public HCallNew { class HCallNewArray: public HCallNew {
public: public:
HCallNewArray(HValue* context, HValue* constructor, int argument_count, HCallNewArray(HValue* context, HValue* constructor, int argument_count,
Handle<Cell> type_cell) Handle<Cell> type_cell, ElementsKind elements_kind)
: HCallNew(context, constructor, argument_count), : HCallNew(context, constructor, argument_count),
type_cell_(type_cell) { elements_kind_(elements_kind),
elements_kind_ = static_cast<ElementsKind>( type_cell_(type_cell) {}
Smi::cast(type_cell->value())->value());
}
Handle<Cell> property_cell() const { Handle<Cell> property_cell() const {
return type_cell_; return type_cell_;
......
...@@ -8873,7 +8873,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) { ...@@ -8873,7 +8873,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
Handle<Cell> cell = expr->allocation_info_cell(); Handle<Cell> cell = expr->allocation_info_cell();
AddInstruction(new(zone()) HCheckFunction(constructor, array_function)); AddInstruction(new(zone()) HCheckFunction(constructor, array_function));
call = new(zone()) HCallNewArray(context, constructor, argument_count, call = new(zone()) HCallNewArray(context, constructor, argument_count,
cell); cell, expr->elements_kind());
} else { } else {
call = new(zone()) HCallNew(context, constructor, argument_count); call = new(zone()) HCallNew(context, constructor, argument_count);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment