Skip to content

Commit 8446cfe

Browse files
committed
Merge remote-tracking branch 'origin/master' into release
2 parents 752b668 + 5d92a64 commit 8446cfe

File tree

4 files changed

+52
-286
lines changed

4 files changed

+52
-286
lines changed

NOTICE

Lines changed: 13 additions & 251 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
Copyright (c) 2017-2019 AssemblyScript authors.
2-
31
The following authors have all licensed their contributions to AssemblyScript
42
under the licensing terms detailed in LICENSE:
53

@@ -27,261 +25,25 @@ the following terms:
2725

2826
* TypeScript: https://github.com/Microsoft/TypeScript
2927

30-
Copyright (c) Microsoft Corporation. All rights reserved.
31-
Apache License, Version 2.0 (see LICENSE file)
28+
Copyright (c) Microsoft Corporation
29+
Apache License, Version 2.0 (https://opensource.org/licenses/Apache-2.0)
3230

3331
* Binaryen: https://github.com/WebAssembly/binaryen
3432

35-
Copyright 2015 WebAssembly Community Group participants
36-
Apache License, Version 2.0 (see LICENSE file)
37-
38-
* Arm Optimized Routines: https://github.com/ARM-software/optimized-routines
39-
40-
----------------------------------------------------------------------
41-
MIT License
42-
43-
Copyright (c) 1999-2019, Arm Limited.
44-
45-
Permission is hereby granted, free of charge, to any person obtaining a copy
46-
of this software and associated documentation files (the "Software"), to deal
47-
in the Software without restriction, including without limitation the rights
48-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
49-
copies of the Software, and to permit persons to whom the Software is
50-
furnished to do so, subject to the following conditions:
51-
52-
The above copyright notice and this permission notice shall be included in all
53-
copies or substantial portions of the Software.
54-
55-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
58-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
59-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
60-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
61-
SOFTWARE.
62-
63-
* musl: http://www.musl-libc.org
64-
65-
musl as a whole is licensed under the following standard MIT license:
66-
67-
----------------------------------------------------------------------
68-
Copyright © 2005-2014 Rich Felker, et al.
69-
70-
Permission is hereby granted, free of charge, to any person obtaining
71-
a copy of this software and associated documentation files (the
72-
"Software"), to deal in the Software without restriction, including
73-
without limitation the rights to use, copy, modify, merge, publish,
74-
distribute, sublicense, and/or sell copies of the Software, and to
75-
permit persons to whom the Software is furnished to do so, subject to
76-
the following conditions:
77-
78-
The above copyright notice and this permission notice shall be
79-
included in all copies or substantial portions of the Software.
80-
81-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
82-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
83-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
84-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
85-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
86-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
87-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88-
----------------------------------------------------------------------
89-
90-
Authors/contributors include:
91-
92-
Alex Dowad
93-
Alexander Monakov
94-
Anthony G. Basile
95-
Arvid Picciani
96-
Bobby Bingham
97-
Boris Brezillon
98-
Brent Cook
99-
Chris Spiegel
100-
Clément Vasseur
101-
Daniel Micay
102-
Denys Vlasenko
103-
Emil Renner Berthing
104-
Felix Fietkau
105-
Felix Janda
106-
Gianluca Anzolin
107-
Hauke Mehrtens
108-
Hiltjo Posthuma
109-
Isaac Dunham
110-
Jaydeep Patil
111-
Jens Gustedt
112-
Jeremy Huntwork
113-
Jo-Philipp Wich
114-
Joakim Sindholt
115-
John Spencer
116-
Josiah Worcester
117-
Justin Cormack
118-
Khem Raj
119-
Kylie McClain
120-
Luca Barbato
121-
Luka Perkov
122-
M Farkas-Dyck (Strake)
123-
Mahesh Bodapati
124-
Michael Forney
125-
Natanael Copa
126-
Nicholas J. Kain
127-
orc
128-
Pascal Cuoq
129-
Petr Hosek
130-
Pierre Carrier
131-
Rich Felker
132-
Richard Pennington
133-
Shiz
134-
sin
135-
Solar Designer
136-
Stefan Kristiansson
137-
Szabolcs Nagy
138-
Timo Teräs
139-
Trutz Behn
140-
Valentin Ochs
141-
William Haddon
142-
143-
Portions of this software are derived from third-party works licensed
144-
under terms compatible with the above MIT license:
145-
146-
The TRE regular expression implementation (src/regex/reg* and
147-
src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
148-
under a 2-clause BSD license (license text in the source files). The
149-
included version has been heavily modified by Rich Felker in 2012, in
150-
the interests of size, simplicity, and namespace cleanliness.
151-
152-
Much of the math library code (src/math/* and src/complex/*) is
153-
Copyright © 1993,2004 Sun Microsystems or
154-
Copyright © 2003-2011 David Schultz or
155-
Copyright © 2003-2009 Steven G. Kargl or
156-
Copyright © 2003-2009 Bruce D. Evans or
157-
Copyright © 2008 Stephen L. Moshier
158-
and labelled as such in comments in the individual source files. All
159-
have been licensed under extremely permissive terms.
160-
161-
The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008
162-
The Android Open Source Project and is licensed under a two-clause BSD
163-
license. It was taken from Bionic libc, used on Android.
33+
Copyright (c) WebAssembly Community Group participants
34+
Apache License, Version 2.0 (https://opensource.org/licenses/Apache-2.0)
16435

165-
The implementation of DES for crypt (src/crypt/crypt_des.c) is
166-
Copyright © 1994 David Burren. It is licensed under a BSD license.
36+
* musl libc: http://www.musl-libc.org
16737

168-
The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
169-
originally written by Solar Designer and placed into the public
170-
domain. The code also comes with a fallback permissive license for use
171-
in jurisdictions that may not recognize the public domain.
172-
173-
The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
174-
Valentin Ochs and is licensed under an MIT-style license.
175-
176-
The BSD PRNG implementation (src/prng/random.c) and XSI search API
177-
(src/search/*.c) functions are Copyright © 2011 Szabolcs Nagy and
178-
licensed under following terms: "Permission to use, copy, modify,
179-
and/or distribute this code for any purpose with or without fee is
180-
hereby granted. There is no warranty."
181-
182-
The x86_64 port was written by Nicholas J. Kain and is licensed under
183-
the standard MIT terms.
184-
185-
The mips and microblaze ports were originally written by Richard
186-
Pennington for use in the ellcc project. The original code was adapted
187-
by Rich Felker for build system and code conventions during upstream
188-
integration. It is licensed under the standard MIT terms.
189-
190-
The mips64 port was contributed by Imagination Technologies and is
191-
licensed under the standard MIT terms.
192-
193-
The powerpc port was also originally written by Richard Pennington,
194-
and later supplemented and integrated by John Spencer. It is licensed
195-
under the standard MIT terms.
196-
197-
All other files which have no copyright comments are original works
198-
produced specifically for use as part of this library, written either
199-
by Rich Felker, the main author of the library, or by one or more
200-
contibutors listed above. Details on authorship of individual files
201-
can be found in the git version control history of the project. The
202-
omission of copyright and license comments in each file is in the
203-
interest of source tree size.
204-
205-
In addition, permission is hereby granted for all public header files
206-
(include/* and arch/*/bits/*) and crt files intended to be linked into
207-
applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
208-
the copyright notice and permission notice otherwise required by the
209-
license, and to use these files without any requirement of
210-
attribution. These files include substantial contributions from:
211-
212-
Bobby Bingham
213-
John Spencer
214-
Nicholas J. Kain
215-
Rich Felker
216-
Richard Pennington
217-
Stefan Kristiansson
218-
Szabolcs Nagy
219-
220-
all of whom have explicitly granted such permission.
221-
222-
This file previously contained text expressing a belief that most of
223-
the files covered by the above exception were sufficiently trivial not
224-
to be subject to copyright, resulting in confusion over whether it
225-
negated the permissions granted in the license. In the spirit of
226-
permissive licensing, and of not having licensing issues being an
227-
obstacle to adoption, that text has been removed.
38+
Copyright (c) Rich Felker, et al.
39+
The MIT License (https://opensource.org/licenses/MIT)
22840

22941
* V8: https://developers.google.com/v8/
23042

231-
This license applies to all parts of V8 that are not externally
232-
maintained libraries. The externally maintained libraries used by V8
233-
are:
234-
235-
- PCRE test suite, located in
236-
test/mjsunit/third_party/regexp-pcre/regexp-pcre.js. This is based on the
237-
test suite from PCRE-7.3, which is copyrighted by the University
238-
of Cambridge and Google, Inc. The copyright notice and license
239-
are embedded in regexp-pcre.js.
240-
241-
- Layout tests, located in test/mjsunit/third_party/object-keys. These are
242-
based on layout tests from webkit.org which are copyrighted by
243-
Apple Computer, Inc. and released under a 3-clause BSD license.
244-
245-
- Strongtalk assembler, the basis of the files assembler-arm-inl.h,
246-
assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
247-
assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h,
248-
assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h,
249-
assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h.
250-
This code is copyrighted by Sun Microsystems Inc. and released
251-
under a 3-clause BSD license.
252-
253-
- Valgrind client API header, located at third_party/valgrind/valgrind.h
254-
This is release under the BSD license.
43+
Copyright (c) the V8 project authors
44+
The 3-Clause BSD License (https://opensource.org/licenses/BSD-3-Clause)
25545

256-
These libraries have their own licenses; we recommend you read them,
257-
as their terms may differ from the terms below.
258-
259-
Further license information can be found in LICENSE files located in
260-
sub-directories.
261-
262-
Copyright 2014, the V8 project authors. All rights reserved.
263-
Redistribution and use in source and binary forms, with or without
264-
modification, are permitted provided that the following conditions are
265-
met:
266-
267-
* Redistributions of source code must retain the above copyright
268-
notice, this list of conditions and the following disclaimer.
269-
* Redistributions in binary form must reproduce the above
270-
copyright notice, this list of conditions and the following
271-
disclaimer in the documentation and/or other materials provided
272-
with the distribution.
273-
* Neither the name of Google Inc. nor the names of its
274-
contributors may be used to endorse or promote products derived
275-
from this software without specific prior written permission.
276-
277-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
278-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
279-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
280-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
281-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
282-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
283-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
284-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
285-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
286-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
287-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46+
* Arm Optimized Routines: https://github.com/ARM-software/optimized-routines
47+
48+
Copyright (c) Arm Limited
49+
The MIT License (https://opensource.org/licenses/MIT)

src/compiler.ts

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6652,28 +6652,46 @@ export class Compiler extends DiagnosticEmitter {
66526652
): void {
66536653
// Differs from `performAutoreleases` in that concluding this flow also
66546654
// concludes all its parent flows, for example on a `return`.
6655-
var module = this.module;
66566655
if (flow.is(FlowFlags.INLINE_CONTEXT)) {
66576656
// Traverse to the top-most flow containing the inlined function's
66586657
// locals as scoped locals and release these instead of all the locals.
6658+
let current = flow;
66596659
let parent: Flow | null;
6660-
while (parent = flow.parent) flow = parent;
6661-
this.performAutoreleases(flow, stmts, /* finalize */ false);
6660+
while (parent = current.parent) current = parent;
6661+
let scopedLocals = current.scopedLocals;
6662+
if (scopedLocals) {
6663+
for (let local of scopedLocals.values()) {
6664+
this.maybeFinishAutorelease(local, flow, stmts);
6665+
}
6666+
}
66626667
} else {
66636668
for (let local of flow.parentFunction.localsByIndex) {
6664-
let localIndex = local.index;
6665-
if (flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) {
6666-
flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED);
6667-
stmts.push(
6668-
this.makeRelease(
6669-
module.local_get(localIndex, local.type.toNativeType())
6670-
)
6671-
);
6672-
}
6669+
this.maybeFinishAutorelease(local, flow, stmts);
66736670
}
66746671
}
66756672
}
66766673

6674+
/** Finishes a single autorelease of the specified local. */
6675+
private maybeFinishAutorelease(
6676+
/** Local to finish autoreleasing. */
6677+
local: Local,
6678+
/** Flow releasing its queued autoreleases. */
6679+
flow: Flow,
6680+
/** Array of statements to append the releases to. */
6681+
stmts: ExpressionRef[]
6682+
): void {
6683+
var localIndex = local.index;
6684+
var module = this.module;
6685+
if (~localIndex && flow.isAnyLocalFlag(localIndex, LocalFlags.ANY_RETAINED)) {
6686+
flow.unsetLocalFlag(localIndex, LocalFlags.ANY_RETAINED);
6687+
stmts.push(
6688+
this.makeRelease(
6689+
module.local_get(localIndex, local.type.toNativeType())
6690+
)
6691+
);
6692+
}
6693+
}
6694+
66776695
// </reference-counting>
66786696

66796697
/** Creates a direct call to the specified function. */

tests/compiler/std/typedarray.optimized.wat

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,20 +3383,16 @@
33833383
block $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0
33843384
local.get $0
33853385
call $~lib/rt/pure/__retain
3386-
local.tee $1
3387-
call $~lib/typedarray/Int64Array#get:length
33883386
local.tee $2
3387+
call $~lib/typedarray/Int64Array#get:length
3388+
local.tee $1
33893389
i32.const 1
33903390
i32.le_s
3391-
if
3392-
local.get $1
3393-
call $~lib/rt/pure/__release
3394-
br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0
3395-
end
3396-
local.get $1
3391+
br_if $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0
3392+
local.get $2
33973393
i32.load offset=4
33983394
local.set $0
3399-
local.get $2
3395+
local.get $1
34003396
i32.const 2
34013397
i32.eq
34023398
if
@@ -3421,24 +3417,22 @@
34213417
local.get $3
34223418
f64.store
34233419
end
3424-
local.get $1
3425-
call $~lib/rt/pure/__release
34263420
br $~lib/typedarray/SORT<~lib/typedarray/Float64Array,f64>|inlined.0
34273421
end
3428-
local.get $2
3422+
local.get $1
34293423
i32.const 256
34303424
i32.lt_s
34313425
if
34323426
local.get $0
3433-
local.get $2
3427+
local.get $1
34343428
call $~lib/util/sort/insertionSort<f64>
34353429
else
34363430
local.get $0
3437-
local.get $2
3431+
local.get $1
34383432
call $~lib/util/sort/weakHeapSort<f64>
34393433
end
34403434
end
3441-
local.get $1
3435+
local.get $2
34423436
)
34433437
(func $~lib/util/sort/COMPARATOR<f64>~anonymous|0 (; 57 ;) (param $0 f64) (param $1 f64) (result i32)
34443438
(local $2 i64)

0 commit comments

Comments
 (0)