src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Expression.java
equal
deleted
inserted
replaced
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. |
19 * limitations under the License. |
19 * limitations under the License. |
20 */ |
20 */ |
21 |
21 |
22 package com.sun.org.apache.xalan.internal.xsltc.compiler; |
22 package com.sun.org.apache.xalan.internal.xsltc.compiler; |
23 |
23 |
24 import java.util.Vector; |
|
25 |
|
26 import com.sun.org.apache.bcel.internal.generic.BranchHandle; |
24 import com.sun.org.apache.bcel.internal.generic.BranchHandle; |
27 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; |
25 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; |
28 import com.sun.org.apache.bcel.internal.generic.GOTO_W; |
26 import com.sun.org.apache.bcel.internal.generic.GOTO_W; |
29 import com.sun.org.apache.bcel.internal.generic.IFEQ; |
27 import com.sun.org.apache.bcel.internal.generic.IFEQ; |
30 import com.sun.org.apache.bcel.internal.generic.InstructionHandle; |
28 import com.sun.org.apache.bcel.internal.generic.InstructionHandle; |
35 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator; |
33 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator; |
36 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType; |
34 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType; |
37 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType; |
35 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType; |
38 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; |
36 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; |
39 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError; |
37 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError; |
|
38 import java.util.List; |
40 |
39 |
41 /** |
40 /** |
42 * @author Jacek Ambroziak |
41 * @author Jacek Ambroziak |
43 * @author Santiago Pericas-Geertsen |
42 * @author Santiago Pericas-Geertsen |
44 * @author Morten Jorgensen |
43 * @author Morten Jorgensen |
191 * considered to be the default one. |
190 * considered to be the default one. |
192 */ |
191 */ |
193 public MethodType lookupPrimop(SymbolTable stable, String op, |
192 public MethodType lookupPrimop(SymbolTable stable, String op, |
194 MethodType ctype) { |
193 MethodType ctype) { |
195 MethodType result = null; |
194 MethodType result = null; |
196 final Vector primop = stable.lookupPrimop(op); |
195 final List<MethodType> primop = stable.lookupPrimop(op); |
197 if (primop != null) { |
196 if (primop != null) { |
198 final int n = primop.size(); |
197 final int n = primop.size(); |
199 int minDistance = Integer.MAX_VALUE; |
198 int minDistance = Integer.MAX_VALUE; |
200 for (int i = 0; i < n; i++) { |
199 for (int i = 0; i < n; i++) { |
201 final MethodType ptype = (MethodType) primop.elementAt(i); |
200 final MethodType ptype = primop.get(i); |
202 // Skip if different arity |
201 // Skip if different arity |
203 if (ptype.argsCount() != ctype.argsCount()) { |
202 if (ptype.argsCount() != ctype.argsCount()) { |
204 continue; |
203 continue; |
205 } |
204 } |
206 |
205 |