1 /* |
1 /* |
2 * reserved comment block |
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT REMOVE OR ALTER! |
3 * @LastModified: Oct 2017 |
4 */ |
4 */ |
5 /* |
5 /* |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
6 * Licensed to the Apache Software Foundation (ASF) under one or more |
7 * contributor license agreements. See the NOTICE file distributed with |
7 * contributor license agreements. See the NOTICE file distributed with |
8 * this work for additional information regarding copyright ownership. |
8 * this work for additional information regarding copyright ownership. |
135 MethodType haveType = lookupPrimop(stable, Ops[_op], wantType); |
135 MethodType haveType = lookupPrimop(stable, Ops[_op], wantType); |
136 |
136 |
137 // Yes, the operation is supported |
137 // Yes, the operation is supported |
138 if (haveType != null) { |
138 if (haveType != null) { |
139 // Check if left-hand side operand must be type casted |
139 // Check if left-hand side operand must be type casted |
140 Type arg1 = (Type)haveType.argsType().elementAt(0); |
140 Type arg1 = (Type)haveType.argsType().get(0); |
141 if (!arg1.identicalTo(tleft)) |
141 if (!arg1.identicalTo(tleft)) |
142 _left = new CastExpr(_left, arg1); |
142 _left = new CastExpr(_left, arg1); |
143 // Check if right-hand side operand must be type casted |
143 // Check if right-hand side operand must be type casted |
144 Type arg2 = (Type) haveType.argsType().elementAt(1); |
144 Type arg2 = (Type) haveType.argsType().get(1); |
145 if (!arg2.identicalTo(tright)) |
145 if (!arg2.identicalTo(tright)) |
146 _right = new CastExpr(_right, arg1); |
146 _right = new CastExpr(_right, arg1); |
147 // Return the result type for the operator we will use |
147 // Return the result type for the operator we will use |
148 return _type = haveType.resultType(); |
148 return _type = haveType.resultType(); |
149 } |
149 } |