/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/compiler/select-lowering.cc
59 строк
1 KB
Michaël Zasso
deps: update V8 to 13.6.233.8
02 май 2025, 16:06
Не верифицирован
02 май 2025, 16:06
918fe04
Код
Авторство
О чём код?
// Copyright 2014 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/compiler/select-lowering.h" #include "src/compiler/common-operator.h" #include "src/compiler/graph-assembler.h" #include "src/compiler/node.h" #include "src/compiler/turbofan-graph.h" namespace v8 { namespace internal { namespace compiler { SelectLowering::SelectLowering(JSGraphAssembler* graph_assembler, TFGraph* graph) : graph_assembler_(graph_assembler), start_(graph->start()) {} SelectLowering::~SelectLowering() = default; Reduction SelectLowering::Reduce(Node* node) { if (node->opcode() != IrOpcode::kSelect) return NoChange(); return LowerSelect(node); } #define __ gasm()-> Reduction SelectLowering::LowerSelect(Node* node) { SelectParameters const p = SelectParametersOf(node->op()); Node* condition = node->InputAt(0); Node* vtrue = node->InputAt(1); Node* vfalse = node->InputAt(2); bool reset_gasm = false; if (gasm()->control() == nullptr) { gasm()->InitializeEffectControl(start(), start()); reset_gasm = true; } auto done = __ MakeLabel(p.representation()); __ GotoIf(condition, &done, vtrue); __ Goto(&done, vfalse); __ Bind(&done); if (reset_gasm) { gasm()->Reset(); } return Changed(done.PhiAt(0)); } #undef __ } // namespace compiler } // namespace internal } // namespace v8