mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 16:44:25 +02:00
Add support for Format41c (field references)
This commit is contained in:
parent
8b3b577f00
commit
d863324ffb
@ -33,6 +33,7 @@ import org.jf.util.IndentingWriter;
|
|||||||
import org.jf.dexlib.*;
|
import org.jf.dexlib.*;
|
||||||
import org.jf.dexlib.Code.Analysis.ValidationException;
|
import org.jf.dexlib.Code.Analysis.ValidationException;
|
||||||
import org.jf.dexlib.Code.Format.Instruction21c;
|
import org.jf.dexlib.Code.Format.Instruction21c;
|
||||||
|
import org.jf.dexlib.Code.Format.Instruction41c;
|
||||||
import org.jf.dexlib.Code.Instruction;
|
import org.jf.dexlib.Code.Instruction;
|
||||||
import org.jf.dexlib.EncodedValue.EncodedValue;
|
import org.jf.dexlib.EncodedValue.EncodedValue;
|
||||||
import org.jf.dexlib.Util.AccessFlags;
|
import org.jf.dexlib.Util.AccessFlags;
|
||||||
@ -115,10 +116,24 @@ public class ClassDefinition {
|
|||||||
case SPUT_CHAR:
|
case SPUT_CHAR:
|
||||||
case SPUT_OBJECT:
|
case SPUT_OBJECT:
|
||||||
case SPUT_SHORT:
|
case SPUT_SHORT:
|
||||||
case SPUT_WIDE:
|
case SPUT_WIDE: {
|
||||||
Instruction21c ins = (Instruction21c)instruction;
|
Instruction21c ins = (Instruction21c)instruction;
|
||||||
FieldIdItem fieldIdItem = (FieldIdItem)ins.getReferencedItem();
|
FieldIdItem fieldIdItem = (FieldIdItem)ins.getReferencedItem();
|
||||||
fieldsSetInStaticConstructor.put(fieldIdItem.getIndex(), fieldIdItem);
|
fieldsSetInStaticConstructor.put(fieldIdItem.getIndex(), fieldIdItem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SPUT_JUMBO:
|
||||||
|
case SPUT_BOOLEAN_JUMBO:
|
||||||
|
case SPUT_BYTE_JUMBO:
|
||||||
|
case SPUT_CHAR_JUMBO:
|
||||||
|
case SPUT_OBJECT_JUMBO:
|
||||||
|
case SPUT_SHORT_JUMBO:
|
||||||
|
case SPUT_WIDE_JUMBO: {
|
||||||
|
Instruction41c ins = (Instruction41c)instruction;
|
||||||
|
FieldIdItem fieldIdItem = (FieldIdItem)ins.getReferencedItem();
|
||||||
|
fieldsSetInStaticConstructor.put(fieldIdItem.getIndex(), fieldIdItem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,22 @@ public enum Opcode
|
|||||||
|
|
||||||
CONST_CLASS_JUMBO((short)0xff00, "const-class/jumbo", ReferenceType.type, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
CONST_CLASS_JUMBO((short)0xff00, "const-class/jumbo", ReferenceType.type, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
CHECK_CAST_JUMBO((short)0xff01, "check-cast/jumbo", ReferenceType.type, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
CHECK_CAST_JUMBO((short)0xff01, "check-cast/jumbo", ReferenceType.type, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
NEW_INSTANCE_JUMBO((short)0xff03, "new-instance/jumbo", ReferenceType.type, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER);
|
NEW_INSTANCE_JUMBO((short)0xff03, "new-instance/jumbo", ReferenceType.type, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
|
|
||||||
|
SGET_JUMBO((short)0xff14, "sget/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
|
SGET_WIDE_JUMBO((short)0xff15, "sget-wide/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER | Opcode.SETS_WIDE_REGISTER),
|
||||||
|
SGET_OBJECT_JUMBO((short)0xff16, "sget-object/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
|
SGET_BOOLEAN_JUMBO((short)0xff17, "sget-boolean/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
|
SGET_BYTE_JUMBO((short)0xff18, "sget-byte/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
|
SGET_CHAR_JUMBO((short)0xff19, "sget-char/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
|
SGET_SHORT_JUMBO((short)0xff1a, "sget-short/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER),
|
||||||
|
SPUT_JUMBO((short)0xff1b, "sput/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE),
|
||||||
|
SPUT_WIDE_JUMBO((short)0xff1c, "sput-wide/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE),
|
||||||
|
SPUT_OBJECT_JUMBO((short)0xff1d, "sput-object/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE),
|
||||||
|
SPUT_BOOLEAN_JUMBO((short)0xff1e, "sput-boolean/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE),
|
||||||
|
SPUT_BYTE_JUMBO((short)0xff1f, "sput-byte/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE),
|
||||||
|
SPUT_CHAR_JUMBO((short)0xff20, "sput-char/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE),
|
||||||
|
SPUT_SHORT_JUMBO((short)0xff21, "sput-short/jumbo", ReferenceType.field, Format.Format41c, Opcode.CAN_THROW | Opcode.CAN_CONTINUE);
|
||||||
|
|
||||||
private static Opcode[] opcodesByValue;
|
private static Opcode[] opcodesByValue;
|
||||||
private static Opcode[] expandedOpcodesByValue;
|
private static Opcode[] expandedOpcodesByValue;
|
||||||
|
@ -50,6 +50,17 @@
|
|||||||
<dumpFile>target/jumbo-type-tests/classes.dump</dumpFile>
|
<dumpFile>target/jumbo-type-tests/classes.dump</dumpFile>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-field-tests</id>
|
||||||
|
<goals>
|
||||||
|
<goal>assemble</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirectory>src/test/smali/jumbo-field-tests</sourceDirectory>
|
||||||
|
<outputFile>target/jumbo-field-tests/classes.dex</outputFile>
|
||||||
|
<dumpFile>target/jumbo-field-tests/classes.dump</dumpFile>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -97,6 +108,20 @@
|
|||||||
</descriptors>
|
</descriptors>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-field-tests</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
<finalName>jumbo-field-tests</finalName>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/assemble/jumbo-field-tests.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -136,6 +161,17 @@
|
|||||||
<destinationFileOrDirectory>/data/local/jumbo-type-tests.zip</destinationFileOrDirectory>
|
<destinationFileOrDirectory>/data/local/jumbo-type-tests.zip</destinationFileOrDirectory>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-field-tests</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>push</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceFileOrDirectory>${project.build.directory}/jumbo-field-tests.zip</sourceFileOrDirectory>
|
||||||
|
<destinationFileOrDirectory>/data/local/jumbo-field-tests.zip</destinationFileOrDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -197,6 +233,24 @@
|
|||||||
</arguments>
|
</arguments>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>jumbo-field-tests</id>
|
||||||
|
<phase>test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<executable>adb</executable>
|
||||||
|
<arguments>
|
||||||
|
<argument>shell</argument>
|
||||||
|
<argument>dalvikvm</argument>
|
||||||
|
<argument>-cp</argument>
|
||||||
|
<argument>/data/local/junit-4.6.zip:/data/local/jumbo-field-tests.zip</argument>
|
||||||
|
<argument>org/junit/runner/JUnitCore</argument>
|
||||||
|
<argument>AllTests</argument>
|
||||||
|
</arguments>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
44
smali-integration-tests/src/assemble/jumbo-field-tests.xml
Normal file
44
smali-integration-tests/src/assemble/jumbo-field-tests.xml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright 2011, Google Inc.
|
||||||
|
~ All rights reserved.
|
||||||
|
~
|
||||||
|
~ Redistribution and use in source and binary forms, with or without
|
||||||
|
~ modification, are permitted provided that the following conditions are
|
||||||
|
~ met:
|
||||||
|
~
|
||||||
|
~ * Redistributions of source code must retain the above copyright
|
||||||
|
~ notice, this list of conditions and the following disclaimer.
|
||||||
|
~ * Redistributions in binary form must reproduce the above
|
||||||
|
~ copyright notice, this list of conditions and the following disclaimer
|
||||||
|
~ in the documentation and/or other materials provided with the
|
||||||
|
~ distribution.
|
||||||
|
~ * Neither the name of Google Inc. nor the names of its
|
||||||
|
~ contributors may be used to endorse or promote products derived from
|
||||||
|
~ this software without specific prior written permission.
|
||||||
|
~
|
||||||
|
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
~ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
~ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
~ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
~ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
~ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
~ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
~ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
~ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
~ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<assembly>
|
||||||
|
<id>zip</id>
|
||||||
|
<formats>
|
||||||
|
<format>zip</format>
|
||||||
|
</formats>
|
||||||
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
|
<files>
|
||||||
|
<file>
|
||||||
|
<source>target/jumbo-field-tests/classes.dex</source>
|
||||||
|
<outputDirectory>/</outputDirectory>
|
||||||
|
</file>
|
||||||
|
</files>
|
||||||
|
</assembly>
|
@ -0,0 +1,41 @@
|
|||||||
|
.class public LAssert;
|
||||||
|
.super Ljava/lang/Object;
|
||||||
|
.source "Assert.smali"
|
||||||
|
|
||||||
|
#junit's Assert doesn't have an AssertEquals method for ints, only longs
|
||||||
|
.method public static assertEquals(II)V
|
||||||
|
.registers 4
|
||||||
|
|
||||||
|
int-to-long v0, p1
|
||||||
|
int-to-long p0, p0
|
||||||
|
|
||||||
|
invoke-static {v0, v1, p0, p1}, Lorg/junit/Assert;->assertEquals(JJ)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
#junit's Assert doesn't have an AssertEquals method for floats, only doubles
|
||||||
|
.method public static assertEquals(FF)V
|
||||||
|
.registers 6
|
||||||
|
|
||||||
|
float-to-double v0, p0
|
||||||
|
float-to-double v2, p1
|
||||||
|
|
||||||
|
const-wide v4, .00001
|
||||||
|
|
||||||
|
invoke-static/range {v0..v5}, Lorg/junit/Assert;->assertEquals(DDD)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
#convenience method that supplies a default "Delta" argument
|
||||||
|
.method public static assertEquals(DD)V
|
||||||
|
.registers 6
|
||||||
|
|
||||||
|
move-wide v0, p0
|
||||||
|
move-wide v2, p2
|
||||||
|
|
||||||
|
const-wide v4, .00001
|
||||||
|
|
||||||
|
invoke-static/range {v0..v5}, Lorg/junit/Assert;->assertEquals(DDD)V
|
||||||
|
|
||||||
|
return-void
|
||||||
|
.end method
|
@ -0,0 +1,167 @@
|
|||||||
|
#Copyright 2011, Google Inc.
|
||||||
|
#All rights reserved.
|
||||||
|
#
|
||||||
|
#Redistribution and use in source and binary forms, with or without
|
||||||
|
#modification, are permitted provided that the following conditions are
|
||||||
|
#met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
#notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
#copyright notice, this list of conditions and the following disclaimer
|
||||||
|
#in the documentation and/or other materials provided with the
|
||||||
|
#distribution.
|
||||||
|
# * Neither the name of Google Inc. nor the names of its
|
||||||
|
#contributors may be used to endorse or promote products derived from
|
||||||
|
#this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
#A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
#OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
#THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
.class public LFormat41c;
|
||||||
|
.super Ljava/lang/Object;
|
||||||
|
.source "Format41c.smali"
|
||||||
|
|
||||||
|
.method public constructor <init>()V
|
||||||
|
.registers 1
|
||||||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-sget-jumbo()V
|
||||||
|
.registers 258
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const v0, 23
|
||||||
|
move/16 v256, v0
|
||||||
|
sput/jumbo v256, LManyStaticFields;->field99999:I
|
||||||
|
|
||||||
|
sget/jumbo v257, LManyStaticFields;->field99999:I
|
||||||
|
|
||||||
|
invoke-static/range {v256 .. v257}, LAssert;->assertEquals(II)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-object-sget-object-jumbo()V
|
||||||
|
.registers 258
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
new-instance v0, Ljava/lang/Object;
|
||||||
|
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
|
||||||
|
|
||||||
|
move-object/16 v256, v0
|
||||||
|
|
||||||
|
sput-object/jumbo v256, LManyStaticFields;->field99999Object:Ljava/lang/Object;
|
||||||
|
|
||||||
|
sget-object/jumbo v257, LManyStaticFields;->field99999Object:Ljava/lang/Object;
|
||||||
|
|
||||||
|
invoke-static/range {v256 .. v257}, Lorg/junit/Assert;->assertEquals(Ljava/lang/Object;Ljava/lang/Object;)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-wide-sget-wide-jumbo()V
|
||||||
|
.registers 260
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const-wide v0, 0x200000000L
|
||||||
|
move-wide/16 v256, v0
|
||||||
|
|
||||||
|
sput-wide/jumbo v256, LManyStaticFields;->field99999Wide:J
|
||||||
|
|
||||||
|
sget-wide/jumbo v258, LManyStaticFields;->field99999Wide:J
|
||||||
|
|
||||||
|
invoke-static/range {v256 .. v259}, Lorg/junit/Assert;->assertEquals(JJ)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-boolean-sget-boolean-true-jumbo()V
|
||||||
|
.registers 258
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const v0, 1
|
||||||
|
move/16 v256, v0
|
||||||
|
|
||||||
|
sput-boolean/jumbo v256, LManyStaticFields;->field99999Boolean:Z
|
||||||
|
|
||||||
|
sget-boolean/jumbo v257, LManyStaticFields;->field99999Boolean:Z
|
||||||
|
|
||||||
|
invoke-static/range {v257}, Lorg/junit/Assert;->assertTrue(Z)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-boolean-sget-boolean-false-jumbo()V
|
||||||
|
.registers 258
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const v0, 0
|
||||||
|
move/16 v256, v0
|
||||||
|
|
||||||
|
sput-boolean/jumbo v256, LManyStaticFields;->field99999Boolean:Z
|
||||||
|
|
||||||
|
sget-boolean/jumbo v257, LManyStaticFields;->field99999Boolean:Z
|
||||||
|
|
||||||
|
invoke-static/range {v257}, Lorg/junit/Assert;->assertFalse(Z)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-byte-sget-byte-jumbo()V
|
||||||
|
.registers 258
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const v0, 120T
|
||||||
|
move/16 v256, v0
|
||||||
|
|
||||||
|
sput-byte/jumbo v256, LManyStaticFields;->field99999Byte:B
|
||||||
|
|
||||||
|
sget-byte/jumbo v257, LManyStaticFields;->field99999Byte:B
|
||||||
|
|
||||||
|
invoke-static/range {v256 .. v257}, LAssert;->assertEquals(II)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-char-sget-char-jumbo()V
|
||||||
|
.registers 258
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const v0, 'a'
|
||||||
|
move/16 v256, v0
|
||||||
|
|
||||||
|
sput-char/jumbo v256, LManyStaticFields;->field99999Char:C
|
||||||
|
|
||||||
|
sget-char/jumbo v257, LManyStaticFields;->field99999Char:C
|
||||||
|
|
||||||
|
invoke-static/range {v256 .. v257}, LAssert;->assertEquals(II)V
|
||||||
|
return-void
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public test-sput-short-sget-short-jumbo()V
|
||||||
|
.registers 258
|
||||||
|
.annotation runtime Lorg/junit/Test;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
const v0, 1234S
|
||||||
|
move/16 v256, v0
|
||||||
|
|
||||||
|
sput-short/jumbo v256, LManyStaticFields;->field99999Short:S
|
||||||
|
|
||||||
|
sget-short/jumbo v257, LManyStaticFields;->field99999Short:S
|
||||||
|
|
||||||
|
invoke-static/range {v256 .. v257}, LAssert;->assertEquals(II)V
|
||||||
|
return-void
|
||||||
|
.end method
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@
|
|||||||
|
#Copyright 2011, Google Inc.
|
||||||
|
#All rights reserved.
|
||||||
|
#
|
||||||
|
#Redistribution and use in source and binary forms, with or without
|
||||||
|
#modification, are permitted provided that the following conditions are
|
||||||
|
#met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
#notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
#copyright notice, this list of conditions and the following disclaimer
|
||||||
|
#in the documentation and/or other materials provided with the
|
||||||
|
#distribution.
|
||||||
|
# * Neither the name of Google Inc. nor the names of its
|
||||||
|
#contributors may be used to endorse or promote products derived from
|
||||||
|
#this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
#A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
#OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
#THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
.class public LAllTests;
|
||||||
|
.super Ljava/lang/Object;
|
||||||
|
|
||||||
|
.annotation runtime Lorg/junit/runner/RunWith;
|
||||||
|
value = Lorg/junit/runners/Suite;
|
||||||
|
.end annotation
|
||||||
|
|
||||||
|
.annotation runtime Lorg/junit/runners/Suite$SuiteClasses;
|
||||||
|
value = { LFormat41c; }
|
||||||
|
.end annotation
|
@ -695,6 +695,22 @@ INSTRUCTION_FORMAT41c_TYPE
|
|||||||
| 'new-instance/jumbo'
|
| 'new-instance/jumbo'
|
||||||
| 'const-class/jumbo';
|
| 'const-class/jumbo';
|
||||||
|
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD
|
||||||
|
: 'sget/jumbo'
|
||||||
|
| 'sget-wide/jumbo'
|
||||||
|
| 'sget-object/jumbo'
|
||||||
|
| 'sget-boolean/jumbo'
|
||||||
|
| 'sget-byte/jumbo'
|
||||||
|
| 'sget-char/jumbo'
|
||||||
|
| 'sget-short/jumbo'
|
||||||
|
| 'sput/jumbo'
|
||||||
|
| 'sput-wide/jumbo'
|
||||||
|
| 'sput-object/jumbo'
|
||||||
|
| 'sput-boolean/jumbo'
|
||||||
|
| 'sput-byte/jumbo'
|
||||||
|
| 'sput-char/jumbo'
|
||||||
|
| 'sput-short/jumbo';
|
||||||
|
|
||||||
INSTRUCTION_FORMAT51l
|
INSTRUCTION_FORMAT51l
|
||||||
: 'const-wide';
|
: 'const-wide';
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@ tokens {
|
|||||||
I_STATEMENT_FORMAT3rc_METHOD;
|
I_STATEMENT_FORMAT3rc_METHOD;
|
||||||
I_STATEMENT_FORMAT3rc_TYPE;
|
I_STATEMENT_FORMAT3rc_TYPE;
|
||||||
I_STATEMENT_FORMAT41c_TYPE;
|
I_STATEMENT_FORMAT41c_TYPE;
|
||||||
|
I_STATEMENT_FORMAT41c_FIELD;
|
||||||
I_STATEMENT_FORMAT51l;
|
I_STATEMENT_FORMAT51l;
|
||||||
I_STATEMENT_ARRAY_DATA;
|
I_STATEMENT_ARRAY_DATA;
|
||||||
I_STATEMENT_PACKED_SWITCH;
|
I_STATEMENT_PACKED_SWITCH;
|
||||||
@ -838,6 +839,9 @@ instruction returns [int size]
|
|||||||
| //e.g. const-class/jumbo v2, Lorg/jf/HelloWorld2/HelloWorld2;
|
| //e.g. const-class/jumbo v2, Lorg/jf/HelloWorld2/HelloWorld2;
|
||||||
INSTRUCTION_FORMAT41c_TYPE REGISTER COMMA reference_type_descriptor {$size = Format.Format41c.size;}
|
INSTRUCTION_FORMAT41c_TYPE REGISTER COMMA reference_type_descriptor {$size = Format.Format41c.size;}
|
||||||
-> ^(I_STATEMENT_FORMAT41c_TYPE[$start, "I_STATEMENT_FORMAT41c"] INSTRUCTION_FORMAT41c_TYPE REGISTER reference_type_descriptor)
|
-> ^(I_STATEMENT_FORMAT41c_TYPE[$start, "I_STATEMENT_FORMAT41c"] INSTRUCTION_FORMAT41c_TYPE REGISTER reference_type_descriptor)
|
||||||
|
| //e.g. sget-object/jumbo v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD REGISTER COMMA fully_qualified_field {$size = Format.Format41c.size;}
|
||||||
|
-> ^(I_STATEMENT_FORMAT41c_FIELD[$start, "I_STATEMENT_FORMAT41c_FIELD"] INSTRUCTION_FORMAT41c_FIELD REGISTER fully_qualified_field)
|
||||||
| //e.g. const-wide v0, 5000000000L
|
| //e.g. const-wide v0, 5000000000L
|
||||||
INSTRUCTION_FORMAT51l REGISTER COMMA fixed_literal {$size = Format.Format51l.size;}
|
INSTRUCTION_FORMAT51l REGISTER COMMA fixed_literal {$size = Format.Format51l.size;}
|
||||||
-> ^(I_STATEMENT_FORMAT51l[$start, "I_STATEMENT_FORMAT51l"] INSTRUCTION_FORMAT51l REGISTER fixed_literal)
|
-> ^(I_STATEMENT_FORMAT51l[$start, "I_STATEMENT_FORMAT51l"] INSTRUCTION_FORMAT51l REGISTER fixed_literal)
|
||||||
|
@ -1259,6 +1259,16 @@ instruction[int totalMethodRegisters, int methodParameterRegisters, List<Instruc
|
|||||||
|
|
||||||
$instructions.add(new Instruction41c(opcode, regA, typeIdItem));
|
$instructions.add(new Instruction41c(opcode, regA, typeIdItem));
|
||||||
}
|
}
|
||||||
|
| //e.g. sget-object/jumbo v0, Ljava/lang/System;->out:LJava/io/PrintStream;
|
||||||
|
^(I_STATEMENT_FORMAT41c_FIELD INSTRUCTION_FORMAT41c_FIELD REGISTER fully_qualified_field)
|
||||||
|
{
|
||||||
|
Opcode opcode = Opcode.getOpcodeByName($INSTRUCTION_FORMAT41c_FIELD.text);
|
||||||
|
int regA = parseRegister_short($REGISTER.text, $totalMethodRegisters, $methodParameterRegisters);
|
||||||
|
|
||||||
|
FieldIdItem fieldIdItem = $fully_qualified_field.fieldIdItem;
|
||||||
|
|
||||||
|
$instructions.add(new Instruction41c(opcode, regA, fieldIdItem));
|
||||||
|
}
|
||||||
| //e.g. const-wide v0, 5000000000L
|
| //e.g. const-wide v0, 5000000000L
|
||||||
^(I_STATEMENT_FORMAT51l INSTRUCTION_FORMAT51l REGISTER fixed_64bit_literal)
|
^(I_STATEMENT_FORMAT51l INSTRUCTION_FORMAT51l REGISTER fixed_64bit_literal)
|
||||||
{
|
{
|
||||||
|
@ -566,6 +566,12 @@ Type = {PrimitiveType} | {ClassDescriptor} | {ArrayDescriptor}
|
|||||||
return newToken(INSTRUCTION_FORMAT41c_TYPE);
|
return newToken(INSTRUCTION_FORMAT41c_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"sget/jumbo" | "sget-wide/jumbo" | "sget-object/jumbo" | "sget-boolean/jumbo" | "sget-byte/jumbo" |
|
||||||
|
"sget-char/jumbo" | "sget-short/jumbo" | "sput/jumbo" | "sput-wide/jumbo" | "sput-object/jumbo" |
|
||||||
|
"sput-boolean/jumbo" | "sput-byte/jumbo" | "sput-char/jumbo" | "sput-short/jumbo" {
|
||||||
|
return newToken(INSTRUCTION_FORMAT41c_FIELD);
|
||||||
|
}
|
||||||
|
|
||||||
"const-wide" {
|
"const-wide" {
|
||||||
return newToken(INSTRUCTION_FORMAT51l);
|
return newToken(INSTRUCTION_FORMAT51l);
|
||||||
}
|
}
|
||||||
|
@ -225,4 +225,18 @@ invoke-super-quick/range
|
|||||||
check-cast/jumbo
|
check-cast/jumbo
|
||||||
new-instance/jumbo
|
new-instance/jumbo
|
||||||
const-class/jumbo
|
const-class/jumbo
|
||||||
|
sget/jumbo
|
||||||
|
sget-wide/jumbo
|
||||||
|
sget-object/jumbo
|
||||||
|
sget-boolean/jumbo
|
||||||
|
sget-byte/jumbo
|
||||||
|
sget-char/jumbo
|
||||||
|
sget-short/jumbo
|
||||||
|
sput/jumbo
|
||||||
|
sput-wide/jumbo
|
||||||
|
sput-object/jumbo
|
||||||
|
sput-boolean/jumbo
|
||||||
|
sput-byte/jumbo
|
||||||
|
sput-char/jumbo
|
||||||
|
sput-short/jumbo
|
||||||
const-wide
|
const-wide
|
@ -225,4 +225,18 @@ INSTRUCTION_FORMAT3rms_METHOD("invoke-super-quick/range")
|
|||||||
INSTRUCTION_FORMAT41c_TYPE("check-cast/jumbo")
|
INSTRUCTION_FORMAT41c_TYPE("check-cast/jumbo")
|
||||||
INSTRUCTION_FORMAT41c_TYPE("new-instance/jumbo")
|
INSTRUCTION_FORMAT41c_TYPE("new-instance/jumbo")
|
||||||
INSTRUCTION_FORMAT41c_TYPE("const-class/jumbo")
|
INSTRUCTION_FORMAT41c_TYPE("const-class/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sget/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sget-wide/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sget-object/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sget-boolean/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sget-byte/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sget-char/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sget-short/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sput/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sput-wide/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sput-object/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sput-boolean/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sput-byte/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sput-char/jumbo")
|
||||||
|
INSTRUCTION_FORMAT41c_FIELD("sput-short/jumbo")
|
||||||
INSTRUCTION_FORMAT51l("const-wide")
|
INSTRUCTION_FORMAT51l("const-wide")
|
Loading…
x
Reference in New Issue
Block a user