aboutsummaryrefslogtreecommitdiff
path: root/smali
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2016-09-09 13:32:14 +0100
committerNarayan Kamath <narayan@google.com>2016-09-09 13:50:45 +0100
commit94bfbe54ada0ffa8f351952f78fcc57fd3a6763c (patch)
tree40b39046f21249e08875d23b8d1d271179361709 /smali
parent649c1501e6183fc4e5ddad949f19889fe16e5235 (diff)
parent7079014a29869e1bac22226681de3471b6dc11b5 (diff)
downloadsmali-94bfbe54ada0ffa8f351952f78fcc57fd3a6763c.tar.gz
smali: update to upstream master.
test: make test-art-host bug: 30550796 Change-Id: I9ae983635a2ad25c9f3a033aaf49c5ea0ef0c3c0
Diffstat (limited to 'smali')
-rw-r--r--smali/build.gradle11
-rw-r--r--smali/src/main/antlr/smaliParser.g56
-rw-r--r--smali/src/main/antlr/smaliTreeWalker.g117
-rw-r--r--smali/src/main/jflex/smaliLexer.jflex28
-rw-r--r--smali/src/test/java/org/jf/smali/ByteLiteralTest.java (renamed from smali/src/test/java/ByteLiteralTest.java)43
-rw-r--r--smali/src/test/java/org/jf/smali/ImplicitReferenceTest.java (renamed from smali/src/test/java/ImplicitReferenceTest.java)10
-rw-r--r--smali/src/test/java/org/jf/smali/IntLiteralTest.java (renamed from smali/src/test/java/IntLiteralTest.java)43
-rw-r--r--smali/src/test/java/org/jf/smali/LexerTest.java (renamed from smali/src/test/java/LexerTest.java)55
-rw-r--r--smali/src/test/java/org/jf/smali/LongLiteralTest.java (renamed from smali/src/test/java/LongLiteralTest.java)43
-rw-r--r--smali/src/test/java/org/jf/smali/ShortLiteralTest.java (renamed from smali/src/test/java/ShortLiteralTest.java)43
-rw-r--r--smali/src/test/resources/LexerTest/InstructionTest.smali6
-rw-r--r--smali/src/test/resources/LexerTest/InstructionTest.tokens6
12 files changed, 200 insertions, 261 deletions
diff --git a/smali/build.gradle b/smali/build.gradle
index 75001d73..318b5a97 100644
--- a/smali/build.gradle
+++ b/smali/build.gradle
@@ -30,7 +30,7 @@
*/
apply plugin: 'antlr'
-apply plugin: 'jflex'
+apply plugin: 'org.xbib.gradle.plugin.jflex'
buildscript {
repositories {
@@ -46,10 +46,6 @@ configurations {
// Remove the full antlr library that's added by the antlr plugin. We manually
// add the smaller antlr_runtime library instead
compile.exclude group: 'org.antlr', module: 'antlr'
-
- // The jflex lexer doesn't have any runtime dependencies, so remove the dependency
- // that gets added by the jflex plugin
- compile.exclude group: 'de.jflex', module: 'jflex'
}
sourceSets {
@@ -86,7 +82,6 @@ dependencies {
testCompile depends.junit
antlr depends.antlr
- jflex depends.jflex
}
processResources.inputs.property('version', version)
@@ -119,8 +114,8 @@ generateGrammarSource {
outputDirectory = new File(outputDirectory, 'org/jf/smali')
}
-generateJFlexSource {
- outputDirectory = new File(outputDirectory, 'org/jf/smali')
+jflex {
+ generateDir = new File(generateDir, 'org/jf/smali')
}
uploadArchives {
diff --git a/smali/src/main/antlr/smaliParser.g b/smali/src/main/antlr/smaliParser.g
index fcccbe80..29cd141b 100644
--- a/smali/src/main/antlr/smaliParser.g
+++ b/smali/src/main/antlr/smaliParser.g
@@ -86,8 +86,6 @@ tokens {
INSTRUCTION_FORMAT21c_FIELD_ODEX;
INSTRUCTION_FORMAT21c_STRING;
INSTRUCTION_FORMAT21c_TYPE;
- INSTRUCTION_FORMAT21c_LAMBDA;
- INSTRUCTION_FORMAT21c_METHOD;
INSTRUCTION_FORMAT21ih;
INSTRUCTION_FORMAT21lh;
INSTRUCTION_FORMAT21s;
@@ -96,14 +94,12 @@ tokens {
INSTRUCTION_FORMAT22c_FIELD;
INSTRUCTION_FORMAT22c_FIELD_ODEX;
INSTRUCTION_FORMAT22c_TYPE;
- INSTRUCTION_FORMAT22c_STRING;
INSTRUCTION_FORMAT22cs_FIELD;
INSTRUCTION_FORMAT22s;
INSTRUCTION_FORMAT22s_OR_ID;
INSTRUCTION_FORMAT22t;
INSTRUCTION_FORMAT22x;
INSTRUCTION_FORMAT23x;
- INSTRUCTION_FORMAT25x;
INSTRUCTION_FORMAT30t;
INSTRUCTION_FORMAT31c;
INSTRUCTION_FORMAT31i;
@@ -120,6 +116,8 @@ tokens {
INSTRUCTION_FORMAT3rc_TYPE;
INSTRUCTION_FORMAT3rmi_METHOD;
INSTRUCTION_FORMAT3rms_METHOD;
+ INSTRUCTION_FORMAT45cc_METHOD;
+ INSTRUCTION_FORMAT4rcc_METHOD;
INSTRUCTION_FORMAT51l;
LINE_COMMENT;
LINE_DIRECTIVE;
@@ -210,8 +208,6 @@ tokens {
I_STATEMENT_FORMAT21c_TYPE;
I_STATEMENT_FORMAT21c_FIELD;
I_STATEMENT_FORMAT21c_STRING;
- I_STATEMENT_FORMAT21c_LAMBDA;
- I_STATEMENT_FORMAT21c_METHOD;
I_STATEMENT_FORMAT21ih;
I_STATEMENT_FORMAT21lh;
I_STATEMENT_FORMAT21s;
@@ -219,12 +215,10 @@ tokens {
I_STATEMENT_FORMAT22b;
I_STATEMENT_FORMAT22c_FIELD;
I_STATEMENT_FORMAT22c_TYPE;
- I_STATEMENT_FORMAT22c_STRING;
I_STATEMENT_FORMAT22s;
I_STATEMENT_FORMAT22t;
I_STATEMENT_FORMAT22x;
I_STATEMENT_FORMAT23x;
- I_STATEMENT_FORMAT25x;
I_STATEMENT_FORMAT30t;
I_STATEMENT_FORMAT31c;
I_STATEMENT_FORMAT31i;
@@ -234,6 +228,8 @@ tokens {
I_STATEMENT_FORMAT35c_TYPE;
I_STATEMENT_FORMAT3rc_METHOD;
I_STATEMENT_FORMAT3rc_TYPE;
+ I_STATEMENT_FORMAT45cc_METHOD;
+ I_STATEMENT_FORMAT4rcc_METHOD;
I_STATEMENT_FORMAT51l;
I_STATEMENT_ARRAY_DATA;
I_STATEMENT_PACKED_SWITCH;
@@ -562,18 +558,14 @@ simple_name
| INSTRUCTION_FORMAT21c_FIELD_ODEX -> SIMPLE_NAME[$INSTRUCTION_FORMAT21c_FIELD_ODEX]
| INSTRUCTION_FORMAT21c_STRING -> SIMPLE_NAME[$INSTRUCTION_FORMAT21c_STRING]
| INSTRUCTION_FORMAT21c_TYPE -> SIMPLE_NAME[$INSTRUCTION_FORMAT21c_TYPE]
- | INSTRUCTION_FORMAT21c_LAMBDA -> SIMPLE_NAME[$INSTRUCTION_FORMAT21c_LAMBDA]
- | INSTRUCTION_FORMAT21c_METHOD -> SIMPLE_NAME[$INSTRUCTION_FORMAT21c_METHOD]
| INSTRUCTION_FORMAT21t -> SIMPLE_NAME[$INSTRUCTION_FORMAT21t]
| INSTRUCTION_FORMAT22c_FIELD -> SIMPLE_NAME[$INSTRUCTION_FORMAT22c_FIELD]
| INSTRUCTION_FORMAT22c_FIELD_ODEX -> SIMPLE_NAME[$INSTRUCTION_FORMAT22c_FIELD_ODEX]
| INSTRUCTION_FORMAT22c_TYPE -> SIMPLE_NAME[$INSTRUCTION_FORMAT22c_TYPE]
- | INSTRUCTION_FORMAT22c_STRING -> SIMPLE_NAME[$INSTRUCTION_FORMAT22c_STRING]
| INSTRUCTION_FORMAT22cs_FIELD -> SIMPLE_NAME[$INSTRUCTION_FORMAT22cs_FIELD]
| INSTRUCTION_FORMAT22s_OR_ID -> SIMPLE_NAME[$INSTRUCTION_FORMAT22s_OR_ID]
| INSTRUCTION_FORMAT22t -> SIMPLE_NAME[$INSTRUCTION_FORMAT22t]
| INSTRUCTION_FORMAT23x -> SIMPLE_NAME[$INSTRUCTION_FORMAT23x]
- | INSTRUCTION_FORMAT25x -> SIMPLE_NAME[$INSTRUCTION_FORMAT25x]
| INSTRUCTION_FORMAT31i_OR_ID -> SIMPLE_NAME[$INSTRUCTION_FORMAT31i_OR_ID]
| INSTRUCTION_FORMAT31t -> SIMPLE_NAME[$INSTRUCTION_FORMAT31t]
| INSTRUCTION_FORMAT35c_METHOD -> SIMPLE_NAME[$INSTRUCTION_FORMAT35c_METHOD]
@@ -581,6 +573,8 @@ simple_name
| INSTRUCTION_FORMAT35c_TYPE -> SIMPLE_NAME[$INSTRUCTION_FORMAT35c_TYPE]
| INSTRUCTION_FORMAT35mi_METHOD -> SIMPLE_NAME[$INSTRUCTION_FORMAT35mi_METHOD]
| INSTRUCTION_FORMAT35ms_METHOD -> SIMPLE_NAME[$INSTRUCTION_FORMAT35ms_METHOD]
+ | INSTRUCTION_FORMAT45cc_METHOD -> SIMPLE_NAME[$INSTRUCTION_FORMAT45cc_METHOD]
+ | INSTRUCTION_FORMAT4rcc_METHOD -> SIMPLE_NAME[$INSTRUCTION_FORMAT4rcc_METHOD]
| INSTRUCTION_FORMAT51l -> SIMPLE_NAME[$INSTRUCTION_FORMAT51l];
member_name
@@ -817,8 +811,6 @@ instruction
| insn_format21c_field_odex
| insn_format21c_string
| insn_format21c_type
- | insn_format21c_lambda
- | insn_format21c_method
| insn_format21ih
| insn_format21lh
| insn_format21s
@@ -827,13 +819,11 @@ instruction
| insn_format22c_field
| insn_format22c_field_odex
| insn_format22c_type
- | insn_format22c_string
| insn_format22cs_field
| insn_format22s
| insn_format22t
| insn_format22x
| insn_format23x
- | insn_format25x
| insn_format30t
| insn_format31c
| insn_format31i
@@ -849,6 +839,8 @@ instruction
| insn_format3rc_type
| insn_format3rmi_method
| insn_format3rms_method
+ | insn_format45cc_method
+ | insn_format4rcc_method
| insn_format51l
| insn_array_data_directive
| insn_packed_switch_directive
@@ -927,16 +919,6 @@ insn_format21c_type
INSTRUCTION_FORMAT21c_TYPE REGISTER COMMA nonvoid_type_descriptor
-> ^(I_STATEMENT_FORMAT21c_TYPE[$start, "I_STATEMENT_FORMAT21c"] INSTRUCTION_FORMAT21c_TYPE REGISTER nonvoid_type_descriptor);
-insn_format21c_lambda
- : //e.g. capture-variable v1, "foobar"
- INSTRUCTION_FORMAT21c_LAMBDA REGISTER COMMA STRING_LITERAL
- -> ^(I_STATEMENT_FORMAT21c_LAMBDA[$start, "I_STATEMENT_FORMAT21c_LAMBDA"] INSTRUCTION_FORMAT21c_LAMBDA REGISTER STRING_LITERAL);
-
-insn_format21c_method
- : //e.g. create-lambda v1, java/io/PrintStream/print(Ljava/lang/Stream;)V
- INSTRUCTION_FORMAT21c_METHOD REGISTER COMMA method_reference
- -> ^(I_STATEMENT_FORMAT21c_METHOD[$start, "I_STATEMENT_FORMAT21c_METHOD"] INSTRUCTION_FORMAT21c_METHOD REGISTER method_reference);
-
insn_format21ih
: //e.g. const/high16 v1, 1234
INSTRUCTION_FORMAT21ih REGISTER COMMA fixed_32bit_literal
@@ -982,11 +964,6 @@ insn_format22c_type
INSTRUCTION_FORMAT22c_TYPE REGISTER COMMA REGISTER COMMA nonvoid_type_descriptor
-> ^(I_STATEMENT_FORMAT22c_TYPE[$start, "I_STATEMENT_FORMAT22c_TYPE"] INSTRUCTION_FORMAT22c_TYPE REGISTER REGISTER nonvoid_type_descriptor);
-insn_format22c_string
- : //e.g. liberate-variable v0, v1, "baz"
- INSTRUCTION_FORMAT22c_STRING REGISTER COMMA REGISTER COMMA STRING_LITERAL
- -> ^(I_STATEMENT_FORMAT22c_STRING[$start, "I_STATEMENT_FORMAT22c_STRING"] INSTRUCTION_FORMAT22c_STRING REGISTER REGISTER STRING_LITERAL);
-
insn_format22cs_field
: //e.g. iget-quick v0, v1, field@0xc
INSTRUCTION_FORMAT22cs_FIELD REGISTER COMMA REGISTER COMMA FIELD_OFFSET
@@ -1014,11 +991,6 @@ insn_format23x
INSTRUCTION_FORMAT23x REGISTER COMMA REGISTER COMMA REGISTER
-> ^(I_STATEMENT_FORMAT23x[$start, "I_STATEMENT_FORMAT23x"] INSTRUCTION_FORMAT23x REGISTER REGISTER REGISTER);
-insn_format25x
- : //e.g. invoke-lambda vClosure, {vA, vB, vC, vD} -- up to 4 parameters + the closure.
- INSTRUCTION_FORMAT25x REGISTER COMMA OPEN_BRACE register_list CLOSE_BRACE
- -> ^(I_STATEMENT_FORMAT25x[$start, "I_STATEMENT_FORMAT25x"] INSTRUCTION_FORMAT25x REGISTER register_list);
-
insn_format30t
: //e.g. goto/32 endloop:
INSTRUCTION_FORMAT30t label_ref
@@ -1106,6 +1078,16 @@ insn_format3rms_method
throwOdexedInstructionException(input, $INSTRUCTION_FORMAT3rms_METHOD.text);
};
+insn_format45cc_method
+ : //e.g. invoke-polymorphic {v0..v1}, java/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (I)J
+ INSTRUCTION_FORMAT45cc_METHOD OPEN_BRACE register_list CLOSE_BRACE COMMA method_reference COMMA method_prototype
+ -> ^(I_STATEMENT_FORMAT45cc_METHOD[$start, "I_STATEMENT_FORMAT45cc_METHOD"] INSTRUCTION_FORMAT45cc_METHOD register_list method_reference method_prototype);
+
+insn_format4rcc_method
+ : //e.g. invoke-polymorphic/range {v0,v1}, java/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (I)J
+ INSTRUCTION_FORMAT4rcc_METHOD OPEN_BRACE register_range CLOSE_BRACE COMMA method_reference COMMA method_prototype
+ -> ^(I_STATEMENT_FORMAT4rcc_METHOD[$start, "I_STATEMENT_FORMAT4rcc_METHOD"] INSTRUCTION_FORMAT4rcc_METHOD register_range method_reference method_prototype);
+
insn_format51l
: //e.g. const-wide v0, 5000000000L
INSTRUCTION_FORMAT51l REGISTER COMMA fixed_literal
@@ -1141,4 +1123,4 @@ insn_sparse_switch_directive
(fixed_32bit_literal ARROW label_ref)*
END_SPARSE_SWITCH_DIRECTIVE
-> ^(I_STATEMENT_SPARSE_SWITCH[$start, "I_STATEMENT_SPARSE_SWITCH"]
- ^(I_SPARSE_SWITCH_ELEMENTS[$start, "I_SPARSE_SWITCH_ELEMENTS"] (fixed_32bit_literal label_ref)*)); \ No newline at end of file
+ ^(I_SPARSE_SWITCH_ELEMENTS[$start, "I_SPARSE_SWITCH_ELEMENTS"] (fixed_32bit_literal label_ref)*));
diff --git a/smali/src/main/antlr/smaliTreeWalker.g b/smali/src/main/antlr/smaliTreeWalker.g
index c3a50994..d074579b 100644
--- a/smali/src/main/antlr/smaliTreeWalker.g
+++ b/smali/src/main/antlr/smaliTreeWalker.g
@@ -62,6 +62,7 @@ import org.jf.dexlib2.immutable.ImmutableAnnotation;
import org.jf.dexlib2.immutable.ImmutableAnnotationElement;
import org.jf.dexlib2.immutable.reference.ImmutableFieldReference;
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference;
+import org.jf.dexlib2.immutable.reference.ImmutableMethodProtoReference;
import org.jf.dexlib2.immutable.reference.ImmutableReference;
import org.jf.dexlib2.immutable.reference.ImmutableTypeReference;
import org.jf.dexlib2.immutable.value.*;
@@ -674,22 +675,6 @@ register_list returns[byte[\] registers, byte registerCount]
$registers[$registerCount++] = parseRegister_nibble($REGISTER.text);
})*);
-register_list4 returns[byte[\] registers, byte registerCount]
- @init
- {
- $registers = new byte[4];
- $registerCount = 0;
- }
- : ^(I_REGISTER_LIST
- (REGISTER
- {
- if ($registerCount == 4) {
- throw new SemanticException(input, $I_REGISTER_LIST, "A list4 of registers can only have a maximum of 4 " +
- "registers. Use the <op>/range alternate opcode instead.");
- }
- $registers[$registerCount++] = parseRegister_nibble($REGISTER.text);
- })*);
-
register_range returns[int startRegister, int endRegister]
: ^(I_REGISTER_RANGE (startReg=REGISTER endReg=REGISTER?)?)
{
@@ -742,8 +727,6 @@ instruction
| insn_format21c_field
| insn_format21c_string
| insn_format21c_type
- | insn_format21c_lambda
- | insn_format21c_method
| insn_format21ih
| insn_format21lh
| insn_format21s
@@ -751,12 +734,10 @@ instruction
| insn_format22b
| insn_format22c_field
| insn_format22c_type
- | insn_format22c_string
| insn_format22s
| insn_format22t
| insn_format22x
| insn_format23x
- | insn_format25x
| insn_format30t
| insn_format31c
| insn_format31i
@@ -766,6 +747,8 @@ instruction
| insn_format35c_type
| insn_format3rc_method
| insn_format3rc_type
+ | insn_format45cc_method
+ | insn_format4rcc_method
| insn_format51l_type
| insn_array_data_directive
| insn_packed_switch_directive
@@ -881,30 +864,6 @@ insn_format21c_type
dexBuilder.internTypeReference($nonvoid_type_descriptor.type)));
};
-insn_format21c_lambda
- : //e.g. capture-variable v1, "foobar"
- ^(I_STATEMENT_FORMAT21c_LAMBDA INSTRUCTION_FORMAT21c_LAMBDA REGISTER string_literal)
- {
- Opcode opcode = opcodes.getOpcodeByName($INSTRUCTION_FORMAT21c_LAMBDA.text);
- short regA = parseRegister_byte($REGISTER.text);
-
- $method::methodBuilder.addInstruction(new BuilderInstruction21c(opcode, regA,
- dexBuilder.internStringReference($string_literal.value)));
- };
-
-insn_format21c_method
- : //e.g. create-lambda v1, java/io/PrintStream/print(Ljava/lang/Stream;)V
- ^(I_STATEMENT_FORMAT21c_METHOD INSTRUCTION_FORMAT21c_METHOD REGISTER method_reference)
- {
- Opcode opcode = opcodes.getOpcodeByName($INSTRUCTION_FORMAT21c_METHOD.text);
- short regA = parseRegister_byte($REGISTER.text);
-
- ImmutableMethodReference methodReference = $method_reference.methodReference;
-
- $method::methodBuilder.addInstruction(new BuilderInstruction21c(opcode, regA,
- dexBuilder.internMethodReference(methodReference)));
- };
-
insn_format21ih
: //e.g. const/high16 v1, 1234
^(I_STATEMENT_FORMAT21ih INSTRUCTION_FORMAT21ih REGISTER fixed_32bit_literal)
@@ -991,18 +950,6 @@ insn_format22c_type
dexBuilder.internTypeReference($nonvoid_type_descriptor.type)));
};
-insn_format22c_string
- : //e.g. liberate-variable v0, v1, "baz"
- ^(I_STATEMENT_FORMAT22c_STRING INSTRUCTION_FORMAT22c_STRING registerA=REGISTER registerB=REGISTER string_literal)
- {
- Opcode opcode = opcodes.getOpcodeByName($INSTRUCTION_FORMAT22c_STRING.text);
- byte regA = parseRegister_nibble($registerA.text);
- byte regB = parseRegister_nibble($registerB.text);
-
- $method::methodBuilder.addInstruction(new BuilderInstruction22c(opcode, regA, regB,
- dexBuilder.internStringReference($string_literal.value)));
- };
-
insn_format22s
: //e.g. add-int/lit16 v0, v1, 12345
^(I_STATEMENT_FORMAT22s INSTRUCTION_FORMAT22s registerA=REGISTER registerB=REGISTER short_integral_literal)
@@ -1050,23 +997,6 @@ insn_format23x
$method::methodBuilder.addInstruction(new BuilderInstruction23x(opcode, regA, regB, regC));
};
-insn_format25x
- : //e.g. invoke-lambda vClosure, {vD, vE, vF, vG} -- up to 4 parameters + the closure.
- ^(I_STATEMENT_FORMAT25x INSTRUCTION_FORMAT25x REGISTER register_list4)
- {
- Opcode opcode = opcodes.getOpcodeByName($INSTRUCTION_FORMAT25x.text);
-
- byte closureRegister = parseRegister_nibble($REGISTER.text);
-
- //this depends on the fact that register_list4 returns a byte[4]
- byte[] registers = $register_list4.registers;
- int parameterRegisterCount = $register_list4.registerCount; // don't count closure register
-
- $method::methodBuilder.addInstruction(new BuilderInstruction25x(opcode,
- parameterRegisterCount, closureRegister, registers[0], registers[1],
- registers[2], registers[3]));
- };
-
insn_format30t
: //e.g. goto/32 endloop:
^(I_STATEMENT_FORMAT30t INSTRUCTION_FORMAT30t label_ref)
@@ -1181,6 +1111,47 @@ insn_format3rc_type
dexBuilder.internTypeReference($nonvoid_type_descriptor.type)));
};
+insn_format45cc_method
+ : //e.g. invoke-polymorphic {v0, v1}, java/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (I)J
+ ^(I_STATEMENT_FORMAT45cc_METHOD INSTRUCTION_FORMAT45cc_METHOD register_list method_reference method_prototype)
+ {
+ Opcode opcode = opcodes.getOpcodeByName($INSTRUCTION_FORMAT45cc_METHOD.text);
+
+ //this depends on the fact that register_list returns a byte[5]
+ byte[] registers = $register_list.registers;
+ byte registerCount = $register_list.registerCount;
+
+ ImmutableMethodReference methodReference = $method_reference.methodReference;
+ ImmutableMethodProtoReference methodProtoReference = new ImmutableMethodProtoReference(
+ $method_prototype.parameters,
+ $method_prototype.returnType);
+
+ $method::methodBuilder.addInstruction(new BuilderInstruction45cc(opcode, registerCount, registers[0], registers[1],
+ registers[2], registers[3], registers[4],
+ dexBuilder.internMethodReference(methodReference),
+ dexBuilder.internMethodProtoReference(methodProtoReference)));
+ };
+
+insn_format4rcc_method
+ : //e.g. invoke-polymorphic {v0..v1}, java/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (I)J
+ ^(I_STATEMENT_FORMAT4rcc_METHOD INSTRUCTION_FORMAT4rcc_METHOD register_range method_reference method_prototype)
+ {
+ Opcode opcode = opcodes.getOpcodeByName($INSTRUCTION_FORMAT4rcc_METHOD.text);
+ int startRegister = $register_range.startRegister;
+ int endRegister = $register_range.endRegister;
+
+ int registerCount = endRegister-startRegister+1;
+
+ ImmutableMethodReference methodReference = $method_reference.methodReference;
+ ImmutableMethodProtoReference methodProtoReference = new ImmutableMethodProtoReference(
+ $method_prototype.parameters,
+ $method_prototype.returnType);
+
+ $method::methodBuilder.addInstruction(new BuilderInstruction4rcc(opcode, startRegister, registerCount,
+ dexBuilder.internMethodReference(methodReference),
+ dexBuilder.internMethodProtoReference(methodProtoReference)));
+ };
+
insn_format51l_type
: //e.g. const-wide v0, 5000000000L
^(I_STATEMENT_FORMAT51l INSTRUCTION_FORMAT51l REGISTER fixed_64bit_literal)
diff --git a/smali/src/main/jflex/smaliLexer.jflex b/smali/src/main/jflex/smaliLexer.jflex
index 2f57a438..2cf3c869 100644
--- a/smali/src/main/jflex/smaliLexer.jflex
+++ b/smali/src/main/jflex/smaliLexer.jflex
@@ -476,14 +476,6 @@ Type = {PrimitiveType} | {ClassDescriptor} | {ArrayPrefix} ({ClassDescriptor} |
return newToken(INSTRUCTION_FORMAT21c_TYPE);
}
- "capture-variable" { // e.g. 'capture-variable vB, <string id>'
- return newToken(INSTRUCTION_FORMAT21c_LAMBDA);
- }
-
- "create-lambda" { // e.g. 'create-lambda vClosure, <method id>'
- return newToken(INSTRUCTION_FORMAT21c_METHOD);
- }
-
"const/high16" {
return newToken(INSTRUCTION_FORMAT21ih);
}
@@ -515,14 +507,10 @@ Type = {PrimitiveType} | {ClassDescriptor} | {ArrayPrefix} ({ClassDescriptor} |
return newToken(INSTRUCTION_FORMAT22c_FIELD_ODEX);
}
- "instance-of" | "new-array" | "unbox-lambda" {
+ "instance-of" | "new-array" {
return newToken(INSTRUCTION_FORMAT22c_TYPE);
}
- "liberate-variable" {
- return newToken(INSTRUCTION_FORMAT22c_STRING);
- }
-
"iget-quick" | "iget-wide-quick" | "iget-object-quick" | "iput-quick" | "iput-wide-quick" | "iput-object-quick" |
"iput-boolean-quick" | "iput-byte-quick" | "iput-char-quick" | "iput-short-quick" {
return newToken(INSTRUCTION_FORMAT22cs_FIELD);
@@ -541,7 +529,7 @@ Type = {PrimitiveType} | {ClassDescriptor} | {ArrayPrefix} ({ClassDescriptor} |
return newToken(INSTRUCTION_FORMAT22t);
}
- "move/from16" | "move-wide/from16" | "move-object/from16" | "box-lambda" {
+ "move/from16" | "move-wide/from16" | "move-object/from16" {
return newToken(INSTRUCTION_FORMAT22x);
}
@@ -555,10 +543,6 @@ Type = {PrimitiveType} | {ClassDescriptor} | {ArrayPrefix} ({ClassDescriptor} |
return newToken(INSTRUCTION_FORMAT23x);
}
- "invoke-lambda" { // e.g. invoke-lambda vClosure, {vD, vE, vF, vG} -- at most 4 params
- return newToken(INSTRUCTION_FORMAT25x);
- }
-
"goto/32" {
return newToken(INSTRUCTION_FORMAT30t);
}
@@ -624,6 +608,14 @@ Type = {PrimitiveType} | {ClassDescriptor} | {ArrayPrefix} ({ClassDescriptor} |
return newToken(INSTRUCTION_FORMAT3rms_METHOD);
}
+ "invoke-polymorphic" {
+ return newToken(INSTRUCTION_FORMAT45cc_METHOD);
+ }
+
+ "invoke-polymorphic/range" {
+ return newToken(INSTRUCTION_FORMAT4rcc_METHOD);
+ }
+
"const-wide" {
return newToken(INSTRUCTION_FORMAT51l);
}
diff --git a/smali/src/test/java/ByteLiteralTest.java b/smali/src/test/java/org/jf/smali/ByteLiteralTest.java
index 2e6511da..7bf7c54e 100644
--- a/smali/src/test/java/ByteLiteralTest.java
+++ b/smali/src/test/java/org/jf/smali/ByteLiteralTest.java
@@ -1,32 +1,35 @@
/*
- * [The "BSD licence"]
- * Copyright (c) 2010 Ben Gruver (JesusFreke)
+ * Copyright 2016, 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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,
+ * 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.
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.jf.smali.LiteralTools;
+package org.jf.smali;import org.jf.smali.LiteralTools;
import org.junit.Assert;
import org.junit.Test;
diff --git a/smali/src/test/java/ImplicitReferenceTest.java b/smali/src/test/java/org/jf/smali/ImplicitReferenceTest.java
index b080c8a5..83046536 100644
--- a/smali/src/test/java/ImplicitReferenceTest.java
+++ b/smali/src/test/java/org/jf/smali/ImplicitReferenceTest.java
@@ -1,18 +1,18 @@
/*
- * Copyright 2014, Google Inc.
+ * Copyright 2016, 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
+ * 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
+ * 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
+ * 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.
*
@@ -29,7 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.google.common.collect.Lists;
+package org.jf.smali;import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import junit.framework.Assert;
import org.antlr.runtime.RecognitionException;
diff --git a/smali/src/test/java/IntLiteralTest.java b/smali/src/test/java/org/jf/smali/IntLiteralTest.java
index f5a8c969..6cc7fbd6 100644
--- a/smali/src/test/java/IntLiteralTest.java
+++ b/smali/src/test/java/org/jf/smali/IntLiteralTest.java
@@ -1,32 +1,35 @@
/*
- * [The "BSD licence"]
- * Copyright (c) 2010 Ben Gruver (JesusFreke)
+ * Copyright 2016, 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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,
+ * 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.
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.jf.smali.LiteralTools;
+package org.jf.smali;import org.jf.smali.LiteralTools;
import org.junit.Assert;
import org.junit.Test;
diff --git a/smali/src/test/java/LexerTest.java b/smali/src/test/java/org/jf/smali/LexerTest.java
index d156015a..5f1f21e4 100644
--- a/smali/src/test/java/LexerTest.java
+++ b/smali/src/test/java/org/jf/smali/LexerTest.java
@@ -1,39 +1,38 @@
/*
- * [The "BSD licence"]
- * Copyright (c) 2010 Ben Gruver
+ * Copyright 2016, 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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,
+ * 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.
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.antlr.runtime.ANTLRInputStream;
+package org.jf.smali;import org.antlr.runtime.ANTLRInputStream;
import org.antlr.runtime.CommonToken;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
-import org.jf.smali.expectedTokensTestGrammarLexer;
-import org.jf.smali.expectedTokensTestGrammarParser;
-import org.jf.smali.smaliFlexLexer;
-import org.jf.smali.smaliParser;
import org.junit.Assert;
import org.junit.Test;
@@ -135,9 +134,9 @@ public class LexerTest {
String smaliFile = String.format("LexerTest%s%s.smali", File.separatorChar, test);
String tokensFile = String.format("LexerTest%s%s.tokens", File.separatorChar, test);
- expectedTokensTestGrammarLexer expectedTokensLexer = null;
+ org.jf.smali.expectedTokensTestGrammarLexer expectedTokensLexer = null;
try {
- expectedTokensLexer = new expectedTokensTestGrammarLexer(new ANTLRInputStream(
+ expectedTokensLexer = new org.jf.smali.expectedTokensTestGrammarLexer(new ANTLRInputStream(
LexerTest.class.getClassLoader().getResourceAsStream(tokensFile)));
} catch (IOException ex) {
throw new RuntimeException(ex);
@@ -145,8 +144,8 @@ public class LexerTest {
CommonTokenStream expectedTokensStream = new CommonTokenStream(expectedTokensLexer);
- expectedTokensTestGrammarParser expectedTokensParser =
- new expectedTokensTestGrammarParser(expectedTokensStream);
+ org.jf.smali.expectedTokensTestGrammarParser expectedTokensParser =
+ new org.jf.smali.expectedTokensTestGrammarParser(expectedTokensStream);
try {
expectedTokensParser.top();
} catch (RecognitionException ex) {
diff --git a/smali/src/test/java/LongLiteralTest.java b/smali/src/test/java/org/jf/smali/LongLiteralTest.java
index f68cf5a7..4659a0ba 100644
--- a/smali/src/test/java/LongLiteralTest.java
+++ b/smali/src/test/java/org/jf/smali/LongLiteralTest.java
@@ -1,32 +1,35 @@
/*
- * [The "BSD licence"]
- * Copyright (c) 2010 Ben Gruver (JesusFreke)
+ * Copyright 2016, 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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,
+ * 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.
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.jf.smali.LiteralTools;
+package org.jf.smali;import org.jf.smali.LiteralTools;
import org.junit.Assert;
import org.junit.Test;
diff --git a/smali/src/test/java/ShortLiteralTest.java b/smali/src/test/java/org/jf/smali/ShortLiteralTest.java
index e366be85..2ba22ac6 100644
--- a/smali/src/test/java/ShortLiteralTest.java
+++ b/smali/src/test/java/org/jf/smali/ShortLiteralTest.java
@@ -1,32 +1,35 @@
/*
- * [The "BSD licence"]
- * Copyright (c) 2010 Ben Gruver (JesusFreke)
+ * Copyright 2016, 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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,
+ * 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.
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import org.jf.smali.LiteralTools;
+package org.jf.smali;import org.jf.smali.LiteralTools;
import org.junit.Assert;
import org.junit.Test;
diff --git a/smali/src/test/resources/LexerTest/InstructionTest.smali b/smali/src/test/resources/LexerTest/InstructionTest.smali
index 174cff8c..62e51006 100644
--- a/smali/src/test/resources/LexerTest/InstructionTest.smali
+++ b/smali/src/test/resources/LexerTest/InstructionTest.smali
@@ -85,8 +85,6 @@ const-string
check-cast
new-instance
const-class
-capture-variable
-create-lambda
const/high16
const-wide/high16
const/16
@@ -125,8 +123,6 @@ iput-wide-volatile
iput-object-volatile
instance-of
new-array
-unbox-lambda
-liberate-variable
iget-quick
iget-wide-quick
iget-object-quick
@@ -153,7 +149,6 @@ if-le
move/from16
move-wide/from16
move-object/from16
-box-lambda
cmpl-float
cmpg-float
cmpl-double
@@ -204,7 +199,6 @@ add-double
sub-double
mul-double
div-double
-invoke-lambda
goto/32
const-string/jumbo
const
diff --git a/smali/src/test/resources/LexerTest/InstructionTest.tokens b/smali/src/test/resources/LexerTest/InstructionTest.tokens
index fa959bad..dfbd584b 100644
--- a/smali/src/test/resources/LexerTest/InstructionTest.tokens
+++ b/smali/src/test/resources/LexerTest/InstructionTest.tokens
@@ -85,8 +85,6 @@ INSTRUCTION_FORMAT21c_STRING("const-string")
INSTRUCTION_FORMAT21c_TYPE("check-cast")
INSTRUCTION_FORMAT21c_TYPE("new-instance")
INSTRUCTION_FORMAT21c_TYPE("const-class")
-INSTRUCTION_FORMAT21c_LAMBDA("capture-variable")
-INSTRUCTION_FORMAT21c_METHOD("create-lambda")
INSTRUCTION_FORMAT21ih("const/high16")
INSTRUCTION_FORMAT21lh("const-wide/high16")
INSTRUCTION_FORMAT21s("const/16")
@@ -125,8 +123,6 @@ INSTRUCTION_FORMAT22c_FIELD_ODEX("iput-wide-volatile")
INSTRUCTION_FORMAT22c_FIELD_ODEX("iput-object-volatile")
INSTRUCTION_FORMAT22c_TYPE("instance-of")
INSTRUCTION_FORMAT22c_TYPE("new-array")
-INSTRUCTION_FORMAT22c_TYPE("unbox-lambda")
-INSTRUCTION_FORMAT22c_STRING("liberate-variable")
INSTRUCTION_FORMAT22cs_FIELD("iget-quick")
INSTRUCTION_FORMAT22cs_FIELD("iget-wide-quick")
INSTRUCTION_FORMAT22cs_FIELD("iget-object-quick")
@@ -153,7 +149,6 @@ INSTRUCTION_FORMAT22t("if-le")
INSTRUCTION_FORMAT22x("move/from16")
INSTRUCTION_FORMAT22x("move-wide/from16")
INSTRUCTION_FORMAT22x("move-object/from16")
-INSTRUCTION_FORMAT22x("box-lambda")
INSTRUCTION_FORMAT23x("cmpl-float")
INSTRUCTION_FORMAT23x("cmpg-float")
INSTRUCTION_FORMAT23x("cmpl-double")
@@ -204,7 +199,6 @@ INSTRUCTION_FORMAT23x("add-double")
INSTRUCTION_FORMAT23x("sub-double")
INSTRUCTION_FORMAT23x("mul-double")
INSTRUCTION_FORMAT23x("div-double")
-INSTRUCTION_FORMAT25x("invoke-lambda")
INSTRUCTION_FORMAT30t("goto/32")
INSTRUCTION_FORMAT31c("const-string/jumbo")
INSTRUCTION_FORMAT31i_OR_ID("const")