Commit c176c6c4 authored by tebbi's avatar tebbi Committed by Commit bot

[turbofan] attempt to fix OOM caused by escape analysis

My hypothesis is that the OOM crash is caused by a loop of forgetting and reallocating a VirtualObject inside of a VirtualState.

R=mstarzinger@chromium.org

BUG=chromium:691487

Review-Url: https://codereview.chromium.org/2694723002
Cr-Commit-Position: refs/heads/master@{#43184}
parent 2d0b1ddf
...@@ -253,10 +253,14 @@ bool VirtualObject::UpdateFrom(const VirtualObject& other) { ...@@ -253,10 +253,14 @@ bool VirtualObject::UpdateFrom(const VirtualObject& other) {
class VirtualState : public ZoneObject { class VirtualState : public ZoneObject {
public: public:
VirtualState(Node* owner, Zone* zone, size_t size) VirtualState(Node* owner, Zone* zone, size_t size)
: info_(size, nullptr, zone), owner_(owner) {} : info_(size, nullptr, zone),
initialized_(static_cast<int>(size), zone),
owner_(owner) {}
VirtualState(Node* owner, const VirtualState& state) VirtualState(Node* owner, const VirtualState& state)
: info_(state.info_.size(), nullptr, state.info_.get_allocator().zone()), : info_(state.info_.size(), nullptr, state.info_.get_allocator().zone()),
initialized_(state.initialized_.length(),
state.info_.get_allocator().zone()),
owner_(owner) { owner_(owner) {
for (size_t i = 0; i < info_.size(); ++i) { for (size_t i = 0; i < info_.size(); ++i) {
if (state.info_[i]) { if (state.info_[i]) {
...@@ -281,6 +285,7 @@ class VirtualState : public ZoneObject { ...@@ -281,6 +285,7 @@ class VirtualState : public ZoneObject {
private: private:
ZoneVector<VirtualObject*> info_; ZoneVector<VirtualObject*> info_;
BitVector initialized_;
Node* owner_; Node* owner_;
DISALLOW_COPY_AND_ASSIGN(VirtualState); DISALLOW_COPY_AND_ASSIGN(VirtualState);
...@@ -376,6 +381,7 @@ VirtualObject* VirtualState::VirtualObjectFromAlias(size_t alias) { ...@@ -376,6 +381,7 @@ VirtualObject* VirtualState::VirtualObjectFromAlias(size_t alias) {
void VirtualState::SetVirtualObject(Alias alias, VirtualObject* obj) { void VirtualState::SetVirtualObject(Alias alias, VirtualObject* obj) {
info_[alias] = obj; info_[alias] = obj;
if (obj) initialized_.Add(alias);
} }
bool VirtualState::UpdateFrom(VirtualState* from, Zone* zone) { bool VirtualState::UpdateFrom(VirtualState* from, Zone* zone) {
...@@ -528,7 +534,8 @@ bool VirtualState::MergeFrom(MergeCache* cache, Zone* zone, Graph* graph, ...@@ -528,7 +534,8 @@ bool VirtualState::MergeFrom(MergeCache* cache, Zone* zone, Graph* graph,
fields = std::min(obj->field_count(), fields); fields = std::min(obj->field_count(), fields);
} }
} }
if (cache->objects().size() == cache->states().size()) { if (cache->objects().size() == cache->states().size() &&
(mergeObject || !initialized_.Contains(alias))) {
bool initialMerge = false; bool initialMerge = false;
if (!mergeObject) { if (!mergeObject) {
initialMerge = true; initialMerge = true;
......
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