Lines Matching refs:binExpr

26 bool Condition::CompileBinaryExpr(PandaGen *pg, const ir::BinaryExpression *binExpr, Label *falseLabel)
28 switch (binExpr->OperatorType()) {
45 binExpr->Left()->Compile(pg);
46 pg->StoreAccumulator(binExpr, lhs);
47 binExpr->Right()->Compile(pg);
48 pg->Condition(binExpr, binExpr->OperatorType(), lhs, falseLabel);
52 binExpr->Left()->Compile(pg);
53 pg->ToBoolean(binExpr);
54 pg->BranchIfFalse(binExpr, falseLabel);
56 binExpr->Right()->Compile(pg);
57 pg->ToBoolean(binExpr);
58 pg->BranchIfFalse(binExpr, falseLabel);
64 binExpr->Left()->Compile(pg);
65 pg->ToBoolean(binExpr);
66 pg->BranchIfTrue(binExpr, endLabel);
68 binExpr->Right()->Compile(pg);
69 pg->ToBoolean(binExpr);
70 pg->BranchIfFalse(binExpr, falseLabel);
71 pg->SetLabel(binExpr, endLabel);
96 // General case including some binExpr i.E.(a+b)
129 void Condition::CompileLogicalOrExpr(ETSGen *etsg, const ir::BinaryExpression *binExpr, Label *falseLabel)
131 auto ttctx = TargetTypeContext(etsg, binExpr->OperationType());
139 binExpr->Left()->Compile(etsg);
140 etsg->ApplyConversionAndStoreAccumulator(binExpr->Left(), lhs, binExpr->OperationType());
141 etsg->ResolveConditionalResultIfTrue(binExpr->Left(), returnLeftLabel);
142 etsg->BranchIfTrue(binExpr, returnLeftLabel);
144 binExpr->Right()->Compile(etsg);
145 etsg->ApplyConversionAndStoreAccumulator(binExpr->Right(), rhs, binExpr->OperationType());
146 etsg->ResolveConditionalResultIfFalse(binExpr->Right(), returnRightFalseLabel);
147 etsg->BranchIfFalse(binExpr, returnRightFalseLabel);
148 etsg->LoadAccumulator(binExpr, rhs);
149 etsg->Branch(binExpr, returnRightTrueLabel);
151 etsg->SetLabel(binExpr, returnRightFalseLabel);
152 etsg->LoadAccumulator(binExpr, rhs);
153 etsg->Branch(binExpr, falseLabel);
154 etsg->SetLabel(binExpr, returnLeftLabel);
155 etsg->LoadAccumulator(binExpr, lhs);
156 etsg->SetLabel(binExpr, returnRightTrueLabel);
159 void Condition::CompileLogicalAndExpr(ETSGen *etsg, const ir::BinaryExpression *binExpr, Label *falseLabel)
161 auto ttctx = TargetTypeContext(etsg, binExpr->OperationType());
169 binExpr->Left()->Compile(etsg);
170 etsg->ApplyConversionAndStoreAccumulator(binExpr->Left(), lhs, binExpr->OperationType());
171 etsg->ResolveConditionalResultIfFalse(binExpr->Left(), returnLeftLabel);
172 etsg->BranchIfFalse(binExpr, returnLeftLabel);
174 binExpr->Right()->Compile(etsg);
175 etsg->ApplyConversionAndStoreAccumulator(binExpr->Right(), rhs, binExpr->OperationType());
176 etsg->ResolveConditionalResultIfFalse(binExpr->Right(), returnRightFalseLabel);
177 etsg->BranchIfFalse(binExpr, returnRightFalseLabel);
178 etsg->LoadAccumulator(binExpr, rhs);
179 etsg->Branch(binExpr, returnRightTrueLabel);
181 etsg->SetLabel(binExpr, returnLeftLabel);
182 etsg->LoadAccumulator(binExpr, lhs);
183 etsg->Branch(binExpr, falseLabel);
184 etsg->SetLabel(binExpr, returnRightFalseLabel);
185 etsg->LoadAccumulator(binExpr, rhs);
186 etsg->Branch(binExpr, falseLabel);
187 etsg->SetLabel(binExpr, returnRightTrueLabel);
238 void Condition::CompileInstanceofExpr(ETSGen *etsg, const ir::BinaryExpression *binExpr, Label *falseLabel)
240 ASSERT(binExpr->OperatorType() == lexer::TokenType::KEYW_INSTANCEOF);
241 binExpr->Compile(etsg);
242 etsg->BranchIfFalse(binExpr, falseLabel);
245 bool Condition::CompileBinaryExpr(ETSGen *etsg, const ir::BinaryExpression *binExpr, Label *falseLabel)
247 if (CompileBinaryExprForBigInt(etsg, binExpr, falseLabel)) {
251 switch (binExpr->OperatorType()) {
258 auto ttctx = TargetTypeContext(etsg, binExpr->OperationType());
263 binExpr->CompileOperands(etsg, lhs);
264 etsg->Condition(binExpr, binExpr->OperatorType(), lhs, falseLabel);
268 CompileLogicalAndExpr(etsg, binExpr, falseLabel);
272 CompileLogicalOrExpr(etsg, binExpr, falseLabel);
276 CompileInstanceofExpr(etsg, binExpr, falseLabel);