d80e58b259c2febc4907aed4aca9d88d43bdd1a1 |
|
24-Jul-2017 |
David Gross <dgross@google.com> |
Improve Java reflection for 32-bit versus 64-bit differences. Bug: 32780232 Bug: 20260865 Bug: 21597073 By default, when targeting API L or above, we support both 32-bit and 64-bit targets. We do so by running two compilation passes -- a 32-bit compilation pass followed by a 64-bit compilation pass. We generate reflected Java code as part of the 64-bit compilation pass. This can cause problems if there are "significant" differences between the user's script (.rs file) as seen during 32-bit compilation compared to 64-bit compilation -- for example, rs object handles (such as rs_allocation and rs_element) are different sizes, the type size_t is a different size, and a user can create arbitrary differences by using the __LP64__ macro. If any of those differences affect reflected code (for example, by changing exported types), then we may get incorrect runtime behavior on 32-bit targets. At present we do have some special processing for rs object handles. However, we don't properly address all cases -- for example, when an rs object handle is a field of a struct or an argument to an invokable function, reflected code does not get the layout of the struct or argument list correct on 32-bit targets. We also make no attempt to address any other differences (such as size_t or __LP64__). This CL is intended to fully address 32-bit versus 64-bit reflection issues: 1) Fully handle rs object handle size differences when laying out data (such as structs and invokable function argument lists). 2) Emit errors for any other differences between 32-bit and 64-bit compilation that would require changes to reflected code (for example, no exported global may be of type size_t). We solve these problems as follows: a) As part of the 32-bit compilation pass, execute (most of) the same code paths we would use to generate reflected code, but instead of actually generating reflected code, collect information for later. b) When we generate reflected code as part of the 64-bit compilation pass, we consult the information collected during the 32-bit compilation pass in order to do target sensitive data layout and to emit errors for intolerable 32-bit versus 64-bit differences. This CL requires changes to the compatibility library (in frameworks/rs). Test: many - slang/lit-tests - slang/test - RsTest aosp_x86_64-eng (aosp, emulator) 32-bit and 64-bit - cts aosp_x86_64-eng (aosp, emulator) RenderScript and CtsRsCppTestCases - RSTestBackward - aosp_arm-eng - n9 LMP MR1 Release (LM) - angler MNC DR Release (MD) - aosp_arm64-eng - n9 LMP MR1 Release (LM) - angler MNC DR Release (MD) - RSTest_Backward19 - aosp_arm-eng - n5 KLP MR2 Release (KT) - n9 LMP MR1 Release (LM) - angler MNC DR Release (MD) - RSTest_CompatLib - aosp_arm-eng - n9 LMP MR1 Release (LM) - angler MNC DR Release (MD) - aosp_arm64-eng - n9 LMP MR1 Release (LM) - angler MNC DR Release (MD) - aosp_x86-eng - emulator aosp - aosp_x86_64-eng - emulator aosp - RSTest_Compat19 - aosp_arm-eng - n5 KLP MR2 Release (KT) - n9 LMP MR1 Release (LM) - angler MNC DR Release (MD) - aosp_x86 - emulator aosp Change-Id: I5d1fc51e35693588dff05afa48e1a4902859036e
/frameworks/compile/slang/slang_rs_reflection.h
|
47cf31e869c1b6f149ac619f82939b9a8cab1180 |
|
01-Jun-2017 |
David Gross <dgross@google.com> |
Move GetTypeName() into class RSReflectionJava. Test: aosp_x86_64-eng slang/tests, slang/lit-tests, RsTest 32/64 (emulator) Change-Id: I5750b19d5c214c5fea332de5b0c68d23e7ef3cef
/frameworks/compile/slang/slang_rs_reflection.h
|
e2ead846c1d78a6e7108e521ffd15850bd9eed3c |
|
13-Aug-2016 |
Chih-Hung Hsieh <chh@google.com> |
Fix clang-tidy warnings in slang. These are proposed changes, looking for upstream changes. * Add explicit keyword to conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 * Use const reference type to avoid unnecessary copy. Bug: 30413862 Test: build with WITH_TIDY=1 Change-Id: I2aeba0ff19fe0581d9c177d9b340e4402fdad3f9
/frameworks/compile/slang/slang_rs_reflection.h
|
1c6bf88e098c767c3cd445f2c2514f0598d91501 |
|
02-Jun-2016 |
David Gross <dgross@google.com> |
Delete simple reduction implementation. Bug: 27298560 Change-Id: I775dd782d658c7c720f57aa31a584deee98cdd17 (cherry picked from commit 8ee018bdb53fc5abdc430878e2bec0c0c0aa560f)
/frameworks/compile/slang/slang_rs_reflection.h
|
277fd5e6545c8ba1272027ee6e6bc55a96316dc0 |
|
14-Jan-2016 |
David Gross <dgross@google.com> |
Add Java reflection for "#pragma rs reduce". Also: - test.py now recognizes "Script*.java.expect" files as masters for comparing reflected code the same way "stderr.txt.expect" and "stdout.txt.expect" are masters for comparing compiler stderr and stdout. - gReflectionTypes[] now has a '"common name" in script (C99)' column (e.g., "short" is the common name by which a type appears in script code, in contrast with "int16_t" which is the name by which a type is reflected in NDK code). Bug: 23535724 Change-Id: I7960968bb98a17e33fe23415f7927cac537b72a3
/frameworks/compile/slang/slang_rs_reflection.h
|
657d20afa621219c1eed72178d1325fd4409f458 |
|
17-Dec-2015 |
David Gross <dgross@google.com> |
Cleanup: RSExportType::getSize() has inconsistent semantics. This is a virtual method with different semantics for different classes in the type hierarchy: RSExportPrimitiveType: Returns number of bytes occupied by type RSExportPointerType: Returns 1 RSExportVectorType: Returns number of bytes occupied by one element (i.e., of the component type) RSExportMatrixType: Returns 1 RSExportConstantArrayType: Returns the number of array elements RSExportRecordType: Returns 1 The fix is to replace this method with methods whose names indicate their actual semantics. Bug: 26235282 Change-Id: Ic7c5cfd1b73a0b6e7e6fd4ed0495de3877adf0e8
/frameworks/compile/slang/slang_rs_reflection.h
|
7682b663581dd8f67b422f6f2f31692ab2f870e3 |
|
31-Jul-2015 |
Matt Wala <wala@google.com> |
Add Java reflection for reduce-style kernels in slang. Bug: 22631253 Change-Id: I43de647a45c02d51cb256d206b64e159daf13864
/frameworks/compile/slang/slang_rs_reflection.h
|
5abbe0e9ca2508260b627ffef2bf01e2554e8357 |
|
13-Aug-2014 |
Chris Wailes <chriswailes@google.com> |
Replace the NULL macro with nullptr literal. Change-Id: I33609969cd0d7aa55eaa83fb2c65f5faa6d55fa0
/frameworks/compile/slang/slang_rs_reflection.h
|
afa84a9112db3b135f88d736b4c8249a049eb40a |
|
08-Jul-2014 |
Stephen Hines <srhines@google.com> |
Merge "Adds support for multi-input kernels to Slang."
|
c9454afec1649846512993d0ef65a9f868976bb4 |
|
14-Jun-2014 |
Chris Wailes <chriswailes@google.com> |
Adds support for multi-input kernels to Slang. This patch modifies slang in the folowing ways: * Updates some of the development target API logic. * Adds logic for validating kernels with multiple inputs. * Added support for multi-input kernels to the Java reflection code. * Adds tests for these new features. * Updated existing tests with the new error messages. Change-Id: I46d2834c37075b2a2407fd8b010546818a4540d1
/frameworks/compile/slang/slang_rs_reflection.h
|
3a38b7489d016b07e5b95a1e04ccfe9064b3438f |
|
02-Jul-2014 |
Tim Murray <timmurray@google.com> |
Reflect Java size information using mElement.getBytesSize(). Item.sizeof is unreliable because of 32/64 differences. getBytesSize() will be significantly more reliable. Change-Id: I7b486f1eb931befcc3ac8bacae3834cbfb47358d
/frameworks/compile/slang/slang_rs_reflection.h
|
c643ceb752ed999def0fd028990eafa802cd13fb |
|
05-Jun-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Remove the ugly EB_ADD macro and related hacks. Change-Id: I3e146af920f7e9e9ca6bcb2165107d4660bc3e0a
/frameworks/compile/slang/slang_rs_reflection.h
|
59f22c376b2c1cd109735280689224fadfe40b42 |
|
04-Jun-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Set the reflection parameters in the constructors. Change-Id: I3c74ab5a10d7aa3adaf460c56d2ab295a766fcfb
/frameworks/compile/slang/slang_rs_reflection.h
|
f33e1561dc390cf2be7a81e9f818b269d458ec7e |
|
04-Jun-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Use GeneratedFile in Java reflection Change-Id: Ib52a82b7649c9247e0b4de56267eba7f6cf2e25e
/frameworks/compile/slang/slang_rs_reflection.h
|
efcff1017f5f1e120a8ffb67125e412343479f94 |
|
04-Jun-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Remove ReflectionBase. Some of the methods of this base class only applies to the C++ reflection. Other methods better belong in reflection_utils. Change-Id: Ib539eb3b31cdc2230a5a7dd925642b5a697a899a
/frameworks/compile/slang/slang_rs_reflection.h
|
2e205d071c86981a8dd301a8612d17b251b3b973 |
|
03-Jun-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Merge RSReflectionJava::Context into RSReflectionJava. Also removed the unused ability to emit the code to stdout. Change-Id: If18c7bcfe94bbca5866c371511c7d811f861cd5a
/frameworks/compile/slang/slang_rs_reflection.h
|
1ce012a517e37bdc63493c7fb2aaee19b6361f92 |
|
03-Jun-2014 |
Stephen Hines <srhines@google.com> |
Fix typo in function name. Change-Id: Ib68b1fc6e80875ed819ce5e1fa3e5943a224afd7
/frameworks/compile/slang/slang_rs_reflection.h
|
2ce118e843fcbd53488b503933136bb4fdbdfbc1 |
|
28-May-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Reformat the reflection code using clang-format Change-Id: I3bec395fdcff8c848025e7e63fc4ac8517154454
/frameworks/compile/slang/slang_rs_reflection.h
|
602def74e8afa68b72a1f9391c31d6ff152add53 |
|
28-May-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Rename RSReflection to RSReflectionJava. Change made to make it more obvious the type of code created for this file. Reformatted the headers with clang-format, hence the slight changes in indentation style. Change-Id: Ib2c748d84bd4eb8a188f95c0c60014ad4c60711f
/frameworks/compile/slang/slang_rs_reflection.h
|
a7c8e602320b1ae329966337454efd40f1e0d6cc |
|
27-May-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Merge "Remove useless "return;" statements."
|
796e7b1400d3f3f7c07496d88bb48129ea925bb9 |
|
27-May-2014 |
Jean-Luc Brouillet <jeanluc@google.com> |
Remove useless "return;" statements. More cleanups to follow... Change-Id: Ib8348255273771c1e9ff07e79bd7fbc8f2795a5b
/frameworks/compile/slang/slang_rs_reflection.h
|
4c8b659edc8dca50ffb9c172258412fc1e02b80d |
|
23-May-2014 |
Stephen Hines <srhines@google.com> |
Generate calls to getBitCode32() for new constructor type. Change-Id: Iec41e3f325ec045362608ee52b0f78c55eb87bed
/frameworks/compile/slang/slang_rs_reflection.h
|
44d495d2ad8c350a8f586502c9ee8e97a513646a |
|
23-May-2014 |
Stephen Hines <srhines@google.com> |
Clean up embedded bitcode path for Java. Change-Id: I79cc65778173c7eeab028dedfc4adcb59bef44c2
/frameworks/compile/slang/slang_rs_reflection.h
|
80706836b18127b5733d790613a5d1b9f97cbb1d |
|
29-Aug-2013 |
Stephen Hines <srhines@google.com> |
Fix initializers and add vector reflection support. Bug: 10427951 This also fixes a bug with floating point initialization (where relevant digits could be truncated because of C++ iostream operators). Change-Id: I2761dea38dd6ad758ea31217744e45436596afce
/frameworks/compile/slang/slang_rs_reflection.h
|
28d60bc2da19821af82d983902c3c78c078343c3 |
|
16-Oct-2012 |
Stephen Hines <srhines@google.com> |
Only generate getFieldID_*() for non-Pointer (bind) types. Bug: 7318821 Change-Id: Ic043f75a1a1a2a6f4a0b6d90ab3f1d053012d8c7
/frameworks/compile/slang/slang_rs_reflection.h
|
0a813a3ef2a82f19d7eab9e23ae8493197143803 |
|
04-Aug-2012 |
Stephen Hines <srhines@google.com> |
Add RS package name option + support. Usage: llvm-rs-cc -rs-package-name=android.renderscript ... or llvm-rs-cc -rs-package-name android.renderscript ... This allows us to reflect a different import path for our base RS classes. The default value is "android.renderscript", resulting in a reflection that produces "import android.renderscript.*;". Change-Id: Icf7e83b963ba70c803899697f49b41fdfb9586e7
/frameworks/compile/slang/slang_rs_reflection.h
|
1f6c331d622ac645ab68a016aa4c577998547373 |
|
04-Jul-2012 |
Stephen Hines <srhines@google.com> |
Fix reflection of setters for unsigned primitive types. BUG=6764163 We now generate set_*() functions for unsigned types by creating a single element FieldPacker and stuffing it with the larger Dalvik type. Reusing FieldPacker in this way allows us to validate that the input is non-negative and within the appropriate range (i.e. not really using more bits than the unsigned C type should). This change also fixes a subtle race where the Dalvik and script side can disagree about a variable's value. All set_*() methods need to be synchronized, and we must do the Dalvik update after validating the input data. Change-Id: I7b2371206848ebbf0b0752779cb6c98cec1ab5f6
/frameworks/compile/slang/slang_rs_reflection.h
|
0d26cef64debfaa6862a27587c1fd0d30baa3b1d |
|
02-May-2012 |
Stephen Hines <srhines@google.com> |
Refactor using genSetExportVariable(). BUG=6009244 Change-Id: I3c830b84c6f863faed8e36da625447bdf416579e
/frameworks/compile/slang/slang_rs_reflection.h
|
a6b54146b93eec68f6daa4b1877639cdc34801dc |
|
10-Apr-2012 |
Stephen Hines <srhines@google.com> |
Reflect element/dim information for FieldPacker. BUG=6009244 Change-Id: Ie24b3ce17817b98e8b651f7ec1304dcd18c8c062
/frameworks/compile/slang/slang_rs_reflection.h
|
5d67178077b50d0a02832e91053ee71ec33a25c2 |
|
01-Feb-2012 |
Stephen Hines <srhines@google.com> |
Reflect constant primitive types back to Java. We reflect it in the containing class as follows: public final static TYPE const_NAME = INIT; Change-Id: I478a6ba75715cfe3ddf1196794153721b793b287
/frameworks/compile/slang/slang_rs_reflection.h
|
a9ae5ae8866d937a99601d24a922c8f3f4223f59 |
|
12-Nov-2011 |
Stephen Hines <srhines@google.com> |
Generate/skip padding and use new prefix for ICS. BUG=5609007 Change-Id: Ia69fa45e0f728914a4c5de1a531f367dda165dba
/frameworks/compile/slang/slang_rs_reflection.h
|
38eca1ad0d6bfac8f1fbf7c8360f4c18ecd205c2 |
|
25-Aug-2011 |
Alex Sakhartchouk <alexst@google.com> |
Fixing copyNow reflection. Adding synchronization to setters/getters Change-Id: I32327473fdcde9d22642b60c8f711f6237200fd3
/frameworks/compile/slang/slang_rs_reflection.h
|
48b72bf3ea4a7dc66a0b59734aeb0c4adfb4d9d1 |
|
11-Jun-2011 |
Stephen Hines <srhines@google.com> |
Type-checking for ForEach with RS types. BUG=4203264 Change-Id: I90e54cdf22fea76ffde9548617fb7b492ba9d643
/frameworks/compile/slang/slang_rs_reflection.h
|
b5a89fbfcba6d8817c1c3700ed78bd6482cf1a5d |
|
17-May-2011 |
Stephen Hines <srhines@google.com> |
Clean up forEach reflection code. BUG=4203264 Change-Id: I8196608408fe333bd8e875d9517b8e875bdce17d
/frameworks/compile/slang/slang_rs_reflection.h
|
593a894650e81be54173106ec266f0311cebebd3 |
|
11-May-2011 |
Stephen Hines <srhines@google.com> |
Simple support for reflecting rsForEach(). BUG=4203264 Change-Id: Idf722ee3fb07c8e46ac0c4628e753ff2fa6840cf
/frameworks/compile/slang/slang_rs_reflection.h
|
6e6578a360497f78a181e63d7783422a9c9bfb15 |
|
08-Feb-2011 |
Stephen Hines <srhines@google.com> |
Add support for assertions in llvm-rs-cc. Bug: 3430674 Change-Id: I3400238652449cde84275cc2a770f405332d9544
/frameworks/compile/slang/slang_rs_reflection.h
|
4cc67fce91f43215d61b2695746eab102a3db516 |
|
01-Feb-2011 |
Stephen Hines <srhines@google.com> |
Support for generating .java dependencies for RS. This updates the -MD option to also emit .java targets to the dependency information placed in our foo.d file. Change-Id: I189cf6302bc1cbd6201487743a37dced87b5c5eb
/frameworks/compile/slang/slang_rs_reflection.h
|
e639eb5caa2c386b4a60659a4929e8a6141a2cbe |
|
09-Nov-2010 |
Stephen Hines <srhines@google.com> |
Improve code style. Change-Id: I26e043849bce2a4b41ae132fbe0c882f4a6f112f
/frameworks/compile/slang/slang_rs_reflection.h
|
d42a429f42fd6f272188af64f412cd604f02b365 |
|
16-Oct-2010 |
Zonr Chang <zonr@google.com> |
b/3093518 Add resize() method in the reflected of ScriptField_*.java.
/frameworks/compile/slang/slang_rs_reflection.h
|
89273bd59a182fc0401d68f14ad206bf4dc800c7 |
|
14-Oct-2010 |
Zonr Chang <zonr@google.com> |
b/3093447 Create element of constant array using Element.add(Element element, String name, int arraySize) API.
/frameworks/compile/slang/slang_rs_reflection.h
|
c383a500aa59423264811be3874461bf8adbfea0 |
|
11-Oct-2010 |
Zonr Chang <zonr@google.com> |
Prepend legal announcement in all files. Release libslang/llvm-rs-cc/llvm-rs-link under Apache 2.0 license.
/frameworks/compile/slang/slang_rs_reflection.h
|
b81c6a4cbd9c08e0b20ea4fbc615b416ac1bc9ec |
|
10-Oct-2010 |
Shih-wei Liao <sliao@google.com> |
Revert "Revert "New implementation of llvm-rs-cc (replacement of slang_driver)."" This reverts commit a6d60672695f1438a63acdbf85eae7f97ce2b50d.
/frameworks/compile/slang/slang_rs_reflection.h
|
a6d60672695f1438a63acdbf85eae7f97ce2b50d |
|
10-Oct-2010 |
Shih-wei Liao <sliao@google.com> |
Revert "New implementation of llvm-rs-cc (replacement of slang_driver)." This reverts commit 6791df284557f4173a9715b3634f4f4901a6bb8a.
/frameworks/compile/slang/slang_rs_reflection.h
|
6791df284557f4173a9715b3634f4f4901a6bb8a |
|
09-Oct-2010 |
Shih-wei Liao <sliao@google.com> |
New implementation of llvm-rs-cc (replacement of slang_driver). Change-Id: I1b8b6cf3dad8ef8fe2f4d24d4df604099f45ff37
/frameworks/compile/slang/slang_rs_reflection.h
|
8c6d9b2d36ed2d6d811279fd9bddc05fffe16803 |
|
07-Oct-2010 |
Zonr Chang <zonr@google.com> |
Use llvm::sys::Path to implement "mkdir -p". Change-Id: I3bb36e1a8050bbd9744fd02935b6186d2f285015
/frameworks/compile/slang/slang_rs_reflection.h
|
2e1dba6c779a0ae55c76d36a3c03553e16725ab7 |
|
05-Oct-2010 |
Zonr Chang <zonr@google.com> |
Rewrite the RSExportConstantArrayType to better support reflecting constant-sized array variable.
/frameworks/compile/slang/slang_rs_reflection.h
|
92b344a51c6c4934e96882bd401e4b13d6d03db8 |
|
05-Oct-2010 |
Zonr Chang <zonr@google.com> |
Create RSExportMatrixType which is a subclass of RSExportType to support rs_matrix{2x2,3x3,4x4} explicitly.
/frameworks/compile/slang/slang_rs_reflection.h
|
66aa299de2b5e0b0c7bfae7628e29a3961247aed |
|
05-Oct-2010 |
Zonr Chang <zonr@google.com> |
Fix FieldIndex issue and re-enable it in reflection.
/frameworks/compile/slang/slang_rs_reflection.h
|
6315f76e3cc6ff2d012d1183a0b030d4ff0dc808 |
|
05-Oct-2010 |
zonr <zonr@google.com> |
More coding style fixing to improve the readability. No actual semantics changed. This also makes cpplint happy.
/frameworks/compile/slang/slang_rs_reflection.h
|