Index: src/compiler/code-assembler.cc |
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc |
index e598c0964225d05abc070bfa01eefb9b2ff91aba..5c3dd15b106d8caf0576d2f53c38cf7c4196d62b 100644 |
--- a/src/compiler/code-assembler.cc |
+++ b/src/compiler/code-assembler.cc |
@@ -694,6 +694,27 @@ void CodeAssembler::Switch(Node* index, Label* default_label, |
labels, case_count); |
} |
+Node* CodeAssembler::Select(Node* condition, Node* true_value, |
+ Node* false_value, MachineRepresentation rep) { |
+ Variable value(this, rep); |
+ Label vtrue(this), vfalse(this), end(this); |
+ Branch(condition, &vtrue, &vfalse); |
+ |
+ Bind(&vtrue); |
+ { |
+ value.Bind(true_value); |
+ Goto(&end); |
+ } |
+ Bind(&vfalse); |
+ { |
+ value.Bind(false_value); |
+ Goto(&end); |
+ } |
+ |
+ Bind(&end); |
+ return value.value(); |
+} |
+ |
// RawMachineAssembler delegate helpers: |
Isolate* CodeAssembler::isolate() const { return raw_assembler_->isolate(); } |