Commit 93b6c866 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[csa] add hint to CAST error message to break in mksnapshot

Change-Id: I51a22de5d6367c38056ea91eface4f69f6651993
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664069Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62274}
parent b37f1c0a
......@@ -1206,6 +1206,13 @@ void CodeAssembler::HandleException(Node* node) {
raw_assembler()->AddNode(raw_assembler()->common()->IfSuccess(), node);
}
std::string CodeAssembler::CSADebugHint() {
std::stringstream s;
s << "Run mksnapshot with --csa-trap-on-node=" << state()->name() << ","
<< state()->raw_assembler_->NodeCount() << " to break in CSA code.";
return s.str();
}
namespace {
template <size_t kMaxSize>
class NodeArray {
......
......@@ -739,7 +739,10 @@ class V8_EXPORT_PRIVATE CodeAssembler {
code_assembler_->SmiConstant(
static_cast<int>(ObjectTypeOf<A>::value))),
std::make_pair(MachineType::AnyTagged(),
code_assembler_->StringConstant(location_)));
code_assembler_->StringConstant(
(location_ + std::string("\n") +
code_assembler_->CSADebugHint())
.c_str())));
}
#endif
return TNode<A>::UncheckedCast(node_);
......@@ -1417,6 +1420,8 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void GotoIfException(Node* node, Label* if_exception,
Variable* exception_var = nullptr);
std::string CSADebugHint();
// Helpers which delegate to RawMachineAssembler.
Factory* factory() const;
Isolate* isolate() const;
......
......@@ -735,6 +735,8 @@ Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
return graph()->NewNodeUnchecked(op, input_count, inputs);
}
size_t RawMachineAssembler::NodeCount() { return graph_->NodeCount(); }
RawMachineLabel::~RawMachineLabel() {
#if DEBUG
if (bound_ == used_) return;
......
......@@ -1067,6 +1067,8 @@ class V8_EXPORT_PRIVATE RawMachineAssembler {
return AddNode(op, sizeof...(args) + 1, buffer);
}
size_t NodeCount();
void SetSourcePosition(const char* file, int line);
SourcePositionTable* source_positions() { return source_positions_; }
......
......@@ -6523,8 +6523,9 @@ UNINITIALIZED_TEST(OutOfMemoryLargeObjects) {
}
}
CHECK_LE(state.old_generation_capacity_at_oom, kOldGenerationLimit);
CHECK_LE(kOldGenerationLimit, state.old_generation_capacity_at_oom +
state.new_space_capacity_at_oom +
size_t size = std::max(state.old_generation_capacity_at_oom,
state.memory_allocator_size_at_oom);
CHECK_LE(kOldGenerationLimit, size + state.new_space_capacity_at_oom +
state.new_lo_space_size_at_oom +
FixedArray::SizeFor(kFixedArrayLength));
CHECK_LE(
......
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