| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
| |
keys/values without injecting the codecs. Also allow it to handle ImmutableSortedMap, since we were always silently degrading to ImmutableMap for objects that weren't declared as ImmutableSortedMap, and there's no good way to handle non-natural comparators. This will lead to runtime failures if a class actually needs an ImmutableSortedMap with a different comparator than the natural one.
This changes the semantics of ImmutableMap serialization. Previously, we went off the declared type. In the case of a declared ImmutableSortedMap, we ignored the comparator, potentially leading to incorrect serialization (new test added in AutoCodecProcessorTest that would have caught that). Moreover, declared ImmutableMaps were deserialized as ImmutableMaps even if they were actually ImmutableSortedMaps. Now, we preserve the ordering unconditionally, and preserve the type if possible. I think this is a better state to be in.
This is needed to kill off MemoizingCodec, since MemoizingCodec has an ImmutableMapMemoizingCodec, which I want to get rid of in favor of this.
PiperOrigin-RevId: 188619637
|
|
|
|
|
|
| |
package-private.
PiperOrigin-RevId: 188610579
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Skylark memoization, but we may extend in future to handle more than just Skylark this way. In fact, we probably want most of our ObjectCodecs to be MemoizingCodecs that can efficiently fall back to ObjectCodec if not using memoization (maybe coming in a follow-up).
At a high level, this CL merges the functionality of MemoizingCodecMap into ObjectCodecRegistry, adds auto-registration of MemoizingCodec, and uses that to get rid of a lot of codecs that were just delegating. The big one to get rid of there is SkylarkValueCodec: all of its delegation duties are implicitly now in ObjectCodecRegistry and friends.
One danger with this CL is that many of the features of Skylark serialization are only being tested in unit tests, which had to be reworked as part of this change. I don't think we've lost any coverage, but I could be wrong. SkylarkValueCodec had a bunch of methods that were effectively test-only, which made it easier to remove.
The plan is to provide a Memoizer.Serializer inside the SerializationContext. At the top level, it will be a DUMMY_SERIALIZER that does no memoization, but a MemoizingCodec can do
context = context.ensureMemoizing()
which will recreate the context with a true memoizing serializer. Then all references to the Serializer in codec code can be cleaned up, and the MemoizingCodec and ObjectCodec signatures will be the same. At that point, we can make all ObjectCodecs compatible with memoization by default (with strategy MEMOIZE_AFTER), and add a "memoize" boolean to @AutoCodec. That should allow us to have full interoperability between all codecs.
This CL also makes CodecScanner deterministic in the order of classes that it processes (there was a lurking bug here where constants must be deterministically ordered but that wasn't enforced at all).
PiperOrigin-RevId: 188559983
|
|
|
|
| |
PiperOrigin-RevId: 188077900
|
|
|
|
|
|
| |
BuildConfiguration, BuildOptions, CollectTargetsUnderDirectoryValue.
PiperOrigin-RevId: 188059815
|
|
|
|
| |
PiperOrigin-RevId: 188034513
|
|
|
|
| |
PiperOrigin-RevId: 187945746
|
|
|
|
|
|
| |
Needed for Attribute serialization.
PiperOrigin-RevId: 187907727
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Fixed issue that led to rollback.
RELNOTES: None
*** Original change description ***
Automated rollback of commit eee53d3a33dde441f7e7adaecde81ef2d3db7c1b.
*** Reason for rollback ***
breaks Blaze_CorpTest
*** Original change description ***
@AutoCodec ConfiguredTargetValue.
PiperOrigin-RevId: 187869560
|
|
|
|
| |
PiperOrigin-RevId: 187868296
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
breaks Blaze_CorpTest
*** Original change description ***
@AutoCodec ConfiguredTargetValue.
PiperOrigin-RevId: 187783702
|
|
|
|
|
|
|
|
| |
ObjectCodec into a MEMOIZE_AFTER MemoizingCodec. I think that this is safe, because all the codecs that are being wrapped this way weren't memoizing anything internally that I could see.
In order to @AutoCodec the WithValue type, which is generic and can have null elements in lists, add functionality to @AutoCodec to deal with generic type static instantiators, matching generic type arguments (although I'm not sure why that wasn't already working), and null elements in lists.
PiperOrigin-RevId: 187740461
|
|
|
|
|
|
|
|
| |
doesn't save memory in the 32-bit case, but makes it easier for people to see how many SkyKeys we have.
There's some unnecessary interning in tests, but it was easier to copypasta and doesn't harm anything, I think.
PiperOrigin-RevId: 187694309
|
|
|
|
| |
PiperOrigin-RevId: 187635570
|
|
|
|
|
|
|
| |
a nice consequence, this lets us reduce GC churn since we no longer need to create a frame instance for the lexical frame at a callsite of either a function when the environment is frozen or a builtin function (since builtins cannot modify bindings in their lexical frame).
RELNOTES: None
PiperOrigin-RevId: 187495787
|
|
|
|
| |
PiperOrigin-RevId: 187397314
|
|
|
|
|
|
| |
Remove the HashCode marshaller.
PiperOrigin-RevId: 187350917
|
|
|
|
|
|
| |
This also gets rid of some static initialization cycles which we should try very hard to avoid in the future.
PiperOrigin-RevId: 187334087
|
|
|
|
|
|
|
|
|
|
|
| |
* FILE_SYMLINK* codecs need ImmutableList so this adds an ImmutableList runtime codec.
* Adds SkyFunction names where codecs exist for their SkyKeys.
* Adds a few @AutoCodec singleton codecs.
We cannot yet disable the ImmutableList marshaller because currently the
runtime ImmutableList codec requires runtime codecs for the contained elements, which doesn't hold everywhere (particularly for protos).
PiperOrigin-RevId: 187224736
|
|
|
|
| |
PiperOrigin-RevId: 187212436
|
|
|
|
| |
PiperOrigin-RevId: 187209783
|
|
|
|
| |
PiperOrigin-RevId: 187199625
|
| |
|
|
|
|
|
|
|
|
| |
This requires codecs for CustomCommandLine and a Marshaller for Charset.
Added AutoCodec functionality to generic classes like Iterable<T>.
PiperOrigin-RevId: 187182889
|
|
|
|
|
|
| |
that has a single static INSTANCE field pointing back to the target field, so that serialization can grab it.
PiperOrigin-RevId: 187065629
|
|
|
|
| |
PiperOrigin-RevId: 187059719
|
|
|
|
|
|
|
|
|
|
| |
AutoCodec still cannnot handle types with generic elements, e.g.
class Foo<T> {
private T member;
}
PiperOrigin-RevId: 187052487
|
|
|
|
|
|
| |
logic so that we can transparently handle arrays. We no longer care about the type of an object in AutoCodecProcessor: Marshallers is in charge of getting the correct code generator for array types anyway, so it can handle bare primitives as well.
PiperOrigin-RevId: 186919695
|
|
|
|
|
|
|
|
| |
(Des|S)erializationContext factories.
This is consistent as ObjectCodecs will eventually create context objects if needed.
PiperOrigin-RevId: 186900662
|
|
|
|
|
|
|
| |
This isn't 100% safe, which requires 1:1 type correspondence, but can catch
some errors at compile time.
PiperOrigin-RevId: 186898025
|
|
|
|
|
|
|
|
| |
* Deletes a number of CODEC references, now superceded by registry functionality.
* Minimal SkyKeySerializer modifications for correctness, as certain codec changes require
codecs to be in available in the registry.
PiperOrigin-RevId: 186834520
|
|
|
|
|
|
| |
to select a codec.
PiperOrigin-RevId: 186378153
|
|
|
|
|
|
|
|
|
|
|
|
| |
* AutoCodec now delegates to the registry.
* Adds getSuperclass logic for resolving a codec.
* Small cleanups for classes that break the registry.
TODO after this change:
* Explicit CODEC definitions are no longer needed and existing ones should be cleaned up.
* POLYMORPHIC is no longer be needed and should be cleaned up.
PiperOrigin-RevId: 186351845
|
|
|
|
|
|
| |
CharSequence fields.
PiperOrigin-RevId: 186323424
|
|
|
|
| |
PiperOrigin-RevId: 185847377
|
|
|
|
| |
PiperOrigin-RevId: 185844072
|
|
|
|
|
|
|
|
|
| |
CodecScanner.
Introduces a class, CodecRegisterer, to allow customization of the scan-based
registration process.
PiperOrigin-RevId: 185749655
|
|
|
|
| |
PiperOrigin-RevId: 185733313
|
|
|
|
|
|
|
| |
Cleaning up references to {Des,S}erializationContext.UNTHREADED_PLEASE_REMOVE,
deleting the code is easier than deciding how to adapt context.
PiperOrigin-RevId: 185602054
|
|
|
|
|
|
|
|
| |
parameter isn't present. Allows us to handle cases where the class type encodes the parameter value. This also gives a compile-time check that field is present before blindly using it in codec.
Lets us get rid of a non-AutoCodec class.
PiperOrigin-RevId: 185573686
|
|
|
|
|
|
| |
(Des|S)erializationContext.
PiperOrigin-RevId: 185547740
|
|
|
|
|
|
|
|
|
|
| |
Context implementations are currently empty, just doing the plumbing in this
change. Once this is in we can start passing along the ObjectCodecRegistry, which
will allow runtime codec resolution for classes not known at compile time.
We'll also inevitably add some memoization helpers, allowing us to optimize the
serialization process further.
PiperOrigin-RevId: 185305674
|
|
|
|
|
|
| |
codec, but whose parent classes have codecs. This is ok because the polymorphic strategy doesn't need an instance of the grandchild class: the parent class is fine, so long as it has a codec.
PiperOrigin-RevId: 185200943
|
|
|
|
|
|
| |
AutoValue support. This is required to serialize ActionOwner.
PiperOrigin-RevId: 185037291
|
|
|
|
|
|
| |
CppCompileAction.
PiperOrigin-RevId: 185020942
|
|
|
|
|
|
|
|
|
|
| |
This partially solves the age old problem of how to find a codec for a value we
don't know the type of at compile time, and allows us to represent such values
on the wire more compactly. @AutoCodec's injecting codec should be able to make
use of this right away - we'll need to make an API change to the ObjectCodec
interface to allow the existing system to make use.
PiperOrigin-RevId: 184918173
|
|
|
|
| |
PiperOrigin-RevId: 184889583
|
|
|
|
| |
PiperOrigin-RevId: 184784669
|
|
|
|
| |
PiperOrigin-RevId: 184720361
|
|
|
|
| |
PiperOrigin-RevId: 184710375
|