Commit Graph

10 Commits

Author SHA1 Message Date
John McCall
41efb3d4d3 Only use metadata patterns for generic types; perform other
initialization in-place on demand.  Initialize parent metadata
references correctly on struct and enum metadata.

Also includes several minor improvements related to relative
pointers that I was using before deciding to simply switch the
parent reference to an absolute reference to get better access
patterns.
2016-03-23 17:04:04 -07:00
Erik Eckstein
c1bcb0b69d SIL: add new instruction set_deallocating
It will be used by the ReleaseDevirtualizer before calling the deallocator.
So far, this is NFC.
2016-03-15 12:56:54 -07:00
practicalswift
fd829f76c8 [gardening] Fix recently introduced typo: "only only" → "only" 2016-03-02 09:34:03 +01:00
Roman Levenstein
dbf233318b swift_allocObject should be exposed as a visible runtime entry. 2016-02-25 08:46:57 -08:00
Roman Levenstein
de3b850ce8 Use more descriptive names for calling conventions.
Rename RuntimeCC into DefaultCC
Rename RuntimeCC1 into RegisterPreservingCC
Remove RuntimeCC0 because it was identical to DefaultCC.
2016-02-25 05:31:00 -08:00
Roman Levenstein
1d7cca9b07 Fix the failing Linux build.
Don't generate global function pointers if the platforms does not need to provide Obj-C interoperability.
2016-02-25 05:31:00 -08:00
Roman Levenstein
0964aecc7d Define functions using a new calling convention RuntimeCC1.
We annotate the most popular runtime functions in terms of how often they are invoked from Swift code:

- Many variants of retain/release functions are annotated to use the new calling convention.
  But those variants of retain/release functions that may result in calls of objc_retain or objc_release
  are not migrated to the new calling convention, because it results in significant performance degradations
  when objects of Obj-C derived classes are used.

- Some popular non-reference counting functions like swift_getGenericMetadata or swift_dynamicCast are annotated as well.
2016-02-25 05:31:00 -08:00
Roman Levenstein
1d0bfcf40e Define runtime functions which should be invoked via a global function pointer.
The list of these functions is pretty much the same as the the set of functions defined in InstrumentsSupport.h
These are basically the functions that can be intercepted by different tools/profilers/etc.
2016-02-25 05:31:00 -08:00
Roman Levenstein
94ab3e2a20 Define a new x-macro FUNCTION_WITH_GLOBAL_SYMBOL_AND_IMPL
This new x-macro should be used to define a runtime function that has an internal implementation
inside the runtime library and a global symbol referring to this internal implementation.

An example of such a runtime function is "swift_retain", which has a global symbol "_swift_retain"
referring to its internal implementation "_swift_retain_".
2016-02-25 05:30:59 -08:00
Roman Levenstein
634579aae2 Move RuntimeFunctions.def into a shared location.
RuntimeFunctions.def was used only by IRGen so far. But it is going to be used by the runtime library as well.
2016-02-25 05:30:59 -08:00