author | joehw |
Wed, 26 Jun 2019 05:49:59 +0000 | |
changeset 55496 | 8e0ae3830fca |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
6 | 1 |
/* |
2 |
* reserved comment block |
|
3 |
* DO NOT REMOVE OR ALTER! |
|
4 |
*/ |
|
44797
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
5 |
/* |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
6 |
* Licensed to the Apache Software Foundation (ASF) under one or more |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
7 |
* contributor license agreements. See the NOTICE file distributed with |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
8 |
* this work for additional information regarding copyright ownership. |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
9 |
* The ASF licenses this file to You under the Apache License, Version 2.0 |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
10 |
* (the "License"); you may not use this file except in compliance with |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
11 |
* the License. You may obtain a copy of the License at |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
12 |
* |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
13 |
* http://www.apache.org/licenses/LICENSE-2.0 |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
14 |
* |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
15 |
* Unless required by applicable law or agreed to in writing, software |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
16 |
* distributed under the License is distributed on an "AS IS" BASIS, |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
17 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
18 |
* See the License for the specific language governing permissions and |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
19 |
* limitations under the License. |
8b3b3b911b8a
8162572: Update License Header for all JAXP sources
joehw
parents:
25868
diff
changeset
|
20 |
*/ |
6 | 21 |
package com.sun.org.apache.bcel.internal.generic; |
22 |
||
46174 | 23 |
import com.sun.org.apache.bcel.internal.Const; |
24 |
import com.sun.org.apache.bcel.internal.ExceptionConst; |
|
6 | 25 |
|
26 |
/** |
|
27 |
* GETFIELD - Fetch field from object |
|
55496 | 28 |
* <PRE>Stack: ..., objectref -> ..., value</PRE> |
29 |
* OR |
|
6 | 30 |
* <PRE>Stack: ..., objectref -> ..., value.word1, value.word2</PRE> |
31 |
* |
|
55496 | 32 |
* @version $Id$ |
6 | 33 |
*/ |
46174 | 34 |
public class GETFIELD extends FieldInstruction implements ExceptionThrower, StackConsumer, |
35 |
StackProducer { |
|
6 | 36 |
|
46174 | 37 |
/** |
55496 | 38 |
* Empty constructor needed for Instruction.readInstruction. |
39 |
* Not to be used otherwise. |
|
46174 | 40 |
*/ |
41 |
GETFIELD() { |
|
42 |
} |
|
6 | 43 |
|
55496 | 44 |
|
46174 | 45 |
public GETFIELD(final int index) { |
46 |
super(Const.GETFIELD, index); |
|
47 |
} |
|
6 | 48 |
|
55496 | 49 |
|
46174 | 50 |
@Override |
55496 | 51 |
public int produceStack( final ConstantPoolGen cpg ) { |
46174 | 52 |
return getFieldSize(cpg); |
53 |
} |
|
6 | 54 |
|
55496 | 55 |
|
46174 | 56 |
@Override |
57 |
public Class<?>[] getExceptions() { |
|
58 |
return ExceptionConst.createExceptions(ExceptionConst.EXCS.EXCS_FIELD_AND_METHOD_RESOLUTION, |
|
55496 | 59 |
ExceptionConst.NULL_POINTER_EXCEPTION, |
60 |
ExceptionConst.INCOMPATIBLE_CLASS_CHANGE_ERROR); |
|
46174 | 61 |
} |
6 | 62 |
|
55496 | 63 |
|
46174 | 64 |
/** |
55496 | 65 |
* Call corresponding visitor method(s). The order is: |
66 |
* Call visitor methods of implemented interfaces first, then |
|
67 |
* call methods according to the class hierarchy in descending order, |
|
68 |
* i.e., the most specific visitXXX() call comes last. |
|
46174 | 69 |
* |
70 |
* @param v Visitor object |
|
71 |
*/ |
|
72 |
@Override |
|
55496 | 73 |
public void accept( final Visitor v ) { |
46174 | 74 |
v.visitExceptionThrower(this); |
75 |
v.visitStackConsumer(this); |
|
76 |
v.visitStackProducer(this); |
|
77 |
v.visitTypedInstruction(this); |
|
78 |
v.visitLoadClass(this); |
|
79 |
v.visitCPInstruction(this); |
|
80 |
v.visitFieldOrMethod(this); |
|
81 |
v.visitFieldInstruction(this); |
|
82 |
v.visitGETFIELD(this); |
|
83 |
} |
|
6 | 84 |
} |