Commit 2caaf7a5 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cleanup] Replace ZoneList with ZoneVector in instruction.h

We are trying to get rid of ZoneList now that List is gone, so here is a
decent place to start.

Bug: v8:6333, v8:6921
Change-Id: Ie02d3f95767a5d9946586b0efbd64ec265326fbc
Reviewed-on: https://chromium-review.googlesource.com/718377Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48554}
parent 26ffd5bf
......@@ -42,9 +42,10 @@ void CompilationDependencies::Set(Handle<Object> object,
void CompilationDependencies::Insert(DependentCode::DependencyGroup group,
Handle<HeapObject> object) {
if (groups_[group] == nullptr) {
groups_[group] = new (zone_) ZoneList<Handle<HeapObject>>(2, zone_);
groups_[group] = new (zone_->New(sizeof(ZoneVector<Handle<HeapObject>>)))
ZoneVector<Handle<HeapObject>>(zone_);
}
groups_[group]->Add(object, zone_);
groups_[group]->push_back(object);
if (object_wrapper_.is_null()) {
// Allocate the wrapper if necessary.
......@@ -73,11 +74,11 @@ void CompilationDependencies::Commit(Handle<Code> code) {
Handle<WeakCell> cell = Code::WeakCellFor(code);
AllowDeferredHandleDereference get_wrapper;
for (int i = 0; i < DependentCode::kGroupCount; i++) {
ZoneList<Handle<HeapObject>>* group_objects = groups_[i];
ZoneVector<Handle<HeapObject>>* group_objects = groups_[i];
if (group_objects == nullptr) continue;
DependentCode::DependencyGroup group =
static_cast<DependentCode::DependencyGroup>(i);
for (int j = 0; j < group_objects->length(); j++) {
for (size_t j = 0; j < group_objects->size(); j++) {
DependentCode* dependent_code = Get(group_objects->at(j));
dependent_code->UpdateToFinishedCode(group, *object_wrapper_, *cell);
}
......@@ -92,11 +93,11 @@ void CompilationDependencies::Rollback() {
AllowDeferredHandleDereference get_wrapper;
// Unregister from all dependent maps if not yet committed.
for (int i = 0; i < DependentCode::kGroupCount; i++) {
ZoneList<Handle<HeapObject>>* group_objects = groups_[i];
ZoneVector<Handle<HeapObject>>* group_objects = groups_[i];
if (group_objects == nullptr) continue;
DependentCode::DependencyGroup group =
static_cast<DependentCode::DependencyGroup>(i);
for (int j = 0; j < group_objects->length(); j++) {
for (size_t j = 0; j < group_objects->size(); j++) {
DependentCode* dependent_code = Get(group_objects->at(j));
dependent_code->RemoveCompilationDependencies(group, *object_wrapper_);
}
......
......@@ -8,6 +8,7 @@
#include "src/handles.h"
#include "src/objects.h"
#include "src/objects/map.h"
#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
......@@ -62,7 +63,7 @@ class CompilationDependencies {
Zone* zone_;
Handle<Foreign> object_wrapper_;
bool aborted_;
ZoneList<Handle<HeapObject> >* groups_[DependentCode::kGroupCount];
ZoneVector<Handle<HeapObject> >* groups_[DependentCode::kGroupCount];
DependentCode* Get(Handle<Object> object) const;
void Set(Handle<Object> object, Handle<DependentCode> dep);
......
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