Commit ac972c58 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Restrict the broker's kRetired mode.

Once the broker retired, only allow retrieval of a reference's
handle. That's all we need for now.

Bug: v8:7790
Change-Id: Ib75887ed4a68e19ad7fad4c6046e340502542850
Reviewed-on: https://chromium-review.googlesource.com/1251086Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56308}
parent 56b6b6a8
...@@ -1379,6 +1379,7 @@ void JSHeapBroker::SetNativeContextRef() { ...@@ -1379,6 +1379,7 @@ void JSHeapBroker::SetNativeContextRef() {
void JSHeapBroker::SerializeStandardObjects() { void JSHeapBroker::SerializeStandardObjects() {
if (mode() == kDisabled) return; if (mode() == kDisabled) return;
CHECK_EQ(mode(), kSerializing);
TraceScope tracer(this, "JSHeapBroker::SerializeStandardObjects"); TraceScope tracer(this, "JSHeapBroker::SerializeStandardObjects");
...@@ -1574,16 +1575,15 @@ base::Optional<MapRef> MapRef::AsElementsKind(ElementsKind kind) const { ...@@ -1574,16 +1575,15 @@ base::Optional<MapRef> MapRef::AsElementsKind(ElementsKind kind) const {
AllowHandleDereference allow_handle_dereference; AllowHandleDereference allow_handle_dereference;
return MapRef(broker(), Map::AsElementsKind(broker()->isolate(), return MapRef(broker(), Map::AsElementsKind(broker()->isolate(),
object<Map>(), kind)); object<Map>(), kind));
} else {
if (kind == elements_kind()) return *this;
const ZoneVector<MapData*>& elements_kind_generalizations =
data()->AsMap()->elements_kind_generalizations();
for (auto data : elements_kind_generalizations) {
MapRef map(broker(), data);
if (map.elements_kind() == kind) return map;
}
return base::Optional<MapRef>();
} }
if (kind == elements_kind()) return *this;
const ZoneVector<MapData*>& elements_kind_generalizations =
data()->AsMap()->elements_kind_generalizations();
for (auto data : elements_kind_generalizations) {
MapRef map(broker(), data);
if (map.elements_kind() == kind) return map;
}
return base::Optional<MapRef>();
} }
int JSFunctionRef::InitialMapInstanceSizeWithMinSlack() const { int JSFunctionRef::InitialMapInstanceSizeWithMinSlack() const {
...@@ -2207,7 +2207,7 @@ ObjectRef JSRegExpRef::source() const { ...@@ -2207,7 +2207,7 @@ ObjectRef JSRegExpRef::source() const {
return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->source()); return ObjectRef(broker(), ObjectRef::data()->AsJSRegExp()->source());
} }
Handle<Object> ObjectRef::object() const { return data()->object(); } Handle<Object> ObjectRef::object() const { return data_->object(); }
JSHeapBroker* ObjectRef::broker() const { return broker_; } JSHeapBroker* ObjectRef::broker() const { return broker_; }
...@@ -2221,7 +2221,7 @@ ObjectData* ObjectRef::data() const { ...@@ -2221,7 +2221,7 @@ ObjectData* ObjectRef::data() const {
CHECK_NE(data_->kind(), kUnserializedHeapObject); CHECK_NE(data_->kind(), kUnserializedHeapObject);
return data_; return data_;
case JSHeapBroker::kRetired: case JSHeapBroker::kRetired:
return data_; UNREACHABLE();
} }
} }
......
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