Commit 4db243f2 authored by Georg Neis's avatar Georg Neis Committed by V8 LUCI CQ

[compiler] Remove an outdated comment and an obsolete argument

The cycle mentioned in the comment has disappeared but we still need
to set the native context Ref twice, once when the broker mode is
kDisabled, and once when it's kSerializing (the earlier Ref is
invalid by that time).

Bug: v8:7790
Change-Id: I5778814a20c2706ca088557176aaa9ccfc3a39df
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2902741
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74634}
parent 1ab979ca
......@@ -2624,8 +2624,7 @@ void JSHeapBroker::PrintRefsAnalysis() const {
}
#endif // DEBUG
void JSHeapBroker::InitializeAndStartSerializing(
Handle<NativeContext> native_context) {
void JSHeapBroker::InitializeAndStartSerializing() {
TraceScope tracer(this, "JSHeapBroker::InitializeAndStartSerializing");
CHECK_EQ(mode_, kDisabled);
......@@ -2638,7 +2637,7 @@ void JSHeapBroker::InitializeAndStartSerializing(
CollectArrayAndObjectPrototypes();
SetTargetNativeContextRef(native_context);
SetTargetNativeContextRef(target_native_context().object());
target_native_context().Serialize();
if (!is_concurrent_inlining()) {
// Perform full native context serialization now if we can't do it later on
......
......@@ -134,13 +134,9 @@ void JSHeapBroker::Retire() {
void JSHeapBroker::SetTargetNativeContextRef(
Handle<NativeContext> native_context) {
// The MapData constructor uses {target_native_context_}. This creates a
// benign cycle that we break by setting {target_native_context_} right before
// starting to serialize (thus creating dummy data), and then again properly
// right after.
DCHECK((mode() == kDisabled && !target_native_context_.has_value()) ||
(mode() == kSerializing &&
target_native_context_->object().equals(native_context) &&
target_native_context_->object().is_identical_to(native_context) &&
target_native_context_->is_unserialized_heap_object()));
target_native_context_ = MakeRef(this, *native_context);
}
......
......@@ -100,7 +100,7 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
}
void SetTargetNativeContextRef(Handle<NativeContext> native_context);
void InitializeAndStartSerializing(Handle<NativeContext> native_context);
void InitializeAndStartSerializing();
Isolate* isolate() const { return isolate_; }
Zone* zone() const { return zone_; }
......
......@@ -1506,7 +1506,7 @@ struct HeapBrokerInitializationPhase {
DECL_MAIN_THREAD_PIPELINE_PHASE_CONSTANTS(HeapBrokerInitialization)
void Run(PipelineData* data, Zone* temp_zone) {
data->broker()->InitializeAndStartSerializing(data->native_context());
data->broker()->InitializeAndStartSerializing();
}
};
......
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