Commit 09b7f786 authored by Jakob Gruber's avatar Jakob Gruber Committed by V8 LUCI CQ

Fix a build error for use_custom_libcxx=false use_sysroot=false

This reverts part of crrev.com/c/2413252 since std::unique_ptr does
not satisfy is_standard_layout; and is_standard_layout is needed
to use offsetof:

 error: offset of on non-standard-layout type [-Werror,-Winvalid-offsetof]

Fixed: v8:12721
Change-Id: Ifbb1235fc3b8d1d855d41a226117fed88c506078
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3540141Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79597}
parent 7ff07f6e
......@@ -95,7 +95,7 @@ class FrameWriter {
const char* debug_hint = "") {
Object obj = iterator->GetRawValue();
PushRawObject(obj, debug_hint);
if (trace_scope_) {
if (trace_scope_ != nullptr) {
PrintF(trace_scope_->file(), " (input #%d)\n", iterator.input_index());
}
deoptimizer_->QueueValueForMaterialization(output_address(top_offset_), obj,
......@@ -580,6 +580,7 @@ Handle<Code> Deoptimizer::compiled_code() const {
Deoptimizer::~Deoptimizer() {
DCHECK(input_ == nullptr && output_ == nullptr);
DCHECK_NULL(disallow_garbage_collection_);
delete trace_scope_;
}
void Deoptimizer::DeleteFrameDescriptions() {
......
......@@ -182,11 +182,11 @@ class Deoptimizer : public Malloced {
Code FindDeoptimizingCode(Address addr);
// Tracing.
bool tracing_enabled() const { return static_cast<bool>(trace_scope_); }
bool tracing_enabled() const { return trace_scope_ != nullptr; }
bool verbose_tracing_enabled() const {
return FLAG_trace_deopt_verbose && trace_scope_;
return FLAG_trace_deopt_verbose && tracing_enabled();
}
CodeTracer::Scope* trace_scope() const { return trace_scope_.get(); }
CodeTracer::Scope* trace_scope() const { return trace_scope_; }
CodeTracer::Scope* verbose_trace_scope() const {
return FLAG_trace_deopt_verbose ? trace_scope() : nullptr;
}
......@@ -239,7 +239,9 @@ class Deoptimizer : public Malloced {
DisallowGarbageCollection* disallow_garbage_collection_;
#endif // DEBUG
std::unique_ptr<CodeTracer::Scope> trace_scope_;
// Note: This is intentionally not a unique_ptr s.t. the Deoptimizer
// satisfies is_standard_layout, needed for offsetof().
CodeTracer::Scope* const trace_scope_;
friend class DeoptimizedFrameInfo;
friend class FrameDescription;
......
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