Commit 347aa822 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by V8 LUCI CQ

[compiler] Mark Code/CodeDataContainer as NeverEverSerialized

Bug: v8:7790
Change-Id: Ic8bb9574c498ae3ce18d1ea29c943d0154d43280
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3008635
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75774}
parent d3390124
...@@ -1789,18 +1789,11 @@ class TemplateObjectDescriptionData : public HeapObjectData { ...@@ -1789,18 +1789,11 @@ class TemplateObjectDescriptionData : public HeapObjectData {
class CodeData : public HeapObjectData { class CodeData : public HeapObjectData {
public: public:
CodeData(JSHeapBroker* broker, ObjectData** storage, Handle<Code> object) CodeData(JSHeapBroker* broker, ObjectData** storage, Handle<Code> object)
: HeapObjectData(broker, storage, object), : HeapObjectData(broker, storage, object) {
inlined_bytecode_size_(object->inlined_bytecode_size() > 0 && // TODO(solanes, v8:7790): Remove this class once all kNeverSerialized types
!object->marked_for_deoptimization() // are NeverEverSerialize.
? object->inlined_bytecode_size() UNREACHABLE();
: 0) {
DCHECK(!broker->is_concurrent_inlining());
} }
unsigned inlined_bytecode_size() const { return inlined_bytecode_size_; }
private:
unsigned const inlined_bytecode_size_;
}; };
class CodeDataContainerData : public HeapObjectData { class CodeDataContainerData : public HeapObjectData {
...@@ -1808,7 +1801,9 @@ class CodeDataContainerData : public HeapObjectData { ...@@ -1808,7 +1801,9 @@ class CodeDataContainerData : public HeapObjectData {
CodeDataContainerData(JSHeapBroker* broker, ObjectData** storage, CodeDataContainerData(JSHeapBroker* broker, ObjectData** storage,
Handle<CodeDataContainer> object) Handle<CodeDataContainer> object)
: HeapObjectData(broker, storage, object) { : HeapObjectData(broker, storage, object) {
DCHECK(!broker->is_concurrent_inlining()); // TODO(solanes, v8:7790): Remove this class once all kNeverSerialized types
// are NeverEverSerialize.
UNREACHABLE();
} }
}; };
...@@ -2288,6 +2283,8 @@ NEVER_EVER_SERIALIZE(ArrayBoilerplateDescription) ...@@ -2288,6 +2283,8 @@ NEVER_EVER_SERIALIZE(ArrayBoilerplateDescription)
NEVER_EVER_SERIALIZE(BytecodeArray) NEVER_EVER_SERIALIZE(BytecodeArray)
NEVER_EVER_SERIALIZE(Cell) NEVER_EVER_SERIALIZE(Cell)
NEVER_EVER_SERIALIZE(CallHandlerInfo) NEVER_EVER_SERIALIZE(CallHandlerInfo)
NEVER_EVER_SERIALIZE(Code)
NEVER_EVER_SERIALIZE(CodeDataContainer)
NEVER_EVER_SERIALIZE(Context) NEVER_EVER_SERIALIZE(Context)
NEVER_EVER_SERIALIZE(FunctionTemplateInfo) NEVER_EVER_SERIALIZE(FunctionTemplateInfo)
NEVER_EVER_SERIALIZE(InternalizedString) NEVER_EVER_SERIALIZE(InternalizedString)
...@@ -3974,17 +3971,13 @@ std::ostream& operator<<(std::ostream& os, const ObjectRef& ref) { ...@@ -3974,17 +3971,13 @@ std::ostream& operator<<(std::ostream& os, const ObjectRef& ref) {
} }
unsigned CodeRef::GetInlinedBytecodeSize() const { unsigned CodeRef::GetInlinedBytecodeSize() const {
if (data_->should_access_heap()) { unsigned value = object()->inlined_bytecode_size();
unsigned value = object()->inlined_bytecode_size(); if (value > 0) {
if (value > 0) { // Don't report inlined bytecode size if the code object was already
// Don't report inlined bytecode size if the code object was already // deoptimized.
// deoptimized. value = object()->marked_for_deoptimization() ? 0 : value;
value = object()->marked_for_deoptimization() ? 0 : value;
}
return value;
} }
return value;
return ObjectRef::data()->AsCode()->inlined_bytecode_size();
} }
#undef BIMODAL_ACCESSOR #undef BIMODAL_ACCESSOR
......
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