Commit 36532619 authored by epertoso's avatar epertoso Committed by Commit bot

[turbofan] Modifies the --turbo-verify-machine-graph flag to act as a filter.

This allows people writing code stubs to just verify the graph of the stub they're working on, at least until we fix all of the issues we have and enable the verification by default.

Also fixes representations in CodeStubAssembler::SmiOr and InterpreterAssembler::StarDispatchLookahead.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2413653006
Cr-Commit-Position: refs/heads/master@{#40320}
parent 2a480eff
......@@ -135,7 +135,8 @@ class CodeStubAssembler : public compiler::CodeAssembler {
// Computes a * b for Smi inputs a and b; result is not necessarily a Smi.
compiler::Node* SmiMul(compiler::Node* a, compiler::Node* b);
compiler::Node* SmiOr(compiler::Node* a, compiler::Node* b) {
return WordOr(a, b);
return BitcastWordToTaggedSigned(
WordOr(BitcastTaggedToWord(a), BitcastTaggedToWord(b)));
}
// Allocate an object of the given size.
......
......@@ -1781,7 +1781,10 @@ bool PipelineImpl::ScheduleAndSelectInstructions(Linkage* linkage) {
info(), data->graph(), data->schedule()));
}
if (FLAG_turbo_verify_machine_graph) {
if (FLAG_turbo_verify_machine_graph != nullptr &&
(!strcmp(FLAG_turbo_verify_machine_graph, "*") ||
!strcmp(FLAG_turbo_verify_machine_graph,
data->info()->GetDebugName().get()))) {
Zone temp_zone(data->isolate()->allocator());
MachineGraphVerifier::Run(data->graph(), data->schedule(), linkage,
&temp_zone);
......
......@@ -450,7 +450,7 @@ DEFINE_BOOL(turbo_asm, true, "enable TurboFan for asm.js code")
DEFINE_BOOL(turbo_asm_deoptimization, false,
"enable deoptimization in TurboFan for asm.js code")
DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase")
DEFINE_BOOL(turbo_verify_machine_graph, false,
DEFINE_STRING(turbo_verify_machine_graph, nullptr,
"verify TurboFan machine graph before instruction selection")
DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics")
DEFINE_BOOL(turbo_stats_nvp, false,
......
......@@ -1035,7 +1035,7 @@ Node* InterpreterAssembler::LoadBytecode(compiler::Node* bytecode_offset) {
Node* InterpreterAssembler::StarDispatchLookahead(Node* target_bytecode) {
Label do_inline_star(this), done(this);
Variable var_bytecode(this, MachineRepresentation::kWord8);
Variable var_bytecode(this, MachineType::PointerRepresentation());
var_bytecode.Bind(target_bytecode);
Node* star_bytecode = IntPtrConstant(static_cast<int>(Bytecode::kStar));
......
......@@ -335,7 +335,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) {
IsChangeUint32ToUint64(after_lookahead_bytecode);
}
target_bytecode_matcher =
IsPhi(MachineRepresentation::kWord8, target_bytecode_matcher,
IsPhi(MachineType::PointerRepresentation(), target_bytecode_matcher,
after_lookahead_bytecode, _);
code_target_matcher =
m.IsLoad(MachineType::Pointer(),
......
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