Commit Graph

234 Commits

Author SHA1 Message Date
Dave Zarzycki
7fedcbcffc Runtime: standards compliance feedback
Swift SVN r16828
2014-04-25 18:28:26 +00:00
Dave Zarzycki
128027dd4d Runtime: abort on resurrection
Also fix a latent bug in the logic in the disabled code to scribble over memory durring dealloc.

<rdar://problem/15855042> QoI: abort on resurrection

Swift SVN r16827
2014-04-25 18:16:59 +00:00
Joe Groff
5c2bd67459 Runtime: Sync QuickLookObject in the runtime with recent stdlib additions.
Swift SVN r16823
2014-04-25 15:00:08 +00:00
Joe Groff
f29a156e83 IRGen/Runtime: Add value witness slots for array witnesses.
Add value witnesses for destroyArray, initializeArrayWithCopy, and initializeArrayWithTake{FrontToBack,BackToFront}, and fill out the runtime value witness table implementations. Stub out the IRGen ones for now.

Swift SVN r16772
2014-04-24 22:25:26 +00:00
Dave Zarzycki
5e5a369b96 Runtime: Renable proxying and dynamic cast support
As it turns out, Swift classes can stumble into having a non-pointer isa.
This might be a problem for 1.0, but that is beyond the scope of this bug.

Swift SVN r16721
2014-04-23 22:06:39 +00:00
Jordan Rose
0da44e23c3 [CMake] Only look for libCrashReporterClient.a in the SDK.
...if one is set.

Swift SVN r16718
2014-04-23 21:37:33 +00:00
Greg Parker
be6ba21fd9 Revert r16648 because it crashes on arm64.
Swift SVN r16696
2014-04-23 09:11:36 +00:00
Greg Parker
b691055649 Fix an incorrect use of Swift metadata in an ObjC class. Add assertions to
catch such uses in the future.


Swift SVN r16695
2014-04-23 08:55:02 +00:00
Dave Zarzycki
f59141d434 Runtime: far better cmake logic for CrashReporter
From what I've been able to test, this does the right thing in all of the
scenarios I tested.

Swift SVN r16685
2014-04-23 03:45:07 +00:00
Ted Kremenek
03a8dc1f52 Remove linking CrashReportClient.a until the CMake logic is refined to be portable.
Currently this prevents building Swift on 10.9.

Right now CrashReportClient.a is used regardless of the SDK being used,
and the CMake logic does a check for the .a across different platforms
and SDKs without checking what the build product target OS actually is.
The current logic somewhat works because the SDKs will be in different
Platforms, but it is fragile.

Swift SVN r16678
2014-04-23 00:13:30 +00:00
Chris Lattner
411e5baf02 revert r16670, which included more than it should have.
Swift SVN r16671
2014-04-22 22:51:26 +00:00
Chris Lattner
4fc1154ca7 implement <rdar://problem/16692437> shadowing loop labels should be an error
Swift SVN r16670
2014-04-22 22:50:46 +00:00
Joe Groff
02e95c2866 stdlib: Use #if to clean up platform-dependent branching in VarArgs implementation.
NFC, but we kill a needless runtime stub.

Swift SVN r16669
2014-04-22 22:38:15 +00:00
Greg Parker
1121b2c132 Revert r16666 because I think my test configuration was wrong.
Swift SVN r16667
2014-04-22 22:24:57 +00:00
Greg Parker
629e7f59b4 Prevent direct ObjC isa dereference when using ObjCClassWrapperMetadata.
This fixes several tests on arm64.


Swift SVN r16666
2014-04-22 22:14:35 +00:00
Dave Zarzycki
15d7225d72 Runtime: more cmake fun
There really ought to be a better way to reason about the internal SDK.

Swift SVN r16649
2014-04-22 06:47:01 +00:00
Dave Zarzycki
61aec09671 Runtime: optimize dynamicCast for pure Swift scenarios
This is r16606 plus a fix to detect unsafe conditional dynamic casts of ObjC
objects.

Swift SVN r16648
2014-04-22 06:05:42 +00:00
Dave Zarzycki
ca34d1f438 Runtime: More internal SDK support
Swift SVN r16647
2014-04-22 05:38:23 +00:00
Dave Zarzycki
f84efe1da8 Runtime: more cmake internal SDK fun
Swift SVN r16642
2014-04-22 03:41:47 +00:00
John McCall
8681963bcb A couple of long-overdue renames.
Builtin.ObjectPointer -> Builtin.NativeObject
Builtin.ObjCPointer -> Builtin.UnknownObject

Swift SVN r16634
2014-04-22 00:17:08 +00:00
Greg Parker
b6a5152e09 Revert r16606 because it crashes on arm64.
Swift SVN r16629
2014-04-21 22:29:02 +00:00
Dave Zarzycki
accd058682 Runtime: fix a silly cmake mistake
Swift SVN r16626
2014-04-21 21:48:26 +00:00
Dave Zarzycki
f87e9ba3d5 Runtime: optimize dynamicCast for pure Swift scenarios
Swift SVN r16606
2014-04-21 04:34:09 +00:00
Dave Zarzycki
c3bc1fb9c4 Runtime: always inline our crash() function
This function only trashes one register on x86_64 and therefore makes crash
reports easier to debug.

Swift SVN r16604
2014-04-21 04:34:05 +00:00
Joe Groff
5b1f1f523d Runtime: Walk up superclass chains in swift_conformsToProtocol.
Fixes <rdar://problem/16624349>.

Swift SVN r16556
2014-04-18 23:41:44 +00:00
Joe Groff
ebe5f4620c Don't include the module in protocol conformance manglings.
The cost of hacks to swift_conformsToProtocol is starting to outweigh any benefit to being principled here. We'll get a linker error now if multiple modules declare a conformance for the same type to the same protocol, but that's arguably a good thing for 1.0 anyway, since we aren't set up to get that right in other ways.

Swift SVN r16554
2014-04-18 23:13:40 +00:00
Joe Groff
e5bb7741f4 #if out function that's unused without objc ivar introspection.
Swift SVN r16533
2014-04-18 17:23:07 +00:00
Joe Groff
a57e955635 Reflection: Disable visiting objc ivars in the default mirror.
We can't do this reliably without crashing, because framework types often lie about their layout and/or leave junk pointers in ivars.

Swift SVN r16491
2014-04-18 03:22:56 +00:00
Joe Groff
822aa300e8 Remove BlockShims.mm.
Swift SVN r16485
2014-04-18 01:07:12 +00:00
Dave Zarzycki
211afa943f Runtime: better crash debugging/reporting
Swift SVN r16426
2014-04-16 21:37:16 +00:00
Doug Gregor
b74c29eb64 Fix linking of the crash reporter client.
Swift SVN r16381
2014-04-15 23:45:15 +00:00
Enrico Granata
e86fc505e4 '6AppKit' is 7 characters, not 8
Swift SVN r16380
2014-04-15 23:39:33 +00:00
Dave Zarzycki
43ee06e3cc Runtime: abort if ObjC code tries to manually allocate a pure swift class
Related: <rdar://problem/16531502>

Swift SVN r16378
2014-04-15 22:26:05 +00:00
Enrico Granata
b7372d3ccc r16374 won't do us any good without this
Swift SVN r16375
2014-04-15 19:08:27 +00:00
Ted Kremenek
3fff062f8d Extend print(Double) precision to 15 digits.
Double's like '0.9999999' were being printed as '1.0'.

'print' isn't a first-class I/O library anyway; it's main use right
now is accurate reporting in the REPL.

Fixes <rdar://problem/16603548>.

Swift SVN r16305
2014-04-14 07:13:15 +00:00
Enrico Granata
77e57c99c4 Enable the runtime to discover protocol conformances for types wrapped from ObjC
The strategy we are using is to obtain the class name from the ObjC runtime (as apparently nominal type descriptor for ObjC-wrapped types do not contain a useful name string) and then crafting the appropriate mangled name for the witness
Also, make AppKit another source of conformances. We currently have custom conformances for Reflectable that we are in Foundation (NSURL) and AppKit (NSView) - if more modules need to have custom mirrors, we might end up having to expand the list



Swift SVN r16280
2014-04-13 17:11:54 +00:00
John McCall
862d50ac1c Change the layout of opaque existentials so that
the value buffer comes first.

The motivation for doing this is similar to the
motivation for moving it for class existentials:
it eliminates the need for an offset for the most
common accesses, which is particularly important
for the generic value witnesses.

Also try to hard-code that layout in fewer places,
or at least static_assert the places that have to
do so.

Swift SVN r16279
2014-04-13 07:43:08 +00:00
Doug Gregor
8d4964bc98 Turn on namespacing of Objective-C class names.
The actual logic to do this is simple; the vast majority of this
commit is just a pile of changes to test cases to reflect the fact
that Objective-C metadata now includes the module name for each class
and the mangling of Swift-defined @objc classes no longer goes into
the "So" namespace for Objective-C classes. Finishes
<rdar://problem/15506580>.


Swift SVN r16274
2014-04-13 04:48:53 +00:00
John McCall
46d35ed288 Change the layout of class existentials to put the instance
pointer first.

This most important effect of this is that accesses to that
field don't need to be dynamically offsetted past an arbitrary
number of value witnesses, which is pretty nice for the
generic value witnesses.

Swift SVN r16243
2014-04-12 02:13:16 +00:00
Joe Groff
d1121a3d86 Reflection: Blacklist NSURL from default mirror functionality.
Its layout information in the ObjC runtime is a complete lie, so we crash if we try to use it to introspect the object. Fixes <rdar://problem/16592777>.

Swift SVN r16228
2014-04-11 21:05:34 +00:00
John McCall
78506ba43e Introduce infrastructure for emitting value witness
tables for non-constant-sized types, and use it for
the existential witness tables.  NFC.

Swift SVN r16199
2014-04-11 05:22:05 +00:00
Joe Groff
f57de31a04 Reflection: Quell some build warnings.
Swift SVN r16172
2014-04-10 22:35:35 +00:00
John McCall
85a6cc1309 Make it really easy to generate value witness tables
from C++ types and aggregates thereof.

Swift SVN r16139
2014-04-10 00:01:34 +00:00
Dave Zarzycki
3e4f388b1f Runtime: allow realloc
Nothing should call this. We'll eventually log a warning. For now, this
silences a build warning.

Swift SVN r16061
2014-04-08 17:54:01 +00:00
Dave Zarzycki
2e76e91466 Runtime: corner case heap policy tweak
Only the compiler calls this API and the compiler never needs
placeholder heap allocations.

Swift SVN r16060
2014-04-08 17:54:00 +00:00
Doug Gregor
c2f0f26ed5 Make Int, Double, and String bridge to Objective-C.
Make these three types conform to the BridgedToObjectiveC
protocol, which is needed for array bridging. This is one part of
<rdar://problem/16533359>.

Because this must happen in the Foundation module, hack
swift_conformsToProtocol to look in the Foundation module for
conformances when it can't find them in the module corresponding to
the type. This is an egregious hack to an egregious hack, but it gets
us closer.


Swift SVN r15997
2014-04-06 04:29:55 +00:00
Joe Groff
3455688cd1 Reflection: Resize our stub Array type.
The new Array is one word, not three. Fixes <rdar://problem/16533371>.

Swift SVN r15993
2014-04-06 01:36:16 +00:00
Joe Groff
18f6e950a6 Reflection: Look through existential containers.
When we reflect an existential container, reflect the contained value as its dynamic type. Implements <rdar://problem/16427022>.

Swift SVN r15952
2014-04-04 20:16:47 +00:00
Jordan Rose
65f82d5cc6 Update existing block shims for UncheckedOptional.
These are both past mistakes from me. One is a case of me missing the
OBJCPTR macro (which adds the UncheckedOptional bit); the other is a case
of including it when the block is actually written in Swift (and thus uses
a non-optional string).

<rdar://problem/16519094&16513659>

Swift SVN r15915
2014-04-04 01:33:32 +00:00
Adrian Prantl
af7198811c silence warnings.
Swift SVN r15839
2014-04-02 22:54:34 +00:00