224 Commits

Author SHA1 Message Date
Narayan Kamath
99b80bbc5a Revert "Add lambda experimental dalvik opcodes"
This reverts commit 144951a9e9e6c87866245f2bdeebf0ebedaa0e38.
2016-08-17 13:15:18 +01:00
Narayan Kamath
afc1f15939 smali/dexlib: deal with invoke-polymorphic / invoke-polymorphic/range.
- Introduces two new instruction formats, 45cc and 4rcc. As the name suggests,
  these instructions are similar to 35c and 3rc, expect that they encode an
  additional constant pool reference in their 4th byte.

- Introduce two new instructions, invoke-polymorphic and
  invoke-polymorphic/range - used to implement signature polymorphism.

- Allow instructions to directly reference the proto_id section of the
  dex file. This involves the introduction of a new kind of reference
  (MethodProtoReference) and has the side effect of cleaning up a fair
  amount of special casing in ProtoPool.

- Disable support for ART version based switches (and remove LambdaTest
  which depends on it). Experimental lambda support and support for ART
  version based switches will be removed in a follow up change.

Bug: 30550796
Test: test-art
Test: ./gradlew build
2016-08-17 13:03:12 +01:00
Ben Gruver
d5c6ffa059 Move existing smali tests to the org.jf.smali package 2016-07-10 20:04:02 -07:00
Ben Gruver
07dc76c03f Switch to jprante's jflex plugin 2016-07-09 13:42:15 -07:00
Ben Gruver
87d10dac27 Add more programmatic-friendly entry points for smali/baksmali
This adds entry points that are more friendly to programmatic usage. E.g.
no calls to System.exit()
2016-02-28 12:19:27 -08:00
Ben Gruver
a198b46e20 Fix issue with parameter list parsing
This fixes an issue that was initially introduced in the smalidea branch
2016-02-28 12:15:22 -08:00
Ben Gruver
11d179bfdb Get rid of the default 6 thread maximum thing 2016-02-28 11:22:16 -08:00
Ben Gruver
6429b3daa9 Clean up the jar naming
The previous naming was interfering with 'gr install' installing the
artifacts locally.
2016-02-20 12:04:47 -08:00
Ben Gruver
1b00e0a155 Add the .tokens files to the binary jar 2016-02-14 12:50:31 -08:00
Ben Gruver
8533ab7429 Merge branch 'master' into smalidea 2016-02-13 15:43:37 -08:00
Ben Gruver
73bd8ce9d4 Add a speculative fix for unicode filename errors on Mac 2015-12-04 12:00:27 -08:00
Ben Gruver
ea3fdd7e86 Merge branch 'master' into smalidea 2015-10-01 08:34:21 -07:00
Ben Gruver
3ff884b1c3 Add art-specific opcodes and opcode values 2015-09-29 23:41:30 -07:00
Ben Gruver
0c7e7b7ffc Add ability to list methods/fields/types when assembling with smali
This can be useful in analyzing why you are going over the 64k
method/field/type limit
2015-09-05 16:11:21 -07:00
Ben Gruver
46b359cf21 Fix an NPE related to an array descriptor just before an EOF 2015-05-05 20:40:02 -07:00
Ben Gruver
9bedfc8e3e Add usage type support for field usages 2015-03-25 19:45:20 -07:00
Ben Gruver
75bef01d10 Merge branch 'master' into smalidea 2015-03-18 21:00:32 -07:00
Ben Gruver
2a0e4657ea Don't wrap a large (>32k) register count in a register directive 2015-03-18 20:13:02 -07:00
Igor Murashkin
144951a9e9 Add lambda experimental dalvik opcodes
* Add new -X/--experimental flag to [dis]assemble opcodes not in art yet
* Add new opcodes liberate-variable, box-lambda, unbox-lambda,
                  capture-variable, create-lambda, invoke-lambda
* Add support for encoding 25x instructions
* Adds LambdaTest to check new opcodes assemble/disassemble properly

TODO: invoke-lambda-range

Change-Id: I5c8bcbfa8b6cb9a13ef2017fce2d1b7fda6e11c3
2015-03-16 11:40:58 -07:00
Ben Gruver
0f49330183 Refactor how PARAM_LIST is parsed 2015-03-04 22:25:51 -08:00
Ben Gruver
8c1d8ddef2 Merge branch 'master' into smalidea3 2015-03-04 20:58:14 -08:00
Ben Gruver
06d108d791 Refactor how the PARAM_LIST_OR_ID thing is parsed
This gets rids of the empty placeholder tokens, which cause errors
in IDEA's built-in lexer support code
2015-03-04 20:56:53 -08:00
Ben Gruver
f70084bdfe Use [^] for the lexer's catch-all rule
[^] matches the entire character set, while . doesn't match new lines, etc.
2015-03-04 00:16:46 -08:00
Ben Gruver
f0c481a7a1 Use single-quotes in build.gradle files when double-quotes aren't needed 2015-03-01 22:30:33 -08:00
Ben Gruver
57bd527d43 Use the antlr plugin for gradle 2015-03-01 20:31:10 -08:00
Ben Gruver
0f6f00a325 Use the jflex plugin for gradle 2015-03-01 20:30:09 -08:00
Ben Gruver
900ad6ea87 Use the proguard plugin for gradle 2015-03-01 19:51:34 -08:00
Ben Gruver
2fd677db88 Tweak how array descriptors are parsed
This is needed to allow smalidea to have an outer array type element to
represent the type as a whole, and an inner class type element for the
actual element type
2015-01-21 09:32:00 -08:00
Ben Gruver
bbc11c79e5 Add lexer implementation based on existing smali lexer 2015-01-21 09:32:00 -08:00
Ben Gruver
103e04a4a9 Add stringtemplate dependency to smali, because proguard. 2015-01-20 08:55:16 -08:00
Ben Gruver
ce7f93cd79 Implement implicit method/field references in smali 2014-07-19 18:53:53 -07:00
Ben Gruver
37ade89bda Improve how method parameter lists are lexed 2014-02-17 14:23:39 -08:00
Ben Gruver
b90e2a4c62 Clean up some unused/unneeded tokens in smaliParser.g 2014-02-03 19:32:41 -08:00
Ben Gruver
1d28b32ff5 Refactor the maven upload build stuff
This also adds the required javadoc jars
2014-01-18 11:33:39 -08:00
Ben Gruver
5b411f3447 Add gradle configuration for uploading smali artifacts to maven 2014-01-17 02:04:07 -08:00
Ben Gruver
532c04b27d Use known-good locale when doing jflex codegen
jflex appears to be using the default locale for a String.toUpperCase
somewhere, which causes incorrect java code to be generated in the
turkish locale.
2013-12-29 14:51:09 -08:00
Ben Gruver
304aadf6e6 Allow primitive types for 21c instruction format (e.g. check-cast) 2013-12-08 17:44:15 -08:00
Ben Gruver
318954d56b Don't attempt to create the smali.jar/baksmali.jar symlinks on windows.
Unsurprisingly, ant.symlink is unsupported on windows.
2013-11-10 22:19:48 -08:00
Ben Gruver
edd961477e Remove the now unused builder instructions and instruction factories 2013-09-15 12:55:36 -07:00
Ben Gruver
51a13e3353 Fix the tests related to bracketed names 2013-09-14 13:42:55 -07:00
Ben Gruver
569c014562 Allow arbitrary bracketed member names
Dalvik allows accesses and definitions of fields with angle brackets

It "allows" definitions of bracketed method names, but it will reject any
attempt to actually call them (except <init>, of course).
2013-09-14 13:35:04 -07:00
Ben Gruver
9a2de93a99 Implement just-in-time instruction fixup due to string jumboification 2013-09-08 21:41:23 -07:00
Ben Gruver
99b46173c5 Generify the IO requirements for writing a dex file
The DexWriter implementations now write to a generic "DexDataStore", instead
of writing directly to a file.

Also, writing of the DebugItems and CodeItems are linked, with the code
items being written to a temporary location, and then the entire code item
section is written as a batch after the debug item section.
2013-09-08 15:30:58 -07:00
Ben Gruver
160449b83a Implement instruction fixing in MutableMethodImplementation 2013-09-07 14:54:16 -07:00
Ben Gruver
e80efa670f Implement instructions for the method builder 2013-09-02 12:20:13 -07:00
Ben Gruver
dff046e1b5 Delete BuilderMethodImplementation, and simplify the DexWriter stuff accordingly
DexBuilder.internMethod now accepts a generic MethodImplementation instead. It is assumed that
the various String/Type/etc. references will have been interned by and returned from the
appropriate DexBuilder methodDelete BuilderMethodImplementation

DexBuilder.internMethod now accepts a generic MethodImplementation instead. It
is assumed that the various String/Type/etc. references will have been
interned by and returned from the appropriate DexBuilder method
2013-08-24 21:53:05 -07:00
Ben Gruver
e9aa2c230f Remove the Instruction template parameter from InstructionFactory 2013-08-24 21:47:57 -07:00
Ben Gruver
766f285a70 Initial stub MethodImplementationBuilder and integration into smali 2013-08-24 18:53:26 -07:00
Ben Gruver
a81c962f00 Remove support for using arbitrary offsets instead of labels 2013-08-24 15:52:38 -07:00
Ben Gruver
49fa5f5f44 Don't crash if the smali/baksmali.properties file can't be found 2013-06-01 13:44:23 -07:00