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
This commit is contained in:
parent
6aed526733
commit
3b60d6de8e
@ -2488,12 +2488,10 @@ class HCallNew: public HBinaryCall {
|
||||
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_;
|
||||
|
@ -8873,7 +8873,7 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user