v8/src/compilation-dependencies.h
machenbach 2631c9f5e3 Revert of Revert of Protect the emptiness of Array prototype elements with a PropertyCell. (patchset #1 id:1 of https://codereview.chromium.org/1099203004/)
Reason for revert:
This was probably an infrastructure problem caused by the mac ninja/goma switch.

Original issue's description:
> Revert of Protect the emptiness of Array prototype elements with a PropertyCell. (patchset #7 id:120001 of https://codereview.chromium.org/1092043002/)
>
> Reason for revert:
> MAC GCSTRESS failure on new test.
>
> Original issue's description:
> > Protect the emptiness of Array prototype elements with a PropertyCell.
> >
> > Not just emptiness, but also a particular structure.
> >
> > BUG=v8:4044
> > LOG=N
>
> TBR=jkummerow@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=v8:4044

TBR=jkummerow@chromium.org,mvstanton@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4044

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

Cr-Commit-Position: refs/heads/master@{#28000}
2015-04-22 10:35:09 +00:00

65 lines
1.8 KiB
C++

// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_DEPENDENCIES_H_
#define V8_DEPENDENCIES_H_
namespace v8 {
namespace internal {
// Collects dependencies for this compilation, e.g. assumptions about
// stable maps, constant globals, etc.
class CompilationDependencies {
public:
CompilationDependencies(Isolate* isolate, Zone* zone)
: isolate_(isolate),
zone_(zone),
object_wrapper_(Handle<Foreign>::null()),
aborted_(false) {
std::fill_n(groups_, DependentCode::kGroupCount, nullptr);
}
void Insert(DependentCode::DependencyGroup group, Handle<HeapObject> handle);
void AssumeInitialMapCantChange(Handle<Map> map) {
Insert(DependentCode::kInitialMapChangedGroup, map);
}
void AssumeFieldType(Handle<Map> map) {
Insert(DependentCode::kFieldTypeGroup, map);
}
void AssumePropertyCell(Handle<PropertyCell> cell) {
Insert(DependentCode::kPropertyCellChangedGroup, cell);
}
void AssumeTenuringDecision(Handle<AllocationSite> site) {
Insert(DependentCode::kAllocationSiteTenuringChangedGroup, site);
}
void AssumeTransitionStable(Handle<AllocationSite> site);
void Commit(Handle<Code> code);
void Rollback();
void Abort() { aborted_ = true; }
bool HasAborted() const { return aborted_; }
bool IsEmpty() const {
for (int i = 0; i < DependentCode::kGroupCount; i++) {
if (groups_[i]) return false;
}
return true;
}
private:
Isolate* isolate_;
Zone* zone_;
Handle<Foreign> object_wrapper_;
bool aborted_;
ZoneList<Handle<HeapObject> >* groups_[DependentCode::kGroupCount];
DependentCode* Get(Handle<Object> object);
void Set(Handle<Object> object, Handle<DependentCode> dep);
};
}
} // namespace v8::internal
#endif // V8_DEPENDENCIES_H_