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

Change-Id: I51a22de5d6367c38056ea91eface4f69f6651993
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664069
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62274}
This commit is contained in:
Tobias Tebbi 2019-06-18 16:26:45 +02:00 committed by Commit Bot
parent b37f1c0a0d
commit 93b6c866f3
5 changed files with 20 additions and 3 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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_; }

View File

@ -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(