Commit 1f80a41f authored by Maya Lekova's avatar Maya Lekova Committed by V8 LUCI CQ

Revert "Reland: ScopeInfo, SharedFunctionInfo never-ever serialized"

This reverts commit d3cacbbb.

Reason for revert: Breaks gc stress again - https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/34248/overview

Original change's description:
> Reland: ScopeInfo, SharedFunctionInfo never-ever serialized
>
> This relands squashed CLs:
>
> 59b9aaf7
> 8f84d0bb
>
> The revert was at crrev.com/c/2996198.
>
> Changed: Fixed a test in which bytecode flushing caused a behavioral
> change between serialized- and unserialized SFI Refs. The serialized
> SFI ref kept bytecode alive while unserialized SFIs allow flushing.
> The test was fixed by adding a %PrepareFunctionForOptimization
> annotation.
>
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: v8:7790, v8:11939
> Change-Id: I170f8085bd7454a2a5f2bb03c8824e2862857827
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2999089
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Auto-Submit: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#75504}

Bug: v8:7790, v8:11939
Change-Id: Icf8858fda38e4ce28080dc254beb7a42444e9784
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2999868
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#75507}
parent ac46a76c
This diff is collapsed.
......@@ -899,8 +899,6 @@ class V8_EXPORT_PRIVATE SharedFunctionInfoRef : public HeapObjectRef {
int context_header_size() const;
BytecodeArrayRef GetBytecodeArray() const;
SharedFunctionInfo::Inlineability GetInlineability() const;
base::Optional<FunctionTemplateInfoRef> function_template_info() const;
ScopeInfoRef scope_info() const;
#define DECL_ACCESSOR(type, name) type name() const;
BROKER_SFI_FIELDS(DECL_ACCESSOR)
......@@ -909,6 +907,12 @@ class V8_EXPORT_PRIVATE SharedFunctionInfoRef : public HeapObjectRef {
bool IsInlineable() const {
return GetInlineability() == SharedFunctionInfo::kIsInlineable;
}
void SerializeFunctionTemplateInfo();
base::Optional<FunctionTemplateInfoRef> function_template_info() const;
void SerializeScopeInfoChain();
ScopeInfoRef scope_info() const;
};
class StringRef : public NameRef {
......
......@@ -1783,6 +1783,12 @@ void SerializerForBackgroundCompilation::VisitForInPrepare(
void SerializerForBackgroundCompilation::ProcessCreateContext(
interpreter::BytecodeArrayIterator* iterator, int scopeinfo_operand_index) {
Handle<ScopeInfo> scope_info =
Handle<ScopeInfo>::cast(iterator->GetConstantForIndexOperand(
scopeinfo_operand_index, broker()->isolate()));
ScopeInfoRef scope_info_ref = MakeRef(broker(), scope_info);
scope_info_ref.SerializeScopeInfoChain();
Hints const& current_context_hints = environment()->current_context_hints();
Hints result_hints;
......@@ -2239,6 +2245,9 @@ void SerializerForBackgroundCompilation::ProcessApiCall(
if (!target_template_info.has_call_code()) return;
target_template_info.SerializeCallCode();
SharedFunctionInfoRef target_ref = MakeRef(broker(), target);
target_ref.SerializeFunctionTemplateInfo();
if (target_template_info.accept_any_receiver() &&
target_template_info.is_signature_undefined()) {
return;
......@@ -2884,6 +2893,8 @@ void SerializerForBackgroundCompilation::ProcessCheckContextExtensions(
ProcessContextAccess(context_hints, Context::EXTENSION_INDEX, i,
kSerializeSlot);
}
SharedFunctionInfoRef shared = MakeRef(broker(), function().shared());
shared.SerializeScopeInfoChain();
}
void SerializerForBackgroundCompilation::ProcessLdaLookupGlobalSlot(
......
......@@ -9,18 +9,16 @@ function TestMapConstructorEntrySideEffect(ctor) {
const k1 = {};
const k2 = {};
let callCount = 0;
let prop = {
get() {
// Verify continuation retains original set function
ctor.prototype.set = () => {
callCount++;
};
return k1;
}
};
%PrepareFunctionForOptimization(prop.get); // To prevent flushing.
const input = [
Object.defineProperty([, 1], "0", prop),
Object.defineProperty([, 1], "0", {
get() {
// Verify continuation retains original set function
ctor.prototype.set = () => {
callCount++;
};
return k1;
}
}),
[k2, 2]
];
const col = new ctor(input);
......
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