Skip to content

Commit a3364b9

Browse files
---
yaml --- r: 285623 b: refs/heads/master c: 4cb6c71 h: refs/heads/master i: 285621: 3ce6851 285619: 3d0c3ab 285615: 0219f8e
1 parent 670327f commit a3364b9

File tree

57 files changed

+1365
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1365
-558
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 0ebdce93e7043278398e07ce557476ded1805d51
2+
refs/heads/master: 4cb6c71adfaf1b53321319376bb9bbb44ef74d24
33
refs/heads/master-next: 90f691eef4aee378af27084030679214a1a39d50
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/benchmark/scripts/compare_perf_tests.py

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,6 @@ def __init__(self, comparator, changes_only,
547547
self.changes_only = changes_only
548548
self.single_table = single_table
549549

550-
MARKDOWN_DETAIL = """
551-
<details {3}>
552-
<summary>{0} ({1})</summary>
553-
{2}
554-
</details>
555-
"""
556-
GIT_DETAIL = """
557-
{0} ({1}): {2}"""
558-
559550
PERFORMANCE_TEST_RESULT_HEADER = ('TEST', 'MIN', 'MAX', 'MEAN', 'MAX_RSS')
560551
RESULT_COMPARISON_HEADER = ('TEST', 'OLD', 'NEW', 'DELTA', 'RATIO')
561552

@@ -589,16 +580,26 @@ def values(result):
589580
def markdown(self):
590581
"""Report results of benchmark comparisons in Markdown format."""
591582
return self._formatted_text(
592-
ROW='{0} | {1} | {2} | {3} | {4} \n',
593-
HEADER_SEPARATOR='---',
594-
DETAIL=self.MARKDOWN_DETAIL)
583+
label_formatter=lambda s: ('**' + s + '**'),
584+
COLUMN_SEPARATOR=' | ',
585+
DELIMITER_ROW=([':---'] + ['---:'] * 4),
586+
SEPARATOR='&nbsp; | | | | \n',
587+
SECTION="""
588+
<details {3}>
589+
<summary>{0} ({1})</summary>
590+
{2}
591+
</details>
592+
""")
595593

596594
def git(self):
597595
"""Report results of benchmark comparisons in 'git' format."""
598596
return self._formatted_text(
599-
ROW='{0} {1} {2} {3} {4} \n',
600-
HEADER_SEPARATOR=' ',
601-
DETAIL=self.GIT_DETAIL)
597+
label_formatter=lambda s: s.upper(),
598+
COLUMN_SEPARATOR=' ',
599+
DELIMITER_ROW=None,
600+
SEPARATOR='\n',
601+
SECTION="""
602+
{0} ({1}): \n{2}""")
602603

603604
def _column_widths(self):
604605
changed = self.comparator.decreased + self.comparator.increased
@@ -614,53 +615,49 @@ def _column_widths(self):
614615
]
615616

616617
def max_widths(maximum, widths):
617-
return tuple(map(max, zip(maximum, widths)))
618+
return map(max, zip(maximum, widths))
618619

619-
return reduce(max_widths, widths, tuple([0] * 5))
620+
return reduce(max_widths, widths, [0] * 5)
620621

621-
def _formatted_text(self, ROW, HEADER_SEPARATOR, DETAIL):
622+
def _formatted_text(self, label_formatter, COLUMN_SEPARATOR,
623+
DELIMITER_ROW, SEPARATOR, SECTION):
622624
widths = self._column_widths()
623625
self.header_printed = False
624626

625627
def justify_columns(contents):
626-
return tuple([c.ljust(w) for w, c in zip(widths, contents)])
628+
return [c.ljust(w) for w, c in zip(widths, contents)]
627629

628630
def row(contents):
629-
return ROW.format(*justify_columns(contents))
630-
631-
def header(header):
632-
return '\n' + row(header) + row(tuple([HEADER_SEPARATOR] * 5))
633-
634-
def format_columns(r, strong):
635-
return (r if not strong else
636-
r[:-1] + ('**{0}**'.format(r[-1]), ))
631+
return ('' if not contents else
632+
COLUMN_SEPARATOR.join(justify_columns(contents)) + '\n')
633+
634+
def header(title, column_labels):
635+
labels = (column_labels if not self.single_table else
636+
map(label_formatter, (title, ) + column_labels[1:]))
637+
h = (('' if not self.header_printed else SEPARATOR) +
638+
row(labels) +
639+
(row(DELIMITER_ROW) if not self.header_printed else ''))
640+
if self.single_table and not self.header_printed:
641+
self.header_printed = True
642+
return h
643+
644+
def format_columns(r, is_strong):
645+
return (r if not is_strong else
646+
r[:-1] + ('**' + r[-1] + '**', ))
637647

638648
def table(title, results, is_strong=False, is_open=False):
639-
rows = [
640-
row(format_columns(ReportFormatter.values(r), is_strong))
641-
for r in results
642-
]
643-
if not rows:
649+
if not results:
644650
return ''
645-
646-
if self.single_table:
647-
t = ''
648-
if not self.header_printed:
649-
t += header(ReportFormatter.header_for(results[0]))
650-
self.header_printed = True
651-
t += row(('**' + title + '**', '', '', '', ''))
652-
t += ''.join(rows)
653-
return t
654-
655-
return DETAIL.format(
656-
*[
657-
title, len(results),
658-
(header(ReportFormatter.header_for(results[0])) +
659-
''.join(rows)),
660-
('open' if is_open else '')
661-
])
662-
663-
return ''.join([
651+
rows = [row(format_columns(ReportFormatter.values(r), is_strong))
652+
for r in results]
653+
table = (header(title if self.single_table else '',
654+
ReportFormatter.header_for(results[0])) +
655+
''.join(rows))
656+
return (table if self.single_table else
657+
SECTION.format(
658+
title, len(results), table, 'open' if is_open else ''))
659+
660+
return '\n' + ''.join([
664661
table('Regression', self.comparator.decreased, True, True),
665662
table('Improvement', self.comparator.increased, True),
666663
('' if self.changes_only else

trunk/benchmark/scripts/run_smoke_bench

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def main():
8888
help='In addition to stdout, write the results into a markdown file')
8989
argparser.add_argument(
9090
'-threshold', type=float,
91-
help='The performance threshold in % which triggers a re-run',
91+
help='The performance threshold in %% which triggers a re-run',
9292
default=5)
9393
argparser.add_argument(
9494
'-num-samples', type=int,

trunk/benchmark/scripts/test_compare_perf_tests.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ def test_column_headers(self):
759759
)
760760
self.assert_markdown_contains([
761761
'TEST | OLD | NEW | DELTA | RATIO',
762-
'--- | --- | --- | --- | --- ',
762+
':--- | ---: | ---: | ---: | ---: ',
763763
'TEST | MIN | MAX | MEAN | MAX_RSS'])
764764
self.assert_git_contains([
765765
'TEST OLD NEW DELTA RATIO',
@@ -855,6 +855,36 @@ def test_report_only_changes(self):
855855
self.assertNotIn('No Changes', html)
856856
self.assertNotIn('AngryPhonebook', html)
857857

858+
def test_single_table_report(self):
859+
"""Single table report has inline headers and no elaborate sections."""
860+
self.tc.removed = [] # test handling empty section
861+
rf = ReportFormatter(self.tc, changes_only=True, single_table=True)
862+
markdown = rf.markdown()
863+
self.assertNotIn('<details', markdown) # no sections
864+
self.assertNotIn('\n\n', markdown) # table must not be broken
865+
self.assertNotIn('Removed', markdown)
866+
self.assert_report_contains([
867+
'\n**Regression** ',
868+
'| **OLD**', '| **NEW**', '| **DELTA**', '| **RATIO**',
869+
'\n**Added** ',
870+
'| **MIN**', '| **MAX**', '| **MEAN**', '| **MAX_RSS**'
871+
], markdown)
872+
# Single delimiter row:
873+
self.assertIn('\n:---', markdown) # first column is left aligned
874+
self.assertEqual(markdown.count('| ---:'), 4) # other, right aligned
875+
# Separator before every inline header (new section):
876+
self.assertEqual(markdown.count('&nbsp; | | | | '), 2)
877+
878+
git = rf.git()
879+
self.assertNotIn('): \n', git) # no sections
880+
self.assertNotIn('REMOVED', git)
881+
self.assert_report_contains([
882+
'\nREGRESSION ', ' OLD ', ' NEW ', ' DELTA ', ' RATIO ',
883+
'\n\nADDED ', ' MIN ', ' MAX ', ' MEAN ', ' MAX_RSS '
884+
], git)
885+
# Separator before every inline header (new section):
886+
self.assertEqual(git.count('\n\n'), 2)
887+
858888

859889
class Test_parse_args(unittest.TestCase):
860890
required = ['--old-file', 'old.log', '--new-file', 'new.log']

trunk/include/swift/ABI/Metadata.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,10 +3121,6 @@ struct MetadataCompletionContext {
31213121
/// it may be called many times as successive dependencies are resolved.
31223122
/// If the function ever completes successfully (by returning null), it
31233123
/// will not be called again for the same type.
3124-
///
3125-
/// \return null to indicate that the type has been completed, or a non-null
3126-
/// pointer to indicate that completion is blocked on the completion of
3127-
/// some other type
31283124
using MetadataCompleter =
31293125
SWIFT_CC(swift)
31303126
MetadataDependency(const Metadata *type,

trunk/include/swift/AST/DiagnosticsParse.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ ERROR(extra_tokens_conditional_compilation_directive,none,
6868
"extra tokens following conditional compilation directive", ())
6969
ERROR(unexpected_rbrace_in_conditional_compilation_block,none,
7070
"unexpected '}' in conditional compilation block", ())
71+
ERROR(unexpected_if_following_else_compilation_directive,none,
72+
"unexpected 'if' keyword following '#else' conditional compilation "
73+
"directive; did you mean '#elseif'?",
74+
())
7175

7276
ERROR(pound_diagnostic_expected_string,none,
7377
"expected string literal in %select{#warning|#error}0 directive",(bool))

trunk/include/swift/IDE/DigesterEnums.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ KEY_BOOL(HasDidset, hasDidset)
135135
KEY_BOOL(HasWillset, hasWillset)
136136
KEY_BOOL(ReqNewWitnessTableEntry, reqNewWitnessTableEntry)
137137
KEY_BOOL(IsABIPlaceholder, isABIPlaceholder)
138+
KEY_BOOL(IsExternal, isExternal)
138139

139140
KEY(kind)
140141

@@ -148,6 +149,11 @@ KEY_STRING(EnumRawTypeName, enumRawTypeName)
148149
KEY_STRING(GenericSig, genericSig)
149150
KEY_STRING(FuncSelfKind, funcSelfKind)
150151
KEY_STRING(ParamValueOwnership, paramValueOwnership)
152+
KEY_STRING(IntromacOS, intro_Macosx)
153+
KEY_STRING(IntroiOS, intro_iOS)
154+
KEY_STRING(IntrotvOS, intro_tvOS)
155+
KEY_STRING(IntrowatchOS, intro_watchOS)
156+
KEY_STRING(Introswift, intro_swift)
151157

152158
KEY_STRING_ARR(SuperclassNames, superclassNames)
153159

trunk/include/swift/Runtime/Metadata.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ const
271271

272272
/// True if two context descriptors in the currently running program describe
273273
/// the same context.
274-
SWIFT_RUNTIME_EXPORT
275274
bool equalContexts(const ContextDescriptor *a, const ContextDescriptor *b);
276275

277276
/// Compute the bounds of class metadata with a resilient superclass.

trunk/lib/IRGen/GenDecl.cpp

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,25 @@ static std::string getDynamicReplacementSection(IRGenModule &IGM) {
13161316
return sectionName;
13171317
}
13181318

1319+
static std::string getDynamicReplacementSomeSection(IRGenModule &IGM) {
1320+
std::string sectionName;
1321+
switch (IGM.TargetInfo.OutputObjectFormat) {
1322+
case llvm::Triple::UnknownObjectFormat:
1323+
llvm_unreachable("Don't know how to emit field records table for "
1324+
"the selected object format.");
1325+
case llvm::Triple::MachO:
1326+
sectionName = "__TEXT, __swift5_replac2, regular, no_dead_strip";
1327+
break;
1328+
case llvm::Triple::ELF:
1329+
case llvm::Triple::Wasm:
1330+
sectionName = "swift5_replac2";
1331+
break;
1332+
case llvm::Triple::COFF:
1333+
sectionName = ".sw5reps$B";
1334+
break;
1335+
}
1336+
return sectionName;
1337+
}
13191338
llvm::GlobalVariable *IRGenModule::getGlobalForDynamicallyReplaceableThunk(
13201339
LinkEntity &entity, llvm::Type *type, ForDefinition_t forDefinition) {
13211340
return cast<llvm::GlobalVariable>(
@@ -1469,6 +1488,41 @@ void IRGenerator::emitDynamicReplacements() {
14691488
/*isConstant*/ true, llvm::GlobalValue::PrivateLinkage);
14701489
autoReplVar->setSection(getDynamicReplacementSection(IGM));
14711490
IGM.addUsedGlobal(autoReplVar);
1491+
1492+
if (origFuncTypes.empty())
1493+
return;
1494+
// Emit records for replacing opaque type descriptor for some types.
1495+
// struct AutomaticReplacementsSome {
1496+
// uint32t flags; // unused
1497+
// uint32t numReplacements;
1498+
// struct Entry {
1499+
// RelativeIndirectablePointer<OpaqueTypeDescriptor*> orig;
1500+
// RelativeDirectPointer<OpaqueTypeDescriptor*> replacement;
1501+
// uint32_t flags; // unused.
1502+
// }[numEntries]
1503+
// };
1504+
auto autoReplacementsSome = builder.beginStruct();
1505+
autoReplacementsSome.addInt32(0); // unused flags.
1506+
autoReplacementsSome.addInt32(
1507+
origFuncTypes.size()); // number of replacement entries.
1508+
auto someReplacementsArray = autoReplacementsSome.beginArray();
1509+
for (auto i : indices(origFuncTypes)) {
1510+
auto origDesc =
1511+
LinkEntity::forOpaqueTypeDescriptor(origFuncTypes[i]->getDecl());
1512+
auto replDesc =
1513+
LinkEntity::forOpaqueTypeDescriptor(newFuncTypes[i]->getDecl());
1514+
auto replacement = someReplacementsArray.beginStruct();
1515+
replacement.addRelativeAddress(
1516+
IGM.getAddrOfLLVMVariableOrGOTEquivalent(origDesc));
1517+
replacement.addRelativeAddress(
1518+
IGM.getAddrOfLLVMVariableOrGOTEquivalent(replDesc));
1519+
replacement.finishAndAddTo(someReplacementsArray);
1520+
}
1521+
someReplacementsArray.finishAndAddTo(autoReplacementsSome);
1522+
auto autoReplVar2 = autoReplacementsSome.finishAndCreateGlobal(
1523+
"\x01l_auto_dynamic_replacements_some", IGM.getPointerAlignment(),
1524+
/*isConstant*/ true, llvm::GlobalValue::PrivateLinkage);
1525+
autoReplVar2->setSection(getDynamicReplacementSomeSection(IGM));
14721526
}
14731527

14741528
void IRGenerator::emitEagerClassInitialization() {

0 commit comments

Comments
 (0)