mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
416
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aea5e52ca | ||
|
|
0736b7281e | ||
|
|
3fb541562b | ||
|
|
3e8a43adfb | ||
|
|
4828d630c8 | ||
|
|
a52736b7a4 | ||
|
|
163b45a5f7 | ||
|
|
20889ba677 | ||
|
|
81051c19f2 | ||
|
|
894439a587 | ||
|
|
9c5d5e7589 | ||
|
|
07e241e2b1 | ||
|
|
61c9ea652f | ||
|
|
e12df734e5 | ||
|
|
f3c1074b8b | ||
|
|
5b3ec0465c | ||
|
|
5197eff485 | ||
|
|
b71dfbe5bf | ||
|
|
54775ae1a1 | ||
|
|
cba302c309 | ||
|
|
ebcbcb5d6c | ||
|
|
ac73df99bd | ||
|
|
98c7aaaed3 | ||
|
|
797397d18e | ||
|
|
7b9b6217c3 | ||
|
|
32fa15d9b0 | ||
|
|
ffa2b975f0 | ||
|
|
2dbfa821bc | ||
|
|
7f04a3171f | ||
|
|
6a795f3474 | ||
|
|
d573fd2398 | ||
|
|
73148692c4 | ||
|
|
cd432233b6 | ||
|
|
8aa7e04577 | ||
|
|
363e181509 | ||
|
|
649261a954 | ||
|
|
c215e04d0d | ||
|
|
5eea16f92e | ||
|
|
870c8d6435 | ||
|
|
df5a4fd2cc | ||
|
|
e2f3c657d1 | ||
|
|
1e089c4c73 | ||
|
|
224c2402b6 | ||
|
|
ebdb8bd598 | ||
|
|
35837a869c | ||
|
|
4971f83ca0 | ||
|
|
185b672518 | ||
|
|
6b2f395ce4 | ||
|
|
311bb403fa | ||
|
|
5a353ecead | ||
|
|
1d22f02f3f | ||
|
|
0a9a60c2a8 | ||
|
|
da649d3804 | ||
|
|
81657d2a45 | ||
|
|
d62d823250 | ||
|
|
b92f21c9de | ||
|
|
5d9ba8a7f5 | ||
|
|
f861912761 | ||
|
|
78f1c62a9e | ||
|
|
3b0c5507b5 | ||
|
|
8c7fc6463d | ||
|
|
645085d014 | ||
|
|
ee4086a969 | ||
|
|
e4eba2857c | ||
|
|
422d70701a | ||
|
|
472e87825e | ||
|
|
a19a5709bc | ||
|
|
ef6cea997b | ||
|
|
88be7c96a7 | ||
|
|
74c3a8c112 | ||
|
|
856e68fd90 | ||
|
|
8eabc21395 | ||
|
|
a4d7c2655a | ||
|
|
ae72fc0da8 | ||
|
|
2122061e26 | ||
|
|
ffecdce498 | ||
|
|
f7c746f66c | ||
|
|
c00ad8fdf0 | ||
|
|
7a53a348d6 | ||
|
|
270274af4b | ||
|
|
3316901644 | ||
|
|
ac19ad3462 | ||
|
|
87d476e45d | ||
|
|
8d08cdd022 | ||
|
|
33ab4bee8e | ||
|
|
a2109761eb | ||
|
|
d53245a320 | ||
|
|
8c790fafba | ||
|
|
83c7cd8837 | ||
|
|
5555a9e8da | ||
|
|
725e5ee542 | ||
|
|
dbda238384 | ||
|
|
f4da527d13 | ||
|
|
68b3f88746 | ||
|
|
c7675455e5 | ||
|
|
97de966994 | ||
|
|
4b5ed2d045 | ||
|
|
f66121b743 | ||
|
|
65b4a3bd6f | ||
|
|
657e0eccdb | ||
|
|
de63c87ee8 | ||
|
|
913af938cd | ||
|
|
41ea134fc8 | ||
|
|
1a7e9406c3 | ||
|
|
36ca6b5233 | ||
|
|
de5361b208 | ||
|
|
68ebbeaf31 | ||
|
|
9b7ad4ac3c | ||
|
|
be7a096eda | ||
|
|
f0b605439a | ||
|
|
11545a3a39 | ||
|
|
eb3af332ab | ||
|
|
d3828c409d | ||
|
|
b385ef4cf4 | ||
|
|
07023561dc | ||
|
|
81b2c25fbf | ||
|
|
07815a88dd | ||
|
|
b258652e87 | ||
|
|
c96c4c2fbe | ||
|
|
913c0b93b0 | ||
|
|
b240d7c0b8 | ||
|
|
19e7b45e6a | ||
|
|
6129749f32 | ||
|
|
1e9d7e2d8d | ||
|
|
258623f1ca | ||
|
|
834a2895db | ||
|
|
fb8af09b10 | ||
|
|
ac26c355db | ||
|
|
555ad45798 | ||
|
|
40814fb083 | ||
|
|
e2ea562360 | ||
|
|
fc3a9636af | ||
|
|
dc767a4ad5 | ||
|
|
5b491ef732 | ||
|
|
5c2a908f2b | ||
|
|
b6b27662a0 | ||
|
|
6988ca987f | ||
|
|
8cb49add59 | ||
|
|
c8279c96a6 | ||
|
|
e4cae2b8f1 | ||
|
|
c67b250955 | ||
|
|
9e05bb7f51 | ||
|
|
9179cc9f6c | ||
|
|
1a3e0aa7c3 | ||
|
|
7919626c17 | ||
|
|
466b48f040 | ||
|
|
7b324f7cc4 | ||
|
|
03dd7dfe55 | ||
|
|
a669562921 | ||
|
|
95738e6bd1 | ||
|
|
959812631d | ||
|
|
771bd09733 | ||
|
|
711458f128 | ||
|
|
e61539e181 | ||
|
|
b835f803d7 | ||
|
|
e7de0a293e | ||
|
|
83e056e3af | ||
|
|
b1a6b65b0c | ||
|
|
702670dae2 | ||
|
|
9abe11df7e | ||
|
|
7373f9c6ef | ||
|
|
1520c89bc5 | ||
|
|
474016bfed | ||
|
|
69f6e89d46 | ||
|
|
db8d2847c3 | ||
|
|
e16d227349 | ||
|
|
6997df4666 | ||
|
|
f24df964dd | ||
|
|
982b07d69f | ||
|
|
4584a80c06 | ||
|
|
6d22ef9d36 | ||
|
|
ed53aa4997 | ||
|
|
f3cf39af02 | ||
|
|
44be4f3208 | ||
|
|
d1131caf35 | ||
|
|
b56c531e5c | ||
|
|
ab050ec219 | ||
|
|
52ab6d7469 | ||
|
|
2bcebde4e5 | ||
|
|
d7b5ca8cba | ||
|
|
c0743ce61c | ||
|
|
d80218ee0b | ||
|
|
bb248bba8f | ||
|
|
0504bb6ca4 | ||
|
|
257c04b1a7 | ||
|
|
f7be2a173e | ||
|
|
7adb1866be | ||
|
|
e522ebee4a | ||
|
|
b4664bede5 | ||
|
|
fbc561d17c | ||
|
|
e8f9d0f95a | ||
|
|
f06574fe5b | ||
|
|
e463e29e0a | ||
|
|
9334918613 | ||
|
|
195be47f2f | ||
|
|
457bb1f247 | ||
|
|
f5b438a51d | ||
|
|
9937117115 | ||
|
|
4ba996de38 | ||
|
|
ed6334ae35 | ||
|
|
c08a2cd9b3 | ||
|
|
e5f26d3004 | ||
|
|
c3733aa980 | ||
|
|
53c61e76ed | ||
|
|
5829e96050 | ||
|
|
5da1119d76 | ||
|
|
0a175bf1a4 | ||
|
|
088c7334ba | ||
|
|
c2c1b1fcfd | ||
|
|
38324a0f52 | ||
|
|
cd1a3ac098 | ||
|
|
4a7a7ab11b | ||
|
|
ea5801c624 | ||
|
|
baf743d89e | ||
|
|
58d7543806 | ||
|
|
f6b84806d7 | ||
|
|
51ebd81dd9 | ||
|
|
9483519cfc | ||
|
|
456b542599 | ||
|
|
520763b0a2 | ||
|
|
71cf5a9be9 | ||
|
|
5c4bba130e | ||
|
|
0ab2fad3a5 | ||
|
|
6119b81254 | ||
|
|
e5b91ab094 | ||
|
|
a9728748e7 | ||
|
|
f8834c4f48 | ||
|
|
34a82ac108 | ||
|
|
a5c28269b1 | ||
|
|
31df63b323 | ||
|
|
6d59bc1f3f | ||
|
|
5fd7dc5ada | ||
|
|
f0b2efd583 | ||
|
|
818b91cb22 | ||
|
|
571d48dba8 | ||
|
|
7788901473 | ||
|
|
4ff6ffbe36 | ||
|
|
28e122bcf5 | ||
|
|
e60232a944 | ||
|
|
11df64e4b8 | ||
|
|
30032bb8fb | ||
|
|
075ea9ac0d | ||
|
|
00d366568e | ||
|
|
870e79a0fd | ||
|
|
cad7a4e698 | ||
|
|
16a08b18be | ||
|
|
b3c23ed215 | ||
|
|
5f6b7974bf | ||
|
|
f66d6296f4 | ||
|
|
df4807294d | ||
|
|
8f38791659 | ||
|
|
d0ab558222 | ||
|
|
3a319110cb | ||
|
|
89263dce56 | ||
|
|
1470ae3076 | ||
|
|
5366c31ac9 | ||
|
|
32df99bd6f | ||
|
|
661565dba9 | ||
|
|
212281f2d3 | ||
|
|
8cb3df657a | ||
|
|
da6dc4eed5 | ||
|
|
afb6910759 | ||
|
|
0d2f3751f1 | ||
|
|
57bf6ae887 | ||
|
|
d709670672 | ||
|
|
e9e448624a | ||
|
|
dc919ec1d7 | ||
|
|
67722d400a | ||
|
|
1e5da6f858 | ||
|
|
c6f81f5b9a | ||
|
|
9fe6fe10ae | ||
|
|
d5fd43350d | ||
|
|
4e12849547 | ||
|
|
a52936ffde | ||
|
|
d644872f3b | ||
|
|
51ccea026b | ||
|
|
cdcff1c71f | ||
|
|
d02ae5061f | ||
|
|
0d8b04be59 | ||
|
|
f96ef184e3 | ||
|
|
0724f383bd | ||
|
|
c618aa1f93 | ||
|
|
a7d1363cc6 | ||
|
|
46a7ba89c5 | ||
|
|
176dc4d4ac | ||
|
|
e647c71760 | ||
|
|
77eaced11d | ||
|
|
1d2e52d593 | ||
|
|
639d7c0b7f | ||
|
|
f48b807c5b | ||
|
|
38f9f0879d | ||
|
|
00fb6eea39 | ||
|
|
2c02393df8 | ||
|
|
542db3c933 | ||
|
|
28c09a3cc2 | ||
|
|
5ad3531cd8 | ||
|
|
32e28e47e6 | ||
|
|
fff12b1908 | ||
|
|
9369390676 | ||
|
|
1f613a1653 | ||
|
|
810dc5158d | ||
|
|
ec4600822d | ||
|
|
9e0243cbbf | ||
|
|
edd26bd0f7 | ||
|
|
827aaeae7f | ||
|
|
ae8301741f | ||
|
|
199c2205b4 | ||
|
|
417697e53a | ||
|
|
e41a822945 | ||
|
|
24e89c4d94 | ||
|
|
8ed815e9a4 | ||
|
|
849cb942a3 | ||
|
|
1bb398b766 | ||
|
|
ddcba9afcf | ||
|
|
f757a0160c | ||
|
|
caa3147dcf | ||
|
|
4fbed4ee86 | ||
|
|
1e400ba4d5 | ||
|
|
340d67b758 | ||
|
|
52406c8ccb | ||
|
|
f2e9427a5c | ||
|
|
18c740db38 | ||
|
|
8e1e5b4097 | ||
|
|
9b4068798a | ||
|
|
422cb6cc96 | ||
|
|
d2c18ab72f | ||
|
|
a48d54b56c | ||
|
|
bec0751d5b | ||
|
|
50b08c4665 | ||
|
|
f7f9eda2db | ||
|
|
435cb2dd46 | ||
|
|
5d246500ef | ||
|
|
14837aa6c1 | ||
|
|
51d9b8154e | ||
|
|
fa5c7724ea | ||
|
|
643e1a7a03 | ||
|
|
6e2a247bf7 | ||
|
|
de22929eb0 | ||
|
|
1171cba17b | ||
|
|
6a7fb1c73d | ||
|
|
8522885699 | ||
|
|
806646dcc8 | ||
|
|
ae46d2413b | ||
|
|
ff409be5fe | ||
|
|
9585905fc7 | ||
|
|
68da0245b6 | ||
|
|
7bf6b8a543 | ||
|
|
24906dde22 | ||
|
|
bf9916e270 | ||
|
|
c6747a0d3f | ||
|
|
17a0cd07df | ||
|
|
d23c285914 | ||
|
|
c94c32d25f | ||
|
|
d14f7229de | ||
|
|
358364e296 | ||
|
|
3c3298c935 | ||
|
|
a8169657e5 | ||
|
|
2abcd8c550 | ||
|
|
0d8ab85503 | ||
|
|
cab3731f55 | ||
|
|
8ec3155df9 | ||
|
|
cbf8c48dd3 | ||
|
|
b1ecc84c40 | ||
|
|
397b7ac493 | ||
|
|
050260877b | ||
|
|
671301931a | ||
|
|
ee40dbd92b | ||
|
|
91edcf60a5 | ||
|
|
7202caa9d9 | ||
|
|
e5c93bb691 | ||
|
|
57accaa58c | ||
|
|
5ca532241d | ||
|
|
5295717ed2 | ||
|
|
e8c324e6a2 | ||
|
|
a0746ae6c5 | ||
|
|
8a5afbae36 | ||
|
|
bcffcd5b81 | ||
|
|
eabeb7d2e2 | ||
|
|
451614ec61 | ||
|
|
172ee433de | ||
|
|
4769716742 | ||
|
|
60e5bcc42d | ||
|
|
0fe9c3f5e7 | ||
|
|
ee2bdff675 | ||
|
|
ac504cc3db | ||
|
|
0d6bd08a90 | ||
|
|
e76f20efbb | ||
|
|
b8fbf2ec20 | ||
|
|
e8d49a8870 | ||
|
|
6635c94936 | ||
|
|
0e6e9da90b | ||
|
|
cf532c2e60 | ||
|
|
9a5238504a | ||
|
|
a0f9928e49 | ||
|
|
b64ac133b7 | ||
|
|
3534344b61 | ||
|
|
7ff7a966fb | ||
|
|
51436c31ee | ||
|
|
0c158dc33c | ||
|
|
b1bf3e9ff1 | ||
|
|
52a04a859c | ||
|
|
6f594e13f3 | ||
|
|
81a1f566ea | ||
|
|
0717dd85e9 | ||
|
|
d6da946bec | ||
|
|
931932d774 | ||
|
|
8a77f84436 | ||
|
|
e73d556bf7 | ||
|
|
e606120a95 | ||
|
|
eeec6e8904 | ||
|
|
628c8cbae0 | ||
|
|
e6ca6781e1 | ||
|
|
852bcf8213 | ||
|
|
0738b1b7fa | ||
|
|
c0c70fc306 | ||
|
|
cef2791818 |
No files matched your search
@@ -1,173 +1,25 @@
|
||||
2006-04-21 Alp Toker <alp@atoker.com>
|
||||
2006-04-25 Wade Berrier <wberrier@novell.com>
|
||||
|
||||
* scripts/mono-service.in: Usage info fixes:
|
||||
Lock file was referred to as .log instead of .lock. Fixes #75724.
|
||||
$0 was in single-quoted, so not interpreted.
|
||||
* scripts/mono-find-provides.in: Only scan files that are in the gac.
|
||||
This allows packages to contain private assemblies that won't conflict
|
||||
with other packages. Fixes bugzilla.novell.com #144655.
|
||||
|
||||
2006-04-13 Chris Toshok <[email protected]>
|
||||
2006-03-13 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: add system.data section listing the
|
||||
SqlClient provider. Also add system.web section listing the
|
||||
membership and role providers. This is here instead of in
|
||||
web.config because the providers are meant to be available to
|
||||
non-web applications as well.
|
||||
|
||||
2006-04-11 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/web.config: add the builtin expression builders.
|
||||
|
||||
2006-04-11 Gert Driesen <[email protected]>
|
||||
|
||||
* scripts/Makefile.am (scripts_2_0): Add 'resgen2'.
|
||||
|
||||
2006-04-07 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: oh, and
|
||||
system.web/anonymousIdentification.
|
||||
|
||||
2006-04-07 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: add system.web/membership and
|
||||
system.web/xhtmlConformance config sections.
|
||||
|
||||
2006-04-04 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Add a check and a helpful error message when 'ar' is not found on solaris.
|
||||
|
||||
2006-04-01 Zoltan Varga <[email protected]>
|
||||
|
||||
* data/mono.supp: Add "Use of uninitialized value of size 8" too.
|
||||
|
||||
2006-03-31 Massimiliano Mantione <[email protected]>
|
||||
|
||||
* docs/tree-mover.txt: Added tree mover documentation.
|
||||
|
||||
Wed, 29 Mar 2006 20:54:05 +0200 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in, mono/Makefile.am: remove the now unused handles dir
|
||||
from the build.
|
||||
|
||||
2006-03-22 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/web.config: add RoleManagerModule to httpModules.
|
||||
|
||||
* data/net_2_0/machine.config: add system.web/roleManager section
|
||||
handler.
|
||||
|
||||
2006-03-20 Zoltan Varga <[email protected]>
|
||||
|
||||
* libmono.vcproj: Add some newly added source files.
|
||||
|
||||
2006-03-17 Zoltan Varga <[email protected]>
|
||||
|
||||
* libmono.vcproj: Remove os/win32/util.h.
|
||||
|
||||
2006-03-09 Vladimir Krasnov <[email protected]>
|
||||
|
||||
* Added data/net_1_1/DefaultWsdlHelpGenerator.jvm.aspx
|
||||
with removed proxy class generation for Grasshopper
|
||||
|
||||
2006-03-08 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/web.config: add a default siteMap section with the
|
||||
AspNetXmlSiteMapProvider provider.
|
||||
|
||||
* data/net_2_0/machine.config: add system.web/siteMap section
|
||||
info.
|
||||
|
||||
2006-03-03 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in mono/os: Merge the contents of libmonoos to metadata/assembly.c and
|
||||
get rid of os/unix and os/win32.
|
||||
|
||||
Wed Mar 1 12:37:43 CET 2006 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in: added checks for visibility attribute,
|
||||
option to disable generics, disabled options string define.
|
||||
|
||||
2006-02-27 Raja R Harinath <[email protected]>
|
||||
|
||||
* configure.in (runtime/etc/mono/{1.0,2.0}/machine.config):
|
||||
Fix m4-quoting.
|
||||
|
||||
Sat Feb 25 11:53:30 CET 2006 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in: more feature for --enable-minimal flags.
|
||||
* data/net_2_0/machine.config: revert r55809, as this change
|
||||
introduces a 2.0 configuration class, which 1.1.13 doesn't
|
||||
support.
|
||||
|
||||
2006-02-24 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* configure.in: define PLATFORM_BSD.
|
||||
|
||||
2006-02-17 Zoltan Varga <[email protected]>
|
||||
|
||||
* Makefile.am: Avoid installing mint.pc if mint is not compiled.
|
||||
|
||||
2006-02-07 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/Makefile.am (EXTRA_DIST): add web.config
|
||||
(mono_DATA): same.
|
||||
|
||||
* data/net_2_0/machine.config: remove the system.web section from
|
||||
here.
|
||||
|
||||
* data/net_2_0/web.config: and add it here.
|
||||
|
||||
2006-02-02 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: Add FtpRequestCreator
|
||||
to create new instances of System.Net.FtpWebWebRequest.
|
||||
|
||||
2006-02-01 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* libmono.vcproj: Added new files to the VS.NET build.
|
||||
* README.vsnet: Updated VS.NET build instructions.
|
||||
|
||||
2006-01-26 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: ignore runtime and startup
|
||||
sections.
|
||||
|
||||
2006-01-25 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: ignore mscorlib,
|
||||
system.runtime.remoting, and strongNames sections.
|
||||
|
||||
2006-01-25 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: for system.web, add default
|
||||
<authorization> section that allows everything. also, add
|
||||
System.Configuration to system.web/compilation/assemblies.
|
||||
|
||||
2006-01-23 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: add System.Configuration to the
|
||||
list of assemblies in system.web/compilation.
|
||||
|
||||
2006-01-23 Martin Baulig <[email protected]>
|
||||
|
||||
* configure.in: Added configure check whether the Mono Debugger is
|
||||
supported on this platform; AC_DEFINE(MONO_DEBUGGER_SUPPORTED) and
|
||||
also added a `MONO_DEBUGGER_SUPPORTED' automake conditional.
|
||||
|
||||
2006-01-13 Raja R Harinath <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: Fix a couple of typos in type names.
|
||||
|
||||
2006-01-10 Raja R Harinath <[email protected]>
|
||||
|
||||
* scripts/Makefile.am (scripts_2_0): Add nunit-console2.
|
||||
|
||||
2006-01-09 Chris Toshok <[email protected]>
|
||||
|
||||
* data/net_2_0/machine.config: switch over to the 2.0
|
||||
configuration sections for System.Web and System.Web.Services.
|
||||
Also, add the configProtectedData stuff so we can encrypt config
|
||||
sections.
|
||||
|
||||
2006-01-08 Robert Jordan <[email protected]>
|
||||
|
||||
* man/mkbundle.1: Documented environment variables and Windows issues.
|
||||
|
||||
2006-01-06 Jonathan Pryor <[email protected]>
|
||||
|
||||
* data/config.in: s/libintl/intl/g. Mono.Unix.Catalog DllImports "intl"
|
||||
|
||||
@@ -20,12 +20,8 @@ dist-hook:
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
if JIT_SUPPORTED
|
||||
if INTERP_SUPPORTED
|
||||
pkgconfig_DATA= mono.pc mint.pc dotnet.pc mono-cairo.pc
|
||||
else
|
||||
pkgconfig_DATA= mono.pc dotnet.pc mono-cairo.pc
|
||||
endif
|
||||
else
|
||||
pkgconfig_DATA= mint.pc mono-cairo.pc
|
||||
endif
|
||||
noinst_DATA = mono-uninstalled.pc
|
||||
|
||||
@@ -25,11 +25,6 @@ This is Mono.
|
||||
|
||||
http://www.hpl.hp.com/research/linux/libunwind/download.php4
|
||||
|
||||
On Solaris, make sure that you used GNU tar to unpack this package, as
|
||||
Solaris tar will not unpack this correctly, and you will get strange errors.
|
||||
|
||||
On Solaris, make sure that you use the GNU toolchain to build the software.
|
||||
|
||||
Optional dependencies:
|
||||
|
||||
* libgdiplus
|
||||
@@ -47,8 +42,7 @@ This is Mono.
|
||||
make
|
||||
make install
|
||||
|
||||
Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390, AMD64, ARM
|
||||
and PowerPC systems.
|
||||
Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390, AMD64 and PowerPC systems.
|
||||
|
||||
If you obtained this as a snapshot, you will need an existing
|
||||
Mono installation. To upgrade your installation, unpack both
|
||||
@@ -93,11 +87,10 @@ This is Mono.
|
||||
|
||||
If you don't have a working Mono installation, an obvious choice
|
||||
is to install the latest released packages of 'mono' for your
|
||||
distribution and running autogen.sh; make; make install in the
|
||||
mono module directory.
|
||||
distribution and try from the beginning.
|
||||
|
||||
You can also try a slightly more risky approach: this may not work,
|
||||
so start from the released tarball as detailed above.
|
||||
You can also try a slightly more risky approach that should work
|
||||
almost all the time.
|
||||
|
||||
This works by first getting the latest version of the 'monolite'
|
||||
distribution, which contains just enough to run the 'mcs'
|
||||
@@ -175,7 +168,7 @@ This is Mono.
|
||||
metadata/
|
||||
The object system and metadata reader.
|
||||
|
||||
mini/
|
||||
jit/
|
||||
The Just in Time Compiler.
|
||||
|
||||
dis/
|
||||
@@ -193,7 +186,7 @@ This is Mono.
|
||||
definition of the CIL bytecodes.
|
||||
|
||||
interp/
|
||||
Interpreter for CLI executables (obsolete).
|
||||
Interpreter for CLI executables.
|
||||
|
||||
arch/
|
||||
Architecture specific portions.
|
||||
|
||||
+12
-21
@@ -1,8 +1,8 @@
|
||||
README.vsnet Last updated: 2006-02-01
|
||||
README.vsnet Last updated: 2005-05-26
|
||||
|
||||
|
||||
SVN includes a Visual Studio .NET 2005 solution, mono.sln, and some
|
||||
projects files to build most of the unmanaged parts in Mono.
|
||||
SVN now includes a Visual Studio .NET 2005 (beta2) solution, mono.sln,
|
||||
and some projects files to build most of the unmanaged parts in Mono.
|
||||
|
||||
The "mono.sln" solution file contains the VC projects files for:
|
||||
|
||||
@@ -30,12 +30,12 @@ REQUIREMENTS
|
||||
* build the class libraries; and
|
||||
* test for regressions.
|
||||
|
||||
* Visual Studio .NET 2005. Previous Visual Studio versions may work or
|
||||
requires, hopefully minimal, changes.
|
||||
* Visual Studio .NET 2005 beta2. Previous Visual Studio versions may
|
||||
work or requires, hopefully minimal, changes.
|
||||
|
||||
* VSDependencies.zip must be decompressed under the /mono/ directory
|
||||
(otherwise you will need to edit all the projects files). This file can
|
||||
be downloaded from http://www.go-mono.com/archive/VSDependencies.zip
|
||||
* VSDependencies.zip must be decompressed under /mono/ (otherwise you
|
||||
will need to edit all the projects files. This file can be downloaded
|
||||
from http://www.go-mono.com/archive/VSDependencies.zip
|
||||
|
||||
|
||||
LOCAL CHANGES
|
||||
@@ -85,11 +85,9 @@ requires a working cygwin environment to create some files (e.g. via
|
||||
genmdesc, monoburg). This isn't so bad as without cygwin you wouldn't be
|
||||
able to test Mono properly (see REQUIREMENTS);
|
||||
|
||||
[3] Only the Debug target is configured properly (that would be easy to
|
||||
fix, but would require turning off some optimizations like omitting
|
||||
stack frames). Anyway there are other issues [1] to fix before switching
|
||||
to Release and IMHO the _biggest_ advantage to VS.NET is it's debugger/
|
||||
debugging tools;
|
||||
[3] Only the Debug target is configured properly (easy to fix). Anyway
|
||||
there are other issues [1] to fix before switching to Release and IMHO
|
||||
the _biggest_ advantage to VS.NET is it's debugger/debugging tools;
|
||||
|
||||
[4] The C compiler emits _lots_ of warning during compilation. Some
|
||||
warnings have been turned off for some projects (there was so much that
|
||||
@@ -103,17 +101,10 @@ Platform SDK (Windows Server 2003 is the latest) to ensure you have the
|
||||
latest Windows header files. You can download it from:
|
||||
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
|
||||
|
||||
[6] Not everyone has VS.NET so it is possible you may have to add some
|
||||
(new) files to the build from time to time. See "more informations" for
|
||||
reporting those changes.
|
||||
|
||||
[7] Probably a lot more I didn't discover... or has changed since.
|
||||
[6] Probably a lot more I didn't discover...
|
||||
|
||||
|
||||
MORE INFORMATIONS
|
||||
|
||||
Please email <[email protected]> if you have any problem
|
||||
and/or if there's something wrong/missing in the instructions.
|
||||
|
||||
An online version of this file is available at
|
||||
http://www.mono-project.com/Mono:Windows
|
||||
+8
-62
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
|
||||
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,1.1.15)
|
||||
AM_INIT_AUTOMAKE(mono,1.1.13.8)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_PROG_LN_S
|
||||
@@ -497,22 +497,16 @@ if test "x$with_xen_opt" = "xyes"; then
|
||||
])
|
||||
fi
|
||||
|
||||
DISABLED_FEATURES=none
|
||||
|
||||
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
|
||||
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
|
||||
reflection_emit, large_code, logging, com, ssa, generics.],
|
||||
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, reflection_emit.],
|
||||
[
|
||||
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
|
||||
eval "mono_feature_disable_$feature='yes'"
|
||||
AC_MSG_NOTICE([Disabled support for feature: $feature])
|
||||
done
|
||||
DISABLED_FEATURES=$enable_minimal
|
||||
disabled="Disabled: $enable_minimal"
|
||||
],[])
|
||||
|
||||
AC_DEFINE_UNQUOTED(DISABLED_FEATURES, "$DISABLED_FEATURES", [String of disabled features])
|
||||
|
||||
if test "x$mono_feature_disable_aot" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_AOT, 1, [Disable AOT support])
|
||||
fi
|
||||
@@ -537,37 +531,6 @@ if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
|
||||
fi
|
||||
|
||||
if test "x$mono_feature_disable_large_code" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_LARGE_CODE, 1, [Disable support for huge assemblies])
|
||||
fi
|
||||
|
||||
if test "x$mono_feature_disable_logging" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_LOGGING, 1, [Disable support debug logging])
|
||||
fi
|
||||
|
||||
if test "x$mono_feature_disable_com" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_COM, 1, [Disable COM support])
|
||||
fi
|
||||
|
||||
if test "x$mono_feature_disable_ssa" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_SSA, 1, [Disable advanced SSA JIT optimizations])
|
||||
fi
|
||||
|
||||
if test "x$mono_feature_disable_generics" = "xyes"; then
|
||||
AC_DEFINE(DISABLE_GENERICS, 1, [Disable generics support])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for visibility __attribute__)
|
||||
AC_TRY_COMPILE([], [
|
||||
void __attribute__ ((visibility ("hidden"))) doit (void) {}
|
||||
void main () { doit (); }
|
||||
], [
|
||||
AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
LIBGC_CFLAGS=
|
||||
LIBGC_LIBS=
|
||||
LIBGC_STATIC_LIBS=
|
||||
@@ -593,9 +556,6 @@ case "x$gc" in
|
||||
AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
|
||||
if test "x$found_gcj_malloc" = "xyes"; then
|
||||
AC_DEFINE(HAVE_GC_GCJ_MALLOC)
|
||||
AC_DEFINE_UNQUOTED(USED_GC_NAME, "System Boehm (with typed GC)", [GC description])
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(USED_GC_NAME, "System Boehm (no typed GC)", [GC description])
|
||||
fi
|
||||
AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
|
||||
if test "x$found_gc_enable" = "xyes"; then
|
||||
@@ -624,23 +584,10 @@ case "x$gc" in
|
||||
# The included libgc contains GCJ support
|
||||
AC_DEFINE(HAVE_GC_GCJ_MALLOC)
|
||||
AC_DEFINE(HAVE_GC_ENABLE)
|
||||
AC_DEFINE_UNQUOTED(USED_GC_NAME, "Included Boehm (with typed GC)", [GC description])
|
||||
;;
|
||||
|
||||
dnl xsgen)
|
||||
dnl found_boehm=no
|
||||
dnl gc_headers=no
|
||||
dnl use_included_gc=no
|
||||
dnl AC_DEFINE(HAVE_SGEN_GC,1,[Using the simple generational GC.])
|
||||
dnl AC_DEFINE(HAVE_MOVING_COLLECTOR,1,[The GC can move objects.])
|
||||
dnl AC_DEFINE(HAVE_WRITE_BARRIERS,1,[The GC needs write barriers.])
|
||||
dnl AC_DEFINE_UNQUOTED(USED_GC_NAME, "Simple generational", [GC description])
|
||||
dnl ;;
|
||||
|
||||
xnone)
|
||||
AC_MSG_WARN("Compiling mono without GC.")
|
||||
AC_DEFINE_UNQUOTED(USED_GC_NAME, "none", [GC description])
|
||||
AC_DEFINE(HAVE_NULL_GC,1,[No GC support.])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Invalid argument to --with-gc.])
|
||||
@@ -1547,11 +1494,7 @@ case "$host" in
|
||||
esac
|
||||
jit_wanted=true
|
||||
if test x"$GCC" = xyes; then
|
||||
# We don't support v8 cpus
|
||||
CFLAGS="$CFLAGS -Wno-cast-align -mcpu=v9"
|
||||
fi
|
||||
if test x"$AR" = xfalse; then
|
||||
AC_MSG_ERROR([The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin.])
|
||||
CFLAGS="$CFLAGS -Wno-cast-align"
|
||||
fi
|
||||
;;
|
||||
alpha*-*-linux* | alpha*-*-osf*)
|
||||
@@ -1847,7 +1790,7 @@ AC_CONFIG_FILES([runtime/semdel-wrapper],[chmod +x runtime/semdel-wrapper])
|
||||
AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
|
||||
[ depth=../../../..
|
||||
case $srcdir in
|
||||
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
|
||||
[\\/$]* | ?:[\\/]* ) reldir=$srcdir ;;
|
||||
.) reldir=$depth ;;
|
||||
*) reldir=$depth/$srcdir ;;
|
||||
esac
|
||||
@@ -1861,7 +1804,7 @@ AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
|
||||
AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
|
||||
[ depth=../../../..
|
||||
case $srcdir in
|
||||
[[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
|
||||
[\\/$]* | ?:[\\/]* ) reldir=$srcdir ;;
|
||||
.) reldir=$depth ;;
|
||||
*) reldir=$depth/$srcdir ;;
|
||||
esac
|
||||
@@ -1889,6 +1832,8 @@ mono/dis/Makefile
|
||||
mono/cil/Makefile
|
||||
mono/arch/Makefile
|
||||
mono/os/Makefile
|
||||
mono/os/win32/Makefile
|
||||
mono/os/unix/Makefile
|
||||
mono/arch/x86/Makefile
|
||||
mono/arch/amd64/Makefile
|
||||
mono/arch/hppa/Makefile
|
||||
@@ -1907,6 +1852,7 @@ mono/monoburg/Makefile
|
||||
mono/monograph/Makefile
|
||||
mono/io-layer/Makefile
|
||||
mono/mini/Makefile
|
||||
mono/handles/Makefile
|
||||
mono/profiler/Makefile
|
||||
ikvm-native/Makefile
|
||||
scripts/Makefile
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ SUBDIRS = net_1_1 net_2_0
|
||||
monodir = $(sysconfdir)/mono
|
||||
|
||||
EXTRA_DIST = config.in \
|
||||
browscap.ini mono.supp README
|
||||
browscap.ini
|
||||
|
||||
mono_DATA = config \
|
||||
browscap.ini
|
||||
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
Files in this directory:
|
||||
|
||||
config.in, config:
|
||||
These files are installed into $prefix/etc/mono and
|
||||
contain the global mappings of dllnames into native
|
||||
library names.
|
||||
|
||||
browscap.ini
|
||||
This file contains the browser capabilty database,
|
||||
this is used by ASP.NET to determine in a per-browser
|
||||
basis what kind of features it can depend on when
|
||||
producing the HTML code.
|
||||
|
||||
mono.supp
|
||||
This is a valgrind data file, it lists the warnings
|
||||
that should be supressed when reporting Mono-related
|
||||
errors.
|
||||
|
||||
net_1_1 and net_2_0
|
||||
They contain profile-specific data files
|
||||
@@ -1,40 +0,0 @@
|
||||
##
|
||||
## mono-specific suppressions (Boehm-GC) for use with valgrind
|
||||
##
|
||||
|
||||
{
|
||||
mono - Conditional jump or move depends on uninitialised value
|
||||
Memcheck:Cond
|
||||
fun:GC_*
|
||||
fun:*
|
||||
obj:/usr/local/bin/mono
|
||||
}
|
||||
{
|
||||
mono - Use of uninitialized value of size 4
|
||||
Memcheck:Value4
|
||||
fun:GC_*
|
||||
fun:*
|
||||
obj:/usr/local/bin/mono
|
||||
}
|
||||
{
|
||||
mono - Use of uninitialized value of size 8
|
||||
Memcheck:Value8
|
||||
fun:GC_*
|
||||
fun:*
|
||||
obj:/usr/local/bin/mono
|
||||
}
|
||||
{
|
||||
mono - Use of uninitialized value of size 1
|
||||
Memcheck:Value1
|
||||
fun:GC_*
|
||||
fun:*
|
||||
obj:/usr/local/bin/mono
|
||||
}
|
||||
{
|
||||
mono - Invalid read of size 4
|
||||
Memcheck:Addr4
|
||||
fun:GC_*
|
||||
fun:*
|
||||
obj:/usr/local/bin/mono
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,10 +1,8 @@
|
||||
monodir = $(sysconfdir)/mono/2.0
|
||||
|
||||
EXTRA_DIST = machine.config \
|
||||
web.config \
|
||||
DefaultWsdlHelpGenerator.aspx
|
||||
DefaultWsdlHelpGenerator.aspx
|
||||
|
||||
mono_DATA = machine.config \
|
||||
web.config \
|
||||
DefaultWsdlHelpGenerator.aspx
|
||||
|
||||
+121
-64
@@ -3,49 +3,45 @@
|
||||
<configuration>
|
||||
|
||||
<configSections>
|
||||
<section name="configProtectedData" type="System.Configuration.ProtectedConfigurationSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="connectionStrings" type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="mscorlib" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="runtime" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="startup" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="system.codedom" type="System.CodeDom.Compiler.CodeDomConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="system.data" type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
|
||||
<section name="strongNames" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
|
||||
<sectionGroup name="system.web" type="System.Web.Configuration.SystemWebSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<section name="anonymousIdentification" type="System.Web.Configuration.AnonymousIdentificationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="authorization" type="System.Web.Configuration.AuthorizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="clientTarget" type="System.Web.Configuration.ClientTargetSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="compilation" type="System.Web.Configuration.CompilationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="customErrors" type="System.Web.Configuration.CustomErrorsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="globalization" type="System.Web.Configuration.GlobalizationSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="httpModules" type="System.Web.Configuration.HttpModulesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="httpRuntime" type="System.Web.Configuration.HttpRuntimeSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="machineKey" type="System.Web.Configuration.MachineKeySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="membership" type="System.Web.Configuration.MembershipSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="pages" type="System.Web.Configuration.PagesSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="profile" type="System.Web.Configuration.ProfileSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="roleManager" type="System.Web.Configuration.RoleManagerSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="sessionState" type="System.Web.Configuration.SessionStateSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="siteMap" type="System.Web.Configuration.SiteMapSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="trace" type="System.Web.Configuration.TraceSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="webControls" type="System.Web.Configuration.WebControlsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="webServices" type="System.Web.Services.Configuration.WebServicesSection, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="xhtmlConformance" type="System.Web.Services.Configuration.XhtmlConformanceSection, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<sectionGroup name="caching" type="System.Web.Configuration.SystemWebCachingSectionGroup, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<section name="cache" type="System.Web.Configuration.CacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="outputCache" type="System.Web.Configuration.OutputCacheSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="outputCacheSettings" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="sqlCacheDependency" type="System.Web.Configuration.OutputCacheSettingsSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</sectionGroup>
|
||||
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
|
||||
<section name="strongNames" type="System.Configuration.IgnoreSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
|
||||
<sectionGroup name="system.web">
|
||||
<section name="httpHandlers"
|
||||
type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="httpModules"
|
||||
type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="machineKey"
|
||||
type="System.Web.Configuration.MachineKeyConfigHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="authentication"
|
||||
type="System.Web.Configuration.AuthenticationConfigHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="authorization"
|
||||
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="globalization"
|
||||
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="sessionState"
|
||||
type="System.Web.SessionState.SessionStateSectionHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="trace"
|
||||
type="System.Web.Configuration.TraceConfigurationHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="webServices"
|
||||
type="System.Web.Services.Configuration.WebServicesConfigurationSectionHandler, System.Web.Services, Version=2.0.0.0 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="webControls"
|
||||
type="System.Web.Configuration.WebControlsSectionHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="compilation"
|
||||
type="System.Web.Configuration.CompilationConfigurationHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="httpRuntime"
|
||||
type="System.Web.Configuration.HttpRuntimeConfigurationHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="customErrors"
|
||||
type="System.Web.Configuration.CustomErrorsConfigHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<section name="pages"
|
||||
type="System.Web.Configuration.PagesConfigurationHandler, System.Web, Version=2.0.0.0, Culture=neutral" />
|
||||
<section name="clientTarget"
|
||||
type="System.Web.Configuration.ClientTargetSectionHandler, System.Web, Version=2.0.0.0, Culture=neutral" />
|
||||
</sectionGroup>
|
||||
<sectionGroup name="system.net">
|
||||
<section name="settings"
|
||||
type="System.Net.Configuration.SettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
type="System.Net.Configuration.NetConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="connectionManagement"
|
||||
type="System.Net.Configuration.ConnectionManagementHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<section name="authenticationModules"
|
||||
@@ -57,16 +53,6 @@
|
||||
</sectionGroup>
|
||||
<section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</configSections>
|
||||
|
||||
<configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
|
||||
<providers>
|
||||
<add name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
|
||||
description="" keyContainerName="MonoFrameworkConfigurationKey" cspProviderName="" useMachineContainer="true" useOAEP="false" />
|
||||
<add name="DataProtectionConfigurationProvider" type="System.Configuration.DpapiProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
|
||||
description="" useMachineProtection="true" keyEntropy="" />
|
||||
</providers>
|
||||
</configProtectedData>
|
||||
|
||||
<system.net>
|
||||
<connectionManagement>
|
||||
<add address="*" maxconnection="2" />
|
||||
@@ -87,12 +73,97 @@
|
||||
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</webRequestModules>
|
||||
<settings>
|
||||
<ipv6 enabled="false"/>
|
||||
</settings>
|
||||
</system.net>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.Config" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.dll" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</httpHandlers>
|
||||
<httpModules>
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</httpModules>
|
||||
<authentication mode="Forms">
|
||||
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
|
||||
<credentials passwordFormat="Clear">
|
||||
<!--<user name="gonzalo" password="gonz"/>-->
|
||||
</credentials>
|
||||
</forms>
|
||||
</authentication>
|
||||
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
|
||||
<globalization requestEncoding="utf-8"
|
||||
responseEncoding="utf-8"
|
||||
fileEncoding="utf-8"/>
|
||||
<!--
|
||||
culture="en-US"
|
||||
uiculture="en-US" />
|
||||
-->
|
||||
<sessionState mode="InProc" />
|
||||
<webServices>
|
||||
<protocols>
|
||||
<add name="HttpSoap"/>
|
||||
<add name="HttpPost"/>
|
||||
<add name="HttpGet"/>
|
||||
<add name="Documentation"/>
|
||||
</protocols>
|
||||
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
|
||||
</webServices>
|
||||
<webControls clientScriptsLocation="/web_scripts" />
|
||||
<compilation debug="false" defaultLanguage="c#" explicit="true" strict="false" >
|
||||
<compilers>
|
||||
<compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
|
||||
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
|
||||
warningLevel="1" compilerOptions=""
|
||||
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</compilers>
|
||||
<assemblies>
|
||||
<!--<add assembly="mscorlib" /> -->
|
||||
<add assembly="System" />
|
||||
<add assembly="System.Xml" />
|
||||
<add assembly="System.Data" />
|
||||
<add assembly="System.Web" />
|
||||
<add assembly="System.Web.Services" />
|
||||
<add assembly="System.Drawing" />
|
||||
<add assembly="*" /> <!-- Add assemblies in bin directory -->
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<httpRuntime executionTimeout="90"
|
||||
maxRequestLength="4096"
|
||||
useFullyQualifiedRedirectUrl="false"
|
||||
minFreeThreads="8"
|
||||
minLocalRequestFreeThreads="4"
|
||||
appRequestQueueLimit="100" />
|
||||
<pages buffer="true"
|
||||
enableSessionState="true"
|
||||
autoEventWireup="true"
|
||||
validateRequest="true" />
|
||||
<clientTarget>
|
||||
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
|
||||
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
|
||||
<add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
|
||||
<add alias="downlevel" userAgent="Unknown" />
|
||||
</clientTarget>
|
||||
</system.web>
|
||||
|
||||
<system.runtime.remoting>
|
||||
<application>
|
||||
@@ -163,20 +234,6 @@
|
||||
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
|
||||
</pubTokenMapping>
|
||||
</strongNames>
|
||||
|
||||
<system.web>
|
||||
<membership>
|
||||
<providers>
|
||||
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="/" />
|
||||
</providers>
|
||||
</membership>
|
||||
|
||||
<roleManager>
|
||||
<providers>
|
||||
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="/" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
</configuration>
|
||||
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
|
||||
<system.web>
|
||||
<authorization>
|
||||
<allow users="*" />
|
||||
</authorization>
|
||||
<httpHandlers>
|
||||
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.master" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.resources" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.skin" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.browser" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.sitemap" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.webinfo" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.resx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.Config" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.vb" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.csproj" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.vbproj" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.licx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.dll" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
|
||||
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</httpHandlers>
|
||||
<httpModules>
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add name="RoleManager" type="System.Web.Security.RoleManagerModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</httpModules>
|
||||
<authentication mode="Forms">
|
||||
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
|
||||
<credentials passwordFormat="Clear">
|
||||
<!--<user name="gonzalo" password="gonz"/>-->
|
||||
</credentials>
|
||||
</forms>
|
||||
</authentication>
|
||||
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
|
||||
<globalization requestEncoding="utf-8"
|
||||
responseEncoding="utf-8"
|
||||
fileEncoding="utf-8"/>
|
||||
<!--
|
||||
culture="en-US"
|
||||
uiculture="en-US" />
|
||||
-->
|
||||
<sessionState mode="InProc" />
|
||||
<webServices>
|
||||
<protocols>
|
||||
<add name="HttpSoap"/>
|
||||
<add name="HttpPost"/>
|
||||
<add name="HttpGet"/>
|
||||
<add name="Documentation"/>
|
||||
</protocols>
|
||||
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
|
||||
</webServices>
|
||||
<webControls clientScriptsLocation="/web_scripts" />
|
||||
<compilation debug="false" defaultLanguage="c#" explicit="true" strict="false" >
|
||||
<compilers>
|
||||
<compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
|
||||
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
|
||||
warningLevel="1" compilerOptions=""
|
||||
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</compilers>
|
||||
<assemblies>
|
||||
<!--<add assembly="mscorlib" /> -->
|
||||
<add assembly="System" />
|
||||
<add assembly="System.Xml" />
|
||||
<add assembly="System.Configuration" />
|
||||
<add assembly="System.Data" />
|
||||
<add assembly="System.Web" />
|
||||
<add assembly="System.Web.Services" />
|
||||
<add assembly="System.Drawing" />
|
||||
<add assembly="*" /> <!-- Add assemblies in bin directory -->
|
||||
</assemblies>
|
||||
<expressionBuilders>
|
||||
<add expressionPrefix="Resources"
|
||||
type="System.Web.Compilation.ResourceExpressionBuilder, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add expressionPrefix="ConnectionStrings"
|
||||
type="System.Web.Compilation.ConnectionStringsExpressionBuilder, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add expressionPrefix="AppSettings"
|
||||
type="System.Web.Compilation.AppSettingsExpressionBuilder, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</expressionBuilders>
|
||||
</compilation>
|
||||
<httpRuntime executionTimeout="90"
|
||||
maxRequestLength="4096"
|
||||
useFullyQualifiedRedirectUrl="false"
|
||||
minFreeThreads="8"
|
||||
minLocalRequestFreeThreads="4"
|
||||
appRequestQueueLimit="100" />
|
||||
<clientTarget>
|
||||
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
|
||||
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
|
||||
<add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
|
||||
<add alias="downlevel" userAgent="Unknown" />
|
||||
</clientTarget>
|
||||
|
||||
<siteMap enabled="false">
|
||||
<providers>
|
||||
<add name="AspNetXmlSiteMapProvider"
|
||||
description="Default site map provider that reads in .sitemap xml files."
|
||||
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
|
||||
siteMapFile="Web.sitemap" />
|
||||
</providers>
|
||||
</siteMap>
|
||||
</system.web>
|
||||
|
||||
</configuration>
|
||||
@@ -1,15 +0,0 @@
|
||||
This is a patch that can be applied to the magic file used by file(1) to
|
||||
recognize mono assemblies.
|
||||
Apply it to the magic file (usually in /usr/share/file/magic or
|
||||
/usr/share/misc/magic) and recompile it with file -C.
|
||||
|
||||
--- magic.old 2006-03-24 21:12:25.000000000 +0100
|
||||
+++ magic 2006-03-24 21:12:17.000000000 +0100
|
||||
@@ -7205,6 +7205,7 @@
|
||||
>>>>(0x3c.l+4) leshort 0x290 PA-RISC
|
||||
>>>>(0x3c.l+22) leshort&0x0100 >0 32-bit
|
||||
>>>>(0x3c.l+22) leshort&0x1000 >0 system file
|
||||
+>>>>(0x3c.l+232) lelong >0 Mono/.Net assembly
|
||||
|
||||
>>>>(0x3c.l+0xf8) string UPX0 \b, UPX compressed
|
||||
>>>>(0x3c.l+0xf8) search/0x140 PEC2 \b, PECompact2 compressed
|
||||
@@ -1,261 +0,0 @@
|
||||
|
||||
Purpose
|
||||
|
||||
Especially when inlining is active, it can happen that temporary
|
||||
variables add pressure to the register allocator, producing bad
|
||||
code.
|
||||
|
||||
The idea is that some of these temporaries can be totally eliminated
|
||||
my moving the MonoInst tree that defines them directly to the use
|
||||
point in the code (so the name "tree mover").
|
||||
|
||||
Please note that this is *not* an optimization: it is mostly a
|
||||
workaround to issues we have in the regalloc.
|
||||
Actually, with the new linear IR this will not be possible at all
|
||||
(there will be no more trees in the code!).
|
||||
Anyway, this workaround turns out to be useful in the current state
|
||||
of things...
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Base logic
|
||||
|
||||
If a local is defined by a value which is a proper expression (a tree
|
||||
of MonoInst, not just another local or a constant), and this definition
|
||||
is used only once, the tree can be moved directly to the use location,
|
||||
and the definition eliminated.
|
||||
Of course, none of the variables used in the tree must be defined in
|
||||
the code path between the definition and the use, and the tree must be
|
||||
free of side effects.
|
||||
We do not handle the cases when the tree is just a local or a constant
|
||||
because they are handled by copyprop and consprop, respectively.
|
||||
|
||||
To make things simpler, we restrict the tree move to the case when:
|
||||
- the definition and the use are in the same BB, and
|
||||
- the use is followed by another definition in the same BB (it is not
|
||||
possible that the 1st value is used again), or alternatively there
|
||||
is no BB in the whole CFG that contains a use of this local before a
|
||||
definition (so, again, there is no code path that can lead to a
|
||||
subsequent use).
|
||||
|
||||
To handle this, we maintain an ACT array (Available Copy Tree, similar
|
||||
to the ACP), where we store the "state" of every local.
|
||||
Ideally, every local can be in the following state:
|
||||
[E] Undefined (by a tree, it could be in the ACP but we don't care).
|
||||
[D] Defined (by a tree), and waiting for a use.
|
||||
[U] Used, with a tree definition available in the same BB, but still
|
||||
without a definition following the use (always in the same BB).
|
||||
Of course state [E] (empty) is the initial one.
|
||||
|
||||
Besides, there are two sort of "meta states", or flags:
|
||||
[W] Still waiting for a use or definition in this BB (we have seen no
|
||||
occurrence of the local yet).
|
||||
[X] Used without being previously defined in the same BB (note that if
|
||||
there is a definition that precedes the use in the same BB, even if
|
||||
the definition is not a tree or is not available because of side
|
||||
effects or because the tree value has changed the local is not in
|
||||
state [X]).
|
||||
Also note that state [X] is a sort of "global" condition, which if set
|
||||
in one BB will stay valid for the whole CFG, even if the local will
|
||||
otherwise change state. The idea of flagging a local as [X] is that if
|
||||
there is a definition/use pair that reaches the end of a BB, it could
|
||||
be that there is a CFG path that then leads to the BB flagging it as
|
||||
[X] (which contains a use), so the tree cannot be moved.
|
||||
So state [X] will always be set, and never examined in all the state
|
||||
transitions we will describe.
|
||||
In practice, we use flag [W] to set state [X]: if, when traversing a
|
||||
BB, we find a use for a local in state [W], then that local is flagged
|
||||
[X].
|
||||
|
||||
|
||||
For each BB, we initialize all states to [E] and [W], and then we
|
||||
traverse the code one inst at a time, and update the variable states
|
||||
in the ACT in the following ways:
|
||||
|
||||
[Definition]
|
||||
- Flag [W] is cleared.
|
||||
- All "affected trees" are killed (go from state [D] to [E]).
|
||||
The "affected trees" are the trees which contain (use) the defined
|
||||
local, and the rationale is that the tree value changed, so the
|
||||
tree is no longer available.
|
||||
- If the local was in state [U], *that* tree move is marked "safe"
|
||||
(because *this* definition makes us sure that the previous tree
|
||||
cannot be used again in any way).
|
||||
The idea is that "safe" moves can happen even if the local is
|
||||
flagged [X], because the second definition "covers" the use.
|
||||
The tree move is then saved in the "todo" list (and the affecting
|
||||
nodes are cleared).
|
||||
- If the local was defined by a tree, it goes to state [D], the tree
|
||||
is recorded, and all the locals used in it are marked as "affecting
|
||||
this tree" (of course these markers are lists, because each local
|
||||
could affect more than one tree).
|
||||
|
||||
[IndirectDefinition]
|
||||
- All potentially affected trees (in state [D]) are killed.
|
||||
|
||||
[Use]
|
||||
- If the local is still [W], it is flagged [X] (the [W] goes away).
|
||||
- If the local is in state [D], it goes to state [U].
|
||||
The tree move must not yet be recorded in the "todo" list, it still
|
||||
stays in the ACT slot belonging to this local.
|
||||
Anyway, the "affecting" nodes are updated, because now a definition
|
||||
of a local used in this tree will affect only "indirect" (or also
|
||||
"propagated") moves, but not *this* move (see below).
|
||||
- If the local is in state [U], then the tree cannot be moved (it is
|
||||
used two times): the move is canceled, and the state goes [E].
|
||||
- If the local is in state [E], the use is ignored.
|
||||
|
||||
[IndirectUse]
|
||||
- All potentially affected trees (in state [D] or [U]) are killed.
|
||||
|
||||
[SideEffect]
|
||||
- Tree is marked as "unmovable".
|
||||
|
||||
Then, at the end of the BB, for each ACT slot:
|
||||
- If state is [U], the tree move is recorded in the "todo" list, but
|
||||
flagged "unsafe".
|
||||
- Anyway, state goes to [E], the [W] flag is set, and all "affecting"
|
||||
lists are cleared (we get ready to traverse the next BB).
|
||||
Finally, when all BBs has been scanned, we traverse the "todo" list,
|
||||
moving all "safe" entries, and moving "unsafe" ones only if their ACT
|
||||
slot is not flagged [X].
|
||||
|
||||
So far, so good.
|
||||
But there are two issues that make things harder :-(
|
||||
|
||||
The first is the concept of "indirect tree move".
|
||||
It can happen that a tree is scheduled for moving, and its destination
|
||||
is a use that is located in a second tree, which could also be moved.
|
||||
The main issue is that a definition of a variable of the 1st tree on
|
||||
the path between the definition and the use of the 2nd one must prevent
|
||||
the move.
|
||||
But which move? The 1st or the 2nd?
|
||||
Well, any of the two!
|
||||
The point is, the 2nd move must be prevented *only* if the 1st one
|
||||
happens: if it is aborted (for an [X] flag or any other reason), the
|
||||
2nd move is OK, and vice versa...
|
||||
We must handle this in the following way:
|
||||
- The ACT must still remember if a slot is scheduled for moving in
|
||||
this BB, and if it is, all the locals used in the tree.
|
||||
We say that the slot is in state [M].
|
||||
Note that [M] is (like [X] and [W]) a sort of "meta state": a local
|
||||
is flagged [M] when it goes to state [U], and the flag is cleared
|
||||
when the tree move is cancelled
|
||||
- A tree that uses a local whose slot is in state [M] is also using all
|
||||
the locals used by the tree in state [M], but the use is "indirect".
|
||||
These use nodes are also included in the "affecting" lists.
|
||||
- The definition of a variable used in an "indirect" way has the
|
||||
effect of "linking" the two involved tree moves, saying that only one
|
||||
of the two can happen in practice, but not both.
|
||||
- When the 2nd tree is scheduled for moving, the 1st one is *still* in
|
||||
state [M], because a third move could "carry it forward", and all the
|
||||
*three* moves should be mutually exclusive (to be safe!).
|
||||
|
||||
The second tricky complication is the "tree forwarding" that can happen
|
||||
when copyprop is involved.
|
||||
It is conceptually similar to the "indirect tree move".
|
||||
Only, the 2nd tree is not really a tree, it is just the local defined
|
||||
in the 1st tree move.
|
||||
It can happen that copyprop will propagate the definition.
|
||||
We cannot make treeprop do the same job of copyprop, because copyprop
|
||||
has less constraints, and is therefore more powerful in its scope.
|
||||
The main issue is that treeprop cannot propagate a tree to *two* uses,
|
||||
while copyprop is perfectly capable of propagating one definition to
|
||||
two (or more) different places.
|
||||
So we must let copyprop do its job otherwise we'll miss optimizations,
|
||||
but we must also make it play safe with treeprop.
|
||||
Let's clarify with an example:
|
||||
a = v1 + v2; //a is defined by a tree, state [D], uses v2 and v2
|
||||
b = a; //a is used, state [U] with move scheduled, and
|
||||
//b is defined by a, ACP[b] is a, and b is in state [DC]
|
||||
c = b + v3; // b is used, goes to state [U]
|
||||
The real trouble is that copyprop happens *immediately*, while treeprop
|
||||
is deferred to the end of the CFG traversal.
|
||||
So, in the 3rd statement, the "b" is immediately turned into an "a" by
|
||||
copyprop, regardless of what treeprop will do.
|
||||
Anyway, if we are careful, this is not so bad.
|
||||
First of all, we must "accept" the fact that in the 3rd statement the
|
||||
"b" is in fact an "a", as treeprop must happen *after* copyprop.
|
||||
The real problem is that "a" is used twice: in the 2nd and 3rd lines.
|
||||
In our usual setup, the 2nd line would set it to [U], and the 3rd line
|
||||
would kill the move (and set "a" to [E]).
|
||||
I have tried to play tricks, and reason as of copyprop didn't happen,
|
||||
but everything becomes really messy.
|
||||
Instead, we should note that the 2nd line is very likely to be dead.
|
||||
At least in this BB, copyprop will turn all "b"s into "a"s as long as
|
||||
it can, and when it cannot, it will be because either "a" or "b" have
|
||||
been redefined, which would be after the tree move anyway.
|
||||
So, the reasoning gets different: let's pretend that "b" will be dead.
|
||||
This will make the "a" use in the 2nd statement useless, so there we
|
||||
can "reset" "a" to [D], but also take note that if "b" will end up
|
||||
not being dead, the tree move associated to this [D] must be aborted.
|
||||
We can detect this in the following way:
|
||||
- Either "b" is used before being defined in this BB, or
|
||||
- It will be flagged "unsafe".
|
||||
Both things are very easy to check.
|
||||
The only quirk is that the "affecting" lists must not be cleared when
|
||||
a slot goes to state [U], because a "propagation" could put it back
|
||||
to state [D] (where those lists are needed, because it can be killed
|
||||
by a definition to a used slot).
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Implementation notes
|
||||
|
||||
All the implementation runs inside the existing mono_local_cprop
|
||||
function, and a separate memory pool is used to hold the temporary
|
||||
data.
|
||||
|
||||
A struct, MonoTreeMover, contains the pointers to the pool, the ACT,
|
||||
the list of scheduled moves and auxiliary things.
|
||||
This struct is allocated if the tree move pass is requested, and is
|
||||
then passed along to all the involved functions, which are therefore
|
||||
aware of the tree mover state.
|
||||
|
||||
The ACT is an array of slots, obviously one per local.
|
||||
Each slot is of type MonoTreeMoverActSlot, and contains the used and
|
||||
affected locals, a pointer to the pending tree move and the "waiting"
|
||||
and "unsafe" flags.
|
||||
|
||||
The "affecting" lists a built from "dependency nodes", of type
|
||||
MonoTreeMoverDependencyNode.
|
||||
Each of the nodes contains the used and affected local, and is in
|
||||
two lists: the locals used by a slot, and the locals affected by a
|
||||
slot (obviously a different one).
|
||||
So, each node means: "variable x is used in tree t, so a definition
|
||||
of x affects tree t".
|
||||
The "affecting" lists are doubly linked, to allow for O(1) deletion.
|
||||
The "used" lists are simply linked, but when they are mantained there
|
||||
is always a pointer to the last element to allow for O(1) list moving.
|
||||
When a used list is dismissed (which happens often, any time a node is
|
||||
killed), its nodes are unlinked from their respective affecting lists
|
||||
and are then put in a "free" list in the MonoTreeMover to be reused.
|
||||
|
||||
Each tree move is represented by a struct (MonoTreeMoverTreeMove),
|
||||
which contains:
|
||||
- the definition and use points,
|
||||
- the "affected" moves (recall the concept of "indirect tree move"),
|
||||
- the "must be dead" slots (recall "tree forwarding"). and
|
||||
- a few utility flags.
|
||||
The tree moves stays in the relevant ACT slot until it is ready to be
|
||||
scheduled for moving, at which point it is put in a list in the
|
||||
MonoTreeMover.
|
||||
The tree moves structs are reused when they are killed, so there is
|
||||
also a "free" list for them in the MonoTreeMover.
|
||||
|
||||
The tree mover code has been added to all the relevant functions that
|
||||
participate in consprop and copyprop, particularly:
|
||||
- mono_cprop_copy_values takes care of variable uses (transitions from
|
||||
states [D] to [U] and [U] to [E] because of killing),
|
||||
- mono_cprop_invalidate_values takes care of side effects (indirect
|
||||
accesses, calls...),
|
||||
- mono_local_cprop_bb sets up and cleans the traversals for each BB,
|
||||
and for each MonoInst it takes care of variable definitions.
|
||||
To each of them has been added a MonoTreeMover parameter, which is not
|
||||
NULL if the tree mover is running.
|
||||
After mono_local_cprop_bb has run for all BBs, the MonoTreeMover has
|
||||
the list of all the pending moves, which must be walked to actually
|
||||
perform the moves (when possible, because "unsafe" flags, "affected"
|
||||
moves and "must be dead" slots can still have their effects, which
|
||||
must be handled now because they are fully known only at the end of
|
||||
the CFG traversal).
|
||||
+2
-37
@@ -1,42 +1,11 @@
|
||||
2006-04-05 Zoltan Varga <[email protected]>
|
||||
|
||||
* include/private/gcconfig.h (LINUX and SPARC): Applied patch from
|
||||
David S. Miller <[email protected]>: Do not
|
||||
use _etest and GC_SysVGetDataStart() to figure out DATASTART.
|
||||
Instead use either SEARCH_FOR_DATA_START or __environ, based
|
||||
upon GLIBC version.
|
||||
|
||||
2006-03-25 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Applied patch from David S. Miller <[email protected]>: Fix support for sparc/linux.
|
||||
|
||||
Mon Mar 20 18:56:21 CET 2006 Paolo Molaro <[email protected]>
|
||||
|
||||
* include/gc.h: enable pthread redirection on darwin, too.
|
||||
* include/gc_pthread_redirects.h: completed from Bryan Berg.
|
||||
|
||||
Thu Feb 9 16:20:55 CET 2006 Paolo Molaro <[email protected]>
|
||||
|
||||
* os_dep.c, include/private/gcconfig.h, darwin_stop_world.c:
|
||||
OSX/x86 support, mostly from Geoff Norton <[email protected]>.
|
||||
|
||||
Wed Feb 1 18:23:55 CET 2006 Paolo Molaro <[email protected]>
|
||||
|
||||
* pthread_support.c, *: back out Zoltan's patch since it's
|
||||
incorrect.
|
||||
The correct fix it to execute the cleanup from inside
|
||||
the thread also when using the __thread var to access the
|
||||
current GC_thread.
|
||||
|
||||
2006-02-01 Zoltan Varga <[email protected]>
|
||||
|
||||
* pthread_support.c (GC_thread_deregister_foreign): New public API
|
||||
function to deregister a foreign thread from the GC.
|
||||
(GC_destroy_thread_local): Clean up the TLS key too.
|
||||
|
||||
Tue Jan 24 12:34:06 CET 2006 Paolo Molaro <[email protected]>
|
||||
|
||||
* *: update from upstream changes.
|
||||
* pthread_support.c: make sure the proper cleanup also happens
|
||||
when using __thread vars.
|
||||
|
||||
2006-01-21 Martin Baulig <[email protected]>
|
||||
|
||||
@@ -47,10 +16,6 @@ Tue Jan 24 12:34:06 CET 2006 Paolo Molaro <[email protected]>
|
||||
* include/libgc-mono-debugger.h: Call the conditional
|
||||
`_IN_THE_MONO_DEBUGGER', not `IN_MONO_DEBUGGER'.
|
||||
|
||||
2006-01-11 Zoltan Varga <[email protected]>
|
||||
|
||||
* include/private/gcconfig.h: Undef _FILE_OFFSET_BITS on sparc.
|
||||
|
||||
2006-01-03 Geoff Norton <[email protected]>
|
||||
|
||||
* darwin_stop_world.c: Merge a patch from Bruce Mitchener that fixes a small
|
||||
|
||||
+5
-36
@@ -41,7 +41,7 @@ asm_libgc_sources =
|
||||
endif
|
||||
|
||||
libmonogc_la_SOURCES = allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
|
||||
dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
|
||||
dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c aix_irix_threads.c \
|
||||
malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
|
||||
obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
|
||||
solaris_pthreads.c solaris_threads.c specific.c stubborn.c typd_mlc.c \
|
||||
@@ -49,9 +49,10 @@ backgraph.c win32_threads.c \
|
||||
pthread_support.c pthread_stop_world.c darwin_stop_world.c \
|
||||
$(asm_libgc_sources)
|
||||
|
||||
# Include THREADDLLIBS here to ensure that the correct versions of
|
||||
|
||||
# Include THREADLIBS here to ensure that the correct versions of
|
||||
# linuxthread semaphore functions get linked:
|
||||
libmonogc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS)
|
||||
libmonogc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
|
||||
libmonogc_la_DEPENDENCIES = @addobjs@
|
||||
libmonogc_la_LDFLAGS = -version-info 1:2:0
|
||||
|
||||
@@ -68,48 +69,16 @@ EXTRA_DIST += alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S
|
||||
|
||||
AM_CFLAGS = @GC_CFLAGS@
|
||||
|
||||
if CPLUSPLUS
|
||||
extra_checks = test_cpp
|
||||
else
|
||||
extra_checks =
|
||||
endif
|
||||
|
||||
#check_PROGRAMS = gctest $(extra_checks)
|
||||
|
||||
#test.o: $(srcdir)/tests/test.c
|
||||
# $(COMPILE) -c $(srcdir)/tests/test.c
|
||||
# Using $< in the above seems to fail with the HP/UX on Itanium make.
|
||||
#test_cpp.o: $(srcdir)/tests/test_cpp.cc
|
||||
# $(CXXCOMPILE) -c $(srcdir)/tests/test_cpp.cc
|
||||
|
||||
## FIXME: this is probably the reason why some files from BUILT_SOURCES
|
||||
## are included in the distribution
|
||||
# gctest_OBJECTS = test.o
|
||||
#gctest_SOURCES = tests/test.c
|
||||
#gctest_LDADD = ./libgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
|
||||
#test_cpp_SOURCES = tests/test_cpp.cc
|
||||
#test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
|
||||
|
||||
#TESTS = gctest $(extra_checks)
|
||||
|
||||
## FIXME: relies on internal code generated by automake.
|
||||
all_objs = @addobjs@ $(libgc_la_OBJECTS)
|
||||
$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
|
||||
include/private/gc_hdrs.h include/gc.h include/gc_gcj.h include/gc_mark.h
|
||||
|
||||
## FIXME: we shouldn't have to do this, but automake forces us to.
|
||||
if COMPILER_XLC
|
||||
## XLC neither requires nor tolerates the unnecessary assembler goop
|
||||
ASM_CPP_OPTIONS =
|
||||
else
|
||||
## We use -Wp,-P to strip #line directives. Irix `as' chokes on
|
||||
## these.
|
||||
ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
|
||||
endif
|
||||
.s.lo:
|
||||
## We use -Wp,-P to strip #line directives. Irix `as' chokes on
|
||||
## these.
|
||||
$(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
|
||||
$(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $<
|
||||
|
||||
## We have our own definition of LTCOMPILE because we want to use our
|
||||
## CFLAGS, not those passed in from the top level make.
|
||||
|
||||
+9
-14
@@ -36,7 +36,7 @@ CFLAGS= -O -I$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_
|
||||
# -DGC_LINUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC
|
||||
# To build the parallel collector in a static library on HP/UX,
|
||||
# add to the above:
|
||||
# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -D_POSIX_C_SOURCE=199506L -mt
|
||||
# -DGC_HPUX_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC -D_POSIX_C_SOURCE=199506L
|
||||
# To build the thread-safe collector on Tru64, add to the above:
|
||||
# -pthread -DGC_OSF1_THREADS
|
||||
|
||||
@@ -70,11 +70,10 @@ HOSTCFLAGS=$(CFLAGS)
|
||||
# Also requires -D_REENTRANT or -D_POSIX_C_SOURCE=199506L. See README.hp.
|
||||
# -DGC_LINUX_THREADS enables support for Xavier Leroy's Linux threads.
|
||||
# see README.linux. -D_REENTRANT may also be required.
|
||||
# -DGC_OSF1_THREADS enables support for Tru64 pthreads.
|
||||
# -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads.
|
||||
# -DGC_OSF1_THREADS enables support for Tru64 pthreads. Untested.
|
||||
# -DGC_FREEBSD_THREADS enables support for FreeBSD pthreads. Untested.
|
||||
# Appeared to run into some underlying thread problems.
|
||||
# -DGC_DARWIN_THREADS enables support for Mac OS X pthreads.
|
||||
# -DGC_AIX_THREADS enables support for IBM AIX threads.
|
||||
# -DGC_DARWIN_THREADS enables support for Mac OS X pthreads. Untested.
|
||||
# -DGC_DGUX386_THREADS enables support for DB/UX on I386 threads.
|
||||
# See README.DGUX386.
|
||||
# -DGC_WIN32_THREADS enables support for win32 threads. That makes sense
|
||||
@@ -234,8 +233,8 @@ HOSTCFLAGS=$(CFLAGS)
|
||||
# -DTHREAD_LOCAL_ALLOC defines GC_local_malloc(), GC_local_malloc_atomic()
|
||||
# and GC_local_gcj_malloc(). Needed for gc_gcj.h interface. These allocate
|
||||
# in a way that usually does not involve acquisition of a global lock.
|
||||
# Currently works only on platforms such as Linux which use pthread_support.c.
|
||||
# Recommended for multiprocessors.
|
||||
# Currently requires -DGC_LINUX_THREADS, but should be easy to port to
|
||||
# other pthreads environments. Recommended for multiprocessors.
|
||||
# -DUSE_COMPILER_TLS causes thread local allocation to use compiler-supported
|
||||
# "__thread" thread-local variables. This is the default in HP/UX. It
|
||||
# may help performance on recent Linux installations. (It failed for
|
||||
@@ -277,10 +276,6 @@ HOSTCFLAGS=$(CFLAGS)
|
||||
# -DPOINTER_SHIFT=n causes the collector to left shift candidate pointers
|
||||
# by the indicated amount before trying to interpret them. Applied
|
||||
# after POINTER_MASK. EXPERIMENTAL. See also the preceding macro.
|
||||
# -DDARWIN_DONT_PARSE_STACK Causes the Darwin port to discover thread
|
||||
# stack bounds in the same way as other pthread ports, without trying to
|
||||
# walk the frames onthe stack. This is recommended only as a fallback
|
||||
# for applications that don't support proper stack unwinding.
|
||||
#
|
||||
|
||||
CXXFLAGS= $(CFLAGS)
|
||||
@@ -288,9 +283,9 @@ AR= ar
|
||||
RANLIB= ranlib
|
||||
|
||||
|
||||
OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o pthread_support.o pthread_stop_world.o darwin_stop_world.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o win32_threads.o
|
||||
OBJS= alloc.o reclaim.o allchblk.o misc.o mach_dep.o os_dep.o mark_rts.o headers.o mark.o obj_map.o blacklst.o finalize.o new_hblk.o dbg_mlc.o malloc.o stubborn.o checksums.o solaris_threads.o aix_irix_threads.o pthread_support.o pthread_stop_world.o darwin_stop_world.o typd_mlc.o ptr_chck.o mallocx.o solaris_pthreads.o gcj_mlc.o specific.o gc_dlopen.o backgraph.o win32_threads.o
|
||||
|
||||
CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c win32_threads.c
|
||||
CSRCS= reclaim.c allchblk.c misc.c alloc.c mach_dep.c os_dep.c mark_rts.c headers.c mark.c obj_map.c pcr_interface.c blacklst.c finalize.c new_hblk.c real_malloc.c dyn_load.c dbg_mlc.c malloc.c stubborn.c checksums.c solaris_threads.c aix_irix_threads.c pthread_support.c pthread_stop_world.c darwin_stop_world.c typd_mlc.c ptr_chck.c mallocx.c solaris_pthreads.c gcj_mlc.c specific.c gc_dlopen.c backgraph.c win32_threads.c
|
||||
|
||||
CORD_SRCS= cord/cordbscs.c cord/cordxtra.c cord/cordprnt.c cord/de.c cord/cordtest.c include/cord.h include/ec.h include/private/cord_pos.h cord/de_win.c cord/de_win.h cord/de_cmds.h cord/de_win.ICO cord/de_win.RC
|
||||
|
||||
@@ -329,7 +324,7 @@ DOC_FILES= README.QUICK doc/README.Mac doc/README.MacOSX doc/README.OS2 \
|
||||
doc/simple_example.html
|
||||
|
||||
TESTS= tests/test.c tests/test_cpp.cc tests/trace_test.c \
|
||||
tests/leak_test.c tests/thread_leak_test.c tests/middle.c
|
||||
tests/leak_test.c tests/thread_leak_test.c
|
||||
|
||||
GNU_BUILD_FILES= configure.in Makefile.am configure acinclude.m4 \
|
||||
libtool.m4 install-sh configure.host Makefile.in \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Makefile for Windows NT. Assumes Microsoft compiler.
|
||||
# Makefile for Windows NT. Assumes Microsoft compiler, and a single thread.
|
||||
# DLLs are included in the root set under NT, but not under win32S.
|
||||
# Use "nmake nodebug=1 all" for optimized versions of library, gctest and editor.
|
||||
|
||||
|
||||
+10
-18
@@ -111,7 +111,7 @@ void GC_print_hblkfreelist()
|
||||
for (i = 0; i <= N_HBLK_FLS; ++i) {
|
||||
h = GC_hblkfreelist[i];
|
||||
# ifdef USE_MUNMAP
|
||||
if (0 != h) GC_printf1("Free list %ld:\n",
|
||||
if (0 != h) GC_printf1("Free list %ld (Total size %ld):\n",
|
||||
(unsigned long)i);
|
||||
# else
|
||||
if (0 != h) GC_printf2("Free list %ld (Total size %ld):\n",
|
||||
@@ -133,12 +133,10 @@ void GC_print_hblkfreelist()
|
||||
h = hhdr -> hb_next;
|
||||
}
|
||||
}
|
||||
# ifndef USE_MUNMAP
|
||||
if (total_free != GC_large_free_bytes) {
|
||||
if (total_free != GC_large_free_bytes) {
|
||||
GC_printf1("GC_large_free_bytes = %lu (INCONSISTENT!!)\n",
|
||||
(unsigned long) GC_large_free_bytes);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
GC_printf1("Total of %lu bytes on free list\n", (unsigned long)total_free);
|
||||
}
|
||||
|
||||
@@ -183,7 +181,7 @@ void GC_dump_regions()
|
||||
hhdr = HDR(p);
|
||||
GC_printf1("\t0x%lx ", (unsigned long)p);
|
||||
if (IS_FORWARDING_ADDR_OR_NIL(hhdr)) {
|
||||
GC_printf1("Missing header!!(%ld)\n", hhdr);
|
||||
GC_printf1("Missing header!!\n", hhdr);
|
||||
p += HBLKSIZE;
|
||||
continue;
|
||||
}
|
||||
@@ -285,8 +283,8 @@ int n;
|
||||
GET_HDR(hhdr -> hb_prev, phdr);
|
||||
phdr -> hb_next = hhdr -> hb_next;
|
||||
}
|
||||
FREE_ASSERT(GC_free_bytes[index] >= hhdr -> hb_sz);
|
||||
INCR_FREE_BYTES(index, - (signed_word)(hhdr -> hb_sz));
|
||||
FREE_ASSERT(GC_free_bytes[index] >= 0);
|
||||
if (0 != hhdr -> hb_next) {
|
||||
hdr * nhdr;
|
||||
GC_ASSERT(!IS_FORWARDING_ADDR_OR_NIL(NHDR(hhdr)));
|
||||
@@ -470,11 +468,7 @@ int index;
|
||||
if (total_size == bytes) return h;
|
||||
rest = (struct hblk *)((word)h + bytes);
|
||||
rest_hdr = GC_install_header(rest);
|
||||
if (0 == rest_hdr) {
|
||||
/* This may be very bad news ... */
|
||||
WARN("Header allocation failed: Dropping block.\n", 0);
|
||||
return(0);
|
||||
}
|
||||
if (0 == rest_hdr) return(0);
|
||||
rest_hdr -> hb_sz = total_size - bytes;
|
||||
rest_hdr -> hb_flags = 0;
|
||||
# ifdef GC_ASSERTIONS
|
||||
@@ -590,9 +584,8 @@ int n;
|
||||
GET_HDR(hbp, hhdr);
|
||||
size_avail = hhdr->hb_sz;
|
||||
if (size_avail < size_needed) continue;
|
||||
if (size_avail != size_needed
|
||||
&& !GC_use_entire_heap
|
||||
&& !GC_dont_gc
|
||||
if (!GC_use_entire_heap
|
||||
&& size_avail != size_needed
|
||||
&& USED_HEAP_SIZE >= GC_requested_heapsize
|
||||
&& !TRUE_INCREMENTAL && GC_should_collect()) {
|
||||
# ifdef USE_MUNMAP
|
||||
@@ -609,8 +602,7 @@ int n;
|
||||
/* If we are deallocating lots of memory from */
|
||||
/* finalizers, fail and collect sooner rather */
|
||||
/* than later. */
|
||||
if (WORDS_TO_BYTES(GC_finalizer_mem_freed)
|
||||
> (GC_heapsize >> 4)) {
|
||||
if (GC_finalizer_mem_freed > (GC_heapsize >> 4)) {
|
||||
continue;
|
||||
}
|
||||
# endif /* !USE_MUNMAP */
|
||||
@@ -700,7 +692,7 @@ int n;
|
||||
struct hblk * h;
|
||||
struct hblk * prev = hhdr -> hb_prev;
|
||||
|
||||
GC_words_wasted += BYTES_TO_WORDS(total_size);
|
||||
GC_words_wasted += total_size;
|
||||
GC_large_free_bytes -= total_size;
|
||||
GC_remove_from_fl(hhdr, n);
|
||||
for (h = hbp; h < limit; h++) {
|
||||
|
||||
+11
-25
@@ -92,16 +92,6 @@ char * GC_copyright[] =
|
||||
|
||||
# include "version.h"
|
||||
|
||||
#if defined(SAVE_CALL_CHAIN) && \
|
||||
!(defined(REDIRECT_MALLOC) && defined(GC_HAVE_BUILTIN_BACKTRACE))
|
||||
# define SAVE_CALL_CHAIN_IN_GC
|
||||
/* This is only safe if the call chain save mechanism won't end up */
|
||||
/* calling GC_malloc. The GNU C library documentation suggests */
|
||||
/* that backtrace doesn't use malloc, but at least the initial */
|
||||
/* call in some versions does seem to invoke the dynamic linker, */
|
||||
/* which uses malloc. */
|
||||
#endif
|
||||
|
||||
/* some more variables */
|
||||
|
||||
extern signed_word GC_mem_found; /* Number of reclaimed longwords */
|
||||
@@ -114,6 +104,8 @@ word GC_free_space_divisor = 3;
|
||||
extern GC_bool GC_collection_in_progress();
|
||||
/* Collection is in progress, or was abandoned. */
|
||||
|
||||
extern GC_bool GC_print_back_height;
|
||||
|
||||
int GC_never_stop_func GC_PROTO((void)) { return(0); }
|
||||
|
||||
unsigned long GC_time_limit = TIME_LIMIT;
|
||||
@@ -141,7 +133,7 @@ int GC_n_attempts = 0; /* Number of attempts at finishing */
|
||||
if (GC_print_stats) {
|
||||
GC_printf0("Abandoning stopped marking after ");
|
||||
GC_printf1("%lu msecs", (unsigned long)time_diff);
|
||||
GC_printf1("(attempt %ld)\n", (unsigned long) GC_n_attempts);
|
||||
GC_printf1("(attempt %d)\n", (unsigned long) GC_n_attempts);
|
||||
}
|
||||
# endif
|
||||
return(1);
|
||||
@@ -206,8 +198,7 @@ word GC_adj_words_allocd()
|
||||
/* had been reallocated this round. Finalization is user */
|
||||
/* visible progress. And if we don't count this, we have */
|
||||
/* stability problems for programs that finalize all objects. */
|
||||
if ((GC_words_wasted >> 3) < result)
|
||||
result += GC_words_wasted;
|
||||
result += GC_words_wasted;
|
||||
/* This doesn't reflect useful work. But if there is lots of */
|
||||
/* new fragmentation, the same is probably true of the heap, */
|
||||
/* and the collection will be correspondingly cheaper. */
|
||||
@@ -232,8 +223,6 @@ void GC_clear_a_few_frames()
|
||||
{
|
||||
# define NWORDS 64
|
||||
word frames[NWORDS];
|
||||
/* Some compilers will warn that frames was set but never used. */
|
||||
/* That's the whole idea ... */
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < NWORDS; i++) frames[i] = 0;
|
||||
@@ -310,7 +299,7 @@ void GC_maybe_gc()
|
||||
# endif
|
||||
if (GC_stopped_mark(GC_time_limit == GC_TIME_UNLIMITED?
|
||||
GC_never_stop_func : GC_timeout_stop_func)) {
|
||||
# ifdef SAVE_CALL_CHAIN_IN_GC
|
||||
# ifdef SAVE_CALL_CHAIN
|
||||
GC_save_callers(GC_last_stack);
|
||||
# endif
|
||||
GC_finish_collection();
|
||||
@@ -379,7 +368,7 @@ GC_stop_func stop_func;
|
||||
}
|
||||
GC_invalidate_mark_state(); /* Flush mark stack. */
|
||||
GC_clear_marks();
|
||||
# ifdef SAVE_CALL_CHAIN_IN_GC
|
||||
# ifdef SAVE_CALL_CHAIN
|
||||
GC_save_callers(GC_last_stack);
|
||||
# endif
|
||||
GC_is_full_gc = TRUE;
|
||||
@@ -434,7 +423,7 @@ int n;
|
||||
for (i = GC_deficit; i < GC_RATE*n; i++) {
|
||||
if (GC_mark_some((ptr_t)0)) {
|
||||
/* Need to finish a collection */
|
||||
# ifdef SAVE_CALL_CHAIN_IN_GC
|
||||
# ifdef SAVE_CALL_CHAIN
|
||||
GC_save_callers(GC_last_stack);
|
||||
# endif
|
||||
# ifdef PARALLEL_MARK
|
||||
@@ -971,7 +960,7 @@ word n;
|
||||
# endif
|
||||
expansion_slop = WORDS_TO_BYTES(min_words_allocd()) + 4*MAXHINCR*HBLKSIZE;
|
||||
if (GC_last_heap_addr == 0 && !((word)space & SIGNB)
|
||||
|| (GC_last_heap_addr != 0 && GC_last_heap_addr < (ptr_t)space)) {
|
||||
|| GC_last_heap_addr != 0 && GC_last_heap_addr < (ptr_t)space) {
|
||||
/* Assume the heap is growing up */
|
||||
GC_greatest_plausible_heap_addr =
|
||||
(GC_PTR)GC_max((ptr_t)GC_greatest_plausible_heap_addr,
|
||||
@@ -1040,9 +1029,9 @@ word needed_blocks;
|
||||
GC_bool ignore_off_page;
|
||||
{
|
||||
if (!GC_incremental && !GC_dont_gc &&
|
||||
((GC_dont_expand && GC_words_allocd > 0)
|
||||
|| (GC_fo_entries > (last_fo_entries + 500) && (last_words_finalized || GC_words_finalized))
|
||||
|| GC_should_collect())) {
|
||||
(GC_dont_expand && GC_words_allocd > 0
|
||||
|| (GC_fo_entries > (last_fo_entries + 500) && (last_words_finalized || GC_words_finalized))
|
||||
|| GC_should_collect())) {
|
||||
GC_gcollect_inner();
|
||||
last_fo_entries = GC_fo_entries;
|
||||
last_words_finalized = GC_words_finalized;
|
||||
@@ -1053,9 +1042,6 @@ GC_bool ignore_off_page;
|
||||
if (blocks_to_get > MAXHINCR) {
|
||||
word slop;
|
||||
|
||||
/* Get the minimum required to make it likely that we */
|
||||
/* can satisfy the current request in the presence of black- */
|
||||
/* listing. This will probably be more than MAXHINCR. */
|
||||
if (ignore_off_page) {
|
||||
slop = 4;
|
||||
} else {
|
||||
|
||||
+13
-12
@@ -1,3 +1,4 @@
|
||||
# $Id$
|
||||
.arch ev6
|
||||
|
||||
.text
|
||||
@@ -11,13 +12,13 @@ GC_push_regs:
|
||||
.mask 0x04000000, 0
|
||||
.frame $sp, 16, $26, 0
|
||||
|
||||
/* $0 integer result */
|
||||
/* $1-$8 temp regs - not preserved cross calls */
|
||||
/* $9-$15 call saved regs */
|
||||
/* $16-$21 argument regs - not preserved cross calls */
|
||||
/* $22-$28 temp regs - not preserved cross calls */
|
||||
/* $29 global pointer - not preserved cross calls */
|
||||
/* $30 stack pointer */
|
||||
# $0 integer result
|
||||
# $1-$8 temp regs - not preserved cross calls
|
||||
# $9-$15 call saved regs
|
||||
# $16-$21 argument regs - not preserved cross calls
|
||||
# $22-$28 temp regs - not preserved cross calls
|
||||
# $29 global pointer - not preserved cross calls
|
||||
# $30 stack pointer
|
||||
|
||||
# define call_push(x) \
|
||||
mov x, $16; \
|
||||
@@ -32,12 +33,12 @@ GC_push_regs:
|
||||
call_push($14)
|
||||
call_push($15)
|
||||
|
||||
/* $f0-$f1 floating point results */
|
||||
/* $f2-$f9 call saved regs */
|
||||
/* $f10-$f30 temp regs - not preserved cross calls */
|
||||
# $f0-$f1 floating point results
|
||||
# $f2-$f9 call saved regs
|
||||
# $f10-$f30 temp regs - not preserved cross calls
|
||||
|
||||
/* Use the most efficient transfer method for this hardware. */
|
||||
/* Bit 1 detects the FIX extension, which includes ftoit. */
|
||||
# Use the most efficient transfer method for this hardware.
|
||||
# Bit 1 detects the FIX extension, which includes ftoit.
|
||||
amask 2, $0
|
||||
bne $0, $use_stack
|
||||
|
||||
|
||||
+12
-31
@@ -85,7 +85,7 @@ static back_edges * new_back_edges(void)
|
||||
{
|
||||
if (0 == back_edge_space) {
|
||||
back_edge_space = (back_edges *)
|
||||
GET_MEM(MAX_BACK_EDGE_STRUCTS*sizeof(back_edges));
|
||||
sbrk(MAX_BACK_EDGE_STRUCTS*sizeof(back_edges));
|
||||
}
|
||||
if (0 != avail_back_edges) {
|
||||
back_edges * result = avail_back_edges;
|
||||
@@ -113,31 +113,17 @@ static void deallocate_back_edges(back_edges *p)
|
||||
/* Table of objects that are currently on the depth-first search */
|
||||
/* stack. Only objects with in-degree one are in this table. */
|
||||
/* Other objects are identified using HEIGHT_IN_PROGRESS. */
|
||||
/* FIXME: This data structure NEEDS IMPROVEMENT. */
|
||||
#define INITIAL_IN_PROGRESS 10000
|
||||
/* This data structure NEEDS IMPROVEMENT. */
|
||||
#define MAX_IN_PROGRESS 10000
|
||||
static ptr_t * in_progress_space = 0;
|
||||
static size_t in_progress_size = 0;
|
||||
static size_t n_in_progress = 0;
|
||||
static int n_in_progress = 0;
|
||||
|
||||
static void push_in_progress(ptr_t p)
|
||||
{
|
||||
if (n_in_progress >= in_progress_size)
|
||||
if (in_progress_size == 0) {
|
||||
in_progress_size = INITIAL_IN_PROGRESS;
|
||||
in_progress_space = (ptr_t *)GET_MEM(in_progress_size * sizeof(ptr_t));
|
||||
} else {
|
||||
ptr_t * new_in_progress_space;
|
||||
in_progress_size *= 2;
|
||||
new_in_progress_space = (ptr_t *)
|
||||
GET_MEM(in_progress_size * sizeof(ptr_t));
|
||||
BCOPY(in_progress_space, new_in_progress_space,
|
||||
n_in_progress * sizeof(ptr_t));
|
||||
in_progress_space = new_in_progress_space;
|
||||
/* FIXME: This just drops the old space. */
|
||||
}
|
||||
if (in_progress_space == 0)
|
||||
ABORT("MAKE_BACK_GRAPH: Out of in-progress space: "
|
||||
"Huge linear data structure?");
|
||||
in_progress_space = sbrk(MAX_IN_PROGRESS * sizeof(ptr_t));
|
||||
if (n_in_progress == MAX_IN_PROGRESS)
|
||||
ABORT("Exceeded MAX_IN_PROGRESS");
|
||||
in_progress_space[n_in_progress++] = p;
|
||||
}
|
||||
|
||||
@@ -332,8 +318,8 @@ static void add_back_edges(ptr_t p, word n_words, word gc_descr)
|
||||
}
|
||||
}
|
||||
|
||||
/* Rebuild the representation of the backward reachability graph. */
|
||||
/* Does not examine mark bits. Can be called before GC. */
|
||||
/* Rebuild the reprentation of the backward reachability graph. */
|
||||
/* Does not examine mark bits. Can be called before GC. */
|
||||
void GC_build_back_graph(void)
|
||||
{
|
||||
GC_apply_to_each_object(add_back_edges);
|
||||
@@ -438,20 +424,15 @@ static void update_max_height(ptr_t p, word n_words, word gc_descr)
|
||||
}
|
||||
}
|
||||
|
||||
word GC_max_max_height = 0;
|
||||
|
||||
void GC_traverse_back_graph(void)
|
||||
{
|
||||
static word max_max_height = 0;
|
||||
GC_max_height = 0;
|
||||
GC_apply_to_each_object(update_max_height);
|
||||
}
|
||||
|
||||
void GC_print_back_graph_stats(void)
|
||||
{
|
||||
GC_printf2("Maximum backwards height of reachable objects at GC %lu is %ld\n",
|
||||
(unsigned long) GC_gc_no, GC_max_height);
|
||||
if (GC_max_height > GC_max_max_height) {
|
||||
GC_max_max_height = GC_max_height;
|
||||
if (GC_max_height > max_max_height) {
|
||||
max_max_height = GC_max_height;
|
||||
GC_printf0("The following unreachable object is last in a longest chain "
|
||||
"of unreachable objects:\n");
|
||||
GC_print_heap_obj(GC_deepest_obj);
|
||||
|
||||
+26
-37
@@ -15,9 +15,9 @@
|
||||
dnl Process this file with autoconf to produce configure.
|
||||
|
||||
AC_PREREQ(2.53)
|
||||
AC_INIT(libgc-mono, 6.6, [email protected])
|
||||
AC_INIT(libgc-mono, 6.3alpha6, [email protected])
|
||||
|
||||
AM_INIT_AUTOMAKE(libgc-mono, 6.6, no-define)
|
||||
AM_INIT_AUTOMAKE(libgc-mono, 6.2, no-define)
|
||||
|
||||
AC_CONFIG_SRCDIR(gcj_mlc.c)
|
||||
AC_CANONICAL_HOST
|
||||
@@ -67,15 +67,14 @@ AC_ARG_ENABLE(cplusplus,
|
||||
)
|
||||
|
||||
INCLUDES=-I${srcdir}/include
|
||||
THREADDLLIBS=
|
||||
## Libraries needed to support dynamic loading and/or threads.
|
||||
THREADLIBS=
|
||||
case "$THREADS" in
|
||||
no | none | single)
|
||||
THREADS=none
|
||||
;;
|
||||
posix | pthreads)
|
||||
THREADS=posix
|
||||
THREADDLLIBS=-lpthread
|
||||
THREADLIBS=-lpthread
|
||||
case "$host" in
|
||||
x86-*-linux* | ia64-*-linux* | i386-*-linux* | i486-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | s390*-*-linux* | sparc*-*-linux* | powerpc-*-linux*)
|
||||
AC_DEFINE(GC_LINUX_THREADS)
|
||||
@@ -101,7 +100,7 @@ case "$THREADS" in
|
||||
AC_DEFINE(PARALLEL_MARK)
|
||||
fi
|
||||
AC_DEFINE(THREAD_LOCAL_ALLOC)
|
||||
THREADDLLIBS="-lpthread -lrt"
|
||||
THREADLIBS="-lpthread -lrt"
|
||||
;;
|
||||
*-*-freebsd4*)
|
||||
AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
|
||||
@@ -112,16 +111,22 @@ case "$THREADS" in
|
||||
INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
|
||||
fi
|
||||
if test "x$PTHREAD_LIBS" = "x"; then
|
||||
THREADDLLIBS=-pthread
|
||||
THREADLIBS=-pthread
|
||||
else
|
||||
THREADDLLIBS=$PTHREAD_LIBS
|
||||
THREADLIBS=$PTHREAD_LIBS
|
||||
fi
|
||||
;;
|
||||
*-*-freebsd5*)
|
||||
AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
|
||||
AC_DEFINE(GC_FREEBSD_THREADS)
|
||||
INCLUDES="$INCLUDES -pthread"
|
||||
THREADDLLIBS=-pthread
|
||||
if test "x$PTHREAD_CFLAGS" != "x"; then
|
||||
INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
|
||||
fi
|
||||
if test "x$PTHREAD_LIBS" = "x"; then
|
||||
THREADLIBS=-pthread
|
||||
else
|
||||
THREADLIBS="$PTHREAD_LIBS"
|
||||
fi
|
||||
;;
|
||||
*-*-freebsd6*)
|
||||
AC_DEFINE(GC_FREEBSD_THREADS)
|
||||
@@ -129,9 +134,9 @@ case "$THREADS" in
|
||||
INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
|
||||
fi
|
||||
if test "x$PTHREAD_LIBS" = "x"; then
|
||||
THREADDLLIBS=-pthread
|
||||
THREADLIBS=-pthread
|
||||
else
|
||||
THREADDLLIBS="$PTHREAD_LIBS"
|
||||
THREADLIBS="$PTHREAD_LIBS"
|
||||
fi
|
||||
;;
|
||||
*-*-solaris*)
|
||||
@@ -160,10 +165,7 @@ case "$THREADS" in
|
||||
# Measurements havent yet been done.
|
||||
fi
|
||||
INCLUDES="$INCLUDES -pthread"
|
||||
THREADDLLIBS="-lpthread -lrt"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
|
||||
THREADLIBS="-lpthread -lrt"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -177,9 +179,9 @@ case "$THREADS" in
|
||||
;;
|
||||
dgux386)
|
||||
THREADS=dgux386
|
||||
AC_MSG_RESULT($THREADDLLIBS)
|
||||
AC_MSG_RESULT($THREADLIBS)
|
||||
# Use pthread GCC switch
|
||||
THREADDLLIBS=-pthread
|
||||
THREADLIBS=-pthread
|
||||
if test "${enable_parallel_mark}" = yes; then
|
||||
AC_DEFINE(PARALLEL_MARK)
|
||||
fi
|
||||
@@ -191,7 +193,7 @@ case "$THREADS" in
|
||||
;;
|
||||
aix)
|
||||
THREADS=posix
|
||||
THREADDLLIBS=-lpthread
|
||||
THREADLIBS=-lpthread
|
||||
AC_DEFINE(GC_AIX_THREADS)
|
||||
AC_DEFINE(_REENTRANT)
|
||||
;;
|
||||
@@ -202,7 +204,7 @@ case "$THREADS" in
|
||||
AC_MSG_ERROR($THREADS is an unknown thread package)
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(THREADDLLIBS)
|
||||
AC_SUBST(THREADLIBS)
|
||||
|
||||
case "$host" in
|
||||
powerpc-*-darwin*)
|
||||
@@ -211,25 +213,12 @@ case "$host" in
|
||||
esac
|
||||
AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
|
||||
|
||||
AC_MSG_CHECKING(for xlc)
|
||||
AC_TRY_COMPILE([],[
|
||||
#ifndef __xlC__
|
||||
# error
|
||||
#endif
|
||||
], [compiler_xlc=yes], [compiler_xlc=no])
|
||||
AC_MSG_RESULT($compiler_xlc)
|
||||
AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
|
||||
if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
|
||||
# the darwin stack-frame-walking code is completely broken on xlc
|
||||
AC_DEFINE(DARWIN_DONT_PARSE_STACK)
|
||||
fi
|
||||
|
||||
# We never want libdl on darwin. It is a fake libdl that just ends up making
|
||||
# dyld calls anyway
|
||||
case "$host" in
|
||||
*-*-darwin*) ;;
|
||||
*)
|
||||
AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
|
||||
AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -330,7 +319,7 @@ case "$host" in
|
||||
machdep="sparc_mach_dep.lo"
|
||||
AC_DEFINE(SUNOS53_SHARED_LIB)
|
||||
;;
|
||||
sparc*-sun-solaris2.*)
|
||||
sparc-sun-solaris2.*)
|
||||
machdep="sparc_mach_dep.lo"
|
||||
;;
|
||||
ia64-*-*)
|
||||
@@ -392,10 +381,10 @@ AC_MSG_RESULT($THREADS)
|
||||
|
||||
dnl As of 4.13a2, the collector will not properly work on Solaris when
|
||||
dnl built with gcc and -O. So we remove -O in the appropriate case.
|
||||
dnl Not needed anymore on Solaris.
|
||||
dnl
|
||||
AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
|
||||
case "$host" in
|
||||
*aix*)
|
||||
sparc-sun-solaris2*|*aix*)
|
||||
if test "$GCC" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
new_CFLAGS=
|
||||
|
||||
@@ -59,7 +59,7 @@ static int extract_conv_spec(CORD_pos source, char *buf,
|
||||
register int result = 0;
|
||||
register int current_number = 0;
|
||||
register int saw_period = 0;
|
||||
register int saw_number = 0;
|
||||
register int saw_number;
|
||||
register int chars_so_far = 0;
|
||||
register char current;
|
||||
|
||||
@@ -243,7 +243,7 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args)
|
||||
char * str = va_arg(args, char *);
|
||||
register char c;
|
||||
|
||||
while ((c = *str++)) {
|
||||
while (c = *str++) {
|
||||
CORD_ec_append(result, c);
|
||||
}
|
||||
goto done;
|
||||
@@ -320,7 +320,7 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args)
|
||||
if (buf != result[0].ec_bufptr) {
|
||||
register char c;
|
||||
|
||||
while ((c = *buf++)) {
|
||||
while (c = *buf++) {
|
||||
CORD_ec_append(result, c);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -221,7 +221,7 @@ void test_printf()
|
||||
if (CORD_cmp(result, result2) != 0)ABORT("CORD_sprintf goofed 5");
|
||||
}
|
||||
|
||||
int main()
|
||||
main()
|
||||
{
|
||||
# ifdef THINK_C
|
||||
printf("cordtest:\n");
|
||||
|
||||
+15
-129
@@ -12,33 +12,23 @@
|
||||
Page 50: "If a leaf procedure's red zone usage would exceed 224 bytes, then
|
||||
it must set up a stack frame just like routines that call other routines."
|
||||
*/
|
||||
#ifdef POWERPC
|
||||
# if CPP_WORDSZ == 32
|
||||
# define PPC_RED_ZONE_SIZE 224
|
||||
# elif CPP_WORDSZ == 64
|
||||
# define PPC_RED_ZONE_SIZE 320
|
||||
# endif
|
||||
#endif
|
||||
#define PPC_RED_ZONE_SIZE 224
|
||||
|
||||
/* Not 64-bit clean. Wait until Apple defines their 64-bit ABI */
|
||||
typedef struct StackFrame {
|
||||
unsigned long savedSP;
|
||||
unsigned long savedCR;
|
||||
unsigned long savedLR;
|
||||
unsigned long reserved[2];
|
||||
unsigned long savedRTOC;
|
||||
unsigned int savedSP;
|
||||
unsigned int savedCR;
|
||||
unsigned int savedLR;
|
||||
unsigned int reserved[2];
|
||||
unsigned int savedRTOC;
|
||||
} StackFrame;
|
||||
|
||||
unsigned long FindTopOfStack(unsigned int stack_start) {
|
||||
|
||||
unsigned int FindTopOfStack(unsigned int stack_start) {
|
||||
StackFrame *frame;
|
||||
|
||||
if (stack_start == 0) {
|
||||
# ifdef POWERPC
|
||||
# if CPP_WORDSZ == 32
|
||||
__asm__ volatile("lwz %0,0(r1)" : "=r" (frame));
|
||||
# else
|
||||
__asm__ volatile("ldz %0,0(r1)" : "=r" (frame));
|
||||
# endif
|
||||
# endif
|
||||
__asm__ volatile("lwz %0,0(r1)" : "=r" (frame));
|
||||
} else {
|
||||
frame = (StackFrame *)stack_start;
|
||||
}
|
||||
@@ -47,7 +37,7 @@ unsigned long FindTopOfStack(unsigned int stack_start) {
|
||||
/* GC_printf1("FindTopOfStack start at sp = %p\n", frame); */
|
||||
# endif
|
||||
do {
|
||||
if (frame->savedSP == 0) break;
|
||||
if (frame->savedSP == NULL) break;
|
||||
/* if there are no more stack frames, stop */
|
||||
|
||||
frame = (StackFrame*)frame->savedSP;
|
||||
@@ -63,108 +53,9 @@ unsigned long FindTopOfStack(unsigned int stack_start) {
|
||||
/* GC_printf1("FindTopOfStack finish at sp = %p\n", frame); */
|
||||
# endif
|
||||
|
||||
return (unsigned long)frame;
|
||||
return (unsigned int)frame;
|
||||
}
|
||||
|
||||
#ifdef DARWIN_DONT_PARSE_STACK
|
||||
void GC_push_all_stacks() {
|
||||
int i;
|
||||
kern_return_t r;
|
||||
GC_thread p;
|
||||
pthread_t me;
|
||||
ptr_t lo, hi;
|
||||
#if defined(POWERPC)
|
||||
ppc_thread_state_t state;
|
||||
#elif defined(I386)
|
||||
i386_thread_state_t state;
|
||||
#else
|
||||
# error FIXME for non-x86 || ppc architectures
|
||||
#endif
|
||||
mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
|
||||
|
||||
me = pthread_self();
|
||||
if (!GC_thr_initialized) GC_thr_init();
|
||||
|
||||
for(i=0;i<THREAD_TABLE_SZ;i++) {
|
||||
for(p=GC_threads[i];p!=0;p=p->next) {
|
||||
if(p -> flags & FINISHED) continue;
|
||||
if(pthread_equal(p->id,me)) {
|
||||
lo = GC_approx_sp();
|
||||
} else {
|
||||
/* Get the thread state (registers, etc) */
|
||||
r = thread_get_state(
|
||||
p->stop_info.mach_thread,
|
||||
MACHINE_THREAD_STATE,
|
||||
(natural_t*)&state,
|
||||
&thread_state_count);
|
||||
if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
|
||||
|
||||
#if defined(I386)
|
||||
lo = state.esp;
|
||||
|
||||
GC_push_one(state.eax);
|
||||
GC_push_one(state.ebx);
|
||||
GC_push_one(state.ecx);
|
||||
GC_push_one(state.edx);
|
||||
GC_push_one(state.edi);
|
||||
GC_push_one(state.esi);
|
||||
GC_push_one(state.ebp);
|
||||
#elif defined(POWERPC)
|
||||
lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);
|
||||
|
||||
GC_push_one(state.r0);
|
||||
GC_push_one(state.r2);
|
||||
GC_push_one(state.r3);
|
||||
GC_push_one(state.r4);
|
||||
GC_push_one(state.r5);
|
||||
GC_push_one(state.r6);
|
||||
GC_push_one(state.r7);
|
||||
GC_push_one(state.r8);
|
||||
GC_push_one(state.r9);
|
||||
GC_push_one(state.r10);
|
||||
GC_push_one(state.r11);
|
||||
GC_push_one(state.r12);
|
||||
GC_push_one(state.r13);
|
||||
GC_push_one(state.r14);
|
||||
GC_push_one(state.r15);
|
||||
GC_push_one(state.r16);
|
||||
GC_push_one(state.r17);
|
||||
GC_push_one(state.r18);
|
||||
GC_push_one(state.r19);
|
||||
GC_push_one(state.r20);
|
||||
GC_push_one(state.r21);
|
||||
GC_push_one(state.r22);
|
||||
GC_push_one(state.r23);
|
||||
GC_push_one(state.r24);
|
||||
GC_push_one(state.r25);
|
||||
GC_push_one(state.r26);
|
||||
GC_push_one(state.r27);
|
||||
GC_push_one(state.r28);
|
||||
GC_push_one(state.r29);
|
||||
GC_push_one(state.r30);
|
||||
GC_push_one(state.r31);
|
||||
#else
|
||||
# error FIXME for non-x86 || ppc architectures
|
||||
#endif
|
||||
} /* p != me */
|
||||
if(p->flags & MAIN_THREAD)
|
||||
hi = GC_stackbottom;
|
||||
else
|
||||
hi = p->stack_end;
|
||||
#if DEBUG_THREADS
|
||||
GC_printf3("Darwin: Stack for thread 0x%lx = [%lx,%lx)\n",
|
||||
(unsigned long) p -> id,
|
||||
(unsigned long) lo,
|
||||
(unsigned long) hi
|
||||
);
|
||||
#endif
|
||||
GC_push_all_stack(lo,hi);
|
||||
} /* for(p=GC_threads[i]...) */
|
||||
} /* for(i=0;i<THREAD_TABLE_SZ...) */
|
||||
}
|
||||
|
||||
#else /* !DARWIN_DONT_PARSE_STACK; Use FindTopOfStack() */
|
||||
|
||||
void GC_push_all_stacks() {
|
||||
int i;
|
||||
kern_return_t r;
|
||||
@@ -184,12 +75,8 @@ void GC_push_all_stacks() {
|
||||
lo = GC_approx_sp();
|
||||
hi = (ptr_t)FindTopOfStack(0);
|
||||
} else {
|
||||
# if defined(POWERPC)
|
||||
# if CPP_WORDSZ == 32
|
||||
# ifdef POWERPC
|
||||
ppc_thread_state_t info;
|
||||
# else
|
||||
ppc_thread_state64_t info;
|
||||
# endif
|
||||
mach_msg_type_number_t outCount = THREAD_STATE_MAX;
|
||||
r = thread_get_state(thread, MACHINE_THREAD_STATE,
|
||||
(natural_t *)&info, &outCount);
|
||||
@@ -269,7 +156,6 @@ void GC_push_all_stacks() {
|
||||
} /* for(p=GC_threads[i]...) */
|
||||
vm_deallocate(current_task(), (vm_address_t)act_list, sizeof(thread_t) * listcount);
|
||||
}
|
||||
#endif /* !DARWIN_DONT_PARSE_STACK */
|
||||
|
||||
static mach_port_t GC_mach_handler_thread;
|
||||
static int GC_use_mach_handler_thread = 0;
|
||||
@@ -440,8 +326,6 @@ void GC_start_world()
|
||||
kern_return_t kern_result;
|
||||
thread_act_array_t act_list;
|
||||
mach_msg_type_number_t listcount;
|
||||
struct thread_basic_info info;
|
||||
mach_msg_type_number_t outCount = THREAD_INFO_MAX;
|
||||
|
||||
# if DEBUG_THREADS
|
||||
GC_printf0("World starting\n");
|
||||
@@ -468,6 +352,8 @@ void GC_start_world()
|
||||
# endif
|
||||
continue;
|
||||
}
|
||||
struct thread_basic_info info;
|
||||
mach_msg_type_number_t outCount = THREAD_INFO_MAX;
|
||||
kern_result = thread_info(thread, THREAD_BASIC_INFO,
|
||||
(thread_info_t)&info, &outCount);
|
||||
if(kern_result != KERN_SUCCESS) continue;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ are GPL'ed, but with an exception that should cover all uses in the
|
||||
collector. (If you are concerned about such things, I recommend you look
|
||||
at the notice in config.guess or ltmain.sh.)
|
||||
|
||||
This is version 6.6 of a conservative garbage collector for C and C++.
|
||||
This is version 6.3alpha6 of a conservative garbage collector for C and C++.
|
||||
|
||||
You might find a more recent version of this at
|
||||
|
||||
|
||||
@@ -2076,175 +2076,7 @@ Since 6.3alpha5:
|
||||
- Remove ltconfig, clean up configure messages for DGUX (thanks to
|
||||
Adrian Bunk for the patches).
|
||||
- Integrated NetBSD/OpenBSD patches from Marc Recht and Matthias Drochner.
|
||||
|
||||
Since gc6.3alpha6:
|
||||
- Compile test_cpp.cc with CXXCOMPILE instead of COMPILE.
|
||||
- Very large allocations could cause a collector hang. Correct
|
||||
calculation of GC_collect_at_heapsize.
|
||||
- GC_print_hblkfreelist printed some bogus results if USE_MUNMAP
|
||||
was defined.
|
||||
- The generic GC_THREADS macro didn't work correctly on Solaris,
|
||||
since the implementation failed to include gc_config_macros.h
|
||||
before deciding whether or not to compile the rest of the file.
|
||||
- Threadlibs.c failed to expand the generic GC_THREADS macro.
|
||||
- Correct MacOSX thread stop code. (Thanks to Dick Porter.)
|
||||
- SMALL_OBJ definition was off by one. This could cause crashes
|
||||
at startup. (Thanks to Zoltan Varga for narrowing this down to
|
||||
a trivial test case.)
|
||||
- Integrate Paolo Molara's patch to deal with a race in the Darwin
|
||||
thread stopping code.
|
||||
- Changed X86_64 implementation to use SA_SIGINFO in the MPROTECT_VDB
|
||||
implementation. The old approach appears to have been broken by
|
||||
recent kernels.
|
||||
- Add GC_ATTR_UNUSED to eliminate a warning in gc_allocator.h. (Thanks
|
||||
to Andrew Begel.)
|
||||
- Fix GC_task_self declaration in os_dep.c. (Thanks to Andrew Pinski.)
|
||||
- Increase INITIAL_BUF_SZ in os_dep.c for Solaris /proc reads.
|
||||
|
||||
Since 6.3:
|
||||
- Merge gcconfig.h changes from gcc tree.
|
||||
- Unconditionally include gc_priv.h in solaris_pthreads.c, win32_threads.h,
|
||||
aix_irix_threads.c, and solaris_threads.c to get thread definitions.
|
||||
- Start marker threads in GC_thr_init, so that they get started even
|
||||
if no other threads are ever started. (Oddly enough, the parallel
|
||||
collector worked correctly, though not well, with no helper threads.)
|
||||
- Go ahead and split large blocks in GC_allochblk_nth if GC_dont_gc
|
||||
is set. (Thanks to Alexander Petrossian.)
|
||||
- GC_PRINT_BACK_HEIGHT would deadlock with thread support.
|
||||
- Let in_progress_space in backgraph.s grow dynamically.
|
||||
- Fix README.solaris2. The GC_thr_init() hack doesn't work anymore.
|
||||
- Convert GC_finalizer_mem_freed to bytes in allchblk.c.
|
||||
- Add missing declaration for GC_generic_malloc_words_small_inner.
|
||||
Without it, s390x breaks. (Thanks to Ulrich Weigand.)
|
||||
- Applied several MacOSX patches to support older tool chains.
|
||||
(Thanks to Stefan Ring.)
|
||||
- Bug fix for NetBSD/amd64. (Thanks to Marc Recht.) Add NetBSD/sh3
|
||||
support. (Thanks to Uchiyama Yasushi.)
|
||||
- Fixed an uninitialized variable in cordprnt.c. (Thanks to gcc for
|
||||
providing the warning.)
|
||||
- Eliminated some, but not all, gcc -Wall warnings.
|
||||
- Changed some old style casts to reinterpret_cast in new_gc_alloc.h.
|
||||
(Thanks to Dan Grayson.)
|
||||
- GC_extend_size_map shouldn't adjust for GC_all_interior_pointers if
|
||||
GC_DONT_ADD_BYTE_AT_END is set.
|
||||
- Changed some (long) casts to (word) in preparation for win64.
|
||||
(Thanks to Peter Colson.)
|
||||
- Changed "int stack_size" declaration in pthread_support.c to use
|
||||
size_t. (Only mattered with GC_ASSERTIONS enabled.)
|
||||
- Added CRIS (etrax) support. (Thanks to Simon Posnjak and
|
||||
Hans-Peter Nilsson.)
|
||||
- Removed GC_IGNORE_FB frame buffer recognition, and replaced
|
||||
it with a check that the mapping type is MEM_IMAGE.
|
||||
In theory, this should work much better, but it is a high
|
||||
risk change for win32. (Thanks to Ashley Bone for the crucial
|
||||
experimental data behind this, and to Rutger Ovidus for
|
||||
some further experiments.)
|
||||
- Fixed print_block_list to print the correct kind number for
|
||||
STUBBORN. (Thanks to Rutger Ovidus.)
|
||||
- GC_allochblk_nth incremented GC_words_wasted by bytes rather than
|
||||
words.
|
||||
- Consider GC_words_wasted in GC_adj_words_allocd only if it is within
|
||||
reason. (A hack to avoid some extremely unlikely scenarios in which
|
||||
we manage to allocate only "wasted" space. 7.0 has a better fix.)
|
||||
- Changed PowerPC GC_clear implementation to use lwsync instead of
|
||||
eieio, since the documentation recommends against eieio, and
|
||||
it seems to be incorrect if the preceding memory op is a load.
|
||||
- Fixed print_block_list to print the correct kind number for
|
||||
STUBBORN. (Thanks to Rutger Ovidus.)
|
||||
- Have configure.in generate an error if it is asked to support
|
||||
pthreads, but doesn't know how to.
|
||||
- Added Kazuhiro Inaoka's patch for Renesas M32R support.
|
||||
- Have the GNU build mechanism link with -ldl. Rename THREADLIBS
|
||||
to THREADDLLIBS to reflect this. (Thanks to Sven Verdoolaege.)
|
||||
- Added Hannes Mehnert's patch for FreeBSD/SPARC support.
|
||||
- Merged some FreeBSD specific patches to threadlibs.c and dyn_load.c.
|
||||
(Thanks tp John Merryweather Cooper.)
|
||||
- Define MPROTECT_VDB on MACOSX only if threads are being used, since the
|
||||
dirty page tracking mechanism uses threads. (This avoids an undefined
|
||||
reference to _GC_darwin_register_mach_handler_thread.)
|
||||
- By popular demand, use __libc symbols only if we are built with
|
||||
USE_LIBC_PRIVATES, which is off by default, and not otherwise documented.
|
||||
- Ignore GC_enable_incremental() requests when KEEP_BACK_PTRS is set.
|
||||
The GC itself will dirty lots of pages in this cases, probably making
|
||||
it counterproductive on all platforms. And the DARWIN port crashes.
|
||||
|
||||
Since GC6.4:
|
||||
- Integrated Paolo Molaro's patch to deal with EINTR in sem_wait.
|
||||
- Make GC_approx_sp() write to dummy location to ensure that stack
|
||||
is grown here, when sp looks reasonable, rather than later, when
|
||||
it might look like a bad memory reference. (Problem was never
|
||||
observed that I know of. But on rereading the code it seemed
|
||||
dubious.)
|
||||
- Separate out GC_with_callee_saves_pushed and sometimes call
|
||||
it from GC_suspend_handler in pthread_stop_world.c. Callee-save
|
||||
register values sometimes failed to get traced under HP/UX on
|
||||
PA-RISC. Linux/IA64 had the same problem, though non-stacked
|
||||
callee-save registers seem to be so rarely used there that nobody
|
||||
ever noticed.
|
||||
- Integrated an ancient Darwin powerpc_darwin_machine_dep.s patch
|
||||
from Andreas Tobler, which I had lost.
|
||||
- Fix compare_and_exchange implementation for gcc/IA64 to deal with
|
||||
pickier compiler versions.
|
||||
- Fixed Itanium 32-bit ABI support (HP/UX). In particular, the
|
||||
compare_and_exchange implementation didn't consider that possibility.
|
||||
- Undefine GC_pthread_detach in win32_threads.c. (Thanks to
|
||||
Tagliapietra Tommaso.)
|
||||
- Fixed inclusion of frame.h for NETBSD in os_dep.c.
|
||||
- Applied Dan Bonachea's patch to use mmap on AIX.
|
||||
- Several fixes to resurrect the Irix port on recent OS versions.
|
||||
- Change ALPHA to use LINUX_STACKBOTTOM.
|
||||
- Change SPARC64/LINUX to also use LINUX_STACKBOTTOM. Deal with potential
|
||||
bad values of __libc_stack_end on that platform. (Thanks to David Miller.)
|
||||
- Relax gctest to allow larger heap if ALIGN_DOUBLE isn't set.
|
||||
(Unnecessary in 7.0)
|
||||
- Force a define of __STDC__=0 for the IBM compiler on AIX, so that
|
||||
we get prototypes. (Unnecessary in 7.0)
|
||||
- GC_INIT definition for AIX and CYGWIN referred to DATASTART and DATAEND
|
||||
which are only defined in private include files.
|
||||
- Integrated some small gcconfig.h patches from Dan Bonachea. Also
|
||||
relaxed assertion about FreeBSD stack size in pthread_support.c.
|
||||
- Integrated Andrew Begel's darwin_stop_world.c patch for 64-bit
|
||||
support. This may need additional work.
|
||||
- Avoided potentially infinite recursion in GC_save_callers if
|
||||
the system backtrace calls malloc. The workaround currently requires
|
||||
__thread support if this code is used with threads.
|
||||
- Avoided another similar infinite recursion by conditionally
|
||||
invoking GC_save_callers in alloc.c. (Thanks to Matthias Andree
|
||||
for helping to track down both of these.)
|
||||
- Removed all traces of aix_irix_threads.c. AIX and Irix now use
|
||||
pthread_support.c and pthread_stop_world.c. The old code appeared
|
||||
to be unreliable for AIX, and was not regularly maintained.
|
||||
- On Irix, ignore segments with MA_FETCHOP or MA_NOTCACHED attributed;
|
||||
they're not always safe to read.
|
||||
- Fixed a previously vacuous assertion (diagnosed by the SGI compiler)
|
||||
in GC_remove_from_fl.
|
||||
- Fix stack_size assertion in GC_pthread_create.
|
||||
- Fix assertion in GC_steal_mark_stack.
|
||||
|
||||
Since 6.5
|
||||
- Fix CPU count detection for Irix and FreeBSD. (Thanks to Dan Bonachea.)
|
||||
- Integrate Dan Bonachea's patch for the IBM XLC compiler on Darwin.
|
||||
- Integrated Andreas Tobler's FreeBSD/PowerPC patch.
|
||||
- Don't access the GC thread structure from the restart handler. It's
|
||||
unsafe, since the handler may run too late. (Thanks to Ben Maurer for
|
||||
tracking this down.)
|
||||
- Applied Christian Thalinger's patch to change comment syntax in
|
||||
alpha_mach_dep.S.
|
||||
- Added test for GC_no_dls in GC_dyld_image_add for DARWIN. (Thanks to
|
||||
Juan Jose Garcia Ripoli).
|
||||
- Use LINUX_STACKBOTTOM for Linux/SH and LINUX/ARM. (Thanks to Sugioka
|
||||
Toshinobu and Christian Thalinger.)
|
||||
- Rewrote GC_parse_map_entry. This assumed a fixed column layout of
|
||||
/proc/self/maps on Linux. This ceased to be true about 2 years ago.
|
||||
The old code is probably quite problemetic with -DREDIRECT_MALLOC. It
|
||||
is also used by default for IA64, though I haven't seen actual failures
|
||||
there.
|
||||
- More consistently define HBLKSIZE to 4096 on 64 bit architectures with
|
||||
4K pages. (Thanks to Andrew Haley.)
|
||||
- With win32 threads, GC_stop_world needs to acquire GC_write_cs. (Thanks
|
||||
to Ben Hutchings for the observation and patch.)
|
||||
- Move up struct callinfo declaration to make gcc 4.0.2. happy.
|
||||
|
||||
To do:
|
||||
- The USE_MUNMAP code should really use a separate data structure
|
||||
indexed by physical page to keep track of time since last use of
|
||||
|
||||
@@ -1,16 +1,3 @@
|
||||
6.5 update:
|
||||
I disabled incremental GC on Darwin in this version, since I couldn't
|
||||
get gctest to pass when the GC was built as a dynamic library. Building
|
||||
with -DMPROTECT_VDB (and threads) on the command line should get you
|
||||
back to the old state. - HB
|
||||
|
||||
./configure --enable-cplusplus results in a "make check" failure, probably
|
||||
because the ::delete override ends up in a separate dl, and Darwin dynamic
|
||||
loader semantics appear to be such that this is not really visible to the
|
||||
main program, unlike on ELF systems. Someone who understands dynamic
|
||||
loading needs to lookat this. For now, gc_cpp.o needs to be linked
|
||||
statically, if needed. - HB
|
||||
|
||||
Darwin/MacOSX Support - December 16, 2003
|
||||
=========================================
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@ GC_IGNORE_FB[=<n>] - (Win32 only.) Try to avoid treating a mapped
|
||||
are never honored, eliminating this risk for most,
|
||||
but not all, applications. This feature is likely to disappear
|
||||
if/when we find a less disgusting "solution".
|
||||
IN VERSION 6.4 AND LATER, THIS SHOULD BE UNNECESSARY.
|
||||
|
||||
The following turn on runtime flags that are also program settable. Checked
|
||||
only during initialization. We expect that they will usually be set through
|
||||
|
||||
@@ -19,10 +19,10 @@ Linux threads. These should not be touched by the client program.
|
||||
|
||||
To use threads, you need to abide by the following requirements:
|
||||
|
||||
1) You need to use LinuxThreads or NPTL (which are included in libc6).
|
||||
1) You need to use LinuxThreads (which are included in libc6).
|
||||
|
||||
The collector relies on some implementation details of the LinuxThreads
|
||||
package. This code may not work on other
|
||||
package. It is unlikely that this code will work on other
|
||||
pthread implementations (in particular it will *not* work with
|
||||
MIT pthreads).
|
||||
|
||||
|
||||
@@ -43,7 +43,9 @@ can result in unpleasant heap growth. But it seems better than the
|
||||
race/deadlock issues we had before.
|
||||
|
||||
If solaris_threads are used on an X86 processor with malloc redirected to
|
||||
GC_malloc a deadlock is likely to result.
|
||||
GC_malloc, it is necessary to call GC_thr_init explicitly before forking the
|
||||
first thread. (This avoids a deadlock arising from calling GC_thr_init
|
||||
with the allocation lock held.)
|
||||
|
||||
It appears that there is a problem in using gc_cpp.h in conjunction with
|
||||
Solaris threads and Sun's C++ runtime. Apparently the overloaded new operator
|
||||
|
||||
+31
-48
@@ -96,7 +96,7 @@
|
||||
/* Newer versions of GNU/Linux define this macro. We
|
||||
* define it similarly for any ELF systems that don't. */
|
||||
# ifndef ElfW
|
||||
# if defined(FREEBSD)
|
||||
# ifdef FREEBSD
|
||||
# if __ELF_WORD_SIZE == 32
|
||||
# define ElfW(type) Elf32_##type
|
||||
# else
|
||||
@@ -114,7 +114,7 @@
|
||||
# define ElfW(type) Elf32_##type
|
||||
# else
|
||||
# define ElfW(type) Elf64_##type
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -493,6 +493,7 @@ static struct link_map *
|
||||
GC_FirstDLOpenedLinkMap()
|
||||
{
|
||||
ElfW(Dyn) *dp;
|
||||
struct r_debug *r;
|
||||
static struct link_map *cachedResult = 0;
|
||||
|
||||
if( _DYNAMIC == 0) {
|
||||
@@ -501,12 +502,6 @@ GC_FirstDLOpenedLinkMap()
|
||||
if( cachedResult == 0 ) {
|
||||
int tag;
|
||||
for( dp = _DYNAMIC; (tag = dp->d_tag) != 0; dp++ ) {
|
||||
/* FIXME: The DT_DEBUG header is not mandated by the */
|
||||
/* ELF spec. This code appears to be dependent on */
|
||||
/* idiosynchracies of older GNU tool chains. If this code */
|
||||
/* fails for you, the real problem is probably that it is */
|
||||
/* being used at all. You should be getting the */
|
||||
/* dl_iterate_phdr version. */
|
||||
if( tag == DT_DEBUG ) {
|
||||
struct link_map *lm
|
||||
= ((struct r_debug *)(dp->d_un.d_ptr))->r_map;
|
||||
@@ -631,8 +626,7 @@ void GC_register_dynamic_libraries()
|
||||
}
|
||||
for (i = 0; i < needed_sz; i++) {
|
||||
flags = addr_map[i].pr_mflags;
|
||||
if ((flags & (MA_BREAK | MA_STACK | MA_PHYS
|
||||
| MA_FETCHOP | MA_NOTCACHED)) != 0) goto irrelevant;
|
||||
if ((flags & (MA_BREAK | MA_STACK | MA_PHYS)) != 0) goto irrelevant;
|
||||
if ((flags & (MA_READ | MA_WRITE)) != (MA_READ | MA_WRITE))
|
||||
goto irrelevant;
|
||||
/* The latter test is empirically useless in very old Irix */
|
||||
@@ -754,10 +748,6 @@ void GC_register_dynamic_libraries()
|
||||
|
||||
# define HAVE_REGISTER_MAIN_STATIC_DATA
|
||||
|
||||
/* The frame buffer testing code is dead in this version. */
|
||||
/* We leave it here temporarily in case the switch to just */
|
||||
/* testing for MEM_IMAGE sections causes un expected */
|
||||
/* problems. */
|
||||
GC_bool GC_warn_fb = TRUE; /* Warn about traced likely */
|
||||
/* graphics memory. */
|
||||
GC_bool GC_disallow_ignore_fb = FALSE;
|
||||
@@ -772,27 +762,25 @@ void GC_register_dynamic_libraries()
|
||||
|
||||
/* Should [start, start+len) be treated as a frame buffer */
|
||||
/* and ignored? */
|
||||
/* Unfortunately, we currently are not quite sure how to tell */
|
||||
/* this automatically, and rely largely on user input. */
|
||||
/* We expect that any mapping with type MEM_MAPPED (which */
|
||||
/* apparently excludes library data sections) can be safely */
|
||||
/* ignored. But we're too chicken to do that in this */
|
||||
/* version. */
|
||||
/* Unfortunately, we currently have no real way to tell */
|
||||
/* automatically, and rely largely on user input. */
|
||||
/* FIXME: If we had more data on this phenomenon (e.g. */
|
||||
/* is start aligned to a MB multiple?) we should be able to */
|
||||
/* do better. */
|
||||
/* Based on a very limited sample, it appears that: */
|
||||
/* - Frame buffer mappings appear as mappings of large */
|
||||
/* length, usually a bit less than a power of two. */
|
||||
/* - The definition of "a bit less" in the above cannot */
|
||||
/* be made more precise. */
|
||||
/* - Have a starting address at best 64K aligned. */
|
||||
/* - Have type == MEM_MAPPED. */
|
||||
static GC_bool is_frame_buffer(ptr_t start, size_t len, DWORD tp)
|
||||
/* - Frame buffer mappings appear as mappings of length */
|
||||
/* 2**n MB - 192K. (We guess the 192K can vary a bit.) */
|
||||
/* - Have a stating address at best 64K aligned. */
|
||||
/* I'd love more information about the mapping, since I */
|
||||
/* can't reproduce the problem. */
|
||||
static GC_bool is_frame_buffer(ptr_t start, size_t len)
|
||||
{
|
||||
static GC_bool initialized = FALSE;
|
||||
# define MB (1024*1024)
|
||||
# define DEFAULT_FB_MB 15
|
||||
# define MIN_FB_MB 3
|
||||
|
||||
if (GC_disallow_ignore_fb || tp != MEM_MAPPED) return FALSE;
|
||||
if (GC_disallow_ignore_fb) return FALSE;
|
||||
if (!initialized) {
|
||||
char * ignore_fb_string = GETENV("GC_IGNORE_FB");
|
||||
|
||||
@@ -881,11 +869,7 @@ void GC_register_dynamic_libraries()
|
||||
&& (protect == PAGE_EXECUTE_READWRITE
|
||||
|| protect == PAGE_READWRITE)
|
||||
&& !GC_is_heap_base(buf.AllocationBase)
|
||||
/* This used to check for
|
||||
* !is_frame_buffer(p, buf.RegionSize, buf.Type)
|
||||
* instead of just checking for MEM_IMAGE.
|
||||
* If something breaks, change it back. */
|
||||
&& buf.Type == MEM_IMAGE) {
|
||||
&& !is_frame_buffer(p, buf.RegionSize)) {
|
||||
# ifdef DEBUG_VIRTUALQUERY
|
||||
GC_dump_meminfo(&buf);
|
||||
# endif
|
||||
@@ -1141,22 +1125,21 @@ static const char *GC_dyld_name_for_hdr(struct mach_header *hdr) {
|
||||
static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) {
|
||||
unsigned long start,end,i;
|
||||
const struct section *sec;
|
||||
if (GC_no_dls) return;
|
||||
for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
|
||||
sec = getsectbynamefromheader(
|
||||
hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
|
||||
if(sec == NULL || sec->size == 0) continue;
|
||||
start = slide + sec->addr;
|
||||
end = start + sec->size;
|
||||
# ifdef DARWIN_DEBUG
|
||||
GC_printf4("Adding section at %p-%p (%lu bytes) from image %s\n",
|
||||
if(sec == NULL || sec->size == 0) continue;
|
||||
start = slide + sec->addr;
|
||||
end = start + sec->size;
|
||||
# ifdef DARWIN_DEBUG
|
||||
GC_printf4("Adding section at %p-%p (%lu bytes) from image %s\n",
|
||||
start,end,sec->size,GC_dyld_name_for_hdr(hdr));
|
||||
# endif
|
||||
# endif
|
||||
GC_add_roots((char*)start,(char*)end);
|
||||
}
|
||||
# ifdef DARWIN_DEBUG
|
||||
GC_print_static_roots();
|
||||
# endif
|
||||
}
|
||||
# ifdef DARWIN_DEBUG
|
||||
GC_print_static_roots();
|
||||
# endif
|
||||
}
|
||||
|
||||
/* This should never be called by a thread holding the lock */
|
||||
@@ -1169,15 +1152,15 @@ static void GC_dyld_image_remove(struct mach_header* hdr, unsigned long slide) {
|
||||
if(sec == NULL || sec->size == 0) continue;
|
||||
start = slide + sec->addr;
|
||||
end = start + sec->size;
|
||||
# ifdef DARWIN_DEBUG
|
||||
# ifdef DARWIN_DEBUG
|
||||
GC_printf4("Removing section at %p-%p (%lu bytes) from image %s\n",
|
||||
start,end,sec->size,GC_dyld_name_for_hdr(hdr));
|
||||
# endif
|
||||
GC_remove_roots((char*)start,(char*)end);
|
||||
}
|
||||
# ifdef DARWIN_DEBUG
|
||||
GC_print_static_roots();
|
||||
# endif
|
||||
# ifdef DARWIN_DEBUG
|
||||
GC_print_static_roots();
|
||||
# endif
|
||||
}
|
||||
|
||||
void GC_register_dynamic_libraries() {
|
||||
|
||||
+16
-17
@@ -807,21 +807,24 @@ void (* GC_finalizer_notifier)() = (void (*) GC_PROTO((void)))0;
|
||||
|
||||
static GC_word last_finalizer_notification = 0;
|
||||
|
||||
#ifdef KEEP_BACK_PTRS
|
||||
void GC_generate_random_backtrace_no_gc(void);
|
||||
#endif
|
||||
|
||||
void GC_notify_or_invoke_finalizers GC_PROTO((void))
|
||||
{
|
||||
/* This is a convenient place to generate backtraces if appropriate, */
|
||||
/* since that code is not callable with the allocation lock. */
|
||||
# if defined(KEEP_BACK_PTRS) || defined(MAKE_BACK_GRAPH)
|
||||
static word last_back_trace_gc_no = 1; /* Skip first one. */
|
||||
# ifdef KEEP_BACK_PTRS
|
||||
if (GC_backtraces > 0) {
|
||||
static word last_back_trace_gc_no = 3; /* Skip early ones. */
|
||||
long i;
|
||||
|
||||
if (GC_gc_no > last_back_trace_gc_no) {
|
||||
word i;
|
||||
|
||||
# ifdef KEEP_BACK_PTRS
|
||||
LOCK();
|
||||
LOCK();
|
||||
if (GC_gc_no > last_back_trace_gc_no) {
|
||||
/* Stops when GC_gc_no wraps; that's OK. */
|
||||
last_back_trace_gc_no = (word)(-1); /* disable others. */
|
||||
for (i = 0; i < GC_backtraces; ++i) {
|
||||
last_back_trace_gc_no = (word)(-1); /* disable others. */
|
||||
for (i = 0; i < GC_backtraces; ++i) {
|
||||
/* FIXME: This tolerates concurrent heap mutation, */
|
||||
/* which may cause occasional mysterious results. */
|
||||
/* We need to release the GC lock, since GC_print_callers */
|
||||
@@ -829,14 +832,10 @@ void GC_notify_or_invoke_finalizers GC_PROTO((void))
|
||||
UNLOCK();
|
||||
GC_generate_random_backtrace_no_gc();
|
||||
LOCK();
|
||||
}
|
||||
last_back_trace_gc_no = GC_gc_no;
|
||||
UNLOCK();
|
||||
# endif
|
||||
# ifdef MAKE_BACK_GRAPH
|
||||
if (GC_print_back_height)
|
||||
GC_print_back_graph_stats();
|
||||
# endif
|
||||
}
|
||||
last_back_trace_gc_no = GC_gc_no;
|
||||
}
|
||||
UNLOCK();
|
||||
}
|
||||
# endif
|
||||
if (GC_finalize_now == 0) return;
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ register struct hblk * h;
|
||||
{
|
||||
hdr * result;
|
||||
|
||||
if (!get_index((word) h)) return(0);
|
||||
if (!get_index((word) h)) return(FALSE);
|
||||
result = alloc_hdr();
|
||||
SET_HDR(h, result);
|
||||
# ifdef USE_MUNMAP
|
||||
|
||||
+7
-30
@@ -32,7 +32,7 @@
|
||||
|
||||
# include "gc_config_macros.h"
|
||||
|
||||
# if defined(__STDC__) || defined(__cplusplus) || defined(_AIX)
|
||||
# if defined(__STDC__) || defined(__cplusplus)
|
||||
# define GC_PROTO(args) args
|
||||
typedef void * GC_PTR;
|
||||
# define GC_CONST const
|
||||
@@ -207,7 +207,7 @@ GC_API GC_word GC_free_space_divisor;
|
||||
/* least N/GC_free_space_divisor bytes between */
|
||||
/* collections, where N is the heap size plus */
|
||||
/* a rough estimate of the root set size. */
|
||||
/* Initially, GC_free_space_divisor = 3. */
|
||||
/* Initially, GC_free_space_divisor = 4. */
|
||||
/* Increasing its value will use less space */
|
||||
/* but more collection time. Decreasing it */
|
||||
/* will appreciably decrease collection time */
|
||||
@@ -324,9 +324,6 @@ GC_API void GC_end_stubborn_change GC_PROTO((GC_PTR));
|
||||
/* the base of the user object. */
|
||||
/* Return 0 if displaced_pointer doesn't point to within a valid */
|
||||
/* object. */
|
||||
/* Note that a deallocated object in the garbage collected heap */
|
||||
/* may be considered valid, even if it has been deallocated with */
|
||||
/* GC_free. */
|
||||
GC_API GC_PTR GC_base GC_PROTO((GC_PTR displaced_pointer));
|
||||
|
||||
/* Given a pointer to the base of an object, return its size in bytes. */
|
||||
@@ -867,7 +864,7 @@ GC_API int GC_thread_is_registered GC_PROTO((void));
|
||||
|
||||
/* Safer assignment of a pointer to a nonstack location. */
|
||||
#ifdef GC_DEBUG
|
||||
# if defined(__STDC__) || defined(_AIX)
|
||||
# ifdef __STDC__
|
||||
# define GC_PTR_STORE(p, q) \
|
||||
(*(void **)GC_is_visible(p) = GC_is_valid_displacement(q))
|
||||
# else
|
||||
@@ -894,7 +891,7 @@ GC_API void (*GC_is_visible_print_proc)
|
||||
/* thread library calls. We do that here by macro defining them. */
|
||||
|
||||
#if !defined(GC_USE_LD_WRAP) && \
|
||||
(defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) || defined(GC_DARWIN_THREADS) || defined(GC_MACOSX_THREADS))
|
||||
(defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS))
|
||||
#if defined(_IN_LIBGC) || defined(USE_INCLUDED_LIBGC)
|
||||
# include "gc_pthread_redirects.h"
|
||||
#else
|
||||
@@ -958,7 +955,7 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */
|
||||
* no-op and the collector self-initializes. But a number of platforms
|
||||
* make that too hard.
|
||||
*/
|
||||
#if (defined(sparc) || defined(__sparc)) && defined(sun)
|
||||
#if defined(sparc) || defined(__sparc)
|
||||
/*
|
||||
* If you are planning on putting
|
||||
* the collector in a SunOS 5 dynamic library, you need to call GC_INIT()
|
||||
@@ -968,32 +965,12 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */
|
||||
# define GC_INIT() { extern end, etext; \
|
||||
GC_noop(&end, &etext); }
|
||||
#else
|
||||
# if defined(__CYGWIN32__) || defined (_AIX)
|
||||
# if defined(__CYGWIN32__) && defined(GC_DLL) || defined (_AIX)
|
||||
/*
|
||||
* Similarly gnu-win32 DLLs need explicit initialization from
|
||||
* the main program, as does AIX.
|
||||
*/
|
||||
# ifdef __CYGWIN32__
|
||||
extern int _data_start__[];
|
||||
extern int _data_end__[];
|
||||
extern int _bss_start__[];
|
||||
extern int _bss_end__[];
|
||||
# define GC_MAX(x,y) ((x) > (y) ? (x) : (y))
|
||||
# define GC_MIN(x,y) ((x) < (y) ? (x) : (y))
|
||||
# define GC_DATASTART ((GC_PTR) GC_MIN(_data_start__, _bss_start__))
|
||||
# define GC_DATAEND ((GC_PTR) GC_MAX(_data_end__, _bss_end__))
|
||||
# ifdef GC_DLL
|
||||
# define GC_INIT() { GC_add_roots(GC_DATASTART, GC_DATAEND); }
|
||||
# else
|
||||
# define GC_INIT()
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_AIX)
|
||||
extern int _data[], _end[];
|
||||
# define GC_DATASTART ((GC_PTR)((ulong)_data))
|
||||
# define GC_DATAEND ((GC_PTR)((ulong)_end))
|
||||
# define GC_INIT() { GC_add_roots(GC_DATASTART, GC_DATAEND); }
|
||||
# endif
|
||||
# define GC_INIT() { GC_add_roots(DATASTART, DATAEND); }
|
||||
# else
|
||||
# if defined(__APPLE__) && defined(__MACH__) || defined(GC_WIN32_THREADS)
|
||||
# define GC_INIT() { GC_init(); }
|
||||
|
||||
@@ -39,13 +39,7 @@
|
||||
|
||||
#define GC_ALLOCATOR_H
|
||||
|
||||
#include "gc.h"
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# define GC_ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
# define GC_ATTR_UNUSED
|
||||
#endif
|
||||
#include "gc.h" // For size_t
|
||||
|
||||
/* First some helpers to allow us to dispatch on whether or not a type
|
||||
* is known to be pointerfree.
|
||||
@@ -128,7 +122,7 @@ public:
|
||||
}
|
||||
|
||||
// __p is not permitted to be a null pointer.
|
||||
void deallocate(pointer __p, size_type GC_ATTR_UNUSED GC_n)
|
||||
void deallocate(pointer __p, size_type GC_n)
|
||||
{ GC_FREE(__p); }
|
||||
|
||||
size_type max_size() const throw()
|
||||
@@ -204,7 +198,7 @@ public:
|
||||
}
|
||||
|
||||
// __p is not permitted to be a null pointer.
|
||||
void deallocate(pointer __p, size_type GC_ATTR_UNUSED GC_n)
|
||||
void deallocate(pointer __p, size_type GC_n)
|
||||
{ GC_FREE(__p); }
|
||||
|
||||
size_type max_size() const throw()
|
||||
|
||||
@@ -95,10 +95,6 @@
|
||||
# define GC_DGUX386_THREADS
|
||||
# define GC_PTHREADS
|
||||
# endif
|
||||
# if defined(_AIX)
|
||||
# define GC_AIX_THREADS
|
||||
# define GC_PTHREADS
|
||||
# endif
|
||||
#endif /* GC_THREADS */
|
||||
|
||||
#if defined(GC_THREADS) && !defined(GC_PTHREADS) && \
|
||||
|
||||
@@ -74,7 +74,7 @@ cycle, then that's considered a storage leak, and neither will be
|
||||
collectable. See the interface gc.h for low-level facilities for
|
||||
handling such cycles of objects with clean-up.
|
||||
|
||||
The collector cannot guarantee that it will find all inaccessible
|
||||
The collector cannot guarrantee that it will find all inaccessible
|
||||
objects. In practice, it finds almost all of them.
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#endif /* SOLARIS_THREADS || SOLARIS_PTHREADS */
|
||||
|
||||
|
||||
#if !defined(GC_USE_LD_WRAP) && (defined(GC_PTHREADS) || defined(GC_DARWIN_THREADS) || defined(GC_MACOSX_THREADS)) && !defined(GC_SOLARIS_PTHREADS)
|
||||
#if !defined(GC_USE_LD_WRAP) && defined(GC_PTHREADS) && !defined(GC_SOLARIS_PTHREADS)
|
||||
/* We treat these similarly. */
|
||||
# include <pthread.h>
|
||||
# include <signal.h>
|
||||
|
||||
@@ -109,7 +109,7 @@ enum { GC_byte_alignment = 8 };
|
||||
enum { GC_word_alignment = GC_byte_alignment/GC_bytes_per_word };
|
||||
|
||||
inline void * &GC_obj_link(void * p)
|
||||
{ return *reinterpret_cast<void **>(p); }
|
||||
{ return *(void **)p; }
|
||||
|
||||
// Compute a number of words >= n+1 bytes.
|
||||
// The +1 allows for pointers one past the end.
|
||||
@@ -228,7 +228,7 @@ class single_client_gc_alloc_template {
|
||||
} else {
|
||||
flh = GC_objfreelist_ptr + nwords;
|
||||
GC_obj_link(p) = *flh;
|
||||
memset(reinterpret_cast<char *>(p) + GC_bytes_per_word, 0,
|
||||
memset((char *)p + GC_bytes_per_word, 0,
|
||||
GC_bytes_per_word * (nwords - 1));
|
||||
*flh = p;
|
||||
GC_aux::GC_mem_recently_freed += nwords;
|
||||
@@ -352,9 +352,9 @@ class simple_alloc<T, alloc> { \
|
||||
public: \
|
||||
static T *allocate(size_t n) \
|
||||
{ return 0 == n? 0 : \
|
||||
reinterpret_cast<T*>(alloc::ptr_free_allocate(n * sizeof (T))); } \
|
||||
(T*) alloc::ptr_free_allocate(n * sizeof (T)); } \
|
||||
static T *allocate(void) \
|
||||
{ return reinterpret_cast<T*>(alloc::ptr_free_allocate(sizeof (T))); } \
|
||||
{ return (T*) alloc::ptr_free_allocate(sizeof (T)); } \
|
||||
static void deallocate(T *p, size_t n) \
|
||||
{ if (0 != n) alloc::ptr_free_deallocate(p, n * sizeof (T)); } \
|
||||
static void deallocate(T *p) \
|
||||
|
||||
@@ -108,7 +108,7 @@ extern hdr * GC_invalid_header; /* header for an imaginary block */
|
||||
|
||||
/* Analogous to GET_HDR, except that in the case of large objects, it */
|
||||
/* Returns the header for the object beginning, and updates p. */
|
||||
/* Returns GC_invalid_header instead of 0. All of this saves a branch */
|
||||
/* Returns &GC_bad_header instead of 0. All of this saves a branch */
|
||||
/* in the fast path. */
|
||||
# define HC_GET_HDR(p, hhdr, source) \
|
||||
{ \
|
||||
|
||||
@@ -155,25 +155,6 @@
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
# endif
|
||||
# if defined(POWERPC)
|
||||
# if CPP_WORDSZ == 64
|
||||
inline static int GC_test_and_set(volatile unsigned int *addr) {
|
||||
unsigned long oldval;
|
||||
unsigned long temp = 1; /* locked value */
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1:\tldarx %0,0,%3\n" /* load and reserve */
|
||||
"\tcmpdi %0, 0\n" /* if load is */
|
||||
"\tbne 2f\n" /* non-zero, return already set */
|
||||
"\tstdcx. %2,0,%1\n" /* else store conditional */
|
||||
"\tbne- 1b\n" /* retry if lost reservation */
|
||||
"\tsync\n" /* import barrier */
|
||||
"2:\t\n" /* oldval is zero if we set */
|
||||
: "=&r"(oldval), "=p"(addr)
|
||||
: "r"(temp), "1"(addr)
|
||||
: "cr0","memory");
|
||||
return (int)oldval;
|
||||
}
|
||||
# else
|
||||
inline static int GC_test_and_set(volatile unsigned int *addr) {
|
||||
int oldval;
|
||||
int temp = 1; /* locked value */
|
||||
@@ -191,13 +172,12 @@
|
||||
: "cr0","memory");
|
||||
return oldval;
|
||||
}
|
||||
# endif
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
inline static void GC_clear(volatile unsigned int *addr) {
|
||||
__asm__ __volatile__("lwsync" : : : "memory");
|
||||
*(addr) = 0;
|
||||
}
|
||||
# define GC_CLEAR_DEFINED
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
inline static void GC_clear(volatile unsigned int *addr) {
|
||||
__asm__ __volatile__("eieio" : : : "memory");
|
||||
*(addr) = 0;
|
||||
}
|
||||
# define GC_CLEAR_DEFINED
|
||||
# endif
|
||||
# if defined(ALPHA)
|
||||
inline static int GC_test_and_set(volatile unsigned int * addr)
|
||||
@@ -251,30 +231,6 @@
|
||||
}
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
# endif /* ARM32 */
|
||||
# ifdef CRIS
|
||||
inline static int GC_test_and_set(volatile unsigned int *addr) {
|
||||
/* Ripped from linuxthreads/sysdeps/cris/pt-machine.h. */
|
||||
/* Included with Hans-Peter Nilsson's permission. */
|
||||
register unsigned long int ret;
|
||||
|
||||
/* Note the use of a dummy output of *addr to expose the write.
|
||||
* The memory barrier is to stop *other* writes being moved past
|
||||
* this code.
|
||||
*/
|
||||
__asm__ __volatile__("clearf\n"
|
||||
"0:\n\t"
|
||||
"movu.b [%2],%0\n\t"
|
||||
"ax\n\t"
|
||||
"move.b %3,[%2]\n\t"
|
||||
"bwf 0b\n\t"
|
||||
"clearf"
|
||||
: "=&r" (ret), "=m" (*addr)
|
||||
: "r" (addr), "r" ((int) 1), "m" (*addr)
|
||||
: "memory");
|
||||
return ret;
|
||||
}
|
||||
# define GC_TEST_AND_SET_DEFINED
|
||||
# endif /* CRIS */
|
||||
# ifdef S390
|
||||
inline static int GC_test_and_set(volatile unsigned int *addr) {
|
||||
int ret;
|
||||
@@ -318,8 +274,6 @@
|
||||
# define GC_test_and_set(addr) test_and_set((void *)addr,1)
|
||||
# endif
|
||||
# else
|
||||
# include <sgidefs.h>
|
||||
# include <mutex.h>
|
||||
# define GC_test_and_set(addr) __test_and_set32((void *)addr,1)
|
||||
# define GC_clear(addr) __lock_release(addr);
|
||||
# define GC_CLEAR_DEFINED
|
||||
@@ -392,7 +346,7 @@
|
||||
# endif
|
||||
|
||||
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
|
||||
&& !defined(GC_WIN32_THREADS)
|
||||
&& !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS)
|
||||
# define NO_THREAD (pthread_t)(-1)
|
||||
# include <pthread.h>
|
||||
# if defined(PARALLEL_MARK)
|
||||
@@ -439,29 +393,6 @@
|
||||
|
||||
# if defined(POWERPC)
|
||||
# if !defined(GENERIC_COMPARE_AND_SWAP)
|
||||
# if CPP_WORDSZ == 64
|
||||
/* Returns TRUE if the comparison succeeded. */
|
||||
inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
|
||||
GC_word old, GC_word new_val)
|
||||
{
|
||||
unsigned long result, dummy;
|
||||
__asm__ __volatile__(
|
||||
"1:\tldarx %0,0,%5\n"
|
||||
"\tcmpd %0,%4\n"
|
||||
"\tbne 2f\n"
|
||||
"\tstdcx. %3,0,%2\n"
|
||||
"\tbne- 1b\n"
|
||||
"\tsync\n"
|
||||
"\tli %1, 1\n"
|
||||
"\tb 3f\n"
|
||||
"2:\tli %1, 0\n"
|
||||
"3:\t\n"
|
||||
: "=&r" (dummy), "=r" (result), "=p" (addr)
|
||||
: "r" (new_val), "r" (old), "2"(addr)
|
||||
: "cr0","memory");
|
||||
return (GC_bool) result;
|
||||
}
|
||||
# else
|
||||
/* Returns TRUE if the comparison succeeded. */
|
||||
inline static GC_bool GC_compare_and_exchange(volatile GC_word *addr,
|
||||
GC_word old, GC_word new_val)
|
||||
@@ -483,7 +414,6 @@
|
||||
: "cr0","memory");
|
||||
return (GC_bool) result;
|
||||
}
|
||||
# endif
|
||||
# endif /* !GENERIC_COMPARE_AND_SWAP */
|
||||
inline static void GC_memory_barrier()
|
||||
{
|
||||
@@ -497,18 +427,9 @@
|
||||
GC_word old, GC_word new_val)
|
||||
{
|
||||
unsigned long oldval;
|
||||
# if CPP_WORDSZ == 32
|
||||
__asm__ __volatile__(
|
||||
"addp4 %0=0,%1\n"
|
||||
"mov ar.ccv=%3 ;; cmpxchg4.rel %0=[%0],%2,ar.ccv"
|
||||
: "=&r"(oldval)
|
||||
: "r"(addr), "r"(new_val), "r"(old) : "memory");
|
||||
# else
|
||||
__asm__ __volatile__(
|
||||
"mov ar.ccv=%3 ;; cmpxchg8.rel %0=[%1],%2,ar.ccv"
|
||||
: "=r"(oldval)
|
||||
: "r"(addr), "r"(new_val), "r"(old) : "memory");
|
||||
# endif
|
||||
__asm__ __volatile__("mov ar.ccv=%4 ;; cmpxchg8.rel %0=%1,%2,ar.ccv"
|
||||
: "=r"(oldval), "=m"(*addr)
|
||||
: "r"(new_val), "1"(*addr), "r"(old) : "memory");
|
||||
return (oldval == old);
|
||||
}
|
||||
# endif /* !GENERIC_COMPARE_AND_SWAP */
|
||||
@@ -672,6 +593,33 @@
|
||||
extern pthread_t GC_mark_lock_holder;
|
||||
# endif
|
||||
# endif /* GC_PTHREADS with linux_threads.c implementation */
|
||||
# if defined(GC_IRIX_THREADS)
|
||||
# include <pthread.h>
|
||||
/* This probably should never be included, but I can't test */
|
||||
/* on Irix anymore. */
|
||||
# include <mutex.h>
|
||||
|
||||
extern volatile unsigned int GC_allocate_lock;
|
||||
/* This is not a mutex because mutexes that obey the (optional) */
|
||||
/* POSIX scheduling rules are subject to convoys in high contention */
|
||||
/* applications. This is basically a spin lock. */
|
||||
extern pthread_t GC_lock_holder;
|
||||
extern void GC_lock(void);
|
||||
/* Allocation lock holder. Only set if acquired by client through */
|
||||
/* GC_call_with_alloc_lock. */
|
||||
# define SET_LOCK_HOLDER() GC_lock_holder = pthread_self()
|
||||
# define NO_THREAD (pthread_t)(-1)
|
||||
# define UNSET_LOCK_HOLDER() GC_lock_holder = NO_THREAD
|
||||
# define I_HOLD_LOCK() (pthread_equal(GC_lock_holder, pthread_self()))
|
||||
# define LOCK() { if (GC_test_and_set(&GC_allocate_lock)) GC_lock(); }
|
||||
# define UNLOCK() GC_clear(&GC_allocate_lock);
|
||||
extern VOLATILE GC_bool GC_collecting;
|
||||
# define ENTER_GC() \
|
||||
{ \
|
||||
GC_collecting = 1; \
|
||||
}
|
||||
# define EXIT_GC() GC_collecting = 0;
|
||||
# endif /* GC_IRIX_THREADS */
|
||||
# if defined(GC_WIN32_THREADS)
|
||||
# if defined(GC_PTHREADS)
|
||||
# include <pthread.h>
|
||||
|
||||
@@ -259,6 +259,17 @@ typedef char * ptr_t; /* A generic pointer to which we can add */
|
||||
/* */
|
||||
/*********************************/
|
||||
|
||||
#ifdef SAVE_CALL_CHAIN
|
||||
|
||||
/* Fill in the pc and argument information for up to NFRAMES of my */
|
||||
/* callers. Ignore my frame and my callers frame. */
|
||||
struct callinfo;
|
||||
void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES]));
|
||||
|
||||
void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef NEED_CALLINFO
|
||||
struct callinfo {
|
||||
word ci_pc; /* Caller, not callee, pc */
|
||||
@@ -272,16 +283,6 @@ typedef char * ptr_t; /* A generic pointer to which we can add */
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef SAVE_CALL_CHAIN
|
||||
|
||||
/* Fill in the pc and argument information for up to NFRAMES of my */
|
||||
/* callers. Ignore my frame and my callers frame. */
|
||||
void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES]));
|
||||
|
||||
void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*********************************/
|
||||
/* */
|
||||
@@ -550,7 +551,7 @@ extern GC_warn_proc GC_current_warn_proc;
|
||||
|
||||
#define CPP_MAXOBJBYTES (CPP_HBLKSIZE/2)
|
||||
#define MAXOBJBYTES ((word)CPP_MAXOBJBYTES)
|
||||
#define CPP_MAXOBJSZ BYTES_TO_WORDS(CPP_MAXOBJBYTES)
|
||||
#define CPP_MAXOBJSZ BYTES_TO_WORDS(CPP_HBLKSIZE/2)
|
||||
#define MAXOBJSZ ((word)CPP_MAXOBJSZ)
|
||||
|
||||
# define divHBLKSZ(n) ((n) >> LOG_HBLKSIZE)
|
||||
@@ -938,11 +939,11 @@ struct _GC_arrays {
|
||||
char _valid_offsets[VALID_OFFSET_SZ];
|
||||
/* GC_valid_offsets[i] == TRUE ==> i */
|
||||
/* is registered as a displacement. */
|
||||
# define OFFSET_VALID(displ) \
|
||||
(GC_all_interior_pointers || GC_valid_offsets[displ])
|
||||
char _modws_valid_offsets[sizeof(word)];
|
||||
/* GC_valid_offsets[i] ==> */
|
||||
/* GC_modws_valid_offsets[i%sizeof(word)] */
|
||||
# define OFFSET_VALID(displ) \
|
||||
(GC_all_interior_pointers || GC_valid_offsets[displ])
|
||||
# ifdef STUBBORN_ALLOC
|
||||
page_hash_table _changed_pages;
|
||||
/* Stubborn object pages that were changes since last call to */
|
||||
@@ -1632,10 +1633,6 @@ ptr_t GC_generic_malloc_ignore_off_page GC_PROTO((size_t b, int k));
|
||||
/* are ignored. */
|
||||
ptr_t GC_generic_malloc_inner GC_PROTO((word lb, int k));
|
||||
/* Ditto, but I already hold lock, etc. */
|
||||
ptr_t GC_generic_malloc_words_small_inner GC_PROTO((word lw, int k));
|
||||
/* Analogous to the above, but assumes */
|
||||
/* a small object size, and bypasses */
|
||||
/* MERGE_SIZES mechanism. */
|
||||
ptr_t GC_generic_malloc_words_small GC_PROTO((size_t lw, int k));
|
||||
/* As above, but size in units of words */
|
||||
/* Bypasses MERGE_SIZES. Assumes */
|
||||
@@ -1729,13 +1726,6 @@ extern GC_bool GC_print_stats; /* Produce at least some logging output */
|
||||
|
||||
#ifdef KEEP_BACK_PTRS
|
||||
extern long GC_backtraces;
|
||||
void GC_generate_random_backtrace_no_gc(void);
|
||||
#endif
|
||||
|
||||
extern GC_bool GC_print_back_height;
|
||||
|
||||
#ifdef MAKE_BACK_GRAPH
|
||||
void GC_print_back_graph_stats(void);
|
||||
#endif
|
||||
|
||||
/* Macros used for collector internal allocation. */
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
# endif
|
||||
|
||||
/* And one for FreeBSD: */
|
||||
# if defined(__FreeBSD__) && !defined(FREEBSD)
|
||||
# if defined(__FreeBSD__)
|
||||
# define FREEBSD
|
||||
# endif
|
||||
|
||||
@@ -97,10 +97,6 @@
|
||||
# define ARM32
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(NETBSD) && defined(__sh__)
|
||||
# define SH
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(vax)
|
||||
# define VAX
|
||||
# ifdef ultrix
|
||||
@@ -119,8 +115,8 @@
|
||||
# if defined(nec_ews) || defined(_nec_ews)
|
||||
# define EWS4800
|
||||
# endif
|
||||
# if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD)
|
||||
# if defined(ultrix) || defined(__ultrix)
|
||||
# if !defined(LINUX) && !defined(EWS4800)
|
||||
# if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
|
||||
# define ULTRIX
|
||||
# else
|
||||
# if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) \
|
||||
@@ -174,7 +170,7 @@
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \
|
||||
&& !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
|
||||
&& !defined(__OpenBSD__) && !(__NetBSD__)
|
||||
# define SPARC
|
||||
# define DRSNX
|
||||
# define mach_type_known
|
||||
@@ -205,16 +201,14 @@
|
||||
# if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
|
||||
|| defined(hppa) || defined(__hppa__)
|
||||
# define HP_PA
|
||||
# if !defined(LINUX) && !defined(HPUX)
|
||||
# ifndef LINUX
|
||||
# define HPUX
|
||||
# endif
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(__ia64) && defined(_HPUX_SOURCE)
|
||||
# define IA64
|
||||
# ifndef HPUX
|
||||
# define HPUX
|
||||
# endif
|
||||
# define HPUX
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(__BEOS__) && defined(_X86_)
|
||||
@@ -238,18 +232,7 @@
|
||||
# define ARM32
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(LINUX) && defined(__cris__)
|
||||
# ifndef CRIS
|
||||
# define CRIS
|
||||
# endif
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || \
|
||||
defined(powerpc64) || defined(__powerpc64__))
|
||||
# define POWERPC
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(FREEBSD) && (defined(powerpc) || defined(__powerpc__))
|
||||
# if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || defined(powerpc64) || defined(__powerpc64__))
|
||||
# define POWERPC
|
||||
# define mach_type_known
|
||||
# endif
|
||||
@@ -269,10 +252,6 @@
|
||||
# define SH
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(LINUX) && defined(__m32r__)
|
||||
# define M32R
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(__alpha) || defined(__alpha__)
|
||||
# define ALPHA
|
||||
# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) && !defined(FREEBSD)
|
||||
@@ -297,36 +276,16 @@
|
||||
# define MACOS
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(macosx) || (defined(__APPLE__) && defined(__MACH__))
|
||||
# define DARWIN
|
||||
# if defined(__ppc__) || defined(__ppc64__)
|
||||
# if defined(macosx) || \
|
||||
defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
|
||||
# define DARWIN
|
||||
# define POWERPC
|
||||
# define mach_type_known
|
||||
# elif defined(__i386__)
|
||||
# endif
|
||||
# if defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
|
||||
# define DARWIN
|
||||
# define I386
|
||||
# define mach_type_known
|
||||
# define DARWIN_DONT_PARSE_STACK
|
||||
# define OS_TYPE "DARWIN"
|
||||
# define DYNAMIC_LOADING
|
||||
/* XXX: see get_end(3), get_etext() and get_end() should not be used.
|
||||
These aren't used when dyld support is enabled (it is by default) */
|
||||
# define DATASTART ((ptr_t) get_etext())
|
||||
# define DATAEND ((ptr_t) get_end())
|
||||
# define STACKBOTTOM ((ptr_t) 0xc0000000)
|
||||
# define USE_MMAP
|
||||
# define USE_MMAP_ANON
|
||||
# define USE_ASM_PUSH_REGS
|
||||
/* This is potentially buggy. It needs more testing. See the comments in
|
||||
os_dep.c. It relies on threads to track writes. */
|
||||
# ifdef GC_DARWIN_THREADS
|
||||
/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
|
||||
# endif
|
||||
# include <unistd.h>
|
||||
# define GETPAGESIZE() getpagesize()
|
||||
/* There seems to be some issues with trylock hanging on darwin. This
|
||||
should be looked into some more */
|
||||
# define NO_PTHREAD_TRYLOCK
|
||||
# endif
|
||||
--> Not really supported, but at least we recognize it.
|
||||
# endif
|
||||
# if defined(NeXT) && defined(mc68000)
|
||||
# define M68K
|
||||
@@ -355,10 +314,6 @@
|
||||
# define X86_64
|
||||
# define mach_type_known
|
||||
# endif
|
||||
# if defined(FREEBSD) && defined(__sparc__)
|
||||
# define SPARC
|
||||
# define mach_type_known
|
||||
#endif
|
||||
# if defined(bsdi) && (defined(i386) || defined(__i386__))
|
||||
# define I386
|
||||
# define BSDI
|
||||
@@ -519,22 +474,17 @@
|
||||
/* POWERPC ==> IBM/Apple PowerPC */
|
||||
/* (MACOS(<=9),DARWIN(incl.MACOSX),*/
|
||||
/* LINUX, NETBSD, NOSYS variants) */
|
||||
/* Handles 32 and 64-bit variants. */
|
||||
/* AIX should be handled here, but */
|
||||
/* that's called an RS6000. */
|
||||
/* CRIS ==> Axis Etrax */
|
||||
/* M32R ==> Renesas M32R */
|
||||
|
||||
|
||||
/*
|
||||
* For each architecture and OS, the following need to be defined:
|
||||
*
|
||||
* CPP_WORDSZ is a simple integer constant representing the word size.
|
||||
* CPP_WORD_SZ is a simple integer constant representing the word size.
|
||||
* in bits. We assume byte addressibility, where a byte has 8 bits.
|
||||
* We also assume CPP_WORDSZ is either 32 or 64.
|
||||
* We also assume CPP_WORD_SZ is either 32 or 64.
|
||||
* (We care about the length of pointers, not hardware
|
||||
* bus widths. Thus a 64 bit processor with a C compiler that uses
|
||||
* 32 bit pointers should use CPP_WORDSZ of 32, not 64. Default is 32.)
|
||||
* 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.)
|
||||
*
|
||||
* MACH_TYPE is a string representation of the machine type.
|
||||
* OS_TYPE is analogous for the OS.
|
||||
@@ -555,9 +505,6 @@
|
||||
* DATAEND, if not `end' where `end' is defined as ``extern int end[];''.
|
||||
* RTH suggests gaining access to linker script synth'd values with
|
||||
* this idiom instead of `&end' where `end' is defined as ``extern int end;'' .
|
||||
* Otherwise, ``GCC will assume these are in .sdata/.sbss'' and it will, e.g.,
|
||||
* cause failures on alpha*-*-* with ``-msmall-data or -fpic'' or mips-*-*
|
||||
* without any special options.
|
||||
*
|
||||
* ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice
|
||||
* the pointer size.
|
||||
@@ -651,8 +598,7 @@
|
||||
*/
|
||||
# if defined(__GNUC__) && ((__GNUC__ >= 3) || \
|
||||
(__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) \
|
||||
&& !defined(__INTEL_COMPILER) \
|
||||
&& !defined(__PATHCC__)
|
||||
&& !defined(__INTEL_COMPILER)
|
||||
# define HAVE_BUILTIN_UNWIND_INIT
|
||||
# endif
|
||||
|
||||
@@ -776,7 +722,7 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(POWERPC)
|
||||
# ifdef POWERPC
|
||||
# define MACH_TYPE "POWERPC"
|
||||
# ifdef MACOS
|
||||
# define ALIGNMENT 2 /* Still necessary? Could it be 4? */
|
||||
@@ -789,14 +735,12 @@
|
||||
# define DATAEND /* not needed */
|
||||
# endif
|
||||
# ifdef LINUX
|
||||
# if defined(__powerpc64__)
|
||||
# if (defined (powerpc64) || defined(__powerpc64__))
|
||||
# define ALIGNMENT 8
|
||||
# define CPP_WORDSZ 64
|
||||
# ifndef HBLKSIZE
|
||||
# define HBLKSIZE 4096
|
||||
# endif
|
||||
# else
|
||||
# define ALIGNMENT 4
|
||||
# define ALIGNMENT 4 /* Guess. Can someone verify? */
|
||||
/* This was 2, but that didn't sound right. */
|
||||
# endif
|
||||
# define OS_TYPE "LINUX"
|
||||
/* HEURISTIC1 has been reliably reported to fail for a 32-bit */
|
||||
@@ -808,12 +752,7 @@
|
||||
# define DATAEND (_end)
|
||||
# endif
|
||||
# ifdef DARWIN
|
||||
# ifdef __ppc64__
|
||||
# define ALIGNMENT 8
|
||||
# define CPP_WORDSZ 64
|
||||
# else
|
||||
# define ALIGNMENT 4
|
||||
# endif
|
||||
# define ALIGNMENT 4
|
||||
# define OS_TYPE "DARWIN"
|
||||
# define DYNAMIC_LOADING
|
||||
/* XXX: see get_end(3), get_etext() and get_end() should not be used.
|
||||
@@ -825,10 +764,8 @@
|
||||
# define USE_MMAP_ANON
|
||||
# define USE_ASM_PUSH_REGS
|
||||
/* This is potentially buggy. It needs more testing. See the comments in
|
||||
os_dep.c. It relies on threads to track writes. */
|
||||
# ifdef GC_DARWIN_THREADS
|
||||
/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
|
||||
# endif
|
||||
os_dep.c */
|
||||
# define MPROTECT_VDB
|
||||
# include <unistd.h>
|
||||
# define GETPAGESIZE() getpagesize()
|
||||
# if defined(USE_PPC_PREFETCH) && defined(__GNUC__)
|
||||
@@ -842,22 +779,6 @@
|
||||
should be looked into some more */
|
||||
# define NO_PTHREAD_TRYLOCK
|
||||
# endif
|
||||
# ifdef FREEBSD
|
||||
# define ALIGNMENT 4
|
||||
# define OS_TYPE "FREEBSD"
|
||||
# ifndef GC_FREEBSD_THREADS
|
||||
# define MPROTECT_VDB
|
||||
# endif
|
||||
# define SIG_SUSPEND SIGUSR1
|
||||
# define SIG_THR_RESTART SIGUSR2
|
||||
# define FREEBSD_STACKBOTTOM
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# endif
|
||||
extern char etext[];
|
||||
extern char * GC_FreeBSDGetDataStart();
|
||||
# define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
|
||||
# endif
|
||||
# ifdef NETBSD
|
||||
# define ALIGNMENT 4
|
||||
# define OS_TYPE "NETBSD"
|
||||
@@ -913,10 +834,6 @@
|
||||
# define CPP_WORDSZ 32
|
||||
# endif
|
||||
# define ALIGN_DOUBLE
|
||||
# ifdef _FILE_OFFSET_BITS
|
||||
# undef _FILE_OFFSET_BITS /* libelf.h & procfs.h doesn't compile with large file support */
|
||||
# define _FILE_OFFSET_BITS 32
|
||||
# endif
|
||||
# ifdef SUNOS5
|
||||
# define OS_TYPE "SUNOS5"
|
||||
extern int _etext[];
|
||||
@@ -989,26 +906,20 @@
|
||||
# define DYNAMIC_LOADING
|
||||
# else
|
||||
Linux Sparc/a.out not supported
|
||||
# endif
|
||||
# define SVR4
|
||||
# include <features.h>
|
||||
# if defined(__GLIBC__) && __GLIBC__ >= 2
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# else
|
||||
extern char **__environ;
|
||||
# define DATASTART ((ptr_t)(&__environ))
|
||||
/* hideous kludge: __environ is the first */
|
||||
/* word in crt0.o, and delimits the start */
|
||||
/* of the data segment, no matter which */
|
||||
/* ld options were passed through. */
|
||||
/* We could use _etext instead, but that */
|
||||
/* would include .rodata, which may */
|
||||
/* contain large read-only data tables */
|
||||
/* that we'd rather not scan. */
|
||||
# endif
|
||||
extern int _end[];
|
||||
extern int _etext[];
|
||||
# define DATAEND (_end)
|
||||
# define LINUX_STACKBOTTOM
|
||||
# define SVR4
|
||||
extern ptr_t GC_SysVGetDataStart();
|
||||
# ifdef __arch64__
|
||||
# define DATASTART GC_SysVGetDataStart(0x100000, _etext)
|
||||
/* libc_stack_end is not set reliably for sparc64 */
|
||||
# define STACKBOTTOM ((ptr_t) 0x80000000000ULL)
|
||||
# else
|
||||
# define DATASTART GC_SysVGetDataStart(0x10000, _etext)
|
||||
# define LINUX_STACKBOTTOM
|
||||
# endif
|
||||
# endif
|
||||
# ifdef OPENBSD
|
||||
# define OS_TYPE "OPENBSD"
|
||||
@@ -1027,23 +938,6 @@
|
||||
# define DATASTART ((ptr_t)(etext))
|
||||
# endif
|
||||
# endif
|
||||
# ifdef FREEBSD
|
||||
# define OS_TYPE "FREEBSD"
|
||||
# define SIG_SUSPEND SIGUSR1
|
||||
# define SIG_THR_RESTART SIGUSR2
|
||||
# define FREEBSD_STACKBOTTOM
|
||||
# ifdef __ELF__
|
||||
# define DYNAMIC_LOADING
|
||||
# endif
|
||||
extern char etext[];
|
||||
extern char edata[];
|
||||
extern char end[];
|
||||
# define NEED_FIND_LIMIT
|
||||
# define DATASTART ((ptr_t)(&etext))
|
||||
# define DATAEND (GC_find_limit (DATASTART, TRUE))
|
||||
# define DATASTART2 ((ptr_t)(&edata))
|
||||
# define DATAEND2 ((ptr_t)(&end))
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef I386
|
||||
@@ -1228,8 +1122,26 @@
|
||||
# endif
|
||||
# ifdef CYGWIN32
|
||||
# define OS_TYPE "CYGWIN32"
|
||||
# define DATASTART ((ptr_t)GC_DATASTART) /* From gc.h */
|
||||
# define DATAEND ((ptr_t)GC_DATAEND)
|
||||
extern int _data_start__[];
|
||||
extern int _data_end__[];
|
||||
extern int _bss_start__[];
|
||||
extern int _bss_end__[];
|
||||
/* For binutils 2.9.1, we have */
|
||||
/* DATASTART = _data_start__ */
|
||||
/* DATAEND = _bss_end__ */
|
||||
/* whereas for some earlier versions it was */
|
||||
/* DATASTART = _bss_start__ */
|
||||
/* DATAEND = _data_end__ */
|
||||
/* To get it right for both, we take the */
|
||||
/* minumum/maximum of the two. */
|
||||
# ifndef MAX
|
||||
# define MAX(x,y) ((x) > (y) ? (x) : (y))
|
||||
# endif
|
||||
# ifndef MIN
|
||||
# define MIN(x,y) ((x) < (y) ? (x) : (y))
|
||||
# endif
|
||||
# define DATASTART ((ptr_t) MIN(_data_start__, _bss_start__))
|
||||
# define DATAEND ((ptr_t) MAX(_data_end__, _bss_end__))
|
||||
# undef STACK_GRAN
|
||||
# define STACK_GRAN 0x10000
|
||||
# define HEURISTIC1
|
||||
@@ -1440,6 +1352,8 @@
|
||||
# define DATAEND /* not needed */
|
||||
# endif
|
||||
# if defined(NETBSD)
|
||||
/* This also checked for __MIPSEL__ . Why? NETBSD recognition */
|
||||
/* should be handled at the top of the file. */
|
||||
# define ALIGNMENT 4
|
||||
# define OS_TYPE "NETBSD"
|
||||
# define HEURISTIC2
|
||||
@@ -1473,8 +1387,6 @@
|
||||
# define CPP_WORDSZ 32
|
||||
# define STACKBOTTOM ((ptr_t)((ulong)&errno))
|
||||
# endif
|
||||
# define USE_MMAP
|
||||
# define USE_MMAP_ANON
|
||||
/* From AIX linker man page:
|
||||
_text Specifies the first location of the program.
|
||||
_etext Specifies the first location after the program.
|
||||
@@ -1631,7 +1543,7 @@
|
||||
# endif
|
||||
# ifdef LINUX
|
||||
# define OS_TYPE "LINUX"
|
||||
# define LINUX_STACKBOTTOM
|
||||
# define STACKBOTTOM ((ptr_t) 0x120000000)
|
||||
# ifdef __ELF__
|
||||
# define SEARCH_FOR_DATA_START
|
||||
# define DYNAMIC_LOADING
|
||||
@@ -1782,7 +1694,7 @@
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
# ifdef UTS4
|
||||
# define OS_TYPE "UTS4"
|
||||
extern int etext[];
|
||||
extern int etext[];
|
||||
extern int _etext[];
|
||||
extern int _end[];
|
||||
extern ptr_t GC_SysVGetDataStart();
|
||||
@@ -1796,20 +1708,18 @@
|
||||
# define MACH_TYPE "S390"
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
# ifndef __s390x__
|
||||
# define ALIGNMENT 4
|
||||
# define CPP_WORDSZ 32
|
||||
# define ALIGNMENT 4
|
||||
# define CPP_WORDSZ 32
|
||||
# else
|
||||
# define ALIGNMENT 8
|
||||
# define CPP_WORDSZ 64
|
||||
# endif
|
||||
# ifndef HBLKSIZE
|
||||
# define HBLKSIZE 4096
|
||||
# define ALIGNMENT 8
|
||||
# define CPP_WORDSZ 64
|
||||
# define HBLKSIZE 4096
|
||||
# endif
|
||||
# ifdef LINUX
|
||||
# define OS_TYPE "LINUX"
|
||||
# define LINUX_STACKBOTTOM
|
||||
# define DYNAMIC_LOADING
|
||||
extern int __data_start[];
|
||||
extern int __data_start[];
|
||||
# define DATASTART ((ptr_t)(__data_start))
|
||||
extern int _end[];
|
||||
# define DATAEND (_end)
|
||||
@@ -1886,19 +1796,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# ifdef CRIS
|
||||
# define MACH_TYPE "CRIS"
|
||||
# define CPP_WORDSZ 32
|
||||
# define ALIGNMENT 1
|
||||
# define OS_TYPE "LINUX"
|
||||
# define DYNAMIC_LOADING
|
||||
# define LINUX_STACKBOTTOM
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
# define SEARCH_FOR_DATA_START
|
||||
extern int _end[];
|
||||
# define DATAEND (_end)
|
||||
# endif
|
||||
|
||||
# ifdef SH
|
||||
# define MACH_TYPE "SH"
|
||||
# define ALIGNMENT 4
|
||||
@@ -1908,20 +1805,13 @@
|
||||
# endif
|
||||
# ifdef LINUX
|
||||
# define OS_TYPE "LINUX"
|
||||
# define LINUX_STACKBOTTOM
|
||||
# define STACKBOTTOM ((ptr_t) 0x7c000000)
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
# define DYNAMIC_LOADING
|
||||
# define SEARCH_FOR_DATA_START
|
||||
extern int _end[];
|
||||
# define DATAEND (_end)
|
||||
# endif
|
||||
# ifdef NETBSD
|
||||
# define OS_TYPE "NETBSD"
|
||||
# define HEURISTIC2
|
||||
# define DATASTART GC_data_start
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
# define DYNAMIC_LOADING
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef SH4
|
||||
@@ -1931,23 +1821,6 @@
|
||||
# define DATAEND /* not needed */
|
||||
# endif
|
||||
|
||||
# ifdef M32R
|
||||
# define CPP_WORDSZ 32
|
||||
# define MACH_TYPE "M32R"
|
||||
# define ALIGNMENT 4
|
||||
# ifdef LINUX
|
||||
# define OS_TYPE "LINUX"
|
||||
# define LINUX_STACKBOTTOM
|
||||
# undef STACK_GRAN
|
||||
# define STACK_GRAN 0x10000000
|
||||
# define USE_GENERIC_PUSH_REGS
|
||||
# define DYNAMIC_LOADING
|
||||
# define SEARCH_FOR_DATA_START
|
||||
extern int _end[];
|
||||
# define DATAEND (_end)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef X86_64
|
||||
# define MACH_TYPE "X86_64"
|
||||
# define ALIGNMENT 8
|
||||
@@ -2173,9 +2046,8 @@
|
||||
# define THREADS
|
||||
# endif
|
||||
|
||||
# if defined(HP_PA) || defined(M88K) \
|
||||
|| defined(POWERPC) && !defined(DARWIN) \
|
||||
|| defined(LINT) || defined(MSWINCE) || defined(ARM32) || defined(CRIS) \
|
||||
# if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(DARWIN) \
|
||||
|| defined(LINT) || defined(MSWINCE) || defined(ARM32) \
|
||||
|| (defined(I386) && defined(__LCC__))
|
||||
/* Use setjmp based hack to mark from callee-save registers. */
|
||||
/* The define should move to the individual platform */
|
||||
@@ -2316,7 +2188,7 @@
|
||||
# else
|
||||
# if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
|
||||
extern void *GC_amiga_get_mem(size_t size);
|
||||
# define GET_MEM(bytes) HBLKPTR((size_t) \
|
||||
define GET_MEM(bytes) HBLKPTR((size_t) \
|
||||
GC_amiga_get_mem((size_t)bytes + GC_page_size) \
|
||||
+ GC_page_size-1)
|
||||
# else
|
||||
@@ -2332,10 +2204,4 @@
|
||||
|
||||
#endif /* GC_PRIVATE_H */
|
||||
|
||||
#if defined(_AIX) && !defined(__GNUC__) && !defined(__STDC__)
|
||||
/* IBMs xlc compiler doesn't appear to follow the convention of */
|
||||
/* defining __STDC__ to be zero in extended mode. */
|
||||
# define __STDC__ 0
|
||||
#endif
|
||||
|
||||
# endif /* GCCONFIG_H */
|
||||
@@ -4,7 +4,7 @@
|
||||
# include "private/gc_priv.h"
|
||||
|
||||
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
|
||||
&& !defined(GC_WIN32_THREADS)
|
||||
&& !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS)
|
||||
|
||||
#if defined(GC_DARWIN_THREADS)
|
||||
# include "private/darwin_stop_world.h"
|
||||
|
||||
+55
-82
@@ -27,10 +27,6 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#if defined(RS6000) || defined(POWERPC)
|
||||
# include <ucontext.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MWERKS__) && !defined(POWERPC)
|
||||
|
||||
asm static void PushMacRegisters()
|
||||
@@ -404,87 +400,64 @@ void GC_push_regs()
|
||||
}
|
||||
#endif /* !USE_GENERIC_PUSH_REGS && !USE_ASM_PUSH_REGS */
|
||||
|
||||
void GC_with_callee_saves_pushed(fn, arg)
|
||||
void (*fn)();
|
||||
ptr_t arg;
|
||||
{
|
||||
word dummy;
|
||||
|
||||
# if defined(USE_GENERIC_PUSH_REGS)
|
||||
# ifdef HAVE_BUILTIN_UNWIND_INIT
|
||||
/* This was suggested by Richard Henderson as the way to */
|
||||
/* force callee-save registers and register windows onto */
|
||||
/* the stack. */
|
||||
__builtin_unwind_init();
|
||||
# else /* !HAVE_BUILTIN_UNWIND_INIT */
|
||||
# if defined(RS6000) || defined(POWERPC)
|
||||
/* FIXME: RS6000 means AIX. */
|
||||
/* This should probably be used in all Posix/non-gcc */
|
||||
/* settings. We defer that change to minimize risk. */
|
||||
ucontext_t ctxt;
|
||||
getcontext(&ctxt);
|
||||
# else
|
||||
/* Generic code */
|
||||
/* The idea is due to Parag Patel at HP. */
|
||||
/* We're not sure whether he would like */
|
||||
/* to be he acknowledged for it or not. */
|
||||
jmp_buf regs;
|
||||
register word * i = (word *) regs;
|
||||
register ptr_t lim = (ptr_t)(regs) + (sizeof regs);
|
||||
|
||||
/* Setjmp doesn't always clear all of the buffer. */
|
||||
/* That tends to preserve garbage. Clear it. */
|
||||
for (; (char *)i < lim; i++) {
|
||||
*i = 0;
|
||||
}
|
||||
# if defined(MSWIN32) || defined(MSWINCE) \
|
||||
|| defined(UTS4) || defined(LINUX) || defined(EWS4800)
|
||||
(void) setjmp(regs);
|
||||
# else
|
||||
(void) _setjmp(regs);
|
||||
/* We don't want to mess with signals. According to */
|
||||
/* SUSV3, setjmp() may or may not save signal mask. */
|
||||
/* _setjmp won't, but is less portable. */
|
||||
# endif
|
||||
# endif /* !AIX ... */
|
||||
# endif /* !HAVE_BUILTIN_UNWIND_INIT */
|
||||
# else
|
||||
# if defined(PTHREADS) && !defined(MSWIN32) /* !USE_GENERIC_PUSH_REGS */
|
||||
/* We may still need this to save thread contexts. */
|
||||
ucontext_t ctxt;
|
||||
getcontext(&ctxt);
|
||||
# else /* Shouldn't be needed */
|
||||
ABORT("Unexpected call to GC_with_callee_saves_pushed");
|
||||
# endif
|
||||
# endif
|
||||
# if (defined(SPARC) && !defined(HAVE_BUILTIN_UNWIND_INIT)) \
|
||||
|| defined(IA64)
|
||||
/* On a register window machine, we need to save register */
|
||||
/* contents on the stack for this to work. The setjmp */
|
||||
/* is probably not needed on SPARC, since pointers are */
|
||||
/* only stored in windowed or scratch registers. It is */
|
||||
/* needed on IA64, since some non-windowed registers are */
|
||||
/* preserved. */
|
||||
{
|
||||
GC_save_regs_ret_val = GC_save_regs_in_stack();
|
||||
/* On IA64 gcc, could use __builtin_ia64_flushrs() and */
|
||||
/* __builtin_ia64_flushrs(). The latter will be done */
|
||||
/* implicitly by __builtin_unwind_init() for gcc3.0.1 */
|
||||
/* and later. */
|
||||
}
|
||||
# endif
|
||||
fn(arg);
|
||||
/* Strongly discourage the compiler from treating the above */
|
||||
/* as a tail-call, since that would pop the register */
|
||||
/* contents before we get a chance to look at them. */
|
||||
GC_noop1((word)(&dummy));
|
||||
}
|
||||
|
||||
#if defined(USE_GENERIC_PUSH_REGS)
|
||||
void GC_generic_push_regs(cold_gc_frame)
|
||||
ptr_t cold_gc_frame;
|
||||
{
|
||||
GC_with_callee_saves_pushed(GC_push_current_stack, cold_gc_frame);
|
||||
{
|
||||
word dummy;
|
||||
|
||||
# ifdef HAVE_BUILTIN_UNWIND_INIT
|
||||
/* This was suggested by Richard Henderson as the way to */
|
||||
/* force callee-save registers and register windows onto */
|
||||
/* the stack. */
|
||||
__builtin_unwind_init();
|
||||
# else /* !HAVE_BUILTIN_UNWIND_INIT */
|
||||
/* Generic code */
|
||||
/* The idea is due to Parag Patel at HP. */
|
||||
/* We're not sure whether he would like */
|
||||
/* to be he acknowledged for it or not. */
|
||||
jmp_buf regs;
|
||||
register word * i = (word *) regs;
|
||||
register ptr_t lim = (ptr_t)(regs) + (sizeof regs);
|
||||
|
||||
/* Setjmp doesn't always clear all of the buffer. */
|
||||
/* That tends to preserve garbage. Clear it. */
|
||||
for (; (char *)i < lim; i++) {
|
||||
*i = 0;
|
||||
}
|
||||
# if defined(POWERPC) || defined(MSWIN32) || defined(MSWINCE) \
|
||||
|| defined(UTS4) || defined(LINUX) || defined(EWS4800)
|
||||
(void) setjmp(regs);
|
||||
# else
|
||||
(void) _setjmp(regs);
|
||||
/* We don't want to mess with signals. According to */
|
||||
/* SUSV3, setjmp() may or may not save signal mask. */
|
||||
/* _setjmp won't, but is less portable. */
|
||||
# endif
|
||||
# endif /* !HAVE_BUILTIN_UNWIND_INIT */
|
||||
# if (defined(SPARC) && !defined(HAVE_BUILTIN_UNWIND_INIT)) \
|
||||
|| defined(IA64)
|
||||
/* On a register window machine, we need to save register */
|
||||
/* contents on the stack for this to work. The setjmp */
|
||||
/* is probably not needed on SPARC, since pointers are */
|
||||
/* only stored in windowed or scratch registers. It is */
|
||||
/* needed on IA64, since some non-windowed registers are */
|
||||
/* preserved. */
|
||||
{
|
||||
GC_save_regs_ret_val = GC_save_regs_in_stack();
|
||||
/* On IA64 gcc, could use __builtin_ia64_flushrs() and */
|
||||
/* __builtin_ia64_flushrs(). The latter will be done */
|
||||
/* implicitly by __builtin_unwind_init() for gcc3.0.1 */
|
||||
/* and later. */
|
||||
}
|
||||
# endif
|
||||
GC_push_current_stack(cold_gc_frame);
|
||||
/* Strongly discourage the compiler from treating the above */
|
||||
/* as a tail-call, since that would pop the register */
|
||||
/* contents before we get a chance to look at them. */
|
||||
GC_noop1((word)(&dummy));
|
||||
}
|
||||
}
|
||||
#endif /* USE_GENERIC_PUSH_REGS */
|
||||
|
||||
@@ -492,7 +465,7 @@ ptr_t cold_gc_frame;
|
||||
/* the stack. Return sp. */
|
||||
# ifdef SPARC
|
||||
asm(" .seg \"text\"");
|
||||
# if defined(SVR4) || defined(NETBSD) || defined(FREEBSD)
|
||||
# if defined(SVR4) || defined(NETBSD)
|
||||
asm(" .globl GC_save_regs_in_stack");
|
||||
asm("GC_save_regs_in_stack:");
|
||||
asm(" .type GC_save_regs_in_stack,#function");
|
||||
|
||||
+1
-2
@@ -172,8 +172,7 @@ int obj_kind;
|
||||
# endif /* REDIRECT_REALLOC */
|
||||
|
||||
|
||||
/* Allocate memory such that only pointers to near the */
|
||||
/* beginning of the object are considered. */
|
||||
/* The same thing, except caller does not hold allocation lock. */
|
||||
/* We avoid holding allocation lock while we clear memory. */
|
||||
ptr_t GC_generic_malloc_ignore_off_page(lb, k)
|
||||
register size_t lb;
|
||||
|
||||
+6
-6
@@ -858,9 +858,9 @@ mse * GC_steal_mark_stack(mse * low, mse * high, mse * local,
|
||||
++top;
|
||||
top -> mse_descr = descr;
|
||||
top -> mse_start = p -> mse_start;
|
||||
GC_ASSERT( (top -> mse_descr & GC_DS_TAGS) != GC_DS_LENGTH ||
|
||||
top -> mse_descr < (ptr_t)GC_greatest_plausible_heap_addr
|
||||
- (ptr_t)GC_least_plausible_heap_addr);
|
||||
GC_ASSERT( top -> mse_descr & GC_DS_TAGS != GC_DS_LENGTH ||
|
||||
top -> mse_descr < GC_greatest_plausible_heap_addr
|
||||
- GC_least_plausible_heap_addr);
|
||||
/* If this is a big object, count it as */
|
||||
/* size/256 + 1 objects. */
|
||||
++i;
|
||||
@@ -1450,8 +1450,8 @@ void GC_push_all_eager(bottom, top)
|
||||
ptr_t bottom;
|
||||
ptr_t top;
|
||||
{
|
||||
word * b = (word *)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
|
||||
word * t = (word *)(((word) top) & ~(ALIGNMENT-1));
|
||||
word * b = (word *)(((long) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
|
||||
word * t = (word *)(((long) top) & ~(ALIGNMENT-1));
|
||||
register word *p;
|
||||
register word q;
|
||||
register word *lim;
|
||||
@@ -1739,7 +1739,7 @@ register hdr * hhdr;
|
||||
{
|
||||
register int sz = hhdr -> hb_sz;
|
||||
|
||||
if (sz <= MAXOBJSZ) {
|
||||
if (sz < MAXOBJSZ) {
|
||||
return(GC_page_was_dirty(h));
|
||||
} else {
|
||||
register ptr_t p = (ptr_t)h;
|
||||
|
||||
+1
-4
@@ -368,11 +368,8 @@ ptr_t p;
|
||||
|
||||
ptr_t GC_approx_sp()
|
||||
{
|
||||
VOLATILE word dummy;
|
||||
word dummy;
|
||||
|
||||
dummy = 42; /* Force stack to grow if necessary. Otherwise the */
|
||||
/* later accesses might cause the kernel to think we're */
|
||||
/* doing something wrong. */
|
||||
# ifdef _MSC_VER
|
||||
# pragma warning(disable:4172)
|
||||
# endif
|
||||
|
||||
+2
-5
@@ -246,7 +246,7 @@ void *arg2;
|
||||
byte_sz = WORDS_TO_BYTES(word_sz);
|
||||
if (GC_all_interior_pointers) {
|
||||
/* We need one extra byte; don't fill in GC_size_map[byte_sz] */
|
||||
byte_sz -= EXTRA_BYTES;
|
||||
byte_sz--;
|
||||
}
|
||||
|
||||
for (j = low_limit; j <= byte_sz; j++) GC_size_map[j] = word_sz;
|
||||
@@ -804,10 +804,7 @@ void GC_init_inner()
|
||||
|
||||
void GC_enable_incremental GC_PROTO(())
|
||||
{
|
||||
# if !defined(SMALL_CONFIG) && !defined(KEEP_BACK_PTRS)
|
||||
/* If we are keeping back pointers, the GC itself dirties all */
|
||||
/* pages on which objects have been marked, making */
|
||||
/* incremental GC pointless. */
|
||||
# if !defined(SMALL_CONFIG)
|
||||
if (!GC_find_leak) {
|
||||
DCL_LOCK_STATE;
|
||||
|
||||
|
||||
+91
-149
@@ -60,10 +60,6 @@
|
||||
# include <signal.h>
|
||||
# endif
|
||||
|
||||
#if defined(LINUX) || defined(LINUX_STACKBOTTOM)
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
|
||||
/* Blatantly OS dependent routines, except for those that are related */
|
||||
/* to dynamic loading. */
|
||||
|
||||
@@ -84,7 +80,7 @@
|
||||
# define NEED_FIND_LIMIT
|
||||
# endif
|
||||
|
||||
#if defined(FREEBSD) && (defined(I386) || defined(powerpc) || defined(__powerpc__))
|
||||
#if defined(FREEBSD) && defined(I386)
|
||||
# include <machine/trap.h>
|
||||
# if !defined(PCR)
|
||||
# define NEED_FIND_LIMIT
|
||||
@@ -254,11 +250,30 @@ word GC_apply_to_maps(word (*fn)(char *))
|
||||
// XXXXXXXX-XXXXXXXX r-xp 00000000 30:05 260537 name of mapping...\n
|
||||
// ^^^^^^^^ ^^^^^^^^ ^^^^ ^^
|
||||
// start end prot maj_dev
|
||||
// 0 9 18 32
|
||||
//
|
||||
// For 64 bit ABIs:
|
||||
// 0 17 34 56
|
||||
//
|
||||
// Note that since about auguat 2003 kernels, the columns no longer have
|
||||
// fixed offsets on 64-bit kernels. Hence we no longer rely on fixed offsets
|
||||
// anywhere, which is safer anyway.
|
||||
// The parser is called with a pointer to the entry and the return value
|
||||
// is either NULL or is advanced to the next entry(the byte after the
|
||||
// trailing '\n'.)
|
||||
//
|
||||
#if CPP_WORDSZ == 32
|
||||
# define OFFSET_MAP_START 0
|
||||
# define OFFSET_MAP_END 9
|
||||
# define OFFSET_MAP_PROT 18
|
||||
# define OFFSET_MAP_MAJDEV 32
|
||||
# define ADDR_WIDTH 8
|
||||
#endif
|
||||
|
||||
#if CPP_WORDSZ == 64
|
||||
# define OFFSET_MAP_START 0
|
||||
# define OFFSET_MAP_END 17
|
||||
# define OFFSET_MAP_PROT 34
|
||||
# define OFFSET_MAP_MAJDEV 56
|
||||
# define ADDR_WIDTH 16
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Assign various fields of the first line in buf_ptr to *start, *end,
|
||||
@@ -267,46 +282,37 @@ word GC_apply_to_maps(word (*fn)(char *))
|
||||
char *GC_parse_map_entry(char *buf_ptr, word *start, word *end,
|
||||
char *prot_buf, unsigned int *maj_dev)
|
||||
{
|
||||
char *start_start, *end_start, *prot_start, *maj_dev_start;
|
||||
char *p;
|
||||
char *endp;
|
||||
int i;
|
||||
char *tok;
|
||||
|
||||
if (buf_ptr == NULL || *buf_ptr == '\0') {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = buf_ptr;
|
||||
while (isspace(*p)) ++p;
|
||||
start_start = p;
|
||||
GC_ASSERT(isxdigit(*start_start));
|
||||
*start = strtoul(start_start, &endp, 16); p = endp;
|
||||
GC_ASSERT(*p=='-');
|
||||
|
||||
++p;
|
||||
end_start = p;
|
||||
GC_ASSERT(isxdigit(*end_start));
|
||||
*end = strtoul(end_start, &endp, 16); p = endp;
|
||||
GC_ASSERT(isspace(*p));
|
||||
|
||||
while (isspace(*p)) ++p;
|
||||
prot_start = p;
|
||||
GC_ASSERT(*prot_start == 'r' || *prot_start == '-');
|
||||
memcpy(prot_buf, prot_start, 4);
|
||||
memcpy(prot_buf, buf_ptr+OFFSET_MAP_PROT, 4);
|
||||
/* do the protections first. */
|
||||
prot_buf[4] = '\0';
|
||||
if (prot_buf[1] == 'w') {/* we can skip the rest if it's not writable. */
|
||||
/* Skip past protection field to offset field */
|
||||
while (!isspace(*p)) ++p; while (isspace(*p)) ++p;
|
||||
GC_ASSERT(isxdigit(*p));
|
||||
/* Skip past offset field, which we ignore */
|
||||
while (!isspace(*p)) ++p; while (isspace(*p)) ++p;
|
||||
maj_dev_start = p;
|
||||
GC_ASSERT(isxdigit(*maj_dev_start));
|
||||
*maj_dev = strtoul(maj_dev_start, NULL, 16);
|
||||
|
||||
if (prot_buf[1] == 'w') {/* we can skip all of this if it's not writable. */
|
||||
|
||||
tok = buf_ptr;
|
||||
buf_ptr[OFFSET_MAP_START+ADDR_WIDTH] = '\0';
|
||||
*start = strtoul(tok, NULL, 16);
|
||||
|
||||
tok = buf_ptr+OFFSET_MAP_END;
|
||||
buf_ptr[OFFSET_MAP_END+ADDR_WIDTH] = '\0';
|
||||
*end = strtoul(tok, NULL, 16);
|
||||
|
||||
buf_ptr += OFFSET_MAP_MAJDEV;
|
||||
tok = buf_ptr;
|
||||
while (*buf_ptr != ':') buf_ptr++;
|
||||
*buf_ptr++ = '\0';
|
||||
*maj_dev = strtoul(tok, NULL, 16);
|
||||
}
|
||||
|
||||
while (*p && *p++ != '\n');
|
||||
while (*buf_ptr && *buf_ptr++ != '\n');
|
||||
|
||||
return p;
|
||||
return buf_ptr;
|
||||
}
|
||||
|
||||
#endif /* Need to parse /proc/self/maps. */
|
||||
@@ -698,8 +704,8 @@ ptr_t GC_get_stack_base()
|
||||
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
|
||||
|| defined(HURD) || defined(NETBSD) || defined(FREEBSD)
|
||||
static struct sigaction old_segv_act;
|
||||
# if defined(IRIX5) || defined(HPUX) \
|
||||
|| defined(HURD) || defined(NETBSD)
|
||||
# if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \
|
||||
|| defined(HURD) || defined(NETBSD) || defined(FREEBSD)
|
||||
static struct sigaction old_bus_act;
|
||||
# endif
|
||||
# else
|
||||
@@ -731,12 +737,10 @@ ptr_t GC_get_stack_base()
|
||||
/* and setting a handler at the same time. */
|
||||
(void) sigaction(SIGSEGV, 0, &old_segv_act);
|
||||
(void) sigaction(SIGSEGV, &act, 0);
|
||||
(void) sigaction(SIGBUS, 0, &old_bus_act);
|
||||
(void) sigaction(SIGBUS, &act, 0);
|
||||
# else
|
||||
(void) sigaction(SIGSEGV, &act, &old_segv_act);
|
||||
# if defined(IRIX5) \
|
||||
|| defined(HPUX) || defined(HURD) || defined(NETBSD)
|
||||
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
|
||||
|| defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
|
||||
/* Under Irix 5.x or HP/UX, we may get SIGBUS. */
|
||||
/* Pthreads doesn't exist under Irix 5.x, so we */
|
||||
/* don't have to worry in the threads case. */
|
||||
@@ -774,8 +778,8 @@ ptr_t GC_get_stack_base()
|
||||
# if defined(SUNOS5SIGS) || defined(IRIX5) \
|
||||
|| defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
|
||||
(void) sigaction(SIGSEGV, &old_segv_act, 0);
|
||||
# if defined(IRIX5) \
|
||||
|| defined(HPUX) || defined(HURD) || defined(NETBSD)
|
||||
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
|
||||
|| defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
|
||||
(void) sigaction(SIGBUS, &old_bus_act, 0);
|
||||
# endif
|
||||
# else
|
||||
@@ -855,14 +859,13 @@ ptr_t GC_get_stack_base()
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ctype.h>
|
||||
|
||||
# define STAT_SKIP 27 /* Number of fields preceding startstack */
|
||||
/* field in /proc/self/stat */
|
||||
|
||||
#ifdef USE_LIBC_PRIVATES
|
||||
# pragma weak __libc_stack_end
|
||||
extern ptr_t __libc_stack_end;
|
||||
#endif
|
||||
|
||||
# ifdef IA64
|
||||
/* Try to read the backing store base from /proc/self/maps. */
|
||||
@@ -892,38 +895,33 @@ ptr_t GC_get_stack_base()
|
||||
return GC_apply_to_maps(backing_store_base_from_maps);
|
||||
}
|
||||
|
||||
# ifdef USE_LIBC_PRIVATES
|
||||
# pragma weak __libc_ia64_register_backing_store_base
|
||||
extern ptr_t __libc_ia64_register_backing_store_base;
|
||||
# endif
|
||||
# pragma weak __libc_ia64_register_backing_store_base
|
||||
extern ptr_t __libc_ia64_register_backing_store_base;
|
||||
|
||||
ptr_t GC_get_register_stack_base(void)
|
||||
{
|
||||
# ifdef USE_LIBC_PRIVATES
|
||||
if (0 != &__libc_ia64_register_backing_store_base
|
||||
&& 0 != __libc_ia64_register_backing_store_base) {
|
||||
/* Glibc 2.2.4 has a bug such that for dynamically linked */
|
||||
/* executables __libc_ia64_register_backing_store_base is */
|
||||
/* defined but uninitialized during constructor calls. */
|
||||
/* Hence we check for both nonzero address and value. */
|
||||
return __libc_ia64_register_backing_store_base;
|
||||
}
|
||||
# endif
|
||||
word result = backing_store_base_from_proc();
|
||||
if (0 == result) {
|
||||
if (0 != &__libc_ia64_register_backing_store_base
|
||||
&& 0 != __libc_ia64_register_backing_store_base) {
|
||||
/* Glibc 2.2.4 has a bug such that for dynamically linked */
|
||||
/* executables __libc_ia64_register_backing_store_base is */
|
||||
/* defined but uninitialized during constructor calls. */
|
||||
/* Hence we check for both nonzero address and value. */
|
||||
return __libc_ia64_register_backing_store_base;
|
||||
} else {
|
||||
word result = backing_store_base_from_proc();
|
||||
if (0 == result) {
|
||||
/* Use dumb heuristics. Works only for default configuration. */
|
||||
result = (word)GC_stackbottom - BACKING_STORE_DISPLACEMENT;
|
||||
result += BACKING_STORE_ALIGNMENT - 1;
|
||||
result &= ~(BACKING_STORE_ALIGNMENT - 1);
|
||||
/* Verify that it's at least readable. If not, we goofed. */
|
||||
GC_noop1(*(word *)result);
|
||||
}
|
||||
return (ptr_t)result;
|
||||
}
|
||||
return (ptr_t)result;
|
||||
}
|
||||
# endif
|
||||
|
||||
void *GC_set_stackbottom = NULL;
|
||||
|
||||
ptr_t GC_linux_stack_base(void)
|
||||
{
|
||||
/* We read the stack base value from /proc/self/stat. We do this */
|
||||
@@ -943,7 +941,7 @@ void *GC_set_stackbottom = NULL;
|
||||
/* since the correct value of __libc_stack_end never */
|
||||
/* becomes visible to us. The second test works around */
|
||||
/* this. */
|
||||
# ifdef USE_LIBC_PRIVATES
|
||||
#if USE_LIBC_PRIVATE_SYMBOLS
|
||||
if (0 != &__libc_stack_end && 0 != __libc_stack_end ) {
|
||||
# ifdef IA64
|
||||
/* Some versions of glibc set the address 16 bytes too */
|
||||
@@ -953,19 +951,10 @@ void *GC_set_stackbottom = NULL;
|
||||
} /* Otherwise it's not safe to add 16 bytes and we fall */
|
||||
/* back to using /proc. */
|
||||
# else
|
||||
# ifdef SPARC
|
||||
/* Older versions of glibc for 64-bit Sparc do not set
|
||||
* this variable correctly, it gets set to either zero
|
||||
* or one.
|
||||
*/
|
||||
if (__libc_stack_end != (ptr_t) (unsigned long)0x1)
|
||||
return __libc_stack_end;
|
||||
# else
|
||||
return __libc_stack_end;
|
||||
# endif
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
f = open("/proc/self/stat", O_RDONLY);
|
||||
if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) {
|
||||
ABORT("Couldn't read /proc/self/stat");
|
||||
@@ -1396,7 +1385,7 @@ int * etext_addr;
|
||||
}
|
||||
# endif
|
||||
|
||||
# if defined(FREEBSD) && (defined(I386) || defined(powerpc) || defined(__powerpc__)) && !defined(PCR)
|
||||
# if defined(FREEBSD) && defined(I386) && !defined(PCR)
|
||||
/* Its unclear whether this should be identical to the above, or */
|
||||
/* whether it should apply to non-X86 architectures. */
|
||||
/* For now we don't assume that there is always an empty page after */
|
||||
@@ -1517,7 +1506,7 @@ void GC_register_data_segments()
|
||||
# endif
|
||||
|
||||
|
||||
# if 0 && defined(RS6000) /* We now use mmap */
|
||||
# ifdef RS6000
|
||||
/* The compiler seems to generate speculative reads one past the end of */
|
||||
/* an allocated object. Hence we need to make sure that the page */
|
||||
/* following the last heap page is also mapped. */
|
||||
@@ -2311,11 +2300,8 @@ GC_bool is_ptrfree;
|
||||
# if defined(ALPHA) || defined(M68K)
|
||||
typedef void (* REAL_SIG_PF)(int, int, s_c *);
|
||||
# else
|
||||
# if defined(IA64) || defined(HP_PA) || defined(X86_64)
|
||||
# if defined(IA64) || defined(HP_PA)
|
||||
typedef void (* REAL_SIG_PF)(int, siginfo_t *, s_c *);
|
||||
/* FIXME: */
|
||||
/* According to SUSV3, the last argument should have type */
|
||||
/* void * or ucontext_t * */
|
||||
# else
|
||||
typedef void (* REAL_SIG_PF)(int, s_c);
|
||||
# endif
|
||||
@@ -2403,7 +2389,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
|
||||
# endif
|
||||
# ifdef FREEBSD
|
||||
# define SIG_OK (sig == SIGBUS)
|
||||
# define CODE_OK TRUE
|
||||
# define CODE_OK (code == BUS_PAGE_FAULT)
|
||||
# endif
|
||||
# endif /* SUNOS4 || (FREEBSD && !SUNOS5SIGS) */
|
||||
|
||||
@@ -2428,7 +2414,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
|
||||
# if defined(ALPHA) || defined(M68K)
|
||||
void GC_write_fault_handler(int sig, int code, s_c * sc)
|
||||
# else
|
||||
# if defined(IA64) || defined(HP_PA) || defined(X86_64)
|
||||
# if defined(IA64) || defined(HP_PA)
|
||||
void GC_write_fault_handler(int sig, siginfo_t * si, s_c * scp)
|
||||
# else
|
||||
# if defined(ARM32)
|
||||
@@ -2494,7 +2480,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
|
||||
char * addr = (char *) (scp -> si_addr);
|
||||
# endif
|
||||
# ifdef LINUX
|
||||
# if defined(I386)
|
||||
# if defined(I386) || defined (X86_64)
|
||||
char * addr = (char *) (sc.cr2);
|
||||
# else
|
||||
# if defined(M68K)
|
||||
@@ -2529,7 +2515,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
|
||||
# ifdef ALPHA
|
||||
char * addr = get_fault_addr(sc);
|
||||
# else
|
||||
# if defined(IA64) || defined(HP_PA) || defined(X86_64)
|
||||
# if defined(IA64) || defined(HP_PA)
|
||||
char * addr = si -> si_addr;
|
||||
/* I believe this is claimed to work on all platforms for */
|
||||
/* Linux 2.3.47 and later. Hopefully we don't have to */
|
||||
@@ -2541,11 +2527,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
|
||||
# if defined(ARM32)
|
||||
char * addr = (char *)sc.fault_address;
|
||||
# else
|
||||
# if defined(CRIS)
|
||||
char * addr = (char *)sc.regs.csraddr;
|
||||
# else
|
||||
--> architecture not supported
|
||||
# endif
|
||||
--> architecture not supported
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -2614,7 +2596,7 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */
|
||||
# if defined(ALPHA) || defined(M68K)
|
||||
(*(REAL_SIG_PF)old_handler) (sig, code, sc);
|
||||
# else
|
||||
# if defined(IA64) || defined(HP_PA) || defined(X86_64)
|
||||
# if defined(IA64) || defined(HP_PA)
|
||||
(*(REAL_SIG_PF)old_handler) (sig, si, scp);
|
||||
# else
|
||||
(*(REAL_SIG_PF)old_handler) (sig, sc);
|
||||
@@ -2708,8 +2690,7 @@ void GC_dirty_init()
|
||||
struct sigaction act, oldact;
|
||||
/* We should probably specify SA_SIGINFO for Linux, and handle */
|
||||
/* the different architectures more uniformly. */
|
||||
# if defined(IRIX5) || defined(LINUX) && !defined(X86_64) \
|
||||
|| defined(OSF1) || defined(HURD)
|
||||
# if defined(IRIX5) || defined(LINUX) || defined(OSF1) || defined(HURD)
|
||||
act.sa_flags = SA_RESTART;
|
||||
act.sa_handler = (SIG_PF)GC_write_fault_handler;
|
||||
# else
|
||||
@@ -3087,7 +3068,7 @@ word n;
|
||||
#include <sys/procfs.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define INITIAL_BUF_SZ 16384
|
||||
#define INITIAL_BUF_SZ 4096
|
||||
word GC_proc_buf_size = INITIAL_BUF_SZ;
|
||||
char *GC_proc_buf;
|
||||
|
||||
@@ -3422,6 +3403,8 @@ extern kern_return_t exception_raise_state_identity(
|
||||
|
||||
#define MAX_EXCEPTION_PORTS 16
|
||||
|
||||
static mach_port_t GC_task_self;
|
||||
|
||||
static struct {
|
||||
mach_msg_type_number_t count;
|
||||
exception_mask_t masks[MAX_EXCEPTION_PORTS];
|
||||
@@ -3748,7 +3731,7 @@ static kern_return_t GC_forward_exception(
|
||||
exception_behavior_t behavior;
|
||||
thread_state_flavor_t flavor;
|
||||
|
||||
thread_state_t thread_state;
|
||||
thread_state_data_t thread_state;
|
||||
mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
|
||||
|
||||
for(i=0;i<GC_old_exc_ports.count;i++)
|
||||
@@ -3809,23 +3792,13 @@ catch_exception_raise(
|
||||
char *addr;
|
||||
struct hblk *h;
|
||||
int i;
|
||||
# if defined(POWERPC)
|
||||
# if CPP_WORDSZ == 32
|
||||
thread_state_flavor_t flavor = PPC_EXCEPTION_STATE;
|
||||
mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE_COUNT;
|
||||
ppc_exception_state_t exc_state;
|
||||
# else
|
||||
thread_state_flavor_t flavor = PPC_EXCEPTION_STATE64;
|
||||
mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
|
||||
ppc_exception_state64_t exc_state;
|
||||
# endif
|
||||
# elif defined(I386)
|
||||
thread_state_flavor_t flavor = i386_EXCEPTION_STATE;
|
||||
mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT;
|
||||
i386_exception_state_t exc_state;
|
||||
# else
|
||||
#ifdef POWERPC
|
||||
thread_state_flavor_t flavor = PPC_EXCEPTION_STATE;
|
||||
mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE_COUNT;
|
||||
ppc_exception_state_t exc_state;
|
||||
#else
|
||||
# error FIXME for non-ppc darwin
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
if(exception != EXC_BAD_ACCESS || code[0] != KERN_PROTECTION_FAILURE) {
|
||||
@@ -3854,13 +3827,7 @@ catch_exception_raise(
|
||||
}
|
||||
|
||||
/* This is the address that caused the fault */
|
||||
#if defined(POWERPC)
|
||||
addr = (char*) exc_state.dar;
|
||||
#elif defined (I386)
|
||||
addr = (char*) exc_state.faultvaddr;
|
||||
#else
|
||||
# error FIXME for non POWERPC/I386
|
||||
#endif
|
||||
|
||||
if((HDR(addr)) == 0) {
|
||||
/* Ugh... just like the SIGBUS problem above, it seems we get a bogus
|
||||
@@ -3991,14 +3958,10 @@ kern_return_t catch_exception_raise_state_identity(
|
||||
# if defined (DRSNX)
|
||||
# include <sys/sparc/frame.h>
|
||||
# else
|
||||
# if defined(OPENBSD)
|
||||
# if defined(OPENBSD) || defined(NETBSD)
|
||||
# include <frame.h>
|
||||
# else
|
||||
# if defined(FREEBSD) || defined(NETBSD)
|
||||
# include <machine/frame.h>
|
||||
# else
|
||||
# include <sys/frame.h>
|
||||
# endif
|
||||
# include <sys/frame.h>
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -4027,16 +3990,6 @@ kern_return_t catch_exception_raise_state_identity(
|
||||
#if NARGS == 0 && NFRAMES % 2 == 0 /* No padding */ \
|
||||
&& defined(GC_HAVE_BUILTIN_BACKTRACE)
|
||||
|
||||
#ifdef REDIRECT_MALLOC
|
||||
/* Deal with possible malloc calls in backtrace by omitting */
|
||||
/* the infinitely recursing backtrace. */
|
||||
# ifdef THREADS
|
||||
__thread /* If your compiler doesn't understand this */
|
||||
/* you could use something like pthread_getspecific. */
|
||||
# endif
|
||||
GC_in_save_callers = FALSE;
|
||||
#endif
|
||||
|
||||
void GC_save_callers (info)
|
||||
struct callinfo info[NFRAMES];
|
||||
{
|
||||
@@ -4046,26 +3999,15 @@ struct callinfo info[NFRAMES];
|
||||
|
||||
/* We retrieve NFRAMES+1 pc values, but discard the first, since it */
|
||||
/* points to our own frame. */
|
||||
# ifdef REDIRECT_MALLOC
|
||||
if (GC_in_save_callers) {
|
||||
info[0].ci_pc = (word)(&GC_save_callers);
|
||||
for (i = 1; i < NFRAMES; ++i) info[i].ci_pc = 0;
|
||||
return;
|
||||
}
|
||||
GC_in_save_callers = TRUE;
|
||||
# endif
|
||||
GC_ASSERT(sizeof(struct callinfo) == sizeof(void *));
|
||||
npcs = backtrace((void **)tmp_info, NFRAMES + IGNORE_FRAMES);
|
||||
BCOPY(tmp_info+IGNORE_FRAMES, info, (npcs - IGNORE_FRAMES) * sizeof(void *));
|
||||
for (i = npcs - IGNORE_FRAMES; i < NFRAMES; ++i) info[i].ci_pc = 0;
|
||||
# ifdef REDIRECT_MALLOC
|
||||
GC_in_save_callers = FALSE;
|
||||
# endif
|
||||
}
|
||||
|
||||
#else /* No builtin backtrace; do it ourselves */
|
||||
|
||||
#if (defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD)) && defined(SPARC)
|
||||
#if (defined(OPENBSD) || defined(NETBSD)) && defined(SPARC)
|
||||
# define FR_SAVFP fr_fp
|
||||
# define FR_SAVPC fr_pc
|
||||
#else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
; GC_push_regs function. Under some optimization levels GCC will clobber
|
||||
; some of the non-volatile registers before we get a chance to save them
|
||||
; therefore, this cannot be inline asm.
|
||||
; therefore, this can't be inline asm.
|
||||
|
||||
.text
|
||||
.align 2
|
||||
@@ -64,8 +64,7 @@ _GC_push_regs:
|
||||
; PIC stuff, generated by GCC
|
||||
|
||||
.data
|
||||
.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
|
||||
.align 2
|
||||
.picsymbol_stub
|
||||
L_GC_push_one$stub:
|
||||
.indirect_symbol _GC_push_one
|
||||
mflr r0
|
||||
@@ -74,12 +73,12 @@ L0$_GC_push_one:
|
||||
mflr r11
|
||||
addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
|
||||
mtlr r0
|
||||
lwzu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
|
||||
lwz r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11)
|
||||
mtctr r12
|
||||
addi r11,r11,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)
|
||||
bctr
|
||||
.data
|
||||
.lazy_symbol_pointer
|
||||
L_GC_push_one$lazy_ptr:
|
||||
.indirect_symbol _GC_push_one
|
||||
.long dyld_stub_binding_helper
|
||||
|
||||
+18
-23
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) 1994 by Xerox Corporation. All rights reserved.
|
||||
* Copyright (c) 1996 by Silicon Graphics. All rights reserved.
|
||||
* Copyright (c) 1998 by Fergus Henderson. All rights reserved.
|
||||
* Copyright (c) 2000-2004 by Hewlett-Packard Company. All rights reserved.
|
||||
* Copyright (c) 2000-2001 by Hewlett-Packard Company. All rights reserved.
|
||||
*
|
||||
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
|
||||
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
||||
@@ -50,7 +50,8 @@
|
||||
# include "private/pthread_support.h"
|
||||
|
||||
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
|
||||
&& !defined(GC_WIN32_THREADS)
|
||||
&& !defined(GC_IRIX_THREADS) && !defined(GC_WIN32_THREADS) \
|
||||
&& !defined(GC_AIX_THREADS)
|
||||
|
||||
# if defined(GC_HPUX_THREADS) && !defined(USE_PTHREAD_SPECIFIC) \
|
||||
&& !defined(USE_COMPILER_TLS)
|
||||
@@ -67,8 +68,7 @@
|
||||
# endif
|
||||
|
||||
# if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
|
||||
defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) \
|
||||
&& !defined(USE_PTHREAD_SPECIFIC)
|
||||
defined(GC_DARWIN_THREADS)) && !defined(USE_PTHREAD_SPECIFIC)
|
||||
# define USE_PTHREAD_SPECIFIC
|
||||
# endif
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
# include <semaphore.h>
|
||||
#endif /* !GC_DARWIN_THREADS */
|
||||
|
||||
#if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS)
|
||||
#if defined(GC_DARWIN_THREADS)
|
||||
# include <sys/sysctl.h>
|
||||
#endif /* GC_DARWIN_THREADS */
|
||||
|
||||
@@ -948,9 +948,9 @@ int GC_get_nprocs()
|
||||
/* We hold the allocation lock. */
|
||||
void GC_thr_init()
|
||||
{
|
||||
# ifndef GC_DARWIN_THREADS
|
||||
int dummy;
|
||||
# endif
|
||||
# ifndef GC_DARWIN_THREADS
|
||||
int dummy;
|
||||
# endif
|
||||
GC_thread t;
|
||||
|
||||
if (GC_thr_initialized) return;
|
||||
@@ -982,15 +982,14 @@ void GC_thr_init()
|
||||
# if defined(GC_HPUX_THREADS)
|
||||
GC_nprocs = pthread_num_processors_np();
|
||||
# endif
|
||||
# if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS)
|
||||
# if defined(GC_OSF1_THREADS)
|
||||
GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (GC_nprocs <= 0) GC_nprocs = 1;
|
||||
# endif
|
||||
# if defined(GC_IRIX_THREADS)
|
||||
GC_nprocs = sysconf(_SC_NPROC_ONLN);
|
||||
if (GC_nprocs <= 0) GC_nprocs = 1;
|
||||
# if defined(GC_FREEBSD_THREADS)
|
||||
GC_nprocs = 1;
|
||||
# endif
|
||||
# if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS)
|
||||
# if defined(GC_DARWIN_THREADS)
|
||||
int ncpus = 1;
|
||||
size_t len = sizeof(ncpus);
|
||||
sysctl((int[2]) {CTL_HW, HW_NCPU}, 2, &ncpus, &len, NULL, 0);
|
||||
@@ -1037,8 +1036,6 @@ void GC_thr_init()
|
||||
/* Disable true incremental collection, but generational is OK. */
|
||||
GC_time_limit = GC_TIME_UNLIMITED;
|
||||
}
|
||||
/* If we are using a parallel marker, actually start helper threads. */
|
||||
if (GC_parallel) start_mark_threads();
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -1055,6 +1052,10 @@ void GC_init_parallel()
|
||||
|
||||
/* GC_init() calls us back, so set flag first. */
|
||||
if (!GC_is_initialized) GC_init();
|
||||
/* If we are using a parallel marker, start the helper threads. */
|
||||
# ifdef PARALLEL_MARK
|
||||
if (GC_parallel) start_mark_threads();
|
||||
# endif
|
||||
/* Initialize thread local free lists if used. */
|
||||
# if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL)
|
||||
LOCK();
|
||||
@@ -1368,7 +1369,7 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
|
||||
if (!GC_thr_initialized) GC_thr_init();
|
||||
# ifdef GC_ASSERTIONS
|
||||
{
|
||||
size_t stack_size;
|
||||
int stack_size;
|
||||
if (NULL == attr) {
|
||||
pthread_attr_t my_attr;
|
||||
pthread_attr_init(&my_attr);
|
||||
@@ -1376,13 +1377,7 @@ WRAP_FUNC(pthread_create)(pthread_t *new_thread,
|
||||
} else {
|
||||
pthread_attr_getstacksize(attr, &stack_size);
|
||||
}
|
||||
# ifdef PARALLEL_MARK
|
||||
GC_ASSERT(stack_size >= (8*HBLKSIZE*sizeof(word)));
|
||||
# else
|
||||
/* FreeBSD-5.3/Alpha: default pthread stack is 64K, */
|
||||
/* HBLKSIZE=8192, sizeof(word)=8 */
|
||||
GC_ASSERT(stack_size >= 65536);
|
||||
# endif
|
||||
GC_ASSERT(stack_size >= (8*HBLKSIZE*sizeof(word)));
|
||||
/* Our threads may need to do some work for the GC. */
|
||||
/* Ridiculously small threads won't work, and they */
|
||||
/* probably wouldn't work anyway. */
|
||||
|
||||
+1
-1
@@ -888,7 +888,7 @@ void GC_print_block_list()
|
||||
{
|
||||
struct Print_stats pstats;
|
||||
|
||||
GC_printf1("(kind(0=ptrfree,1=normal,2=unc.,%lu=stubborn):size_in_bytes, #_marks_set)\n", STUBBORN);
|
||||
GC_printf0("(kind(0=ptrfree,1=normal,2=unc.,3=stubborn):size_in_bytes, #_marks_set)\n");
|
||||
pstats.number_of_blocks = 0;
|
||||
pstats.total_bytes = 0;
|
||||
GC_apply_to_all_blocks(GC_print_block_descr, (word)&pstats);
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
* Modified by Peter C. for Solaris Posix Threads.
|
||||
*/
|
||||
|
||||
# include "private/gc_priv.h"
|
||||
|
||||
# if defined(GC_SOLARIS_PTHREADS)
|
||||
# include "private/gc_priv.h"
|
||||
# include <pthread.h>
|
||||
# include <thread.h>
|
||||
# include <signal.h>
|
||||
|
||||
+8
-11
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
/* Boehm, September 14, 1994 4:44 pm PDT */
|
||||
|
||||
# include "private/gc_priv.h"
|
||||
|
||||
# if defined(GC_SOLARIS_THREADS) || defined(GC_SOLARIS_PTHREADS)
|
||||
|
||||
# include "private/gc_priv.h"
|
||||
# include "private/solaris_threads.h"
|
||||
# include <thread.h>
|
||||
# include <synch.h>
|
||||
@@ -248,8 +248,8 @@ static void stop_all_lwps()
|
||||
for (i = 0; i < max_lwps; i++)
|
||||
last_ids[i] = 0;
|
||||
for (;;) {
|
||||
if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0)
|
||||
ABORT("Main PIOCSTATUS failed");
|
||||
if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0)
|
||||
ABORT("Main PIOCSTATUS failed");
|
||||
if (status.pr_nlwp < 1)
|
||||
ABORT("Invalid number of lwps returned by PIOCSTATUS");
|
||||
if (status.pr_nlwp >= max_lwps) {
|
||||
@@ -262,7 +262,7 @@ static void stop_all_lwps()
|
||||
for (i = 0; i < max_lwps; i++)
|
||||
last_ids[i] = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCLWPIDS, GC_current_ids) < 0)
|
||||
ABORT("PIOCLWPIDS failed");
|
||||
changed = FALSE;
|
||||
@@ -803,7 +803,6 @@ void GC_thr_init(void)
|
||||
{
|
||||
GC_thread t;
|
||||
thread_t tid;
|
||||
int ret;
|
||||
|
||||
if (GC_thr_initialized)
|
||||
return;
|
||||
@@ -821,11 +820,9 @@ void GC_thr_init(void)
|
||||
t = GC_new_thread(thr_self());
|
||||
t -> stack_size = 0;
|
||||
t -> flags = DETACHED | CLIENT_OWNS_STACK;
|
||||
ret = thr_create(0 /* stack */, 0 /* stack_size */, GC_thr_daemon,
|
||||
0 /* arg */, THR_DETACHED | THR_DAEMON,
|
||||
&tid /* thread_id */);
|
||||
if (ret != 0) {
|
||||
GC_err_printf1("Thr_create returned %ld\n", ret);
|
||||
if (thr_create(0 /* stack */, 0 /* stack_size */, GC_thr_daemon,
|
||||
0 /* arg */, THR_DETACHED | THR_DAEMON,
|
||||
&tid /* thread_id */) != 0) {
|
||||
ABORT("Cant fork daemon");
|
||||
}
|
||||
thr_setprio(tid, 126);
|
||||
|
||||
+1
-2
@@ -11,10 +11,9 @@
|
||||
* modified is included with the above copyright notice.
|
||||
*/
|
||||
|
||||
#include "private/gc_priv.h" /* For GC_compare_and_exchange, GC_memory_barrier */
|
||||
|
||||
#if defined(GC_LINUX_THREADS)
|
||||
|
||||
#include "private/gc_priv.h" /* For GC_compare_and_exchange, GC_memory_barrier */
|
||||
#include "private/specific.h"
|
||||
|
||||
static tse invalid_tse = {INVALID_QTID, 0, 0, INVALID_THREADID};
|
||||
|
||||
+1
-9
@@ -1,4 +1,3 @@
|
||||
# include "gc_config_macros.h"
|
||||
# include "private/gcconfig.h"
|
||||
# include <stdio.h>
|
||||
|
||||
@@ -11,17 +10,10 @@ int main()
|
||||
"-Wl,--wrap -Wl,pthread_sigmask -Wl,--wrap -Wl,sleep\n");
|
||||
# endif
|
||||
# if defined(GC_LINUX_THREADS) || defined(GC_IRIX_THREADS) \
|
||||
|| defined(GC_SOLARIS_PTHREADS) \
|
||||
|| defined(GC_FREEBSD_THREADS) || defined(GC_SOLARIS_PTHREADS) \
|
||||
|| defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
|
||||
printf("-lpthread\n");
|
||||
# endif
|
||||
# if defined(GC_FREEBSD_THREADS)
|
||||
# if (__FREEBSD_version >= 500000)
|
||||
printf("-lpthread\n");
|
||||
# else
|
||||
printf("-pthread\n");
|
||||
# endif
|
||||
# endif
|
||||
# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
|
||||
printf("-lpthread -lrt\n");
|
||||
# endif
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
/* Eventually this one may become unnecessary. For now we need */
|
||||
/* it to keep the old-style build process working. */
|
||||
#define GC_TMP_VERSION_MAJOR 6
|
||||
#define GC_TMP_VERSION_MINOR 6
|
||||
#define GC_TMP_ALPHA_VERSION GC_NOT_ALPHA
|
||||
#define GC_TMP_VERSION_MINOR 3
|
||||
#define GC_TMP_ALPHA_VERSION 6
|
||||
|
||||
#ifndef GC_NOT_ALPHA
|
||||
# define GC_NOT_ALPHA 0xff
|
||||
|
||||
+2
-13
@@ -1,7 +1,6 @@
|
||||
#include "private/gc_priv.h"
|
||||
|
||||
#if defined(GC_WIN32_THREADS)
|
||||
|
||||
#include "private/gc_priv.h"
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef CYGWIN32
|
||||
@@ -11,7 +10,6 @@
|
||||
# undef pthread_create
|
||||
# undef pthread_sigmask
|
||||
# undef pthread_join
|
||||
# undef pthread_detach
|
||||
# undef dlopen
|
||||
|
||||
# define DEBUG_CYGWIN_THREADS 0
|
||||
@@ -197,7 +195,7 @@ static void GC_delete_thread(DWORD thread_id) {
|
||||
/* Must still be in_use, since nobody else can store our thread_id. */
|
||||
i++) {}
|
||||
if (i > my_max) {
|
||||
WARN("Removing nonexistent thread %ld\n", (GC_word)thread_id);
|
||||
WARN("Removing nonexisiting thread %ld\n", (GC_word)thread_id);
|
||||
} else {
|
||||
GC_delete_gc_thread(thread_table+i);
|
||||
}
|
||||
@@ -244,9 +242,6 @@ void GC_push_thread_structures GC_PROTO((void))
|
||||
# endif
|
||||
}
|
||||
|
||||
/* Defined in misc.c */
|
||||
extern CRITICAL_SECTION GC_write_cs;
|
||||
|
||||
void GC_stop_world()
|
||||
{
|
||||
DWORD thread_id = GetCurrentThreadId();
|
||||
@@ -255,9 +250,6 @@ void GC_stop_world()
|
||||
if (!GC_thr_initialized) ABORT("GC_stop_world() called before GC_thr_init()");
|
||||
|
||||
GC_please_stop = TRUE;
|
||||
# ifndef CYGWIN32
|
||||
EnterCriticalSection(&GC_write_cs);
|
||||
# endif /* !CYGWIN32 */
|
||||
for (i = 0; i <= GC_get_max_thread_index(); i++)
|
||||
if (thread_table[i].stack_base != 0
|
||||
&& thread_table[i].id != thread_id) {
|
||||
@@ -288,9 +280,6 @@ void GC_stop_world()
|
||||
# endif
|
||||
thread_table[i].suspended = TRUE;
|
||||
}
|
||||
# ifndef CYGWIN32
|
||||
LeaveCriticalSection(&GC_write_cs);
|
||||
# endif /* !CYGWIN32 */
|
||||
}
|
||||
|
||||
void GC_start_world()
|
||||
|
||||
+29
-66
@@ -490,35 +490,6 @@
|
||||
RelativePath="mono\utils\strtod.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\utils\mono-counters.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\utils\mono-counters.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="metadata"
|
||||
@@ -1654,6 +1625,35 @@
|
||||
RelativePath="mono\os\gc_wrapper.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\os\win32\util.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\os\util.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mini"
|
||||
@@ -1687,10 +1687,6 @@
|
||||
RelativePath="mono\mini\abcremoval.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\mono\mini\aliasing.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\mini\aot.c"
|
||||
>
|
||||
@@ -1716,10 +1712,6 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\mono\mini\branch-opts.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\mini\cfold.c"
|
||||
>
|
||||
@@ -2056,10 +2048,6 @@
|
||||
RelativePath="mono\mini\mini-x86.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\mini\jit-icalls.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\mini\mini.c"
|
||||
>
|
||||
@@ -2089,31 +2077,6 @@
|
||||
RelativePath="mono\mini\mini.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\mini\jit-icalls.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="mono\mini\regalloc.c"
|
||||
>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
2006-03-15 Miguel de Icaza <[email protected]>
|
||||
|
||||
* mono.1: Document MONO_XEXCEPTIONS and MONO_XSYNC, create new
|
||||
section, sort the previous enviornment section.
|
||||
|
||||
2006-03-06 Lluis Sanchez Gual <[email protected]>
|
||||
|
||||
* mono.1: Updated MONO_XMLSERIALIZER_THS option information.
|
||||
|
||||
2006-02-22 Jelmer Vernooij <[email protected]>
|
||||
* mbas.1, Makefile.am: Add manpage for mbas (based on mcs.1)
|
||||
|
||||
2006-01-26 Jonathan Pryor <[email protected]>
|
||||
|
||||
* ChangeLog: Started
|
||||
* mono-shlib-cop.1: Document another BUG/design issue that it doesn't check
|
||||
for; formatting/style changes.
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@ man_MANS = mcs.1 mono.1 monostyle.1 mono-config.5 sqlsharp.1 oldmono.1 ilasm.1 \
|
||||
cert2spc.1 cilc.1 genxs.1 wsdl.1 disco.1 soapsuds.1 makecert.1 \
|
||||
chktrust.1 setreg.1 sn.1 secutil.1 signcode.1 certmgr.1 monop.1 xsd.1 gacutil.1 \
|
||||
macpack.1 mkbundle.1 dtd2xsd.1 permview.1 prj2make.1 mono-service.1 mono-shlib-cop.1 \
|
||||
al.1 mozroots.1 mono-xmltool.1 mbas.1
|
||||
al.1 mozroots.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
+12
-30
@@ -13,60 +13,42 @@
|
||||
macpack \- Macintosh OS X Packager for managed gui assemblies
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
.B macpack [options] assembly
|
||||
.B macpack [options]
|
||||
.SH DESCRIPTION
|
||||
\fImacpack\fP is a tool used to package managed assemblies (like
|
||||
System.Windows.Forms or Cocoa#) that require gui availability for deployment
|
||||
on Mac OS X.
|
||||
.PP
|
||||
macpack will prepare a OS X compatible bundle from the provided assembly
|
||||
and resources. The bundle will include the specified assembly as well
|
||||
as any of the provided resources (specified with the -resource: switch).
|
||||
.PP
|
||||
Developers can specify the kind of application to produce using the
|
||||
-mode: argument. This controls how the environment in the Mono class
|
||||
libraries is setup.
|
||||
and resources.
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
.I "-a assembly"
|
||||
.I "-a" <assembly location>
|
||||
.Sp
|
||||
This option tells macpack where the managed assembly that you
|
||||
want to bundle resides. This option is also used to point to the shell
|
||||
script to launch in the case of a X11/Gtk# application.
|
||||
.Sp
|
||||
This is the same as just passing the assembly as an argument.
|
||||
.I "-m" <mode>
|
||||
.Sp
|
||||
.I "-m [winforms,x11,console,cocoa]"
|
||||
or
|
||||
.I "-mode:[winforms,x11,console,cocoa]"
|
||||
An integer parameter of the mode (Cocoa# or System.Windows.Forms or X11).
|
||||
System.Windows.Forms = 1
|
||||
Cocoa# = 2
|
||||
Gtk#/X11 = 3
|
||||
.Sp
|
||||
A value indicating the kind of application: WinForms is a Winforms
|
||||
application running on Quartz; X11 is an application that requires
|
||||
the X11 server to run; console is a non-graphical application; cocoa
|
||||
is an application based on Cocoa#
|
||||
.Sp
|
||||
.I "-n NAME"
|
||||
or
|
||||
.I "-name:NAME"
|
||||
.I "-n" <application name>
|
||||
.Sp
|
||||
This option specifies the application name of the emitted bundle.
|
||||
This is what you will see in Finder.
|
||||
.Sp
|
||||
.I "-o DIRECTORY"
|
||||
or
|
||||
.I "-output:DIRECTORY"
|
||||
.I "-o" <output path>
|
||||
.Sp
|
||||
This option specifies the path to output the generated Application.
|
||||
.Sp
|
||||
.I "-r RESOURCE"
|
||||
or
|
||||
.I "-resource:RESOURCE"
|
||||
.I "-r" <resource>
|
||||
.Sp
|
||||
This option can be specified multiple times. It will place a copy of each resource
|
||||
into the bundles resources directory. Alternatively, you can use a
|
||||
comma separated list of resources.
|
||||
into the bundles resources directory.
|
||||
.fi
|
||||
.SH AUTHOR
|
||||
Geoff Norton
|
||||
.SH WEB SITE
|
||||
Visit: http://www.mono-project.com for details
|
||||
-240
@@ -1,240 +0,0 @@
|
||||
.TH mbas 1 "21 February 2006"
|
||||
.SH NAME
|
||||
mbas \- Mono Basic Compiler.
|
||||
.SH SYNOPSIS
|
||||
.B mbas
|
||||
[option] [source-files]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.I MonoBASIC (mbas)
|
||||
is a CIL compiler for the VisualBasic.NET language, an
|
||||
extended version of Visual Basic.
|
||||
.PP
|
||||
Applications developed on Windows with vbc can execute on Mono and applications
|
||||
compiled with 'mbas' can be executed on .NET runtime.
|
||||
.PP
|
||||
The Mono Basic compiler accepts the same options as
|
||||
the Microsoft VB.NET compiler. Those options can start with a slash or a
|
||||
dash (/checked is the same as -checked). Additionally to this, the
|
||||
GNU-like options are supported, those begin with "--". All
|
||||
-specific flags which are not available in the Microsoft VB.NET
|
||||
compiler are available only with the GNU-style options.
|
||||
.PP
|
||||
Visual Basic.NET source files must end with a ".vb" extension. Compilation of
|
||||
VB.NET source code requires all the files that make up a library, module or
|
||||
executable to be provided on the command line. There is no support
|
||||
for partial compilation. To achieve the benefits of partial
|
||||
compilation, you should compile programs into their own assemblies,
|
||||
and later reference them with the "-r" flag.
|
||||
.PP
|
||||
The Mono Basic compiler generates images (.exe files) that contain
|
||||
CIL byte code that can be executed by any system that implements a Common
|
||||
Language Infrastructure virtual machine such as the Microsoft .NET
|
||||
runtime engine on Windows or the Mono runtime engine on Unix systems.
|
||||
Executables are not bound to a specific CPU or operating system.
|
||||
.PP
|
||||
The Mono Basic compiler by default only references three assemblies:
|
||||
mscorlib.dll, System.dll and System.Xml.dll. If you want to
|
||||
reference extra libraries you must manually specify them using the
|
||||
-pkg: command line option or the -r: command line option.
|
||||
Alternatively if you want to get all of the System libraries, you can
|
||||
use the -pkg:dotnet command line option.
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I \-\-about
|
||||
Displays information about the Mono Basic compiler
|
||||
.TP
|
||||
.I \-\-addmodule:MODULE1[,MODULE2]
|
||||
Includes the specified modules in the resulting assembly.
|
||||
.TP
|
||||
.I -codepage:ID
|
||||
Specifies the code page used to process the input files from the
|
||||
point it is specified on. By default files will be processed in the
|
||||
Latin-1 code page. The compiler will also automatically detect
|
||||
Unicode files that have an embedded byte mark at the beginning.
|
||||
.TP
|
||||
Other popular encodings are 28591 (Latin1), 1252 (iso-8859-1) and 65001 (UTF-8).
|
||||
.TP
|
||||
Mono Basic supports a couple of shorthands: "utf8" can be used to specify utf-8 instead
|
||||
of using the cryptic 65001 and "reset" restores the automatic handling of
|
||||
code pages. These shorthands are not available on the Microsoft compiler.
|
||||
.TP
|
||||
.I \-define:SYMLIST, -d:SYMLIST
|
||||
Defines the symbol listed by the semi-colon separeted list SYMLIST
|
||||
SYMBOL. This can be tested in the source code by the pre-processor,
|
||||
or can be used by methods that have been tagged with the Conditional
|
||||
attribute.
|
||||
.TP
|
||||
.I \-debug-args:arguments
|
||||
Debugger arguments.
|
||||
.TP
|
||||
.I \-debug:AMOUNT
|
||||
Specify the amount of debugging information to emit. Possible values for
|
||||
AMOUNT are "full" and "pdbonly".
|
||||
.TP
|
||||
.I \-~, \-debugoptions
|
||||
Show debugging info while processing options.
|
||||
.TP
|
||||
.I \-\-fatal
|
||||
This is used for debugging the compiler. This makes the error emission
|
||||
generate an exception that can be caught by a debugger.
|
||||
.TP
|
||||
.I \-imports:import-list
|
||||
Declare global Imports for listed namespaces.
|
||||
.TP
|
||||
.I \-ignorewarn:XXXX
|
||||
Ignores warning number XXXX.
|
||||
.TP
|
||||
.I -lib:PATHLIST, -libpath:PATHLIST
|
||||
Each path specified in the comma-separated list will direct the
|
||||
compiler to look for libraries in that specified path.
|
||||
.TP
|
||||
.I \-L PATH
|
||||
Directs the compiler to look for libraries in the specified path.
|
||||
Multiple paths can be provided by using the option multiple times.
|
||||
.TP
|
||||
.I \-main:CLASS
|
||||
Tells the compiler which CLASS or MODULE contains the entry point. Useful when
|
||||
you are compiling several classes with a Main method.
|
||||
.TP
|
||||
.I \-nologo
|
||||
Suppress printing copyright information on startup.
|
||||
.TP
|
||||
.I \-nostdlib, -nostdlib+
|
||||
Use this flag if you want to compile the core library. This makes the
|
||||
compiler load its internal types from the assembly being compiled.
|
||||
.TP
|
||||
.I \-noconfig, \-noconfig+
|
||||
Disables the default compiler configuration to be loaded. The
|
||||
compiler by default has references to the system assemblies.
|
||||
.TP
|
||||
.I \-nowarn
|
||||
Makes the compiler ignore warnings.
|
||||
.TP
|
||||
.I \-optioncompare:binary, \-optioncompare:text
|
||||
Select between binary and text string comparisons. The default is binary
|
||||
string comparisons.
|
||||
.TP
|
||||
.I \-optionexplicit[+|-]
|
||||
Require explicit declaration of variables
|
||||
.TP
|
||||
.I \-optionstrict[+|-]
|
||||
Enforce strict language semantics
|
||||
.TP
|
||||
.I \-out:FNAME, -o FNAME
|
||||
Names the output file to be generated.
|
||||
.TP
|
||||
.I \-\-parse
|
||||
Used for benchmarking. The compiler will only parse its input files.
|
||||
Currently ignored.
|
||||
.TP
|
||||
.I \-pkg:package1[,packageN]
|
||||
The compiler will invoke pkg-config --libs on the set of packages
|
||||
specified on the command line to obtain libraries and directories to
|
||||
compile the code.
|
||||
.PP
|
||||
This is typically used with third party components, like this:
|
||||
.nf
|
||||
$ mbas -pkg:gtk-sharp demo.vb
|
||||
.fi
|
||||
.TP
|
||||
.TP
|
||||
.I \-pkg:dotnet
|
||||
This will instruct the compiler to reference the System.* libraries
|
||||
available on a typical dotnet framework installation, notice that this
|
||||
does not include all of the Mono libraies, only the System.* ones. This
|
||||
is a convenient shortcut for those porting code.
|
||||
.TP
|
||||
.I -q -quiet
|
||||
Commands the compiler to show only error messages for syntax-related errors
|
||||
and warnings.
|
||||
.TP
|
||||
.I -resource:RESOURCE[,ID]
|
||||
Embeds to the given resource file. The optional ID can be used to
|
||||
give a different name to the resource. If not specified, the resource
|
||||
name will be the file name.
|
||||
.TP
|
||||
.I -linkresource:RESOURCE[,ID]
|
||||
Links to the specified RESOURCE. The optional ID can be used to give
|
||||
a name to the linked resource.
|
||||
.TP
|
||||
.I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
|
||||
Reference the named assemblies. Use this to use classes from the named
|
||||
assembly in your program. The assembly will be loaded from either the
|
||||
system directory where all the assemblies live, or from the path
|
||||
explicitly given with the -L option.
|
||||
.PP
|
||||
You can also use a semicolon to separate the assemblies instead of a
|
||||
comma.
|
||||
.TP
|
||||
.I \-removeintchecks[+|-]
|
||||
Remove integer checks. Default off.
|
||||
.TP
|
||||
.I \-rootnamespace:namespace
|
||||
Specifies the root namespace for all type declarations
|
||||
.TP
|
||||
.I \-\-stacktrace
|
||||
Generates a stack trace at the time the error is reported, useful for
|
||||
debugging the compiler.
|
||||
.TP
|
||||
.I \-target:KIND, \-t:KIND
|
||||
Used to specify the desired target. The possible values are: exe
|
||||
(plain executable), winexe (Windows.Forms executable), library
|
||||
(component libraries) and module (partial library).
|
||||
.TP
|
||||
.I \-\-timestamp
|
||||
Another debugging flag. Used to display the times at various points
|
||||
in the compilation process.
|
||||
.TP
|
||||
.I \-tokenize
|
||||
Only tokenizes source files. Currently ignored.
|
||||
.TP
|
||||
.I \-unsafe, -unsafe+
|
||||
Enables compilation of unsafe code.
|
||||
.TP
|
||||
.I \-utf8output[+|-]
|
||||
Emit compiler output in UTF8 character encoding. Currently ignored.
|
||||
.TP
|
||||
.I \-v
|
||||
Debugging. Turns on verbose yacc parsing.
|
||||
.TP
|
||||
.I -. -verbosegetoptions
|
||||
Show verbose parsing of options
|
||||
.TP
|
||||
.I \-\-version
|
||||
Shows the compiler version.
|
||||
.TP
|
||||
.I \-warnaserror, \-warnaserror+
|
||||
Treat warnings as errors.
|
||||
.TP
|
||||
.I \-wlevel:LEVEL
|
||||
Sets the warning level. 0 is the lowest warning level, and 4 is the
|
||||
highest. The default is 2.
|
||||
.TP
|
||||
.I \-\-
|
||||
Use this to stop option parsing, and allow option-looking parameters
|
||||
to be passed on the command line.
|
||||
.SH STABILITY
|
||||
As of early 2006, the Mono Basic compiler is still considered alpha software.
|
||||
Several language constructions that are accepted by the Microsoft Visual
|
||||
Basic.NET compiler are refused by the Mono Basic compiler. Occassional
|
||||
crashes also still occur.
|
||||
.PP
|
||||
.SH AUTHORS
|
||||
See the ChangeLog for authors
|
||||
.PP
|
||||
.SH LICENSE
|
||||
The Mono Basic compiler is released under the terms of the GNU GPL.
|
||||
Please read the accompanying `COPYING' file for details. Alternative
|
||||
licenses are available from Ximian.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
mcs(1), mono(1), mint(1), sn(1)
|
||||
.PP
|
||||
.SH BUGS
|
||||
To report bugs in the compiler, you can use `bug-buddy', or you can
|
||||
file bug reports in our bug tracking system:
|
||||
http://bugzilla.ximian.com.
|
||||
.SH MAILING LIST
|
||||
The Mono Basic Mailing List is available at: [email protected]
|
||||
@@ -144,11 +144,6 @@ is to omit the switch.
|
||||
ISO-1 - Restrict compiler to use only ISO standardized features.
|
||||
The usage of features such as generics, static classes, anonymous
|
||||
methods will lead to error.
|
||||
.Sp
|
||||
Notice that this flag only controls the language features available to
|
||||
the programmer, it does not control the kind of assemblies produced.
|
||||
Programs compiled with mcs will reference the 1.1 APIs, Programs
|
||||
compiled with gmcs reference the 2.0 APIs.
|
||||
.TP
|
||||
.I -lib:PATHLIST
|
||||
Each path specified in the comma-separated list will direct the
|
||||
|
||||
@@ -87,22 +87,9 @@ When passed, DIR will be set for the MONO_CFG_DIR environment variable
|
||||
Compresses the assemblies before embedding. This results in smaller
|
||||
executable files, but increases startup time and requires zlib to be
|
||||
installed on the target system.
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
.I "AS"
|
||||
Assembler command. The default is "as".
|
||||
.TP
|
||||
.I "CC"
|
||||
C compiler command. The default is "cc" under Linux and "gcc -mno-cygwin"
|
||||
under Windows.
|
||||
.SH FILES
|
||||
This program will load referenced assemblies from the Mono assembly
|
||||
cache.
|
||||
.SH BUGS
|
||||
The options "--static" and "-z" are not supported under Windows.
|
||||
Moreover, a full cygwin environment containing at least "gcc" and "as"
|
||||
is required for the build process. The generated executable does not
|
||||
depend on cygwin.
|
||||
.SH MAILING LISTS
|
||||
Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
|
||||
.SH WEB SITE
|
||||
|
||||
+26
-121
@@ -1,13 +1,3 @@
|
||||
.\"
|
||||
.\" mono-shlib-cop manual page.
|
||||
.\" (C) 2005-2006 Jonathan Pryor
|
||||
.\" Author:
|
||||
.\" Jonathan Pryor ([email protected])
|
||||
.\"
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.TH "mono-shlib-cop" 1
|
||||
.SH NAME
|
||||
mono-shlib-cop \- Shared Library Usage Checker
|
||||
@@ -24,7 +14,7 @@ correct.
|
||||
.SH DESCRIPTION
|
||||
.I mono-shlib-cop
|
||||
is a tool that inspects a managed assembly looking for
|
||||
erroneous or suspecious usage of shared libraries.
|
||||
erroneous or suspecious behavior of shared libraries.
|
||||
.PP
|
||||
The tool takes one or more assembly filenames, and inspects each assembly
|
||||
specified.
|
||||
@@ -43,39 +33,25 @@ The warnings checked for include:
|
||||
Is the target shared library a versioned library? (Relevant only on Unix
|
||||
systems, not Mac OS X or Windows.)
|
||||
.PP
|
||||
In general, only versioned libraries such as
|
||||
.I libc.so.6
|
||||
are present on the
|
||||
user's machine, and efforts to load
|
||||
.I libc.so
|
||||
will result in a
|
||||
.B System.DllNotFoundException.
|
||||
There are three solutions to this:
|
||||
In general, only versioned libraries such as libc.so.6 are present on the
|
||||
user's machine, and efforts to load libc.so will result in a
|
||||
System.DllNotFoundException. There are three solutions to this:
|
||||
.TP
|
||||
1.
|
||||
Require that the user install any
|
||||
.I -devel
|
||||
packages which provide the
|
||||
Require that the user install any -devel packages which provide the
|
||||
unversioned library. This usually requires that the user install a large
|
||||
number of additional packages, complicating the installation process.
|
||||
.TP
|
||||
2.
|
||||
Use a fully versioned name in your
|
||||
.B DllImport
|
||||
statements. This requires
|
||||
Use a fully versioned name in your DllImport statements. This requires
|
||||
editing your source code and recompiling whenever you need to target a
|
||||
different version of the shared library.
|
||||
.TP
|
||||
3.
|
||||
Provide an
|
||||
.I assembly.config
|
||||
file which contains <dllmap/> elements to remap
|
||||
Provide an assembly.config file which contains <dllmap/> elements to remap
|
||||
the shared library name used by your assembly to the actual versioned shared
|
||||
library present on the users system. Mono provides a number of pre-existing
|
||||
<dllmap/> entries, including ones for
|
||||
.I libc.so
|
||||
and
|
||||
.I libX11.so.
|
||||
<dllmap/> entries, including libc.so and libX11.so.
|
||||
.SH EXAMPLE
|
||||
The following code contains examples of the above errors and warnings:
|
||||
.nf
|
||||
@@ -94,52 +70,26 @@ The following code contains examples of the above errors and warnings:
|
||||
.TP
|
||||
Bad library name
|
||||
Assuming that the library
|
||||
.I bad-library-name
|
||||
doesn't exist on your machine,
|
||||
.I Demo.BadLibraryName
|
||||
will generate an error, as
|
||||
it requires a shared library which cannot be loaded.
|
||||
This may be ignorable; see
|
||||
.B BUGS
|
||||
.
|
||||
.B bad-library-name
|
||||
doesn't exist on your machine, Demo.BadLibraryName will generate an error, as
|
||||
it requires a shared library which doesn't exist.
|
||||
.TP
|
||||
Bad symbol name
|
||||
.I Demo.BadSymbolName
|
||||
will generate an error, as
|
||||
.I libc.so
|
||||
(remapped to
|
||||
.I libc.so.6
|
||||
by mono's
|
||||
.I $prefix/etc/mono/config
|
||||
file) doesn't contain the function
|
||||
.I BadSymbolName
|
||||
.
|
||||
Demo.BadSymbolName will generate an error, as libc.so (remapped to libc.so.6
|
||||
by mono's $prefix/etc/mono/config file) doesn't contain the function
|
||||
BadSymbolName.
|
||||
.TP
|
||||
Unversioned library dependency
|
||||
Assuming you have the file
|
||||
.I libcap.so
|
||||
,
|
||||
.I Demo.cap_clear
|
||||
will generate a
|
||||
warning because, while
|
||||
.I libcap.so
|
||||
could be loaded,
|
||||
.I libcap.so
|
||||
might not exist on
|
||||
the users machine (on FC2,
|
||||
.I /lib/libcap.so
|
||||
is provided by
|
||||
Assuming you have the file libcap.so, Demo.cap_clear will generate a
|
||||
warning because, while libcap.so could be loaded, libcap.so might not exist on
|
||||
the users machine (on FC2, /lib/libcap.so is provided by
|
||||
.I libcap-devel
|
||||
, and you can't assume that end users will have any
|
||||
.I "-devel"
|
||||
packages installed).
|
||||
, and you can't assume that end users will have any -devel packages installed).
|
||||
.SH FIXING CODE
|
||||
The fix depends on the warning or error:
|
||||
.TP
|
||||
Bad library names
|
||||
Use a valid library name in the
|
||||
.B DllImport
|
||||
attribute, or provide a <dllmap/>
|
||||
Use a valid library name in the DllImport attribute, or provide a <dllmap/>
|
||||
entry to map your existing library name to a valid library name.
|
||||
.TP
|
||||
Bad symbol names
|
||||
@@ -164,16 +114,13 @@ mapping information. For example, with
|
||||
.I Mono.Posix.dll.config
|
||||
\.
|
||||
.PP
|
||||
The
|
||||
.I .config
|
||||
file is an XML document containing a top-level <configuration/>
|
||||
The .config file is an XML document containing a top-level <configuration/>
|
||||
section with nested <dllmap/> entries, which contains
|
||||
.B dll
|
||||
and
|
||||
.B target
|
||||
attributes. The dll attribute should contain the same string used in your
|
||||
.B DllImport
|
||||
attribute value, and the target attribute specifies which shared
|
||||
DllImport attribute value, and the target attribute specifies which shared
|
||||
library mono should
|
||||
.I actually
|
||||
load at runtime.
|
||||
@@ -185,59 +132,17 @@ A sample .config file is:
|
||||
</configuration>
|
||||
.fi
|
||||
.SH BUGS
|
||||
.TP
|
||||
*
|
||||
Only
|
||||
.B DllImport
|
||||
entries are checked; the surrounding IL is ignored. Consequently, if a runtime
|
||||
check is performed to choose which shared library to invoke, an error will be
|
||||
reported even though the specified library is never used. Consider this code:
|
||||
.nf
|
||||
using System.Runtime.InteropServices; // for DllImport
|
||||
class Beep {
|
||||
[DllImport ("kernel32.dll")]
|
||||
private static extern int Beep (int dwFreq, int dwDuration);
|
||||
|
||||
[DllImport ("libcurses.so")]
|
||||
private static extern int beep ();
|
||||
|
||||
public static void Beep ()
|
||||
{
|
||||
if (System.IO.Path.DirectorySeparatorChar == '\\\\') {
|
||||
Beep (750, 300);
|
||||
}
|
||||
else {
|
||||
beep ();
|
||||
}
|
||||
}
|
||||
}
|
||||
.fi
|
||||
If
|
||||
.I mono-shlib-cop
|
||||
is run on this assembly, an error will be reported for using
|
||||
.I kernel32.dll
|
||||
, even though
|
||||
.I kernel32.dll
|
||||
will never be used on Unix platforms.
|
||||
.TP
|
||||
*
|
||||
.I mono-shlib-cop
|
||||
currently only examines the shared library file extension to determine if a
|
||||
warning should be generated. A
|
||||
.I .so
|
||||
extension will always generate a warning, even if the
|
||||
.I .so
|
||||
is not a symlink,
|
||||
isn't provided in a
|
||||
.I -devel
|
||||
package, and there is no versioned shared library
|
||||
(possible examples including
|
||||
.I /usr/lib/libtcl8.4.so,
|
||||
.I /usr/lib/libubsec.so,
|
||||
extension will always generate a warning, even if the .so is not a symlink,
|
||||
isn't provided in a -devel package, and there is no versioned shared library
|
||||
(possible examples including /usr/lib/libtcl8.4.so, /usr/lib/libubsec.so,
|
||||
etc.).
|
||||
.Sp
|
||||
.PP
|
||||
Consequently, warnings for any such libraries are useless, and incorrect.
|
||||
.Sp
|
||||
.PP
|
||||
Windows and Mac OS X will never generate warnings, as these
|
||||
platforms use different shared library extensions.
|
||||
.SH MAILING LISTS
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
.\"
|
||||
.\" mono manual page.
|
||||
.\" (C) 2003 Ximian, Inc.
|
||||
.\" (C) 2004-2005 Novell, Inc.
|
||||
.\" Author:
|
||||
.\" Miguel de Icaza ([email protected])
|
||||
.\"
|
||||
.de Sp \" Vertical space (when we can't use .PP)
|
||||
.if t .sp .5v
|
||||
.if n .sp
|
||||
..
|
||||
.TH mono-xmltool "Mono 1.0"
|
||||
.SH NAME
|
||||
mono-xmltool \- Mono XML validation and transformation tool.
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
.B mono-xmltool --validate [*.rng | *.rnc | *.nvdl | *.xsd] [instances]
|
||||
.PP
|
||||
.B mono-xmltool --validate-rng relax-ng-grammar-xml [instances]
|
||||
.PP
|
||||
.B mono-xmltool --validate-rnc relax-ng-compact-grammar-file [instances]
|
||||
.PP
|
||||
.B mono-xmltool --validate-nvdl nvdl-script-xml [instances]
|
||||
.PP
|
||||
.B mono-xmltool --validate-xsd xml-schema [instances]
|
||||
.PP
|
||||
.B mono-xmltool --transform stylesheet instance-xml
|
||||
.PP
|
||||
.B mono-xmltool --prettyprint [source [result]]
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
\fImono-xmltool\fP is a command line front end for various functions
|
||||
available in the Mono XML class libraries, currently it offers
|
||||
validation with various different kinds of schemas, xslt
|
||||
transformations and pretty printing.
|
||||
.PP
|
||||
.SH XML VALIDATION
|
||||
mono-xmltool can validate a given set of XML files (the instances
|
||||
parameter) using the given schema file. Currently supported schema
|
||||
files include Relax NG (*.rng), Compact Relax NG (*.rnc),
|
||||
Namespace-based Validation Dispatching Language (*.nvdl) and XML
|
||||
Schema (*.xsd).
|
||||
.PP
|
||||
If invoked with the --validate argument, Mono will use the filename
|
||||
extension to guess the kind of validation required. The
|
||||
--validate-xxx flags would force a specific kind of validation.
|
||||
.PP
|
||||
The following lists the flags and the actual class that implements
|
||||
this in Mono:
|
||||
.TP
|
||||
.I --validate-rng
|
||||
.Sp
|
||||
Commons.Xml.Relaxng.RelaxNgPattern as the schema, and
|
||||
Commons.Xml.Relaxng.RelaxngValidatingReader validator.
|
||||
.TP
|
||||
.I --validate-rnc
|
||||
Commons.Xml.Relaxng.RncParser as the schema, and
|
||||
Commons.Xml.Relaxng.RelaxngValidatingReader validator.
|
||||
.TP
|
||||
.I --validate-nvdl
|
||||
.Sp
|
||||
Commons.Xml.Nvdl as the schema and Commons.Xml.NvdlValidatingReader
|
||||
validator.
|
||||
.TP
|
||||
.I --validate-xsd
|
||||
System.Xml.Schema.XmlSchema as the schema and uses
|
||||
System.Xml.XmlValidatingReader as the validator.
|
||||
.SH TRANSFORMATIONS
|
||||
This does an XSLT transformation, the stylesheet must be an XSLT file,
|
||||
the instance-xml is the document to be processed. Output it sent to
|
||||
the standard output.
|
||||
.SH PRETTY PRINTING
|
||||
Produces a prett-print rendering of the
|
||||
.I source
|
||||
file. If it is not
|
||||
specified it reads the standard input. If
|
||||
.I result
|
||||
is not specified, the output is sent to the standard output.
|
||||
.SH MAILING LISTS
|
||||
Mailing lists are listed at the
|
||||
http://www.mono-project.com/Mailing_Lists
|
||||
.SH WEB SITE
|
||||
http://www.mono-project.com
|
||||
.SH SEE ALSO
|
||||
.BR mono(1), mcs(1).
|
||||
+42
-75
@@ -249,13 +249,6 @@ compiled. This is used for testing the code generator performance.
|
||||
Displays information about the work done by the runtime during the
|
||||
execution of an application.
|
||||
.TP
|
||||
.I "--wapi=hps|semdel"
|
||||
Perform maintenance of the process shared data.
|
||||
.Sp
|
||||
semdel will delete the global semaphore.
|
||||
.Sp
|
||||
hps will list the currently used handles.
|
||||
.TP
|
||||
.I "-v", "--verbose"
|
||||
Increases the verbosity level, each time it is listed, increases the
|
||||
verbosity level to include more information (including, for example,
|
||||
@@ -284,13 +277,8 @@ is a profiler-specific string of options for the profiler itself.
|
||||
.Sp
|
||||
The default profiler accepts the following options 'alloc' to profile
|
||||
memory consumption by the application; 'time' to profile the time
|
||||
spent on each routine; 'jit' to collect time spent JIT-compiling methods
|
||||
and 'stat' to perform sample statistical profiling.
|
||||
If no options are provided the default is 'alloc,time,jit'.
|
||||
.PP
|
||||
By default the
|
||||
profile data is printed to stdout: to change this, use the 'file=filename'
|
||||
option to output the data to filename.
|
||||
spent on each routine and 'stat' to perform sample statistical
|
||||
profiling. If no options are provided the default is 'alloc,time'.
|
||||
.Sp
|
||||
For example:
|
||||
.nf
|
||||
@@ -304,16 +292,11 @@ and allocation profiling.
|
||||
.Sp
|
||||
.nf
|
||||
|
||||
mono --profile=default:stat,alloc,file=prof.out program.exe
|
||||
mono --profile=default:stat,alloc program.exe
|
||||
|
||||
.fi
|
||||
Will do sample statistical profiling and allocation profiling on
|
||||
program.exe. The profile data is put in prof.out.
|
||||
.Sp
|
||||
Note that the statistical profiler has a very low overhead and should
|
||||
be the preferred profiler to use (for better output use the full path
|
||||
to the mono binary when running and make sure you have installed the
|
||||
addr2line utility that comes from the binutils package).
|
||||
program.exe.
|
||||
.SH PROFILERS
|
||||
There are a number of external profilers that have been developed for
|
||||
Mono, we will update this section to contain the profilers.
|
||||
@@ -487,11 +470,7 @@ to disable the use of a C# customized
|
||||
serializer, or an integer that is the minimum number of uses before
|
||||
the runtime will produce a custom serializer (0 will produce a
|
||||
custom serializer on the first access, 50 will produce a serializer on
|
||||
the 50th use). Mono will fallback to an interpreted serializer if the
|
||||
serializer generation somehow fails. This behavior can be disabled
|
||||
by setting the option
|
||||
.B `nofallback'
|
||||
(for example: MONO_XMLSERIALIZER_THS=0,nofallback).
|
||||
the 50th use).
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
.I "GC_DONT_GC"
|
||||
@@ -503,6 +482,11 @@ If set, this variable will instruct Mono to ahead-of-time compile new
|
||||
assemblies on demand and store the result into a cache in
|
||||
~/.mono/aot-cache.
|
||||
.TP
|
||||
.I "MONO_ASPNET_NODELETE"
|
||||
If set to any value, temporary source files generated by ASP.NET support
|
||||
classes will not be removed. They will be kept in the user's temporary
|
||||
directory.
|
||||
.TP
|
||||
.I "MONO_CFG_DIR"
|
||||
If set, this variable overrides the default system configuration directory
|
||||
($PREFIX/etc). It's used to locate machine.config file.
|
||||
@@ -544,13 +528,6 @@ If set, tells mono NOT to attempt using native asynchronous I/O services. In
|
||||
that case, a default select/poll implementation is used. Currently only epoll()
|
||||
is supported.
|
||||
.TP
|
||||
.I "MONO_DISABLE_MANAGED_COLLATION"
|
||||
If this environment variable is `yes', the runtime uses unmanaged
|
||||
collation (which actually means no culture-sensitive collation). It
|
||||
internally disables managed collation functionality invoked via the
|
||||
members of System.Globalization.CompareInfo class. Collation is
|
||||
enabled by default.
|
||||
.TP
|
||||
.I "MONO_EGD_SOCKET"
|
||||
For platforms that do not otherwise have a way of obtaining random bytes
|
||||
this can be set to the name of a file system socket on which an egd or
|
||||
@@ -582,6 +559,21 @@ unix). MONO_GAC_PREFIX should point to the top directory of a prefixed
|
||||
install. Or to the directory provided in the gacutil /gacdir command. Example:
|
||||
.B /home/username/.mono:/usr/local/mono/
|
||||
.TP
|
||||
.I "MONO_LOG_LEVEL"
|
||||
The logging level, possible values are `error', `critical', `warning',
|
||||
`message', `info' and `debug'. See the DEBUGGING section for more
|
||||
details.
|
||||
.TP
|
||||
.I "MONO_LOG_MASK"
|
||||
Controls the domain of the Mono runtime that logging will apply to.
|
||||
If set, the log mask is changed to the set value. Possible values are
|
||||
"asm" (assembly loader), "type", "dll" (native library loader), "gc"
|
||||
(garbage collector), "cfg" (config file loader), "aot" (precompiler) and "all".
|
||||
The default value is "all". Changing the mask value allows you to display only
|
||||
messages for a certain component. You can use multiple masks by comma
|
||||
separating them. For example to see config file messages and assembly loader
|
||||
messages set you mask to "asm,cfg".
|
||||
.TP
|
||||
.I "MONO_MANAGED_WATCHER"
|
||||
If set to any value, System.IO.FileSystemWatcher will use the default
|
||||
managed implementation (slow). If unset, mono will try to use FAM under
|
||||
@@ -631,10 +623,6 @@ Mono typically uses the hostname to create the files that are used to
|
||||
share state across multiple Mono processes. This is done to support
|
||||
home directories that might be shared over the network.
|
||||
.TP
|
||||
.I "MONO_STRICT_IO_EMULATION"
|
||||
If set, extra checks are made during IO operations. Currently, this
|
||||
includes only advisory locks around file writes.
|
||||
.TP
|
||||
.I "MONO_THEME"
|
||||
The name of the theme to be used by Windows.Forms. Available themes today
|
||||
include "clearlooks", "nice" and "win32".
|
||||
@@ -646,35 +634,6 @@ The maximum number of threads in the general threadpool will be
|
||||
20 + (MONO_THREADS_PER_CPU * number of CPUs). The default value for this
|
||||
variable is 5.
|
||||
.TP
|
||||
.I "MONO_XMLSERIALIZER_THS"
|
||||
Controls the threshold for the XmlSerializer to produce a custom
|
||||
serializer for a given class instead of using the Reflection-based
|
||||
interpreter. The possible values are `no' to disable the use of a
|
||||
custom serializer or a number to indicate when the XmlSerializer
|
||||
should start serializing. The default value is 50, which means that
|
||||
the a custom serializer will be produced on the 50th use.
|
||||
.SH ENVIRONMENT VARIABLES FOR DEBUGGING
|
||||
.TP
|
||||
.I "MONO_ASPNET_NODELETE"
|
||||
If set to any value, temporary source files generated by ASP.NET support
|
||||
classes will not be removed. They will be kept in the user's temporary
|
||||
directory.
|
||||
.TP
|
||||
.I "MONO_LOG_LEVEL"
|
||||
The logging level, possible values are `error', `critical', `warning',
|
||||
`message', `info' and `debug'. See the DEBUGGING section for more
|
||||
details.
|
||||
.TP
|
||||
.I "MONO_LOG_MASK"
|
||||
Controls the domain of the Mono runtime that logging will apply to.
|
||||
If set, the log mask is changed to the set value. Possible values are
|
||||
"asm" (assembly loader), "type", "dll" (native library loader), "gc"
|
||||
(garbage collector), "cfg" (config file loader), "aot" (precompiler) and "all".
|
||||
The default value is "all". Changing the mask value allows you to display only
|
||||
messages for a certain component. You can use multiple masks by comma
|
||||
separating them. For example to see config file messages and assembly loader
|
||||
messages set you mask to "asm,cfg".
|
||||
.TP
|
||||
.I "MONO_TRACE"
|
||||
Used for runtime tracing of method calls. The format of the comma separated
|
||||
trace options is:
|
||||
@@ -700,16 +659,24 @@ be used when writing messages like this: Console.Error:MyProgramName.
|
||||
See the System.Diagnostics.DefaultTraceListener documentation for more
|
||||
information.
|
||||
.TP
|
||||
.I "MONO_XEXCEPTIONS"
|
||||
This throws an exception when a X11 error is encountered; by default a
|
||||
message is displayed but execution continues
|
||||
.I "MONO_DISABLE_MANAGED_COLLATION"
|
||||
If this environment variable is `yes', the runtime uses unmanaged
|
||||
collation (which actually means no culture-sensitive collation). It
|
||||
internally disables managed collation functionality invoked via the
|
||||
members of System.Globalization.CompareInfo class. Collation is
|
||||
enabled by default.
|
||||
.TP
|
||||
.I "MONO_XSYNC"
|
||||
This is used in the System.Windows.Forms implementation when running
|
||||
with the X11 backend. This is used to debug problems in Windows.Forms
|
||||
as it forces all of the commands send to X11 server to be done
|
||||
synchronously. The default mode of operation is asynchronous which
|
||||
makes it hard to isolate the root of certain problems.
|
||||
.I "MONO_XMLSERIALIZER_THS"
|
||||
Controls the threshold for the XmlSerializer to produce a custom
|
||||
serializer for a given class instead of using the Reflection-based
|
||||
interpreter. The possible values are `no' to disable the use of a
|
||||
custom serializer or a number to indicate when the XmlSerializer
|
||||
should start serializing. The default value is 50, which means that
|
||||
the a custom serializer will be produced on the 50th use.
|
||||
.TP
|
||||
.I "MONO_STRICT_IO_EMULATION"
|
||||
If set, extra checks are made during IO operations. Currently, this
|
||||
includes only advisory locks around file writes.
|
||||
.SH FILES
|
||||
On Unix assemblies are loaded from the installation lib directory. If you set
|
||||
`prefix' to /usr, the assemblies will be located in /usr/lib. On
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2006-04-11 Raja R Harinath <[email protected]>
|
||||
|
||||
* Makefile (SUBDIRS): Remove tools/resgen.
|
||||
|
||||
2005-11-21 Raja R Harinath <[email protected]>
|
||||
|
||||
* Makefile (net_2_0_bootstrap_SUBDIRS): Add ilasm.
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
thisdir := .
|
||||
|
||||
SUBDIRS := build jay mcs class mbas nunit20 ilasm tools tests errors docs
|
||||
SUBDIRS := build jay mcs tools/resgen class mbas nunit20 ilasm tools tests errors docs
|
||||
DIST_ONLY_SUBDIRS := gmcs
|
||||
|
||||
basic_SUBDIRS := build jay mcs class
|
||||
@@ -31,7 +31,7 @@ default_centum_tests := \
|
||||
class/System.XML \
|
||||
class/System.Data
|
||||
|
||||
net_2_0_centum_tests := $(centum_tests) #class/Mono.C5
|
||||
net_2_0_centum_tests := $(centum_tests) class/Mono.C5
|
||||
|
||||
ifdef ONLY_CENTUM_TESTS
|
||||
TEST_SUBDIRS := $($(PROFILE)_centum_tests)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyVersion(Consts.MonoVersion)]
|
||||
[assembly: AssemblyTitle ("Mono VB.NET Compiler")]
|
||||
[assembly: AssemblyDescription ("Mono VB.NET Compiler with Generics")]
|
||||
[assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
|
||||
[assembly: AssemblyCompany ("Ximian, Inc.")]
|
||||
-20333
File diff suppressed because it is too large.
Load diff
@@ -1,406 +0,0 @@
|
||||
//
|
||||
// CryptoConvert.cs - Crypto Convertion Routines
|
||||
//
|
||||
// Author:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
|
||||
// (C) 2004 Novell (http://www.novell.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Mono.Security.Cryptography {
|
||||
|
||||
#if INSIDE_CORLIB
|
||||
internal
|
||||
#else
|
||||
public
|
||||
#endif
|
||||
sealed class CryptoConvert {
|
||||
|
||||
private CryptoConvert ()
|
||||
{
|
||||
}
|
||||
|
||||
static private int ToInt32LE (byte [] bytes, int offset)
|
||||
{
|
||||
return (bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset];
|
||||
}
|
||||
|
||||
static private uint ToUInt32LE (byte [] bytes, int offset)
|
||||
{
|
||||
return (uint)((bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset]);
|
||||
}
|
||||
|
||||
static private byte [] GetBytesLE (int val)
|
||||
{
|
||||
return new byte [] {
|
||||
(byte) (val & 0xff),
|
||||
(byte) ((val >> 8) & 0xff),
|
||||
(byte) ((val >> 16) & 0xff),
|
||||
(byte) ((val >> 24) & 0xff)
|
||||
};
|
||||
}
|
||||
|
||||
static private byte[] Trim (byte[] array)
|
||||
{
|
||||
for (int i=0; i < array.Length; i++) {
|
||||
if (array [i] != 0x00) {
|
||||
byte[] result = new byte [array.Length - i];
|
||||
Buffer.BlockCopy (array, i, result, 0, result.Length);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// convert the key from PRIVATEKEYBLOB to RSA
|
||||
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/private_key_blobs.asp
|
||||
// e.g. SNK files, PVK files
|
||||
static public RSA FromCapiPrivateKeyBlob (byte[] blob)
|
||||
{
|
||||
return FromCapiPrivateKeyBlob (blob, 0);
|
||||
}
|
||||
|
||||
static public RSA FromCapiPrivateKeyBlob (byte[] blob, int offset)
|
||||
{
|
||||
if (blob == null)
|
||||
throw new ArgumentNullException ("blob");
|
||||
if (offset >= blob.Length)
|
||||
throw new ArgumentException ("blob is too small.");
|
||||
|
||||
try {
|
||||
if ((blob [offset] != 0x07) || // PRIVATEKEYBLOB (0x07)
|
||||
(blob [offset+1] != 0x02) || // Version (0x02)
|
||||
(blob [offset+2] != 0x00) || // Reserved (word)
|
||||
(blob [offset+3] != 0x00) ||
|
||||
(ToUInt32LE (blob, offset+8) != 0x32415352)) // DWORD magic = RSA2
|
||||
throw new CryptographicException ("Invalid blob header");
|
||||
|
||||
// ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)
|
||||
// int algId = ToInt32LE (blob, offset+4);
|
||||
|
||||
// DWORD bitlen
|
||||
int bitLen = ToInt32LE (blob, offset+12);
|
||||
|
||||
// DWORD public exponent
|
||||
RSAParameters rsap = new RSAParameters ();
|
||||
byte[] exp = new byte [4];
|
||||
Buffer.BlockCopy (blob, offset+16, exp, 0, 4);
|
||||
Array.Reverse (exp);
|
||||
rsap.Exponent = Trim (exp);
|
||||
|
||||
int pos = offset+20;
|
||||
// BYTE modulus[rsapubkey.bitlen/8];
|
||||
int byteLen = (bitLen >> 3);
|
||||
rsap.Modulus = new byte [byteLen];
|
||||
Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);
|
||||
Array.Reverse (rsap.Modulus);
|
||||
pos += byteLen;
|
||||
|
||||
// BYTE prime1[rsapubkey.bitlen/16];
|
||||
int byteHalfLen = (byteLen >> 1);
|
||||
rsap.P = new byte [byteHalfLen];
|
||||
Buffer.BlockCopy (blob, pos, rsap.P, 0, byteHalfLen);
|
||||
Array.Reverse (rsap.P);
|
||||
pos += byteHalfLen;
|
||||
|
||||
// BYTE prime2[rsapubkey.bitlen/16];
|
||||
rsap.Q = new byte [byteHalfLen];
|
||||
Buffer.BlockCopy (blob, pos, rsap.Q, 0, byteHalfLen);
|
||||
Array.Reverse (rsap.Q);
|
||||
pos += byteHalfLen;
|
||||
|
||||
// BYTE exponent1[rsapubkey.bitlen/16];
|
||||
rsap.DP = new byte [byteHalfLen];
|
||||
Buffer.BlockCopy (blob, pos, rsap.DP, 0, byteHalfLen);
|
||||
Array.Reverse (rsap.DP);
|
||||
pos += byteHalfLen;
|
||||
|
||||
// BYTE exponent2[rsapubkey.bitlen/16];
|
||||
rsap.DQ = new byte [byteHalfLen];
|
||||
Buffer.BlockCopy (blob, pos, rsap.DQ, 0, byteHalfLen);
|
||||
Array.Reverse (rsap.DQ);
|
||||
pos += byteHalfLen;
|
||||
|
||||
// BYTE coefficient[rsapubkey.bitlen/16];
|
||||
rsap.InverseQ = new byte [byteHalfLen];
|
||||
Buffer.BlockCopy (blob, pos, rsap.InverseQ, 0, byteHalfLen);
|
||||
Array.Reverse (rsap.InverseQ);
|
||||
pos += byteHalfLen;
|
||||
|
||||
// ok, this is hackish but CryptoAPI support it so...
|
||||
// note: only works because CRT is used by default
|
||||
// http://bugzilla.ximian.com/show_bug.cgi?id=57941
|
||||
rsap.D = new byte [byteLen]; // must be allocated
|
||||
if (pos + byteLen + offset <= blob.Length) {
|
||||
// BYTE privateExponent[rsapubkey.bitlen/8];
|
||||
Buffer.BlockCopy (blob, pos, rsap.D, 0, byteLen);
|
||||
Array.Reverse (rsap.D);
|
||||
}
|
||||
|
||||
RSA rsa = (RSA)RSA.Create ();
|
||||
rsa.ImportParameters (rsap);
|
||||
return rsa;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new CryptographicException ("Invalid blob.", e);
|
||||
}
|
||||
}
|
||||
|
||||
static public byte[] ToCapiPrivateKeyBlob (RSA rsa)
|
||||
{
|
||||
RSAParameters p = rsa.ExportParameters (true);
|
||||
int keyLength = p.Modulus.Length; // in bytes
|
||||
byte[] blob = new byte [20 + (keyLength << 2) + (keyLength >> 1)];
|
||||
|
||||
blob [0] = 0x07; // Type - PRIVATEKEYBLOB (0x07)
|
||||
blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02)
|
||||
// [2], [3] // RESERVED - Always 0
|
||||
blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)
|
||||
blob [8] = 0x52; // Magic - RSA2 (ASCII in hex)
|
||||
blob [9] = 0x53;
|
||||
blob [10] = 0x41;
|
||||
blob [11] = 0x32;
|
||||
|
||||
byte[] bitlen = GetBytesLE (keyLength << 3);
|
||||
blob [12] = bitlen [0]; // bitlen
|
||||
blob [13] = bitlen [1];
|
||||
blob [14] = bitlen [2];
|
||||
blob [15] = bitlen [3];
|
||||
|
||||
// public exponent (DWORD)
|
||||
int pos = 16;
|
||||
int n = p.Exponent.Length;
|
||||
while (n > 0)
|
||||
blob [pos++] = p.Exponent [--n];
|
||||
// modulus
|
||||
pos = 20;
|
||||
byte[] part = p.Modulus;
|
||||
int len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
pos += len;
|
||||
// private key
|
||||
part = p.P;
|
||||
len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
pos += len;
|
||||
|
||||
part = p.Q;
|
||||
len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
pos += len;
|
||||
|
||||
part = p.DP;
|
||||
len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
pos += len;
|
||||
|
||||
part = p.DQ;
|
||||
len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
pos += len;
|
||||
|
||||
part = p.InverseQ;
|
||||
len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
pos += len;
|
||||
|
||||
part = p.D;
|
||||
len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
|
||||
return blob;
|
||||
}
|
||||
|
||||
static public RSA FromCapiPublicKeyBlob (byte[] blob)
|
||||
{
|
||||
return FromCapiPublicKeyBlob (blob, 0);
|
||||
}
|
||||
|
||||
static public RSA FromCapiPublicKeyBlob (byte[] blob, int offset)
|
||||
{
|
||||
if (blob == null)
|
||||
throw new ArgumentNullException ("blob");
|
||||
if (offset >= blob.Length)
|
||||
throw new ArgumentException ("blob is too small.");
|
||||
|
||||
try {
|
||||
if ((blob [offset] != 0x06) || // PUBLICKEYBLOB (0x06)
|
||||
(blob [offset+1] != 0x02) || // Version (0x02)
|
||||
(blob [offset+2] != 0x00) || // Reserved (word)
|
||||
(blob [offset+3] != 0x00) ||
|
||||
(ToUInt32LE (blob, offset+8) != 0x31415352)) // DWORD magic = RSA1
|
||||
throw new CryptographicException ("Invalid blob header");
|
||||
|
||||
// ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)
|
||||
// int algId = ToInt32LE (blob, offset+4);
|
||||
|
||||
// DWORD bitlen
|
||||
int bitLen = ToInt32LE (blob, offset+12);
|
||||
|
||||
// DWORD public exponent
|
||||
RSAParameters rsap = new RSAParameters ();
|
||||
rsap.Exponent = new byte [3];
|
||||
rsap.Exponent [0] = blob [offset+18];
|
||||
rsap.Exponent [1] = blob [offset+17];
|
||||
rsap.Exponent [2] = blob [offset+16];
|
||||
|
||||
int pos = offset+20;
|
||||
// BYTE modulus[rsapubkey.bitlen/8];
|
||||
int byteLen = (bitLen >> 3);
|
||||
rsap.Modulus = new byte [byteLen];
|
||||
Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);
|
||||
Array.Reverse (rsap.Modulus);
|
||||
|
||||
RSA rsa = (RSA)RSA.Create ();
|
||||
rsa.ImportParameters (rsap);
|
||||
return rsa;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new CryptographicException ("Invalid blob.", e);
|
||||
}
|
||||
}
|
||||
|
||||
static public byte[] ToCapiPublicKeyBlob (RSA rsa)
|
||||
{
|
||||
RSAParameters p = rsa.ExportParameters (false);
|
||||
int keyLength = p.Modulus.Length; // in bytes
|
||||
byte[] blob = new byte [20 + keyLength];
|
||||
|
||||
blob [0] = 0x06; // Type - PUBLICKEYBLOB (0x06)
|
||||
blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02)
|
||||
// [2], [3] // RESERVED - Always 0
|
||||
blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)
|
||||
blob [8] = 0x52; // Magic - RSA1 (ASCII in hex)
|
||||
blob [9] = 0x53;
|
||||
blob [10] = 0x41;
|
||||
blob [11] = 0x31;
|
||||
|
||||
byte[] bitlen = GetBytesLE (keyLength << 3);
|
||||
blob [12] = bitlen [0]; // bitlen
|
||||
blob [13] = bitlen [1];
|
||||
blob [14] = bitlen [2];
|
||||
blob [15] = bitlen [3];
|
||||
|
||||
// public exponent (DWORD)
|
||||
int pos = 16;
|
||||
int n = p.Exponent.Length;
|
||||
while (n > 0)
|
||||
blob [pos++] = p.Exponent [--n];
|
||||
// modulus
|
||||
pos = 20;
|
||||
byte[] part = p.Modulus;
|
||||
int len = part.Length;
|
||||
Array.Reverse (part, 0, len);
|
||||
Buffer.BlockCopy (part, 0, blob, pos, len);
|
||||
pos += len;
|
||||
return blob;
|
||||
}
|
||||
|
||||
// PRIVATEKEYBLOB
|
||||
// PUBLICKEYBLOB
|
||||
static public RSA FromCapiKeyBlob (byte[] blob)
|
||||
{
|
||||
return FromCapiKeyBlob (blob, 0);
|
||||
}
|
||||
|
||||
static public RSA FromCapiKeyBlob (byte[] blob, int offset)
|
||||
{
|
||||
if (blob == null)
|
||||
throw new ArgumentNullException ("blob");
|
||||
if (offset >= blob.Length)
|
||||
throw new ArgumentException ("blob is too small.");
|
||||
|
||||
switch (blob [offset]) {
|
||||
case 0x00:
|
||||
// this could be a public key inside an header
|
||||
// like "sn -e" would produce
|
||||
if (blob [offset + 12] == 0x06) {
|
||||
return FromCapiPublicKeyBlob (blob, offset + 12);
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
return FromCapiPublicKeyBlob (blob, offset);
|
||||
case 0x07:
|
||||
return FromCapiPrivateKeyBlob (blob, offset);
|
||||
}
|
||||
throw new CryptographicException ("Unknown blob format.");
|
||||
}
|
||||
|
||||
static public byte[] ToCapiKeyBlob (AsymmetricAlgorithm keypair, bool includePrivateKey)
|
||||
{
|
||||
if (keypair == null)
|
||||
throw new ArgumentNullException ("keypair");
|
||||
|
||||
// check between RSA and DSA (and potentially others like DH)
|
||||
if (keypair is RSA)
|
||||
return ToCapiKeyBlob ((RSA)keypair, includePrivateKey);
|
||||
else
|
||||
return null; // TODO
|
||||
}
|
||||
|
||||
static public byte[] ToCapiKeyBlob (RSA rsa, bool includePrivateKey)
|
||||
{
|
||||
if (rsa == null)
|
||||
throw new ArgumentNullException ("rsa");
|
||||
|
||||
rsa.ExportParameters (includePrivateKey);
|
||||
if (includePrivateKey)
|
||||
return ToCapiPrivateKeyBlob (rsa);
|
||||
else
|
||||
return ToCapiPublicKeyBlob (rsa);
|
||||
}
|
||||
|
||||
static public string ToHex (byte[] input)
|
||||
{
|
||||
if (input == null)
|
||||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder (input.Length * 2);
|
||||
foreach (byte b in input) {
|
||||
sb.Append (b.ToString ("X2", CultureInfo.InvariantCulture));
|
||||
}
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
static private byte FromHexChar (char c)
|
||||
{
|
||||
if ((c >= 'a') && (c <= 'f'))
|
||||
return (byte) (c - 'a' + 10);
|
||||
if ((c >= 'A') && (c <= 'F'))
|
||||
return (byte) (c - 'A' + 10);
|
||||
if ((c >= '0') && (c <= '9'))
|
||||
return (byte) (c - '0');
|
||||
throw new ArgumentException ("invalid hex char");
|
||||
}
|
||||
|
||||
static public byte[] FromHex (string hex)
|
||||
{
|
||||
if (hex == null)
|
||||
return null;
|
||||
if ((hex.Length & 0x1) == 0x1)
|
||||
throw new ArgumentException ("Length must be a multiple of 2");
|
||||
|
||||
byte[] result = new byte [hex.Length >> 1];
|
||||
int n = 0;
|
||||
int i = 0;
|
||||
while (n < result.Length) {
|
||||
result [n] = (byte) (FromHexChar (hex [i++]) << 4);
|
||||
result [n++] += FromHexChar (hex [i++]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
#
|
||||
# This makefile needs work, currently we overwrite the value of `bmcs.exe',
|
||||
# the reason is that we need this to be compiled with gmcs, so it uses the
|
||||
# .NET 2.0 profile.
|
||||
#
|
||||
thisdir := bmcs
|
||||
SUBDIRS :=
|
||||
include ../build/rules.make
|
||||
|
||||
#uncomment to enable some debug stuff
|
||||
#DEBUG_FLAGS=/define:MCS_DEBUG
|
||||
|
||||
BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0_bootstrap/mcs.exe $(DEBUG_FLAGS)
|
||||
|
||||
BUILT_SOURCES = mb-parser.cs
|
||||
|
||||
EXTRA_DISTFILES = mb-parser.jay
|
||||
|
||||
PROGRAM_COMPILE = $(BOOT_COMPILE)
|
||||
|
||||
CLEAN_FILES = y.output
|
||||
|
||||
PROGRAM = bmcs.exe
|
||||
|
||||
mb-parser.cs: mb-parser.jay $(topdir)/jay/skeleton.cs
|
||||
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
|
||||
|
||||
include ../build/executable.make
|
||||
|
||||
bmcs.exe: mb-parser.cs
|
||||
gmcs -d:NET_1_1 -d:ONLY_1_1 -debug /target:exe /out:bmcs.exe /r:Microsoft.VisualBasic.dll mb-parser.cs @bmcs.exe.sources -nowarn:219 -nowarn:162
|
||||
|
||||
winstall: all
|
||||
cp bmcs.exe $(prefix)/lib/mono/2.0/
|
||||
|
||||
diffus:
|
||||
diff --exclude='.svn' --exclude='*-parser.*' --exclude='*-tokenizer.cs' -ruN ../gmcs ../bmcs
|
||||
@@ -1,22 +0,0 @@
|
||||
* This is BMCS
|
||||
|
||||
Last merge to GMCS: 42056
|
||||
|
||||
BMCS is a new fork of the generics compiler from revision
|
||||
38733 (11th of January 2005).
|
||||
|
||||
This new compiler is based on the changes that Jambunathan did
|
||||
to mcs from November 30th, 2004 to integrate the existing mbas
|
||||
compiler with a more recent mcs.
|
||||
|
||||
We have ported those changes to use `gmcs' so that we get
|
||||
support for generics into our VB compiler eventually.
|
||||
|
||||
Work toward integrating the improvements from mbas will go here.
|
||||
|
||||
* LICENSING
|
||||
|
||||
Notice that the compiler might eventually need to go into the
|
||||
class libraries. We request that contributors grant us permission
|
||||
to relicense the code under the MIT X11 license if we have to.
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,632 +0,0 @@
|
||||
//
|
||||
// assign.cs: Assignments.
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza ([email protected])
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2001, 2002, 2003 Ximian, Inc.
|
||||
// (C) 2004 Novell, Inc
|
||||
//
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
|
||||
namespace Mono.CSharp {
|
||||
|
||||
/// <summary>
|
||||
/// This interface is implemented by expressions that can be assigned to.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This interface is implemented by Expressions whose values can not
|
||||
/// store the result on the top of the stack.
|
||||
///
|
||||
/// Expressions implementing this (Properties, Indexers and Arrays) would
|
||||
/// perform an assignment of the Expression "source" into its final
|
||||
/// location.
|
||||
///
|
||||
/// No values on the top of the stack are expected to be left by
|
||||
/// invoking this method.
|
||||
/// </remarks>
|
||||
public interface IAssignMethod {
|
||||
//
|
||||
// This is an extra version of Emit. If leave_copy is `true'
|
||||
// A copy of the expression will be left on the stack at the
|
||||
// end of the code generated for EmitAssign
|
||||
//
|
||||
void Emit (EmitContext ec, bool leave_copy);
|
||||
|
||||
//
|
||||
// This method does the assignment
|
||||
// `source' will be stored into the location specified by `this'
|
||||
// if `leave_copy' is true, a copy of `source' will be left on the stack
|
||||
// if `prepare_for_load' is true, when `source' is emitted, there will
|
||||
// be data on the stack that it can use to compuatate its value. This is
|
||||
// for expressions like a [f ()] ++, where you can't call `f ()' twice.
|
||||
//
|
||||
void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load);
|
||||
|
||||
/*
|
||||
For simple assignments, this interface is very simple, EmitAssign is called with source
|
||||
as the source expression and leave_copy and prepare_for_load false.
|
||||
|
||||
For compound assignments it gets complicated.
|
||||
|
||||
EmitAssign will be called as before, however, prepare_for_load will be
|
||||
true. The @source expression will contain an expression
|
||||
which calls Emit. So, the calls look like:
|
||||
|
||||
this.EmitAssign (ec, source, false, true) ->
|
||||
source.Emit (ec); ->
|
||||
[...] ->
|
||||
this.Emit (ec, false); ->
|
||||
end this.Emit (ec, false); ->
|
||||
end [...]
|
||||
end source.Emit (ec);
|
||||
end this.EmitAssign (ec, source, false, true)
|
||||
|
||||
|
||||
When prepare_for_load is true, EmitAssign emits a `token' on the stack that
|
||||
Emit will use for its state.
|
||||
|
||||
Let's take FieldExpr as an example. assume we are emitting f ().y += 1;
|
||||
|
||||
Here is the call tree again. This time, each call is annotated with the IL
|
||||
it produces:
|
||||
|
||||
this.EmitAssign (ec, source, false, true)
|
||||
call f
|
||||
dup
|
||||
|
||||
Binary.Emit ()
|
||||
this.Emit (ec, false);
|
||||
ldfld y
|
||||
end this.Emit (ec, false);
|
||||
|
||||
IntConstant.Emit ()
|
||||
ldc.i4.1
|
||||
end IntConstant.Emit
|
||||
|
||||
add
|
||||
end Binary.Emit ()
|
||||
|
||||
stfld
|
||||
end this.EmitAssign (ec, source, false, true)
|
||||
|
||||
Observe two things:
|
||||
1) EmitAssign left a token on the stack. It was the result of f ().
|
||||
2) This token was used by Emit
|
||||
|
||||
leave_copy (in both EmitAssign and Emit) tells the compiler to leave a copy
|
||||
of the expression at that point in evaluation. This is used for pre/post inc/dec
|
||||
and for a = x += y. Let's do the above example with leave_copy true in EmitAssign
|
||||
|
||||
this.EmitAssign (ec, source, true, true)
|
||||
call f
|
||||
dup
|
||||
|
||||
Binary.Emit ()
|
||||
this.Emit (ec, false);
|
||||
ldfld y
|
||||
end this.Emit (ec, false);
|
||||
|
||||
IntConstant.Emit ()
|
||||
ldc.i4.1
|
||||
end IntConstant.Emit
|
||||
|
||||
add
|
||||
end Binary.Emit ()
|
||||
|
||||
dup
|
||||
stloc temp
|
||||
stfld
|
||||
ldloc temp
|
||||
end this.EmitAssign (ec, source, true, true)
|
||||
|
||||
And with it true in Emit
|
||||
|
||||
this.EmitAssign (ec, source, false, true)
|
||||
call f
|
||||
dup
|
||||
|
||||
Binary.Emit ()
|
||||
this.Emit (ec, true);
|
||||
ldfld y
|
||||
dup
|
||||
stloc temp
|
||||
end this.Emit (ec, true);
|
||||
|
||||
IntConstant.Emit ()
|
||||
ldc.i4.1
|
||||
end IntConstant.Emit
|
||||
|
||||
add
|
||||
end Binary.Emit ()
|
||||
|
||||
stfld
|
||||
ldloc temp
|
||||
end this.EmitAssign (ec, source, false, true)
|
||||
|
||||
Note that these two examples are what happens for ++x and x++, respectively.
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An Expression to hold a temporary value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The LocalTemporary class is used to hold temporary values of a given
|
||||
/// type to "simulate" the expression semantics on property and indexer
|
||||
/// access whose return values are void.
|
||||
///
|
||||
/// The local temporary is used to alter the normal flow of code generation
|
||||
/// basically it creates a local variable, and its emit instruction generates
|
||||
/// code to access this value, return its address or save its value.
|
||||
///
|
||||
/// If `is_address' is true, then the value that we store is the address to the
|
||||
/// real value, and not the value itself.
|
||||
///
|
||||
/// This is needed for a value type, because otherwise you just end up making a
|
||||
/// copy of the value on the stack and modifying it. You really need a pointer
|
||||
/// to the origional value so that you can modify it in that location. This
|
||||
/// Does not happen with a class because a class is a pointer -- so you always
|
||||
/// get the indirection.
|
||||
///
|
||||
/// The `is_address' stuff is really just a hack. We need to come up with a better
|
||||
/// way to handle it.
|
||||
/// </remarks>
|
||||
public class LocalTemporary : Expression, IMemoryLocation {
|
||||
LocalBuilder builder;
|
||||
bool is_address;
|
||||
|
||||
public LocalTemporary (EmitContext ec, Type t) : this (ec, t, false) {}
|
||||
|
||||
public LocalTemporary (EmitContext ec, Type t, bool is_address)
|
||||
{
|
||||
type = t;
|
||||
eclass = ExprClass.Value;
|
||||
loc = Location.Null;
|
||||
builder = ec.GetTemporaryLocal (is_address ? TypeManager.GetReferenceType (t): t);
|
||||
this.is_address = is_address;
|
||||
}
|
||||
|
||||
public LocalTemporary (LocalBuilder b, Type t)
|
||||
{
|
||||
type = t;
|
||||
eclass = ExprClass.Value;
|
||||
loc = Location.Null;
|
||||
builder = b;
|
||||
}
|
||||
|
||||
public void Release (EmitContext ec)
|
||||
{
|
||||
ec.FreeTemporaryLocal (builder, type);
|
||||
builder = null;
|
||||
}
|
||||
|
||||
public override Expression DoResolve (EmitContext ec)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void Emit (EmitContext ec)
|
||||
{
|
||||
ILGenerator ig = ec.ig;
|
||||
|
||||
ig.Emit (OpCodes.Ldloc, builder);
|
||||
// we need to copy from the pointer
|
||||
if (is_address)
|
||||
LoadFromPtr (ig, type);
|
||||
}
|
||||
|
||||
// NB: if you have `is_address' on the stack there must
|
||||
// be a managed pointer. Otherwise, it is the type from
|
||||
// the ctor.
|
||||
public void Store (EmitContext ec)
|
||||
{
|
||||
ILGenerator ig = ec.ig;
|
||||
ig.Emit (OpCodes.Stloc, builder);
|
||||
}
|
||||
|
||||
public void AddressOf (EmitContext ec, AddressOp mode)
|
||||
{
|
||||
// if is_address, than this is just the address anyways,
|
||||
// so we just return this.
|
||||
ILGenerator ig = ec.ig;
|
||||
|
||||
if (is_address)
|
||||
ig.Emit (OpCodes.Ldloc, builder);
|
||||
else
|
||||
ig.Emit (OpCodes.Ldloca, builder);
|
||||
}
|
||||
|
||||
public bool PointsToAddress {
|
||||
get {
|
||||
return is_address;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Assign node takes care of assigning the value of source into
|
||||
/// the expression represented by target.
|
||||
/// </summary>
|
||||
public class Assign : ExpressionStatement {
|
||||
protected Expression target, source, real_source;
|
||||
protected LocalTemporary temp = null, real_temp = null;
|
||||
protected Assign embedded = null;
|
||||
protected bool is_embedded = false;
|
||||
protected bool must_free_temp = false;
|
||||
|
||||
public Assign (Expression target, Expression source, Location l)
|
||||
{
|
||||
this.target = target;
|
||||
this.source = this.real_source = source;
|
||||
this.loc = l;
|
||||
}
|
||||
|
||||
protected Assign (Assign embedded, Location l)
|
||||
: this (embedded.target, embedded.source, l)
|
||||
{
|
||||
this.is_embedded = true;
|
||||
}
|
||||
|
||||
protected virtual Assign GetEmbeddedAssign (Location loc)
|
||||
{
|
||||
return new Assign (this, loc);
|
||||
}
|
||||
|
||||
public Expression Target {
|
||||
get {
|
||||
return target;
|
||||
}
|
||||
|
||||
set {
|
||||
target = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Expression Source {
|
||||
get {
|
||||
return source;
|
||||
}
|
||||
|
||||
set {
|
||||
source = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static void error70 (EventInfo ei, Location l)
|
||||
{
|
||||
Report.Error (70, l, "The event '" + ei.Name +
|
||||
"' can only appear on the left-side of a += or -= (except when" +
|
||||
" used from within the type '" + ei.DeclaringType + "')");
|
||||
}
|
||||
|
||||
//
|
||||
// Will return either `this' or an instance of `New'.
|
||||
//
|
||||
public override Expression DoResolve (EmitContext ec)
|
||||
{
|
||||
// Create an embedded assignment if our source is an assignment.
|
||||
if (source is Assign)
|
||||
source = embedded = ((Assign) source).GetEmbeddedAssign (loc);
|
||||
|
||||
real_source = source = source.Resolve (ec);
|
||||
if (source == null)
|
||||
return null;
|
||||
|
||||
//
|
||||
// This is used in an embedded assignment.
|
||||
// As an example, consider the statement "A = X = Y = Z".
|
||||
//
|
||||
if (is_embedded && !(source is Constant)) {
|
||||
// If this is the innermost assignment (the "Y = Z" in our example),
|
||||
// create a new temporary local, otherwise inherit that variable
|
||||
// from our child (the "X = (Y = Z)" inherits the local from the
|
||||
// "Y = Z" assignment).
|
||||
|
||||
if (embedded == null) {
|
||||
if (this is CompoundAssign)
|
||||
real_temp = temp = new LocalTemporary (ec, target.Type);
|
||||
else
|
||||
real_temp = temp = new LocalTemporary (ec, source.Type);
|
||||
} else
|
||||
temp = embedded.temp;
|
||||
|
||||
// Set the source to the new temporary variable.
|
||||
// This means that the following target.ResolveLValue () will tell
|
||||
// the target to read it's source value from that variable.
|
||||
source = temp;
|
||||
}
|
||||
|
||||
// If we have an embedded assignment, use the embedded assignment's temporary
|
||||
// local variable as source.
|
||||
if (embedded != null)
|
||||
source = (embedded.temp != null) ? embedded.temp : embedded.source;
|
||||
|
||||
target = target.ResolveLValue (ec, source);
|
||||
|
||||
if (target == null)
|
||||
return null;
|
||||
|
||||
Type target_type = target.Type;
|
||||
Type source_type = real_source.Type;
|
||||
|
||||
// If we're an embedded assignment, our parent will reuse our source as its
|
||||
// source, it won't read from our target.
|
||||
if (is_embedded)
|
||||
type = source_type;
|
||||
else
|
||||
type = target_type;
|
||||
eclass = ExprClass.Value;
|
||||
|
||||
if (target is EventExpr) {
|
||||
EventInfo ei = ((EventExpr) target).EventInfo;
|
||||
|
||||
Expression ml = MemberLookup (
|
||||
ec, ec.ContainerType, ei.Name,
|
||||
MemberTypes.Event, AllBindingFlags | BindingFlags.DeclaredOnly, loc);
|
||||
|
||||
if (ml == null) {
|
||||
//
|
||||
// If this is the case, then the Event does not belong
|
||||
// to this Type and so, according to the spec
|
||||
// is allowed to only appear on the left hand of
|
||||
// the += and -= operators
|
||||
//
|
||||
// Note that target will not appear as an EventExpr
|
||||
// in the case it is being referenced within the same type container;
|
||||
// it will appear as a FieldExpr in that case.
|
||||
//
|
||||
|
||||
if (!(source is BinaryDelegate)) {
|
||||
error70 (ei, loc);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FieldExpr field_exp = target as FieldExpr;
|
||||
if (field_exp != null && field_exp.DeclaringType.IsValueType && !ec.IsConstructor && !ec.IsFieldInitializer) {
|
||||
field_exp = field_exp.InstanceExpression as FieldExpr;
|
||||
if (field_exp != null && field_exp.FieldInfo.IsInitOnly) {
|
||||
if (field_exp.IsStatic) {
|
||||
Report.Error (1650, loc, "Members of static readonly field '{0}' cannot be assigned to " +
|
||||
"(except in a static constructor or a variable initializer)", TypeManager.GetFullNameSignature (field_exp.FieldInfo));
|
||||
} else {
|
||||
Report.Error (1648, loc, "Members of readonly field '{0}' cannot be assigned to " +
|
||||
"(except in a constructor or a variable initializer)", TypeManager.GetFullNameSignature (field_exp.FieldInfo));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(target is IAssignMethod) && (target.eclass != ExprClass.EventAccess)) {
|
||||
Report.Error (131, loc,
|
||||
"Left hand of an assignment must be a variable, " +
|
||||
"a property or an indexer");
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((source.eclass == ExprClass.Type) && (source is TypeExpr)) {
|
||||
source.Error_UnexpectedKind ("variable or value", loc);
|
||||
return null;
|
||||
} else if ((RootContext.Version == LanguageVersion.ISO_1) &&
|
||||
(source is MethodGroupExpr)){
|
||||
((MethodGroupExpr) source).ReportUsageError ();
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
if (target_type == source_type){
|
||||
if (source is New && target_type.IsValueType &&
|
||||
(target.eclass != ExprClass.IndexerAccess) && (target.eclass != ExprClass.PropertyAccess)){
|
||||
New n = (New) source;
|
||||
|
||||
if (n.SetValueTypeVariable (target))
|
||||
return n;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
//
|
||||
// If this assignemnt/operator was part of a compound binary
|
||||
// operator, then we allow an explicit conversion, as detailed
|
||||
// in the spec.
|
||||
//
|
||||
|
||||
if (this is CompoundAssign){
|
||||
CompoundAssign a = (CompoundAssign) this;
|
||||
|
||||
Binary b = source as Binary;
|
||||
if (b != null){
|
||||
//
|
||||
// 1. if the source is explicitly convertible to the
|
||||
// target_type
|
||||
//
|
||||
|
||||
source = Convert.WideningAndNarrowingConversion (ec, source, target_type, loc);
|
||||
if (source == null){
|
||||
Convert.Error_CannotWideningConversion (loc, source_type, target_type);
|
||||
return null;
|
||||
}
|
||||
|
||||
//
|
||||
// 2. and the original right side is implicitly convertible to
|
||||
// the type of target
|
||||
//
|
||||
if (Convert.WideningStandardConversionExists (ec, a.original_source, target_type))
|
||||
return this;
|
||||
|
||||
//
|
||||
// In the spec 2.4 they added: or if type of the target is int
|
||||
// and the operator is a shift operator...
|
||||
//
|
||||
if (source_type == TypeManager.int32_type &&
|
||||
(b.Oper == Binary.Operator.LeftShift || b.Oper == Binary.Operator.RightShift))
|
||||
return this;
|
||||
|
||||
Convert.Error_CannotWideningConversion (loc, a.original_source.Type, target_type);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
source = Convert.ImplicitVBConversionRequired (ec, source, target_type, loc);
|
||||
if (source == null)
|
||||
return null;
|
||||
|
||||
// If we're an embedded assignment, we need to create a new temporary variable
|
||||
// for the converted value. Our parent will use this new variable as its source.
|
||||
// The same applies when we have an embedded assignment - in this case, we need
|
||||
// to convert our embedded assignment's temporary local variable to the correct
|
||||
// type and store it in a new temporary local.
|
||||
if (is_embedded || embedded != null) {
|
||||
type = target_type;
|
||||
temp = new LocalTemporary (ec, type);
|
||||
must_free_temp = true;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Expression EmitEmbedded (EmitContext ec)
|
||||
{
|
||||
// Emit an embedded assignment.
|
||||
|
||||
if (real_temp != null) {
|
||||
// If we're the innermost assignment, `real_source' is the right-hand
|
||||
// expression which gets assigned to all the variables left of it.
|
||||
// Emit this expression and store its result in real_temp.
|
||||
real_source.Emit (ec);
|
||||
real_temp.Store (ec);
|
||||
}
|
||||
|
||||
if (embedded != null)
|
||||
embedded.EmitEmbedded (ec);
|
||||
|
||||
// This happens when we've done a type conversion, in this case source will be
|
||||
// the expression which does the type conversion from real_temp.
|
||||
// So emit it and store the result in temp; this is the var which will be read
|
||||
// by our parent.
|
||||
if (temp != real_temp) {
|
||||
source.Emit (ec);
|
||||
temp.Store (ec);
|
||||
}
|
||||
|
||||
Expression temp_source = (temp != null) ? temp : source;
|
||||
((IAssignMethod) target).EmitAssign (ec, temp_source, false, false);
|
||||
return temp_source;
|
||||
}
|
||||
|
||||
void ReleaseEmbedded (EmitContext ec)
|
||||
{
|
||||
if (embedded != null)
|
||||
embedded.ReleaseEmbedded (ec);
|
||||
|
||||
if (real_temp != null)
|
||||
real_temp.Release (ec);
|
||||
|
||||
if (must_free_temp)
|
||||
temp.Release (ec);
|
||||
}
|
||||
|
||||
void Emit (EmitContext ec, bool is_statement)
|
||||
{
|
||||
if (target is EventExpr) {
|
||||
((EventExpr) target).EmitAddOrRemove (ec, source);
|
||||
return;
|
||||
}
|
||||
|
||||
IAssignMethod am = (IAssignMethod) target;
|
||||
|
||||
Expression temp_source;
|
||||
if (embedded != null) {
|
||||
temp_source = embedded.EmitEmbedded (ec);
|
||||
|
||||
if (temp != null) {
|
||||
source.Emit (ec);
|
||||
temp.Store (ec);
|
||||
temp_source = temp;
|
||||
}
|
||||
} else
|
||||
temp_source = source;
|
||||
|
||||
am.EmitAssign (ec, temp_source, !is_statement, this is CompoundAssign);
|
||||
|
||||
if (embedded != null) {
|
||||
if (temp != null)
|
||||
temp.Release (ec);
|
||||
embedded.ReleaseEmbedded (ec);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Emit (EmitContext ec)
|
||||
{
|
||||
Emit (ec, false);
|
||||
}
|
||||
|
||||
public override void EmitStatement (EmitContext ec)
|
||||
{
|
||||
Emit (ec, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// This class is used for compound assignments.
|
||||
//
|
||||
class CompoundAssign : Assign {
|
||||
Binary.Operator op;
|
||||
public Expression original_source;
|
||||
|
||||
public CompoundAssign (Binary.Operator op, Expression target, Expression source, Location l)
|
||||
: base (target, source, l)
|
||||
{
|
||||
original_source = source;
|
||||
this.op = op;
|
||||
}
|
||||
|
||||
protected CompoundAssign (CompoundAssign embedded, Location l)
|
||||
: this (embedded.op, embedded.target, embedded.source, l)
|
||||
{
|
||||
this.is_embedded = true;
|
||||
}
|
||||
|
||||
protected override Assign GetEmbeddedAssign (Location loc)
|
||||
{
|
||||
return new CompoundAssign (this, loc);
|
||||
}
|
||||
|
||||
public Expression ResolveSource (EmitContext ec)
|
||||
{
|
||||
return original_source.Resolve (ec);
|
||||
}
|
||||
|
||||
public override Expression DoResolve (EmitContext ec)
|
||||
{
|
||||
original_source = original_source.Resolve (ec);
|
||||
if (original_source == null)
|
||||
return null;
|
||||
|
||||
target = target.Resolve (ec);
|
||||
if (target == null)
|
||||
return null;
|
||||
|
||||
//
|
||||
// Only now we can decouple the original source/target
|
||||
// into a tree, to guarantee that we do not have side
|
||||
// effects.
|
||||
//
|
||||
source = new Binary (op, target, original_source, loc);
|
||||
return base.DoResolve (ec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,14 +0,0 @@
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v2.0.50727"/>
|
||||
</startup>
|
||||
<system.diagnostics>
|
||||
<trace autoflush="true" indentsize="4">
|
||||
<listeners>
|
||||
<add name="compilerLogListener" type="System.Diagnostics.TextWriterTraceListener,System"
|
||||
initializeData="mcs.log" />
|
||||
<remove type="System.Diagnostics.DefaultTraceListener,System"/>
|
||||
</listeners>
|
||||
</trace>
|
||||
</system.diagnostics>
|
||||
</configuration>
|
||||
@@ -1,40 +0,0 @@
|
||||
AssemblyInfo.cs
|
||||
anonymous.cs
|
||||
assign.cs
|
||||
attribute.cs
|
||||
driver.cs
|
||||
mb-tokenizer.cs
|
||||
cfold.cs
|
||||
class.cs
|
||||
codegen.cs
|
||||
const.cs
|
||||
constant.cs
|
||||
convert.cs
|
||||
decl.cs
|
||||
delegate.cs
|
||||
doc.cs
|
||||
enum.cs
|
||||
ecore.cs
|
||||
expression.cs
|
||||
flowanalysis.cs
|
||||
generic.cs
|
||||
iterators.cs
|
||||
literal.cs
|
||||
location.cs
|
||||
modifiers.cs
|
||||
namespace.cs
|
||||
parameter.cs
|
||||
pending.cs
|
||||
report.cs
|
||||
rootcontext.cs
|
||||
statement.cs
|
||||
support.cs
|
||||
typemanager.cs
|
||||
symbolwriter.cs
|
||||
tree.cs
|
||||
module.cs
|
||||
../class/corlib/Mono.Security.Cryptography/CryptoConvert.cs
|
||||
../class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs
|
||||
../class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs
|
||||
../class/Mono.CompilerServices.SymbolWriter/MonoSymbolWriter.cs
|
||||
../build/common/Consts.cs
|
||||
-1246
File diff suppressed because it is too large.
Load diff
-8091
File diff suppressed because it is too large.
Load diff
-1377
File diff suppressed because it is too large.
Load diff
@@ -1,321 +0,0 @@
|
||||
//
|
||||
// const.cs: Constant declarations.
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza ([email protected])
|
||||
// Marek Safar ([email protected])
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// This is needed because the following situation arises:
|
||||
//
|
||||
// The FieldBuilder is declared with the real type for an enumeration
|
||||
//
|
||||
// When we attempt to set the value for the constant, the FieldBuilder.SetConstant
|
||||
// function aborts because it requires its argument to be of the same type
|
||||
//
|
||||
|
||||
namespace Mono.CSharp {
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
|
||||
public class Const : FieldMember {
|
||||
public Expression Expr;
|
||||
EmitContext const_ec;
|
||||
|
||||
bool resolved = false;
|
||||
object ConstantValue = null;
|
||||
|
||||
bool in_transit = false;
|
||||
|
||||
public const int AllowedModifiers =
|
||||
Modifiers.NEW |
|
||||
Modifiers.PUBLIC |
|
||||
Modifiers.PROTECTED |
|
||||
Modifiers.INTERNAL |
|
||||
Modifiers.PRIVATE;
|
||||
|
||||
public Const (TypeContainer parent, Expression constant_type, string name,
|
||||
Expression expr, int mod_flags, Attributes attrs, Location loc)
|
||||
: base (parent, constant_type, mod_flags, AllowedModifiers,
|
||||
new MemberName (name), null, attrs, loc)
|
||||
{
|
||||
Expr = expr;
|
||||
ModFlags |= Modifiers.STATIC;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
void dump_tree (Type t)
|
||||
{
|
||||
Console.WriteLine ("Dumping hierarchy");
|
||||
while (t != null){
|
||||
Console.WriteLine (" " + t.FullName + " " +
|
||||
(t.GetType ().IsEnum ? "yes" : "no"));
|
||||
t = t.BaseType;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
protected override bool CheckBase ()
|
||||
{
|
||||
// Constant.Define can be called when the parent type hasn't yet been populated
|
||||
// and it's base types need not have been populated. So, we defer this check
|
||||
// to the second time Define () is called on this member.
|
||||
if (Parent.BaseCache == null)
|
||||
return true;
|
||||
return base.CheckBase ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the constant in the @parent
|
||||
/// </summary>
|
||||
public override bool Define ()
|
||||
{
|
||||
// Make Define () idempotent, but ensure that the error check happens.
|
||||
if (FieldBuilder != null)
|
||||
return base.CheckBase ();
|
||||
|
||||
if (!base.Define ())
|
||||
return false;
|
||||
|
||||
const_ec = new EmitContext (Parent, Location, null, MemberType, ModFlags);
|
||||
|
||||
Type ttype = MemberType;
|
||||
while (ttype.IsArray)
|
||||
ttype = TypeManager.GetElementType (ttype);
|
||||
|
||||
if (!TypeManager.IsBuiltinType(ttype) && (!ttype.IsSubclassOf(TypeManager.enum_type)) && !(Expr is NullLiteral)){
|
||||
Report.Error (
|
||||
-3, Location,
|
||||
"Constant type is not valid (only system types are allowed)");
|
||||
return false;
|
||||
}
|
||||
|
||||
FieldAttributes field_attr = FieldAttributes.Static | Modifiers.FieldAttr (ModFlags);
|
||||
// I don't know why but they emit decimal constant as InitOnly
|
||||
if (ttype == TypeManager.decimal_type) {
|
||||
field_attr |= FieldAttributes.InitOnly;
|
||||
}
|
||||
else {
|
||||
field_attr |= FieldAttributes.Literal;
|
||||
}
|
||||
|
||||
FieldBuilder = Parent.TypeBuilder.DefineField (Name, MemberType, field_attr);
|
||||
|
||||
TypeManager.RegisterConstant (FieldBuilder, this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Changes the type of the constant expression `expr' to the Type `type'
|
||||
// Returns null on failure.
|
||||
//
|
||||
public static Constant ChangeType (Location loc, Constant expr, Type type)
|
||||
{
|
||||
if (type == TypeManager.object_type)
|
||||
return expr;
|
||||
|
||||
bool fail;
|
||||
|
||||
// from the null type to any reference-type.
|
||||
if (expr.Type == TypeManager.null_type && !type.IsValueType && !TypeManager.IsEnumType (type))
|
||||
return NullLiteral.Null;
|
||||
|
||||
if (!Convert.WideningStandardConversionExists (Convert.ConstantEC, expr, type)){
|
||||
Convert.Error_CannotWideningConversion (loc, expr.Type, type);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Special-case: The 0 literal can be converted to an enum value,
|
||||
// and WideningStandardConversionExists will return true in that case.
|
||||
if (expr.Type == TypeManager.int32_type && TypeManager.IsEnumType (type)){
|
||||
if (expr is IntLiteral && ((IntLiteral) expr).Value == 0)
|
||||
return new EnumConstant (expr, type);
|
||||
}
|
||||
|
||||
object constant_value = TypeManager.ChangeType (expr.GetValue (), type, out fail);
|
||||
if (fail){
|
||||
Convert.Error_CannotWideningConversion (loc, expr.Type, type);
|
||||
|
||||
//
|
||||
// We should always catch the error before this is ever
|
||||
// reached, by calling Convert.WideningStandardConversionExists
|
||||
//
|
||||
throw new Exception (
|
||||
String.Format ("LookupConstantValue: This should never be reached {0} {1}", expr.Type, type));
|
||||
}
|
||||
|
||||
Constant retval;
|
||||
if (type == TypeManager.int32_type)
|
||||
retval = new IntConstant ((int) constant_value);
|
||||
else if (type == TypeManager.uint32_type)
|
||||
retval = new UIntConstant ((uint) constant_value);
|
||||
else if (type == TypeManager.int64_type)
|
||||
retval = new LongConstant ((long) constant_value);
|
||||
else if (type == TypeManager.uint64_type)
|
||||
retval = new ULongConstant ((ulong) constant_value);
|
||||
else if (type == TypeManager.float_type)
|
||||
retval = new FloatConstant ((float) constant_value);
|
||||
else if (type == TypeManager.double_type)
|
||||
retval = new DoubleConstant ((double) constant_value);
|
||||
else if (type == TypeManager.string_type)
|
||||
retval = new StringConstant ((string) constant_value);
|
||||
else if (type == TypeManager.short_type)
|
||||
retval = new ShortConstant ((short) constant_value);
|
||||
else if (type == TypeManager.ushort_type)
|
||||
retval = new UShortConstant ((ushort) constant_value);
|
||||
else if (type == TypeManager.sbyte_type)
|
||||
retval = new SByteConstant ((sbyte) constant_value);
|
||||
else if (type == TypeManager.byte_type)
|
||||
retval = new ByteConstant ((byte) constant_value);
|
||||
else if (type == TypeManager.char_type)
|
||||
retval = new CharConstant ((char) constant_value);
|
||||
else if (type == TypeManager.bool_type)
|
||||
retval = new BoolConstant ((bool) constant_value);
|
||||
else if (type == TypeManager.decimal_type)
|
||||
retval = new DecimalConstant ((decimal) constant_value);
|
||||
else
|
||||
throw new Exception ("LookupConstantValue: Unhandled constant type: " + type);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up the value of a constant field. Defines it if it hasn't
|
||||
/// already been. Similar to LookupEnumValue in spirit.
|
||||
/// </summary>
|
||||
public bool LookupConstantValue (out object value)
|
||||
{
|
||||
if (resolved) {
|
||||
value = ConstantValue;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (in_transit) {
|
||||
Report.Error (110, Location,
|
||||
"The evaluation of the constant value for `" +
|
||||
Name + "' involves a circular definition.");
|
||||
value = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
in_transit = true;
|
||||
int errors = Report.Errors;
|
||||
|
||||
//
|
||||
// We might have cleared Expr ourselves in a recursive definition
|
||||
//
|
||||
if (Expr == null){
|
||||
value = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
Expr = Expr.Resolve (const_ec);
|
||||
|
||||
in_transit = false;
|
||||
|
||||
if (Expr == null) {
|
||||
if (errors == Report.Errors)
|
||||
Report.Error (150, Location, "A constant value is expected");
|
||||
value = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
Expression real_expr = Expr;
|
||||
|
||||
Constant ce = Expr as Constant;
|
||||
if (ce == null){
|
||||
UnCheckedExpr un_expr = Expr as UnCheckedExpr;
|
||||
CheckedExpr ch_expr = Expr as CheckedExpr;
|
||||
EmptyCast ec_expr = Expr as EmptyCast;
|
||||
|
||||
if ((un_expr != null) && (un_expr.Expr is Constant))
|
||||
Expr = un_expr.Expr;
|
||||
else if ((ch_expr != null) && (ch_expr.Expr is Constant))
|
||||
Expr = ch_expr.Expr;
|
||||
else if ((ec_expr != null) && (ec_expr.Child is Constant))
|
||||
Expr = ec_expr.Child;
|
||||
else if (Expr is ArrayCreation){
|
||||
Report.Error (133, Location, "Arrays can not be constant");
|
||||
} else {
|
||||
if (errors == Report.Errors)
|
||||
Report.Error (150, Location, "A constant value is expected");
|
||||
value = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
ce = Expr as Constant;
|
||||
}
|
||||
|
||||
if (MemberType != real_expr.Type) {
|
||||
ce = ChangeType (Location, ce, MemberType);
|
||||
if (ce == null){
|
||||
value = null;
|
||||
return false;
|
||||
}
|
||||
Expr = ce;
|
||||
}
|
||||
|
||||
if (ce != null)
|
||||
ConstantValue = ce.GetValue ();
|
||||
|
||||
if (MemberType.IsEnum){
|
||||
//
|
||||
// This sadly does not work for our user-defined enumerations types ;-(
|
||||
//
|
||||
try {
|
||||
ConstantValue = System.Enum.ToObject (
|
||||
MemberType, ConstantValue);
|
||||
} catch (ArgumentException){
|
||||
Report.Error (
|
||||
-16, Location,
|
||||
".NET SDK 1.0 does not permit to create the constant "+
|
||||
" field from a user-defined enumeration");
|
||||
}
|
||||
}
|
||||
|
||||
if (ce is DecimalConstant) {
|
||||
Decimal d = ((DecimalConstant)ce).Value;
|
||||
int[] bits = Decimal.GetBits (d);
|
||||
object[] args = new object[] { (byte)(bits [3] >> 16), (byte)(bits [3] >> 31), (uint)bits [2], (uint)bits [1], (uint)bits [0] };
|
||||
CustomAttributeBuilder cab = new CustomAttributeBuilder (TypeManager.decimal_constant_attribute_ctor, args);
|
||||
FieldBuilder.SetCustomAttribute (cab);
|
||||
}
|
||||
else{
|
||||
FieldBuilder.SetConstant (ConstantValue);
|
||||
}
|
||||
|
||||
if (!TypeManager.RegisterFieldValue (FieldBuilder, ConstantValue))
|
||||
throw new Exception ("Cannot register const value");
|
||||
|
||||
value = ConstantValue;
|
||||
resolved = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Emits the field value by evaluating the expression
|
||||
/// </summary>
|
||||
public override void Emit ()
|
||||
{
|
||||
object value;
|
||||
LookupConstantValue (out value);
|
||||
|
||||
if (OptAttributes != null) {
|
||||
OptAttributes.Emit (const_ec, this);
|
||||
}
|
||||
|
||||
base.Emit ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
-2480
File diff suppressed because it is too large.
Load diff
-2477
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
-819
@@ -1,819 +0,0 @@
|
||||
//
|
||||
// doc.cs: Support for XML documentation comment.
|
||||
//
|
||||
// Author:
|
||||
// Atsushi Enomoto <[email protected]>
|
||||
//
|
||||
// Licensed under the terms of the GNU GPL
|
||||
//
|
||||
// (C) 2004 Novell, Inc.
|
||||
//
|
||||
//
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Security.Permissions;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
using Mono.CompilerServices.SymbolWriter;
|
||||
|
||||
namespace Mono.CSharp {
|
||||
|
||||
//
|
||||
// Support class for XML documentation.
|
||||
//
|
||||
public static class DocUtil
|
||||
{
|
||||
// TypeContainer
|
||||
|
||||
//
|
||||
// Generates xml doc comments (if any), and if required,
|
||||
// handle warning report.
|
||||
//
|
||||
internal static void GenerateTypeDocComment (TypeContainer t,
|
||||
DeclSpace ds)
|
||||
{
|
||||
GenerateDocComment (t, ds);
|
||||
|
||||
if (t.DefaultStaticConstructor != null)
|
||||
t.DefaultStaticConstructor.GenerateDocComment (t);
|
||||
|
||||
if (t.InstanceConstructors != null)
|
||||
foreach (Constructor c in t.InstanceConstructors)
|
||||
c.GenerateDocComment (t);
|
||||
|
||||
if (t.Types != null)
|
||||
foreach (TypeContainer tc in t.Types)
|
||||
tc.GenerateDocComment (t);
|
||||
|
||||
if (t.Parts != null) {
|
||||
IDictionary comments = RootContext.Documentation.PartialComments;
|
||||
foreach (ClassPart cp in t.Parts) {
|
||||
if (cp.DocComment == null)
|
||||
continue;
|
||||
comments [cp] = cp;
|
||||
}
|
||||
}
|
||||
|
||||
if (t.Enums != null)
|
||||
foreach (Enum en in t.Enums)
|
||||
en.GenerateDocComment (t);
|
||||
|
||||
if (t.Constants != null)
|
||||
foreach (Const c in t.Constants)
|
||||
c.GenerateDocComment (t);
|
||||
|
||||
if (t.Fields != null)
|
||||
foreach (Field f in t.Fields)
|
||||
f.GenerateDocComment (t);
|
||||
|
||||
if (t.Events != null)
|
||||
foreach (Event e in t.Events)
|
||||
e.GenerateDocComment (t);
|
||||
|
||||
if (t.Indexers != null)
|
||||
foreach (Indexer ix in t.Indexers)
|
||||
ix.GenerateDocComment (t);
|
||||
|
||||
if (t.Properties != null)
|
||||
foreach (Property p in t.Properties)
|
||||
p.GenerateDocComment (t);
|
||||
|
||||
if (t.Methods != null)
|
||||
foreach (Method m in t.Methods)
|
||||
m.GenerateDocComment (t);
|
||||
|
||||
if (t.Operators != null)
|
||||
foreach (Operator o in t.Operators)
|
||||
o.GenerateDocComment (t);
|
||||
}
|
||||
|
||||
// MemberCore
|
||||
private static readonly string lineHead =
|
||||
Environment.NewLine + " ";
|
||||
|
||||
private static XmlNode GetDocCommentNode (MemberCore mc,
|
||||
string name)
|
||||
{
|
||||
// FIXME: It could be even optimizable as not
|
||||
// to use XmlDocument. But anyways the nodes
|
||||
// are not kept in memory.
|
||||
XmlDocument doc = RootContext.Documentation.XmlDocumentation;
|
||||
try {
|
||||
XmlElement el = doc.CreateElement ("member");
|
||||
el.SetAttribute ("name", name);
|
||||
string normalized = mc.DocComment;
|
||||
el.InnerXml = normalized;
|
||||
// csc keeps lines as written in the sources
|
||||
// and inserts formatting indentation (which
|
||||
// is different from XmlTextWriter.Formatting
|
||||
// one), but when a start tag contains an
|
||||
// endline, it joins the next line. We don't
|
||||
// have to follow such a hacky behavior.
|
||||
string [] split =
|
||||
normalized.Split ('\n');
|
||||
int j = 0;
|
||||
for (int i = 0; i < split.Length; i++) {
|
||||
string s = split [i].TrimEnd ();
|
||||
if (s.Length > 0)
|
||||
split [j++] = s;
|
||||
}
|
||||
el.InnerXml = lineHead + String.Join (
|
||||
lineHead, split, 0, j);
|
||||
return el;
|
||||
} catch (XmlException ex) {
|
||||
Report.Warning (1570, 1, mc.Location, "XML comment on '{0}' has non-well-formed XML ({1}).", name, ex.Message);
|
||||
XmlComment com = doc.CreateComment (String.Format ("FIXME: Invalid documentation markup was found for member {0}", name));
|
||||
return com;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Generates xml doc comments (if any), and if required,
|
||||
// handle warning report.
|
||||
//
|
||||
internal static void GenerateDocComment (MemberCore mc,
|
||||
DeclSpace ds)
|
||||
{
|
||||
if (mc.DocComment != null) {
|
||||
string name = mc.GetDocCommentName (ds);
|
||||
|
||||
XmlNode n = GetDocCommentNode (mc, name);
|
||||
|
||||
XmlElement el = n as XmlElement;
|
||||
if (el != null) {
|
||||
mc.OnGenerateDocComment (ds, el);
|
||||
|
||||
// FIXME: it could be done with XmlReader
|
||||
foreach (XmlElement inc in n.SelectNodes (".//include"))
|
||||
HandleInclude (mc, inc);
|
||||
|
||||
// FIXME: it could be done with XmlReader
|
||||
DeclSpace dsTarget = mc as DeclSpace;
|
||||
if (dsTarget == null)
|
||||
dsTarget = ds;
|
||||
|
||||
foreach (XmlElement see in n.SelectNodes (".//see"))
|
||||
HandleSee (mc, dsTarget, see);
|
||||
foreach (XmlElement seealso in n.SelectNodes (".//seealso"))
|
||||
HandleSeeAlso (mc, dsTarget, seealso);
|
||||
foreach (XmlElement see in n.SelectNodes (".//exception"))
|
||||
HandleException (mc, dsTarget, see);
|
||||
}
|
||||
|
||||
n.WriteTo (RootContext.Documentation.XmlCommentOutput);
|
||||
}
|
||||
else if (mc.IsExposedFromAssembly (ds)) {
|
||||
Constructor c = mc as Constructor;
|
||||
if (c == null || !c.IsDefault ())
|
||||
Report.Warning (1591, 4, mc.Location,
|
||||
"Missing XML comment for publicly visible type or member '{0}'", mc.GetSignatureForError ());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Processes "include" element. Check included file and
|
||||
// embed the document content inside this documentation node.
|
||||
//
|
||||
private static void HandleInclude (MemberCore mc, XmlElement el)
|
||||
{
|
||||
string file = el.GetAttribute ("file");
|
||||
string path = el.GetAttribute ("path");
|
||||
if (file == "") {
|
||||
Report.Warning (1590, 1, mc.Location, "Invalid XML 'include' element; Missing 'file' attribute.");
|
||||
el.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
|
||||
}
|
||||
else if (path == "") {
|
||||
Report.Warning (1590, 1, mc.Location, "Invalid XML 'include' element; Missing 'path' attribute.");
|
||||
el.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (" Include tag is invalid "), el);
|
||||
}
|
||||
else {
|
||||
XmlDocument doc = RootContext.Documentation.StoredDocuments [file] as XmlDocument;
|
||||
if (doc == null) {
|
||||
try {
|
||||
doc = new XmlDocument ();
|
||||
doc.Load (file);
|
||||
RootContext.Documentation.StoredDocuments.Add (file, doc);
|
||||
} catch (Exception) {
|
||||
el.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (String.Format (" Badly formed XML in at comment file '{0}': cannot be included ", file)), el);
|
||||
Report.Warning (1592, 1, mc.Location, "Badly formed XML in included comments file -- '{0}'", file);
|
||||
}
|
||||
}
|
||||
bool keepIncludeNode = false;
|
||||
if (doc != null) {
|
||||
try {
|
||||
XmlNodeList nl = doc.SelectNodes (path);
|
||||
if (nl.Count == 0) {
|
||||
el.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (" No matching elements were found for the include tag embedded here. "), el);
|
||||
|
||||
keepIncludeNode = true;
|
||||
}
|
||||
foreach (XmlNode n in nl)
|
||||
el.ParentNode.InsertBefore (el.OwnerDocument.ImportNode (n, true), el);
|
||||
} catch (Exception ex) {
|
||||
el.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (" Failed to insert some or all of included XML "), el);
|
||||
Report.Warning (1589, 1, mc.Location, "Unable to include XML fragment '{0}' of file {1} -- {2}.", path, file, ex.Message);
|
||||
}
|
||||
}
|
||||
if (!keepIncludeNode)
|
||||
el.ParentNode.RemoveChild (el);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Handles <see> elements.
|
||||
//
|
||||
private static void HandleSee (MemberCore mc,
|
||||
DeclSpace ds, XmlElement see)
|
||||
{
|
||||
HandleXrefCommon (mc, ds, see);
|
||||
}
|
||||
|
||||
//
|
||||
// Handles <seealso> elements.
|
||||
//
|
||||
private static void HandleSeeAlso (MemberCore mc,
|
||||
DeclSpace ds, XmlElement seealso)
|
||||
{
|
||||
HandleXrefCommon (mc, ds, seealso);
|
||||
}
|
||||
|
||||
//
|
||||
// Handles <exception> elements.
|
||||
//
|
||||
private static void HandleException (MemberCore mc,
|
||||
DeclSpace ds, XmlElement seealso)
|
||||
{
|
||||
HandleXrefCommon (mc, ds, seealso);
|
||||
}
|
||||
|
||||
static readonly char [] wsChars =
|
||||
new char [] {' ', '\t', '\n', '\r'};
|
||||
|
||||
//
|
||||
// returns a full runtime type name from a name which might
|
||||
// be C# specific type name.
|
||||
//
|
||||
private static Type FindDocumentedType (MemberCore mc, string name, DeclSpace ds, string cref)
|
||||
{
|
||||
bool isArray = false;
|
||||
string identifier = name;
|
||||
if (name [name.Length - 1] == ']') {
|
||||
string tmp = name.Substring (0, name.Length - 1).Trim (wsChars);
|
||||
if (tmp [tmp.Length - 1] == '[') {
|
||||
identifier = tmp.Substring (0, tmp.Length - 1).Trim (wsChars);
|
||||
isArray = true;
|
||||
}
|
||||
}
|
||||
Type t = FindDocumentedTypeNonArray (mc, identifier, ds, cref);
|
||||
if (t != null && isArray)
|
||||
t = Array.CreateInstance (t, 0).GetType ();
|
||||
return t;
|
||||
}
|
||||
|
||||
private static Type FindDocumentedTypeNonArray (MemberCore mc,
|
||||
string identifier, DeclSpace ds, string cref)
|
||||
{
|
||||
switch (identifier) {
|
||||
case "int":
|
||||
return typeof (int);
|
||||
case "uint":
|
||||
return typeof (uint);
|
||||
case "short":
|
||||
return typeof (short);
|
||||
case "ushort":
|
||||
return typeof (ushort);
|
||||
case "long":
|
||||
return typeof (long);
|
||||
case "ulong":
|
||||
return typeof (ulong);
|
||||
case "float":
|
||||
return typeof (float);
|
||||
case "double":
|
||||
return typeof (double);
|
||||
case "char":
|
||||
return typeof (char);
|
||||
case "decimal":
|
||||
return typeof (decimal);
|
||||
case "byte":
|
||||
return typeof (byte);
|
||||
case "sbyte":
|
||||
return typeof (sbyte);
|
||||
case "object":
|
||||
return typeof (object);
|
||||
case "bool":
|
||||
return typeof (bool);
|
||||
case "string":
|
||||
return typeof (string);
|
||||
case "void":
|
||||
return typeof (void);
|
||||
}
|
||||
FullNamedExpression e = ds.FindType (mc.Location, identifier);
|
||||
if (e != null) {
|
||||
if (!(e is TypeExpr))
|
||||
return null;
|
||||
return ((TypeExpr) e).ResolveType (ds.EmitContext);
|
||||
}
|
||||
int index = identifier.LastIndexOf ('.');
|
||||
if (index < 0)
|
||||
return null;
|
||||
int warn;
|
||||
Type parent = FindDocumentedType (mc, identifier.Substring (0, index), ds, cref);
|
||||
if (parent == null)
|
||||
return null;
|
||||
return FindDocumentedMember (mc, parent,
|
||||
identifier.Substring (index + 1),
|
||||
Type.EmptyTypes,
|
||||
ds, out warn, cref) as Type;
|
||||
}
|
||||
|
||||
//
|
||||
// Returns a MemberInfo that is referenced in XML documentation
|
||||
// (by "see" or "seealso" elements).
|
||||
//
|
||||
private static MemberInfo FindDocumentedMember (MemberCore mc,
|
||||
Type type, string memberName, Type [] paramList,
|
||||
DeclSpace ds, out int warningType, string cref)
|
||||
{
|
||||
warningType = 0;
|
||||
MethodSignature msig = new MethodSignature (memberName, null, paramList);
|
||||
MemberInfo [] mis = type.FindMembers (
|
||||
MemberTypes.All,
|
||||
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
|
||||
MethodSignature.method_signature_filter,
|
||||
msig);
|
||||
if (mis.Length > 0)
|
||||
return mis [0];
|
||||
|
||||
if (paramList.Length == 0) {
|
||||
// search for fields/events etc.
|
||||
mis = type.FindMembers (
|
||||
MemberTypes.All,
|
||||
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance,
|
||||
Type.FilterName,
|
||||
memberName);
|
||||
return (mis.Length > 0) ? mis [0] : null;
|
||||
}
|
||||
|
||||
// search for operators (whose parameters exactly
|
||||
// matches with the list) and possibly report CS1581.
|
||||
string oper = null;
|
||||
string returnTypeName = null;
|
||||
if (memberName.StartsWith ("implicit operator ")) {
|
||||
oper = "op_Implicit";
|
||||
returnTypeName = memberName.Substring (18).Trim (wsChars);
|
||||
}
|
||||
else if (memberName.StartsWith ("explicit operator ")) {
|
||||
oper = "op_Explicit";
|
||||
returnTypeName = memberName.Substring (18).Trim (wsChars);
|
||||
}
|
||||
else if (memberName.StartsWith ("operator ")) {
|
||||
oper = memberName.Substring (9).Trim (wsChars);
|
||||
switch (oper) {
|
||||
// either unary or binary
|
||||
case "+":
|
||||
oper = paramList.Length == 2 ?
|
||||
Binary.oper_names [(int) Binary.Operator.Addition] :
|
||||
Unary.oper_names [(int) Unary.Operator.UnaryPlus];
|
||||
break;
|
||||
case "-":
|
||||
oper = paramList.Length == 2 ?
|
||||
Binary.oper_names [(int) Binary.Operator.Subtraction] :
|
||||
Unary.oper_names [(int) Unary.Operator.UnaryNegation];
|
||||
break;
|
||||
// unary
|
||||
case "!":
|
||||
oper = Unary.oper_names [(int) Unary.Operator.LogicalNot]; break;
|
||||
case "~":
|
||||
oper = Unary.oper_names [(int) Unary.Operator.OnesComplement]; break;
|
||||
|
||||
case "++":
|
||||
oper = "op_Increment"; break;
|
||||
case "--":
|
||||
oper = "op_Decrement"; break;
|
||||
case "true":
|
||||
oper = "op_True"; break;
|
||||
case "false":
|
||||
oper = "op_False"; break;
|
||||
// binary
|
||||
case "*":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.Multiply]; break;
|
||||
case "/":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.Division]; break;
|
||||
case "%":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.Modulus]; break;
|
||||
case "&":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.BitwiseAnd]; break;
|
||||
case "|":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.BitwiseOr]; break;
|
||||
case "^":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.ExclusiveOr]; break;
|
||||
case "<<":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.LeftShift]; break;
|
||||
case ">>":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.RightShift]; break;
|
||||
case "==":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.Equality]; break;
|
||||
case "!=":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.Inequality]; break;
|
||||
case "<":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.LessThan]; break;
|
||||
case ">":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.GreaterThan]; break;
|
||||
case "<=":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.LessThanOrEqual]; break;
|
||||
case ">=":
|
||||
oper = Binary.oper_names [(int) Binary.Operator.GreaterThanOrEqual]; break;
|
||||
default:
|
||||
warningType = 1584;
|
||||
Report.Warning (1020, 1, mc.Location, "Overloadable {0} operator is expected", paramList.Length == 2 ? "binary" : "unary");
|
||||
Report.Warning (1584, 1, mc.Location, "XML comment on '{0}' has syntactically incorrect attribute '{1}'", mc.GetSignatureForError (), cref);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// here we still does not consider return type (to
|
||||
// detect CS1581 or CS1002+CS1584).
|
||||
msig = new MethodSignature (oper, null, paramList);
|
||||
mis = type.FindMembers (
|
||||
MemberTypes.Method,
|
||||
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static,
|
||||
MethodSignature.method_signature_filter,
|
||||
msig);
|
||||
if (mis.Length == 0)
|
||||
return null; // CS1574
|
||||
MemberInfo mi = mis [0];
|
||||
Type expected = mi is MethodInfo ?
|
||||
((MethodInfo) mi).ReturnType :
|
||||
mi is PropertyInfo ?
|
||||
((PropertyInfo) mi).PropertyType :
|
||||
null;
|
||||
if (returnTypeName != null) {
|
||||
Type returnType = FindDocumentedType (mc, returnTypeName, ds, cref);
|
||||
if (returnType == null || returnType != expected) {
|
||||
warningType = 1581;
|
||||
Report.Warning (1581, 1, mc.Location, "Invalid return type in XML comment cref attribute '{0}'", cref);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return mis [0];
|
||||
}
|
||||
|
||||
//
|
||||
// Processes "see" or "seealso" elements.
|
||||
// Checks cref attribute.
|
||||
//
|
||||
private static void HandleXrefCommon (MemberCore mc,
|
||||
DeclSpace ds, XmlElement xref)
|
||||
{
|
||||
string cref = xref.GetAttribute ("cref").Trim (wsChars);
|
||||
// when, XmlReader, "if (cref == null)"
|
||||
if (!xref.HasAttribute ("cref"))
|
||||
return;
|
||||
if (cref.Length == 0)
|
||||
Report.Warning (1001, 1, mc.Location, "Identifier expected");
|
||||
// ... and continue until CS1584.
|
||||
|
||||
string signature; // "x:" are stripped
|
||||
string name; // method invokation "(...)" are removed
|
||||
string parameters; // method parameter list
|
||||
|
||||
// strip 'T:' 'M:' 'F:' 'P:' 'E:' etc.
|
||||
// Here, MS ignores its member kind. No idea why.
|
||||
if (cref.Length > 2 && cref [1] == ':')
|
||||
signature = cref.Substring (2).Trim (wsChars);
|
||||
else
|
||||
signature = cref;
|
||||
|
||||
int parensPos = signature.IndexOf ('(');
|
||||
if (parensPos > 0 && signature [signature.Length - 1] == ')') {
|
||||
name = signature.Substring (0, parensPos).Trim (wsChars);
|
||||
parameters = signature.Substring (parensPos + 1, signature.Length - parensPos - 2);
|
||||
}
|
||||
else {
|
||||
name = signature;
|
||||
parameters = String.Empty;
|
||||
}
|
||||
|
||||
string identifier = name;
|
||||
|
||||
if (name.Length > 0 && name [name.Length - 1] == ']') {
|
||||
string tmp = name.Substring (0, name.Length - 1).Trim (wsChars);
|
||||
if (tmp [tmp.Length - 1] == '[')
|
||||
identifier = tmp.Substring (0, tmp.Length - 1).Trim (wsChars);
|
||||
}
|
||||
|
||||
// Check if identifier is valid.
|
||||
// This check is not necessary to mark as error, but
|
||||
// csc specially reports CS1584 for wrong identifiers.
|
||||
foreach (string nameElem in identifier.Split ('.')) {
|
||||
if (!Tokenizer.IsValidIdentifier (nameElem)
|
||||
&& nameElem.IndexOf ("operator") < 0) {
|
||||
if (nameElem.EndsWith ("[]") &&
|
||||
Tokenizer.IsValidIdentifier (
|
||||
nameElem.Substring (
|
||||
0, nameElem.Length - 2)))
|
||||
continue;
|
||||
|
||||
Report.Warning (1584, 1, mc.Location, "XML comment on '{0}' has syntactically incorrect attribute '{1}'", mc.GetSignatureForError (), cref);
|
||||
xref.SetAttribute ("cref", "!:" + signature);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// check if parameters are valid
|
||||
Type [] parameterTypes = Type.EmptyTypes;
|
||||
if (parameters.Length > 0) {
|
||||
string [] paramList = parameters.Split (',');
|
||||
ArrayList plist = new ArrayList ();
|
||||
for (int i = 0; i < paramList.Length; i++) {
|
||||
string paramTypeName = paramList [i].Trim (wsChars);
|
||||
Type paramType = FindDocumentedType (mc, paramTypeName, ds, cref);
|
||||
if (paramType == null) {
|
||||
Report.Warning (1580, 1, mc.Location, "Invalid type for parameter '{0}' in XML comment cref attribute '{1}'", i + 1, cref);
|
||||
return;
|
||||
}
|
||||
plist.Add (paramType);
|
||||
}
|
||||
parameterTypes = plist.ToArray (typeof (Type)) as Type [];
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
sb.Append ('(');
|
||||
for (int i = 0; i < parameterTypes.Length; i++) {
|
||||
Type t = parameterTypes [i];
|
||||
if (sb.Length > 1)
|
||||
sb.Append (',');
|
||||
sb.Append (t.FullName.Replace ('+', '.'));
|
||||
}
|
||||
sb.Append (')');
|
||||
parameters = sb.ToString ();
|
||||
}
|
||||
|
||||
Type type = FindDocumentedType (mc, name, ds, cref);
|
||||
if (type != null) {
|
||||
xref.SetAttribute ("cref", "T:" + type.FullName.Replace ("+", "."));
|
||||
return; // a type
|
||||
}
|
||||
|
||||
// don't use identifier here. System[] is not alloed.
|
||||
if (Namespace.IsNamespace (name)) {
|
||||
xref.SetAttribute ("cref", "N:" + name);
|
||||
return; // a namespace
|
||||
}
|
||||
|
||||
int period = name.LastIndexOf ('.');
|
||||
if (period > 0) {
|
||||
string typeName = name.Substring (0, period);
|
||||
string memberName = name.Substring (period + 1);
|
||||
type = FindDocumentedType (mc, typeName, ds, cref);
|
||||
int warnResult;
|
||||
if (type != null) {
|
||||
MemberInfo mi = FindDocumentedMember (mc, type, memberName, parameterTypes, ds, out warnResult, cref);
|
||||
if (warnResult > 0)
|
||||
return;
|
||||
if (mi != null) {
|
||||
xref.SetAttribute ("cref", GetMemberDocHead (mi.MemberType) + type.FullName.Replace ("+", ".") + "." + memberName + parameters);
|
||||
return; // a member of a type
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
int warnResult;
|
||||
MemberInfo mi = FindDocumentedMember (mc, ds.TypeBuilder, name, parameterTypes, ds, out warnResult, cref);
|
||||
if (warnResult > 0)
|
||||
return;
|
||||
if (mi != null) {
|
||||
xref.SetAttribute ("cref", GetMemberDocHead (mi.MemberType) + ds.TypeBuilder.FullName.Replace ("+", ".") + "." + name);
|
||||
return; // local member name
|
||||
}
|
||||
}
|
||||
|
||||
Report.Warning (1574, 1, mc.Location, "XML comment on '{0}' has cref attribute '{1}' that could not be resolved in '{2}'.", mc.GetSignatureForError (), cref, ds.GetSignatureForError ());
|
||||
|
||||
xref.SetAttribute ("cref", "!:" + name);
|
||||
}
|
||||
|
||||
//
|
||||
// Get a prefix from member type for XML documentation (used
|
||||
// to formalize cref target name).
|
||||
//
|
||||
static string GetMemberDocHead (MemberTypes type)
|
||||
{
|
||||
switch (type) {
|
||||
case MemberTypes.Constructor:
|
||||
case MemberTypes.Method:
|
||||
return "M:";
|
||||
case MemberTypes.Event:
|
||||
return "E:";
|
||||
case MemberTypes.Field:
|
||||
return "F:";
|
||||
case MemberTypes.NestedType:
|
||||
case MemberTypes.TypeInfo:
|
||||
return "T:";
|
||||
case MemberTypes.Property:
|
||||
return "P:";
|
||||
}
|
||||
return "!:";
|
||||
}
|
||||
|
||||
// MethodCore
|
||||
|
||||
//
|
||||
// Returns a string that represents the signature for this
|
||||
// member which should be used in XML documentation.
|
||||
//
|
||||
public static string GetMethodDocCommentName (MethodCore mc, DeclSpace ds)
|
||||
{
|
||||
Parameter [] plist = mc.Parameters.FixedParameters;
|
||||
Parameter parr = mc.Parameters.ArrayParameter;
|
||||
string paramSpec = String.Empty;
|
||||
if (plist != null) {
|
||||
StringBuilder psb = new StringBuilder ();
|
||||
foreach (Parameter p in plist) {
|
||||
psb.Append (psb.Length != 0 ? "," : "(");
|
||||
psb.Append (p.ParameterType.FullName.Replace ("+", "."));
|
||||
}
|
||||
paramSpec = psb.ToString ();
|
||||
}
|
||||
if (parr != null)
|
||||
paramSpec += String.Concat (
|
||||
paramSpec == String.Empty ? "(" : ",",
|
||||
parr.ParameterType.FullName.Replace ("+", "."));
|
||||
|
||||
if (paramSpec.Length > 0)
|
||||
paramSpec += ")";
|
||||
|
||||
string name = mc is Constructor ? "#ctor" : mc.Name;
|
||||
string suffix = String.Empty;
|
||||
Operator op = mc as Operator;
|
||||
if (op != null) {
|
||||
switch (op.OperatorType) {
|
||||
case Operator.OpType.Implicit:
|
||||
case Operator.OpType.Explicit:
|
||||
suffix = "~" + op.OperatorMethodBuilder.ReturnType.FullName.Replace ('+', '.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
return String.Concat (mc.DocCommentHeader, ds.Name, ".", name, paramSpec, suffix);
|
||||
}
|
||||
|
||||
//
|
||||
// Raised (and passed an XmlElement that contains the comment)
|
||||
// when GenerateDocComment is writing documentation expectedly.
|
||||
//
|
||||
// FIXME: with a few effort, it could be done with XmlReader,
|
||||
// that means removal of DOM use.
|
||||
//
|
||||
internal static void OnMethodGenerateDocComment (
|
||||
MethodCore mc, DeclSpace ds, XmlElement el)
|
||||
{
|
||||
Hashtable paramTags = new Hashtable ();
|
||||
foreach (XmlElement pelem in el.SelectNodes ("param")) {
|
||||
int i;
|
||||
string xname = pelem.GetAttribute ("name");
|
||||
if (xname == "")
|
||||
continue; // really? but MS looks doing so
|
||||
if (xname != "" && mc.Parameters.GetParameterByName (xname, out i) == null)
|
||||
Report.Warning (1572, 2, mc.Location, "XML comment on '{0}' has a 'param' tag for '{1}', but there is no such parameter.", mc.Name, xname);
|
||||
else if (paramTags [xname] != null)
|
||||
Report.Warning (1571, 2, mc.Location, "XML comment on '{0}' has a duplicate param tag for '{1}'", mc.Name, xname);
|
||||
paramTags [xname] = xname;
|
||||
}
|
||||
Parameter [] plist = mc.Parameters.FixedParameters;
|
||||
if (plist != null) {
|
||||
foreach (Parameter p in plist) {
|
||||
if (paramTags.Count > 0 && paramTags [p.Name] == null)
|
||||
Report.Warning (1573, 4, mc.Location, "Parameter '{0}' has no matching param tag in the XML comment for '{1}' (but other parameters do)", mc.Name, p.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enum
|
||||
public static void GenerateEnumDocComment (Enum e, DeclSpace ds)
|
||||
{
|
||||
GenerateDocComment (e, ds);
|
||||
foreach (string name in e.ordered_enums) {
|
||||
MemberCore mc = e.GetDefinition (name);
|
||||
GenerateDocComment (mc, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Implements XML documentation generation.
|
||||
//
|
||||
public class Documentation
|
||||
{
|
||||
public Documentation (string xml_output_filename)
|
||||
{
|
||||
docfilename = xml_output_filename;
|
||||
XmlDocumentation = new XmlDocument ();
|
||||
XmlDocumentation.PreserveWhitespace = false;
|
||||
}
|
||||
|
||||
private string docfilename;
|
||||
|
||||
//
|
||||
// Used to create element which helps well-formedness checking.
|
||||
//
|
||||
public XmlDocument XmlDocumentation;
|
||||
|
||||
//
|
||||
// The output for XML documentation.
|
||||
//
|
||||
public XmlWriter XmlCommentOutput;
|
||||
|
||||
//
|
||||
// Stores XmlDocuments that are included in XML documentation.
|
||||
// Keys are included filenames, values are XmlDocuments.
|
||||
//
|
||||
public Hashtable StoredDocuments = new Hashtable ();
|
||||
|
||||
//
|
||||
// Stores comments on partial types (should handle uniquely).
|
||||
// Keys are PartialContainers, values are comment strings
|
||||
// (didn't use StringBuilder; usually we have just 2 or more).
|
||||
//
|
||||
public IDictionary PartialComments = new ListDictionary ();
|
||||
|
||||
//
|
||||
// Outputs XML documentation comment from tokenized comments.
|
||||
//
|
||||
public bool OutputDocComment (string asmfilename)
|
||||
{
|
||||
XmlTextWriter w = null;
|
||||
try {
|
||||
w = new XmlTextWriter (docfilename, null);
|
||||
w.Indentation = 4;
|
||||
w.Formatting = Formatting.Indented;
|
||||
w.WriteStartDocument ();
|
||||
w.WriteStartElement ("doc");
|
||||
w.WriteStartElement ("assembly");
|
||||
w.WriteStartElement ("name");
|
||||
w.WriteString (Path.ChangeExtension (asmfilename, null));
|
||||
w.WriteEndElement (); // name
|
||||
w.WriteEndElement (); // assembly
|
||||
w.WriteStartElement ("members");
|
||||
XmlCommentOutput = w;
|
||||
GenerateDocComment ();
|
||||
w.WriteFullEndElement (); // members
|
||||
w.WriteEndElement ();
|
||||
w.WriteWhitespace (Environment.NewLine);
|
||||
w.WriteEndDocument ();
|
||||
return true;
|
||||
} catch (Exception ex) {
|
||||
Report.Error (1569, "Error generating XML documentation file '{0}' ('{1}')", docfilename, ex.Message);
|
||||
return false;
|
||||
} finally {
|
||||
if (w != null)
|
||||
w.Close ();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Fixes full type name of each documented types/members up.
|
||||
//
|
||||
public void GenerateDocComment ()
|
||||
{
|
||||
TypeContainer root = RootContext.Tree.Types;
|
||||
if (root.Interfaces != null)
|
||||
foreach (Interface i in root.Interfaces)
|
||||
DocUtil.GenerateTypeDocComment (i, null);
|
||||
|
||||
if (root.Types != null)
|
||||
foreach (TypeContainer tc in root.Types)
|
||||
DocUtil.GenerateTypeDocComment (tc, null);
|
||||
|
||||
if (root.Parts != null) {
|
||||
IDictionary comments = PartialComments;
|
||||
foreach (ClassPart cp in root.Parts) {
|
||||
if (cp.DocComment == null)
|
||||
continue;
|
||||
comments [cp] = cp;
|
||||
}
|
||||
}
|
||||
|
||||
if (root.Delegates != null)
|
||||
foreach (Delegate d in root.Delegates)
|
||||
DocUtil.GenerateDocComment (d, null);
|
||||
|
||||
if (root.Enums != null)
|
||||
foreach (Enum e in root.Enums)
|
||||
DocUtil.GenerateEnumDocComment (e, null);
|
||||
|
||||
IDictionary table = new ListDictionary ();
|
||||
foreach (ClassPart cp in PartialComments.Keys) {
|
||||
table [cp.PartialContainer] += cp.DocComment;
|
||||
}
|
||||
foreach (PartialContainer pc in table.Keys) {
|
||||
pc.DocComment = table [pc] as string;
|
||||
DocUtil.GenerateDocComment (pc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-1863
File diff suppressed because it is too large.
Load diff
-3918
File diff suppressed because it is too large.
Load diff
@@ -1,811 +0,0 @@
|
||||
//
|
||||
// enum.cs: Enum handling.
|
||||
//
|
||||
// Author: Miguel de Icaza ([email protected])
|
||||
// Ravi Pratap ([email protected])
|
||||
//
|
||||
// Licensed under the terms of the GNU GPL
|
||||
//
|
||||
// (C) 2001 Ximian, Inc (http://www.ximian.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Globalization;
|
||||
using System.Xml;
|
||||
|
||||
namespace Mono.CSharp {
|
||||
|
||||
class EnumMember: MemberCore {
|
||||
static string[] attribute_targets = new string [] { "field" };
|
||||
|
||||
Enum parent_enum;
|
||||
public FieldBuilder builder;
|
||||
internal readonly Expression Type;
|
||||
|
||||
public EnumMember (Enum parent_enum, Expression expr, string name,
|
||||
Location loc, Attributes attrs):
|
||||
base (null, new MemberName (name), attrs, loc)
|
||||
{
|
||||
this.parent_enum = parent_enum;
|
||||
this.ModFlags = parent_enum.ModFlags;
|
||||
this.Type = expr;
|
||||
}
|
||||
|
||||
public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
|
||||
{
|
||||
if (a.Type == TypeManager.marshal_as_attr_type) {
|
||||
UnmanagedMarshal marshal = a.GetMarshal (this);
|
||||
if (marshal != null) {
|
||||
builder.SetMarshal (marshal);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
|
||||
a.Error_InvalidSecurityParent ();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.SetCustomAttribute (cb);
|
||||
}
|
||||
|
||||
public override AttributeTargets AttributeTargets {
|
||||
get {
|
||||
return AttributeTargets.Field;
|
||||
}
|
||||
}
|
||||
|
||||
public void DefineMember (TypeBuilder tb)
|
||||
{
|
||||
FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
|
||||
| FieldAttributes.Literal;
|
||||
|
||||
builder = tb.DefineField (Name, tb, attr);
|
||||
}
|
||||
|
||||
public override bool Define ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void Emit (EmitContext ec)
|
||||
{
|
||||
if (OptAttributes != null)
|
||||
OptAttributes.Emit (ec, this);
|
||||
|
||||
Emit ();
|
||||
}
|
||||
|
||||
public override string GetSignatureForError()
|
||||
{
|
||||
return String.Concat (parent_enum.GetSignatureForError (), '.', base.GetSignatureForError ());
|
||||
}
|
||||
|
||||
public override string[] ValidAttributeTargets {
|
||||
get {
|
||||
return attribute_targets;
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool VerifyClsCompliance(DeclSpace ds)
|
||||
{
|
||||
// Because parent is TypeContainer and we have only DeclSpace parent.
|
||||
// Parameter replacing is required
|
||||
return base.VerifyClsCompliance (parent_enum);
|
||||
}
|
||||
|
||||
// There is no base type
|
||||
protected override void VerifyObsoleteAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
public override string DocCommentHeader {
|
||||
get { return "F:"; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration container
|
||||
/// </summary>
|
||||
public class Enum : DeclSpace {
|
||||
public ArrayList ordered_enums;
|
||||
|
||||
public Expression BaseType;
|
||||
|
||||
public Type UnderlyingType;
|
||||
|
||||
Hashtable member_to_location;
|
||||
|
||||
//
|
||||
// This is for members that have been defined
|
||||
//
|
||||
Hashtable member_to_value;
|
||||
|
||||
//
|
||||
// This is used to mark members we're currently defining
|
||||
//
|
||||
Hashtable in_transit;
|
||||
|
||||
ArrayList field_builders;
|
||||
|
||||
public const int AllowedModifiers =
|
||||
Modifiers.NEW |
|
||||
Modifiers.PUBLIC |
|
||||
Modifiers.PROTECTED |
|
||||
Modifiers.INTERNAL |
|
||||
Modifiers.PRIVATE;
|
||||
|
||||
public Enum (NamespaceEntry ns, TypeContainer parent, Expression type,
|
||||
int mod_flags, MemberName name, Attributes attrs, Location l)
|
||||
: base (ns, parent, name, attrs, l)
|
||||
{
|
||||
this.BaseType = type;
|
||||
ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
|
||||
IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE, l);
|
||||
|
||||
ordered_enums = new ArrayList ();
|
||||
member_to_location = new Hashtable ();
|
||||
member_to_value = new Hashtable ();
|
||||
in_transit = new Hashtable ();
|
||||
field_builders = new ArrayList ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds @name to the enumeration space, with @expr
|
||||
/// being its definition.
|
||||
/// </summary>
|
||||
public void AddEnumMember (string name, Expression expr, Location loc, Attributes opt_attrs, string documentation)
|
||||
{
|
||||
if (name == "value__") {
|
||||
Report.Error (76, loc, "An item in an enumeration can't have an identifier `value__'");
|
||||
return;
|
||||
}
|
||||
|
||||
EnumMember em = new EnumMember (this, expr, name, loc, opt_attrs);
|
||||
em.DocComment = documentation;
|
||||
if (!AddToContainer (em, name, ""))
|
||||
return;
|
||||
|
||||
|
||||
// TODO: can be almost deleted
|
||||
ordered_enums.Add (name);
|
||||
member_to_location.Add (name, loc);
|
||||
}
|
||||
|
||||
//
|
||||
// This is used by corlib compilation: we map from our
|
||||
// type to a type that is consumable by the DefineField
|
||||
//
|
||||
Type MapToInternalType (Type t)
|
||||
{
|
||||
if (t == TypeManager.int32_type)
|
||||
return typeof (int);
|
||||
if (t == TypeManager.int64_type)
|
||||
return typeof (long);
|
||||
if (t == TypeManager.uint32_type)
|
||||
return typeof (uint);
|
||||
if (t == TypeManager.uint64_type)
|
||||
return typeof (ulong);
|
||||
if (t == TypeManager.float_type)
|
||||
return typeof (float);
|
||||
if (t == TypeManager.double_type)
|
||||
return typeof (double);
|
||||
if (t == TypeManager.byte_type)
|
||||
return typeof (byte);
|
||||
if (t == TypeManager.sbyte_type)
|
||||
return typeof (sbyte);
|
||||
if (t == TypeManager.char_type)
|
||||
return typeof (char);
|
||||
if (t == TypeManager.short_type)
|
||||
return typeof (short);
|
||||
if (t == TypeManager.ushort_type)
|
||||
return typeof (ushort);
|
||||
|
||||
throw new Exception ();
|
||||
}
|
||||
|
||||
public override TypeBuilder DefineType ()
|
||||
{
|
||||
if (TypeBuilder != null)
|
||||
return TypeBuilder;
|
||||
|
||||
TypeAttributes attr = Modifiers.TypeAttr (ModFlags, IsTopLevel);
|
||||
|
||||
ec = new EmitContext (this, this, Location, null, null, ModFlags, false);
|
||||
|
||||
attr |= TypeAttributes.Class | TypeAttributes.Sealed;
|
||||
|
||||
if (!(BaseType is TypeLookupExpression)) {
|
||||
Report.Error (1008, Location,
|
||||
"Type byte, sbyte, short, ushort, int, uint, " +
|
||||
"long, or ulong expected (got: `{0}')", BaseType);
|
||||
return null;
|
||||
}
|
||||
|
||||
TypeExpr ute = ResolveBaseTypeExpr (BaseType, false, Location);
|
||||
if (ute == null)
|
||||
return null;
|
||||
|
||||
UnderlyingType = ute.Type;
|
||||
|
||||
if (UnderlyingType != TypeManager.int32_type &&
|
||||
UnderlyingType != TypeManager.uint32_type &&
|
||||
UnderlyingType != TypeManager.int64_type &&
|
||||
UnderlyingType != TypeManager.uint64_type &&
|
||||
UnderlyingType != TypeManager.short_type &&
|
||||
UnderlyingType != TypeManager.ushort_type &&
|
||||
UnderlyingType != TypeManager.byte_type &&
|
||||
UnderlyingType != TypeManager.sbyte_type) {
|
||||
Report.Error (1008, Location,
|
||||
"Type byte, sbyte, short, ushort, int, uint, " +
|
||||
"long, or ulong expected (got: " +
|
||||
TypeManager.CSharpName (UnderlyingType) + ")");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (IsTopLevel) {
|
||||
if (TypeManager.NamespaceClash (Name, Location))
|
||||
return null;
|
||||
|
||||
ModuleBuilder builder = CodeGen.Module.Builder;
|
||||
|
||||
TypeBuilder = builder.DefineType (Name, attr, TypeManager.enum_type);
|
||||
} else {
|
||||
TypeBuilder builder = Parent.TypeBuilder;
|
||||
|
||||
TypeBuilder = builder.DefineNestedType (
|
||||
Basename, attr, TypeManager.enum_type);
|
||||
}
|
||||
|
||||
//
|
||||
// Call MapToInternalType for corlib
|
||||
//
|
||||
TypeBuilder.DefineField ("value__", UnderlyingType,
|
||||
FieldAttributes.Public | FieldAttributes.SpecialName
|
||||
| FieldAttributes.RTSpecialName);
|
||||
|
||||
TypeManager.AddEnumType (Name, TypeBuilder, this);
|
||||
|
||||
return TypeBuilder;
|
||||
}
|
||||
|
||||
bool IsValidEnumConstant (Expression e)
|
||||
{
|
||||
if (!(e is Constant))
|
||||
return false;
|
||||
|
||||
if (e is IntConstant || e is UIntConstant || e is LongConstant ||
|
||||
e is ByteConstant || e is SByteConstant || e is ShortConstant ||
|
||||
e is UShortConstant || e is ULongConstant || e is EnumConstant ||
|
||||
e is CharConstant)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
object GetNextDefaultValue (object default_value)
|
||||
{
|
||||
if (UnderlyingType == TypeManager.int32_type) {
|
||||
int i = (int) default_value;
|
||||
|
||||
if (i < System.Int32.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
} else if (UnderlyingType == TypeManager.uint32_type) {
|
||||
uint i = (uint) default_value;
|
||||
|
||||
if (i < System.UInt32.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
} else if (UnderlyingType == TypeManager.int64_type) {
|
||||
long i = (long) default_value;
|
||||
|
||||
if (i < System.Int64.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
} else if (UnderlyingType == TypeManager.uint64_type) {
|
||||
ulong i = (ulong) default_value;
|
||||
|
||||
if (i < System.UInt64.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
} else if (UnderlyingType == TypeManager.short_type) {
|
||||
short i = (short) default_value;
|
||||
|
||||
if (i < System.Int16.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
} else if (UnderlyingType == TypeManager.ushort_type) {
|
||||
ushort i = (ushort) default_value;
|
||||
|
||||
if (i < System.UInt16.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
} else if (UnderlyingType == TypeManager.byte_type) {
|
||||
byte i = (byte) default_value;
|
||||
|
||||
if (i < System.Byte.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
} else if (UnderlyingType == TypeManager.sbyte_type) {
|
||||
sbyte i = (sbyte) default_value;
|
||||
|
||||
if (i < System.SByte.MaxValue)
|
||||
return ++i;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
void Error_ConstantValueCannotBeConverted (object val, Location loc)
|
||||
{
|
||||
if (val is Constant)
|
||||
Report.Error (31, loc, "Constant value '" + ((Constant) val).AsString () +
|
||||
"' cannot be converted" +
|
||||
" to a " + TypeManager.CSharpName (UnderlyingType));
|
||||
else
|
||||
Report.Error (31, loc, "Constant value '" + val +
|
||||
"' cannot be converted" +
|
||||
" to a " + TypeManager.CSharpName (UnderlyingType));
|
||||
return;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if a standard implicit conversion exists from
|
||||
/// expr_type to target_type
|
||||
/// </summary>
|
||||
public static bool WideningConversionExists (Type expr_type, Type target_type)
|
||||
{
|
||||
expr_type = TypeManager.TypeToCoreType (expr_type);
|
||||
|
||||
if (expr_type == TypeManager.void_type)
|
||||
return false;
|
||||
|
||||
if (expr_type == target_type)
|
||||
return true;
|
||||
|
||||
// First numeric conversions
|
||||
|
||||
if (expr_type == TypeManager.sbyte_type){
|
||||
//
|
||||
// From sbyte to short, int, long, float, double.
|
||||
//
|
||||
if ((target_type == TypeManager.int32_type) ||
|
||||
(target_type == TypeManager.int64_type) ||
|
||||
(target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.short_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if (expr_type == TypeManager.byte_type){
|
||||
//
|
||||
// From byte to short, ushort, int, uint, long, ulong, float, double
|
||||
//
|
||||
if ((target_type == TypeManager.short_type) ||
|
||||
(target_type == TypeManager.ushort_type) ||
|
||||
(target_type == TypeManager.int32_type) ||
|
||||
(target_type == TypeManager.uint32_type) ||
|
||||
(target_type == TypeManager.uint64_type) ||
|
||||
(target_type == TypeManager.int64_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if (expr_type == TypeManager.short_type){
|
||||
//
|
||||
// From short to int, long, float, double
|
||||
//
|
||||
if ((target_type == TypeManager.int32_type) ||
|
||||
(target_type == TypeManager.int64_type) ||
|
||||
(target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if (expr_type == TypeManager.ushort_type){
|
||||
//
|
||||
// From ushort to int, uint, long, ulong, float, double
|
||||
//
|
||||
if ((target_type == TypeManager.uint32_type) ||
|
||||
(target_type == TypeManager.uint64_type) ||
|
||||
(target_type == TypeManager.int32_type) ||
|
||||
(target_type == TypeManager.int64_type) ||
|
||||
(target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if (expr_type == TypeManager.int32_type){
|
||||
//
|
||||
// From int to long, float, double
|
||||
//
|
||||
if ((target_type == TypeManager.int64_type) ||
|
||||
(target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if (expr_type == TypeManager.uint32_type){
|
||||
//
|
||||
// From uint to long, ulong, float, double
|
||||
//
|
||||
if ((target_type == TypeManager.int64_type) ||
|
||||
(target_type == TypeManager.uint64_type) ||
|
||||
(target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if ((expr_type == TypeManager.uint64_type) ||
|
||||
(expr_type == TypeManager.int64_type)) {
|
||||
//
|
||||
// From long/ulong to float, double
|
||||
//
|
||||
if ((target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if (expr_type == TypeManager.char_type){
|
||||
//
|
||||
// From char to ushort, int, uint, long, ulong, float, double
|
||||
//
|
||||
if ((target_type == TypeManager.ushort_type) ||
|
||||
(target_type == TypeManager.int32_type) ||
|
||||
(target_type == TypeManager.uint32_type) ||
|
||||
(target_type == TypeManager.uint64_type) ||
|
||||
(target_type == TypeManager.int64_type) ||
|
||||
(target_type == TypeManager.float_type) ||
|
||||
(target_type == TypeManager.double_type) ||
|
||||
(target_type == TypeManager.decimal_type))
|
||||
return true;
|
||||
|
||||
} else if (expr_type == TypeManager.float_type){
|
||||
//
|
||||
// float to double
|
||||
//
|
||||
if (target_type == TypeManager.double_type)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Horrible, horrible. But there is no other way we can pass the EmitContext
|
||||
// to the recursive definition triggered by the evaluation of a forward
|
||||
// expression
|
||||
//
|
||||
static EmitContext current_ec = null;
|
||||
|
||||
/// <summary>
|
||||
/// This is used to lookup the value of an enum member. If the member is undefined,
|
||||
/// it attempts to define it and return its value
|
||||
/// </summary>
|
||||
public object LookupEnumValue (EmitContext ec, string name, Location loc)
|
||||
{
|
||||
|
||||
object default_value = null;
|
||||
Constant c = null;
|
||||
|
||||
default_value = member_to_value [name];
|
||||
|
||||
if (default_value != null)
|
||||
return default_value;
|
||||
|
||||
//
|
||||
// This may happen if we're calling a method in System.Enum, for instance
|
||||
// Enum.IsDefined().
|
||||
//
|
||||
if (!defined_names.Contains (name))
|
||||
return null;
|
||||
|
||||
if (in_transit.Contains (name)) {
|
||||
Report.Error (110, loc, "The evaluation of the constant value for `" +
|
||||
Name + "." + name + "' involves a circular definition.");
|
||||
return null;
|
||||
}
|
||||
|
||||
//
|
||||
// So if the above doesn't happen, we have a member that is undefined
|
||||
// We now proceed to define it
|
||||
//
|
||||
Expression val = this [name];
|
||||
|
||||
if (val == null) {
|
||||
|
||||
int idx = ordered_enums.IndexOf (name);
|
||||
|
||||
if (idx == 0)
|
||||
default_value = 0;
|
||||
else {
|
||||
for (int i = 0; i < idx; ++i) {
|
||||
string n = (string) ordered_enums [i];
|
||||
Location m_loc = (Mono.CSharp.Location)
|
||||
member_to_location [n];
|
||||
in_transit.Add (name, true);
|
||||
|
||||
EmitContext old_ec = current_ec;
|
||||
current_ec = ec;
|
||||
|
||||
default_value = LookupEnumValue (ec, n, m_loc);
|
||||
|
||||
current_ec = old_ec;
|
||||
|
||||
in_transit.Remove (name);
|
||||
if (default_value == null)
|
||||
return null;
|
||||
}
|
||||
|
||||
default_value = GetNextDefaultValue (default_value);
|
||||
}
|
||||
|
||||
} else {
|
||||
bool old = ec.InEnumContext;
|
||||
ec.InEnumContext = true;
|
||||
in_transit.Add (name, true);
|
||||
|
||||
EmitContext old_ec = current_ec;
|
||||
current_ec = ec;
|
||||
val = val.Resolve (ec);
|
||||
current_ec = old_ec;
|
||||
|
||||
in_transit.Remove (name);
|
||||
ec.InEnumContext = old;
|
||||
|
||||
if (val == null)
|
||||
return null;
|
||||
|
||||
if (!IsValidEnumConstant (val)) {
|
||||
Report.Error (
|
||||
1008, loc,
|
||||
"Type byte, sbyte, short, ushort, int, uint, long, or " +
|
||||
"ulong expected (have: " + val + ")");
|
||||
return null;
|
||||
}
|
||||
|
||||
c = (Constant) val;
|
||||
default_value = c.GetValue ();
|
||||
|
||||
if (default_value == null) {
|
||||
Error_ConstantValueCannotBeConverted (c, loc);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (val is EnumConstant){
|
||||
Type etype = TypeManager.EnumToUnderlying (c.Type);
|
||||
|
||||
if (!WideningConversionExists (etype, UnderlyingType)){
|
||||
Convert.Error_CannotWideningConversion (
|
||||
loc, c.Type, UnderlyingType);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EnumMember em = (EnumMember) defined_names [name];
|
||||
em.DefineMember (TypeBuilder);
|
||||
|
||||
bool fail;
|
||||
default_value = TypeManager.ChangeType (default_value, UnderlyingType, out fail);
|
||||
if (fail){
|
||||
Error_ConstantValueCannotBeConverted (c, loc);
|
||||
return null;
|
||||
}
|
||||
|
||||
em.builder.SetConstant (default_value);
|
||||
field_builders.Add (em.builder);
|
||||
member_to_value [name] = default_value;
|
||||
|
||||
if (!TypeManager.RegisterFieldValue (em.builder, default_value))
|
||||
return null;
|
||||
|
||||
return default_value;
|
||||
}
|
||||
|
||||
public override bool DefineMembers (TypeContainer parent)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Define ()
|
||||
{
|
||||
//
|
||||
// If there was an error during DefineEnum, return
|
||||
//
|
||||
if (TypeBuilder == null)
|
||||
return false;
|
||||
|
||||
ec = new EmitContext (this, this, Location, null, UnderlyingType, ModFlags, false);
|
||||
|
||||
object default_value = 0;
|
||||
|
||||
|
||||
foreach (string name in ordered_enums) {
|
||||
//
|
||||
// Have we already been defined, thanks to some cross-referencing ?
|
||||
//
|
||||
if (member_to_value.Contains (name))
|
||||
continue;
|
||||
|
||||
Location loc = (Mono.CSharp.Location) member_to_location [name];
|
||||
|
||||
if (this [name] != null) {
|
||||
default_value = LookupEnumValue (ec, name, loc);
|
||||
|
||||
if (default_value == null)
|
||||
return true;
|
||||
} else {
|
||||
if (name == "value__"){
|
||||
Report.Error (76, loc, "The name `value__' is reserved for enumerations");
|
||||
return false;
|
||||
}
|
||||
|
||||
EnumMember em = (EnumMember) defined_names [name];
|
||||
|
||||
em.DefineMember (TypeBuilder);
|
||||
FieldBuilder fb = em.builder;
|
||||
|
||||
if (default_value == null) {
|
||||
Report.Error (543, loc, "Enumerator value for '" + name + "' is too large to " +
|
||||
"fit in its type");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fail;
|
||||
default_value = TypeManager.ChangeType (default_value, UnderlyingType, out fail);
|
||||
if (fail){
|
||||
Error_ConstantValueCannotBeConverted (default_value, loc);
|
||||
return false;
|
||||
}
|
||||
|
||||
fb.SetConstant (default_value);
|
||||
field_builders.Add (fb);
|
||||
member_to_value [name] = default_value;
|
||||
|
||||
if (!TypeManager.RegisterFieldValue (fb, default_value))
|
||||
return false;
|
||||
}
|
||||
|
||||
default_value = GetNextDefaultValue (default_value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Emit ()
|
||||
{
|
||||
if (OptAttributes != null) {
|
||||
OptAttributes.Emit (ec, this);
|
||||
}
|
||||
|
||||
foreach (EnumMember em in defined_names.Values) {
|
||||
em.Emit (ec);
|
||||
}
|
||||
|
||||
base.Emit ();
|
||||
}
|
||||
|
||||
void VerifyClsName ()
|
||||
{
|
||||
Hashtable ht = new Hashtable ();
|
||||
foreach (string name in ordered_enums) {
|
||||
string locase = name.ToLower (System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (!ht.Contains (locase)) {
|
||||
ht.Add (locase, defined_names [name]);
|
||||
continue;
|
||||
}
|
||||
|
||||
MemberCore conflict = (MemberCore)ht [locase];
|
||||
Report.SymbolRelatedToPreviousError (conflict);
|
||||
conflict = GetDefinition (name);
|
||||
Report.Error (3005, conflict.Location, "Identifier '{0}' differing only in case is not CLS-compliant", conflict.GetSignatureForError ());
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool VerifyClsCompliance (DeclSpace ds)
|
||||
{
|
||||
if (!base.VerifyClsCompliance (ds))
|
||||
return false;
|
||||
|
||||
VerifyClsName ();
|
||||
|
||||
if (!AttributeTester.IsClsCompliant (UnderlyingType)) {
|
||||
Report.Error (3009, Location, "'{0}': base type '{1}' is not CLS-compliant", GetSignatureForError (), TypeManager.CSharpName (UnderlyingType));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns full enum name.
|
||||
/// </summary>
|
||||
string GetEnumeratorName (string valueName)
|
||||
{
|
||||
return String.Concat (Name, ".", valueName);
|
||||
}
|
||||
|
||||
//
|
||||
// IMemberFinder
|
||||
//
|
||||
public override MemberList FindMembers (MemberTypes mt, BindingFlags bf,
|
||||
MemberFilter filter, object criteria)
|
||||
{
|
||||
ArrayList members = new ArrayList ();
|
||||
|
||||
if ((mt & MemberTypes.Field) != 0) {
|
||||
if (criteria is string){
|
||||
if (member_to_value [criteria] == null && current_ec != null){
|
||||
LookupEnumValue (current_ec, (string) criteria, Location.Null);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (FieldBuilder fb in field_builders)
|
||||
if (filter (fb, criteria) == true)
|
||||
members.Add (fb);
|
||||
}
|
||||
|
||||
return new MemberList (members);
|
||||
}
|
||||
|
||||
public override MemberCache MemberCache {
|
||||
get {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList ValueNames {
|
||||
get {
|
||||
return ordered_enums;
|
||||
}
|
||||
}
|
||||
|
||||
// indexer
|
||||
public Expression this [string name] {
|
||||
get {
|
||||
return ((EnumMember) defined_names [name]).Type;
|
||||
}
|
||||
}
|
||||
|
||||
public override AttributeTargets AttributeTargets {
|
||||
get {
|
||||
return AttributeTargets.Enum;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void VerifyObsoleteAttribute()
|
||||
{
|
||||
// UnderlyingType is never obsolete
|
||||
}
|
||||
|
||||
//
|
||||
// Generates xml doc comments (if any), and if required,
|
||||
// handle warning report.
|
||||
//
|
||||
internal override void GenerateDocComment (DeclSpace ds)
|
||||
{
|
||||
DocUtil.GenerateEnumDocComment (this, ds);
|
||||
}
|
||||
|
||||
//
|
||||
// Represents header string for documentation comment.
|
||||
//
|
||||
public override string DocCommentHeader {
|
||||
get { return "T:"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,100 +0,0 @@
|
||||
// gen-il.cs: Generates MSIL code from the CIR.Tree
|
||||
//
|
||||
// Author: Miguel de Icaza ([email protected])
|
||||
//
|
||||
// Licensed under the terms of the GNU GPL
|
||||
//
|
||||
// (C) 2001 Ximian, Inc. (http://www.ximian.com)
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using CIR;
|
||||
|
||||
namespace MSIL {
|
||||
|
||||
public class Generator : CIR.ITreeDump {
|
||||
StreamWriter o;
|
||||
int indent = 0;
|
||||
|
||||
void output (string s)
|
||||
{
|
||||
Console.Write (s);
|
||||
o.Write (s);
|
||||
}
|
||||
|
||||
void space ()
|
||||
{
|
||||
output (new String (' ', indent * 2));
|
||||
}
|
||||
|
||||
void ioutput (string s)
|
||||
{
|
||||
space ();
|
||||
output (s);
|
||||
}
|
||||
|
||||
void ioutputl (string s)
|
||||
{
|
||||
ioutput (s + "\n");
|
||||
}
|
||||
|
||||
string ClassAttributes (Class c)
|
||||
{
|
||||
// FIXME
|
||||
return "";
|
||||
}
|
||||
|
||||
string ILName (string name)
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
string ClassExtends (Class c)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void GenerateFromClass (Class c)
|
||||
{
|
||||
ioutputl (".class " + ClassAttributes (c) + " " + ILName (c.Name));
|
||||
ioutputl (ClassExtends (c));
|
||||
ioutputl ("{");
|
||||
indent++;
|
||||
|
||||
|
||||
|
||||
indent--;
|
||||
ioutputl ("}");
|
||||
}
|
||||
|
||||
void GenerateFromTypes (TypeContainer types)
|
||||
{
|
||||
if (types.Types == null)
|
||||
return;
|
||||
|
||||
foreach (DictionaryEntry de in types.Types){
|
||||
TypeContainer type = (TypeContainer) de.Value;
|
||||
|
||||
if (type is Class)
|
||||
GenerateFromClass ((Class) type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int GenerateFromTree (Tree tree, StreamWriter os)
|
||||
{
|
||||
this.o = os;
|
||||
|
||||
ioutputl (".assembly test.exe { }");
|
||||
GenerateFromTypes (tree.Types);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void ParseOptions (string options)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,988 +0,0 @@
|
||||
// cs-treedump.cs: Dumps the parsed tree to standard output
|
||||
//
|
||||
// Author: Miguel de Icaza ([email protected])
|
||||
//
|
||||
// Licensed under the terms of the GNU GPL
|
||||
//
|
||||
// (C) 2001 Ximian, Inc. (http://www.ximian.com)
|
||||
//
|
||||
// TODO:
|
||||
// Variable declarations
|
||||
// Fix precedence rules to lower the number of parenthesis.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using CIR;
|
||||
|
||||
namespace Generator {
|
||||
|
||||
public class TreeDump : CIR.ITreeDump {
|
||||
StreamWriter o;
|
||||
int indent;
|
||||
bool indented;
|
||||
bool tag_values;
|
||||
|
||||
void space ()
|
||||
{
|
||||
if (!indented)
|
||||
output (new String (' ', indent * 8));
|
||||
indented = true;
|
||||
}
|
||||
|
||||
void output (string s)
|
||||
{
|
||||
Console.Write (s);
|
||||
//o.Write (s);
|
||||
}
|
||||
|
||||
void newline ()
|
||||
{
|
||||
output ("\n");
|
||||
indented = false;
|
||||
}
|
||||
|
||||
void output_newline (string s)
|
||||
{
|
||||
output (s);
|
||||
newline ();
|
||||
}
|
||||
|
||||
void ioutput (string s)
|
||||
{
|
||||
space ();
|
||||
output (s);
|
||||
}
|
||||
|
||||
string GetParameter (Parameter par)
|
||||
{
|
||||
Parameter.Modifier f = par.ModFlags;
|
||||
string mod = "";
|
||||
|
||||
switch (f){
|
||||
case Parameter.Modifier.REF:
|
||||
mod = "ref "; break;
|
||||
case Parameter.Modifier.OUT:
|
||||
mod = "out "; break;
|
||||
case Parameter.Modifier.PARAMS:
|
||||
mod = "params "; break;
|
||||
case Parameter.Modifier.NONE:
|
||||
mod = ""; break;
|
||||
}
|
||||
return mod + par.Type + " " + par.Name;
|
||||
}
|
||||
|
||||
string GetUnary (Unary u, int paren_level)
|
||||
{
|
||||
string e;
|
||||
bool left = true;
|
||||
string s = "0_ERROR>";
|
||||
int prec = 0;
|
||||
|
||||
switch (u.Oper){
|
||||
case Unary.Operator.UnaryPlus:
|
||||
prec = 10;
|
||||
s = "+";
|
||||
break;
|
||||
|
||||
case Unary.Operator.UnaryNegation:
|
||||
prec = 10;
|
||||
s = "-";
|
||||
break;
|
||||
|
||||
case Unary.Operator.LogicalNot:
|
||||
s = "!";
|
||||
prec = 10;
|
||||
break;
|
||||
|
||||
case Unary.Operator.OnesComplement:
|
||||
prec = 10;
|
||||
s = "~";
|
||||
break;
|
||||
|
||||
case Unary.Operator.Indirection:
|
||||
prec = 10;
|
||||
s = "*";
|
||||
break;
|
||||
|
||||
case Unary.Operator.AddressOf:
|
||||
prec = 10;
|
||||
s = "&";
|
||||
break;
|
||||
|
||||
case Unary.Operator.PreIncrement:
|
||||
prec = 11;
|
||||
s = "++";
|
||||
break;
|
||||
|
||||
case Unary.Operator.PreDecrement:
|
||||
prec = 11;
|
||||
s = "--";
|
||||
break;
|
||||
|
||||
case Unary.Operator.PostDecrement:
|
||||
left = false;
|
||||
prec = 12;
|
||||
s = "--";
|
||||
break;
|
||||
|
||||
case Unary.Operator.PostIncrement:
|
||||
s = "++";
|
||||
prec = 12;
|
||||
left = false;
|
||||
break;
|
||||
}
|
||||
|
||||
e = GetExpression (u.Expr, prec);
|
||||
if (left)
|
||||
e = s + e;
|
||||
else
|
||||
e = e + s;
|
||||
|
||||
if (prec < paren_level)
|
||||
return "(" + e + ")";
|
||||
else
|
||||
return e;
|
||||
}
|
||||
|
||||
string GetBinary (Binary b, int paren_level)
|
||||
{
|
||||
string l, r;
|
||||
string op = null;
|
||||
bool assoc_left = true;
|
||||
int prec = 0;
|
||||
|
||||
switch (b.Oper){
|
||||
case Binary.Operator.Multiply:
|
||||
prec = 9;
|
||||
op = "*"; break;
|
||||
|
||||
case Binary.Operator.Division:
|
||||
prec = 9;
|
||||
op = "/"; break;
|
||||
|
||||
case Binary.Operator.Modulus:
|
||||
prec = 9;
|
||||
op = "%"; break;
|
||||
|
||||
case Binary.Operator.Addition:
|
||||
prec = 8;
|
||||
op = "+"; break;
|
||||
|
||||
case Binary.Operator.Subtraction:
|
||||
prec = 8;
|
||||
op = "-"; break;
|
||||
|
||||
case Binary.Operator.LeftShift:
|
||||
prec = 7;
|
||||
op = "<<"; break;
|
||||
|
||||
case Binary.Operator.RightShift:
|
||||
prec = 7;
|
||||
op = ">>"; break;
|
||||
|
||||
case Binary.Operator.LessThan:
|
||||
prec = 6;
|
||||
op = "<"; break;
|
||||
|
||||
case Binary.Operator.GreaterThan:
|
||||
prec = 6;
|
||||
op = ">"; break;
|
||||
|
||||
case Binary.Operator.LessThanOrEqual:
|
||||
prec = 6;
|
||||
op = "<="; break;
|
||||
|
||||
case Binary.Operator.GreaterThanOrEqual:
|
||||
prec = 6;
|
||||
op = ">="; break;
|
||||
|
||||
case Binary.Operator.Equality:
|
||||
prec = 5;
|
||||
op = "=="; break;
|
||||
|
||||
case Binary.Operator.Inequality:
|
||||
prec = 5;
|
||||
op = "!="; break;
|
||||
|
||||
case Binary.Operator.BitwiseAnd:
|
||||
prec = 4;
|
||||
op = "&"; break;
|
||||
|
||||
case Binary.Operator.BitwiseOr:
|
||||
prec = 2;
|
||||
op = "|"; break;
|
||||
|
||||
case Binary.Operator.LogicalAndAlso:
|
||||
prec = 1;
|
||||
op = "AndAlso"; break;
|
||||
|
||||
case Binary.Operator.LogicalOrElse:
|
||||
prec = 0;
|
||||
op = "OrElse"; break;
|
||||
|
||||
case Binary.Operator.ExclusiveOr:
|
||||
prec = 3;
|
||||
op = "^"; break;
|
||||
}
|
||||
|
||||
l = GetExpression (b.Left, prec - (assoc_left ? 0 : 1));
|
||||
r = GetExpression (b.Right, prec - (assoc_left ? 0 : 1));
|
||||
|
||||
if (prec <= paren_level)
|
||||
return "(" + l + " " + op + " " + r + ")";
|
||||
else
|
||||
return l + " " + op + " " + r;
|
||||
}
|
||||
|
||||
string GetCast (Cast c)
|
||||
{
|
||||
return "(" + c.TargetType + ") (" + GetExpression (c.Expr, 0) + ")";
|
||||
}
|
||||
|
||||
string GetConditional (Conditional c)
|
||||
{
|
||||
return "(" + GetExpression (c.Expr, 0) + ") ? (" +
|
||||
GetExpression (c.TrueExpr, 0) + ") : (" +
|
||||
GetExpression (c.FalseExpr, 0) + ")";
|
||||
}
|
||||
|
||||
string GetAssign (Assign a)
|
||||
{
|
||||
return GetExpression (a.Target, 0) + " = " + GetExpression (a.Source, 0);
|
||||
}
|
||||
|
||||
string GetArguments (ArrayList args)
|
||||
{
|
||||
string r = "";
|
||||
|
||||
if (args != null){
|
||||
int top = args.Count;
|
||||
|
||||
for (int i = 0; i < top; i++){
|
||||
Argument arg = (Argument) args [i];
|
||||
|
||||
switch (arg.ArgType){
|
||||
case Argument.AType.Ref:
|
||||
r += "ref "; break;
|
||||
case Argument.AType.Out:
|
||||
r += "out "; break;
|
||||
}
|
||||
r += GetExpression (arg.Expr, 0);
|
||||
|
||||
if (i+1 != top)
|
||||
r += ", ";
|
||||
}
|
||||
}
|
||||
|
||||
return "(" + r + ")";
|
||||
}
|
||||
|
||||
string GetInvocation (Invocation i)
|
||||
{
|
||||
return GetExpression (i.Expr, 0) + " " + GetArguments (i.Arguments);
|
||||
}
|
||||
|
||||
string GetNew (New n)
|
||||
{
|
||||
return "new " + n.RequestedType + GetArguments (n.Arguments);
|
||||
}
|
||||
|
||||
string GetTypeOf (TypeOf t)
|
||||
{
|
||||
return "typeof (" + t.QueriedType + ")";
|
||||
}
|
||||
|
||||
string GetSizeOf (SizeOf t)
|
||||
{
|
||||
return "sizeof (" + t.QueriedType + ")";
|
||||
}
|
||||
|
||||
string GetMemberAccess (MemberAccess m)
|
||||
{
|
||||
return GetExpression (m.Expr, 0) +
|
||||
(tag_values ? "/* member access */ . " : ".") +
|
||||
m.Identifier;
|
||||
}
|
||||
|
||||
string GetSimpleName (SimpleName n)
|
||||
{
|
||||
string s = n.Name;
|
||||
|
||||
if (s.StartsWith ("0_"))
|
||||
return "id_" + s;
|
||||
else
|
||||
return s;
|
||||
}
|
||||
|
||||
string GetProbe (Probe p)
|
||||
{
|
||||
string s = GetExpression (p.Expr, 6);
|
||||
|
||||
if (p.Oper == CIR.Probe.Operator.Is)
|
||||
s += " is ";
|
||||
else if (p.Oper == CIR.Probe.Operator.As)
|
||||
s += " as ";
|
||||
else
|
||||
s += "UNHANDLED";
|
||||
|
||||
s += p.ProbeType;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
string GetLocalVariableReference (LocalVariableReference l)
|
||||
{
|
||||
if (tag_values)
|
||||
return "/* local var: */" + l.Name;
|
||||
else
|
||||
return l.Name;
|
||||
}
|
||||
|
||||
string GetParameterReference (ParameterReference r)
|
||||
{
|
||||
if (tag_values)
|
||||
return "/* par: */ " + r.Name;
|
||||
else
|
||||
return r.Name;
|
||||
}
|
||||
|
||||
string GetExpression (Expression e, int paren_level)
|
||||
{
|
||||
if (e == null){
|
||||
return "<NULL EXPRESSION>";
|
||||
}
|
||||
|
||||
if (e is Unary)
|
||||
return GetUnary ((Unary) e, paren_level);
|
||||
else if (e is Binary)
|
||||
return GetBinary ((Binary) e, paren_level);
|
||||
else if (e is Cast)
|
||||
return GetCast ((Cast) e);
|
||||
else if (e is Conditional)
|
||||
return GetConditional ((Conditional) e);
|
||||
else if (e is SimpleName)
|
||||
return GetSimpleName ((SimpleName)e);
|
||||
else if (e is LocalVariableReference)
|
||||
return GetLocalVariableReference ((LocalVariableReference) e);
|
||||
else if (e is ParameterReference)
|
||||
return GetParameterReference ((ParameterReference) e);
|
||||
else if (e is Assign)
|
||||
return GetAssign ((Assign) e);
|
||||
else if (e is Literal)
|
||||
return e.ToString ();
|
||||
else if (e is Invocation)
|
||||
return GetInvocation ((Invocation) e);
|
||||
else if (e is New)
|
||||
return GetNew ((New) e);
|
||||
else if (e is This)
|
||||
return "this";
|
||||
else if (e is TypeOf)
|
||||
return GetTypeOf ((TypeOf) e);
|
||||
else if (e is SizeOf)
|
||||
return GetSizeOf ((SizeOf) e);
|
||||
else if (e is MemberAccess)
|
||||
return GetMemberAccess ((MemberAccess) e);
|
||||
else if (e is Probe)
|
||||
return GetProbe ((Probe) e);
|
||||
else
|
||||
return "WARNING {" + e.ToString () + "} WARNING";
|
||||
}
|
||||
|
||||
void GenerateParameters (Parameters pars)
|
||||
{
|
||||
Parameter [] pfixed;
|
||||
Parameter parray;
|
||||
|
||||
pfixed = pars.FixedParameters;
|
||||
|
||||
if (pfixed != null){
|
||||
for (int i = 0; i < pfixed.Length; i++){
|
||||
output (GetParameter (pfixed [i]));
|
||||
if (i+1 != pfixed.Length)
|
||||
output (", ");
|
||||
}
|
||||
}
|
||||
|
||||
parray = pars.ArrayParameter;
|
||||
if (parray != null){
|
||||
output (GetParameter (parray));
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateIf (If s)
|
||||
{
|
||||
bool do_indent;
|
||||
|
||||
output ("if (" + GetExpression (s.Expr, 0) + ") ");
|
||||
do_indent = !(s.TrueStatement is Block);
|
||||
if (do_indent)
|
||||
indent++;
|
||||
GenerateStatement (s.TrueStatement, true, false, false);
|
||||
if (do_indent)
|
||||
indent--;
|
||||
if (s.FalseStatement != null){
|
||||
ioutput ("else");
|
||||
newline ();
|
||||
GenerateStatement (s.FalseStatement, false, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateDo (Do s)
|
||||
{
|
||||
output ("do"); newline ();
|
||||
indent++;
|
||||
GenerateStatement (s.EmbeddedStatement, false, false, false);
|
||||
indent--;
|
||||
output (" while (" + GetExpression (s.Expr, 0) + ");");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateWhile (While s)
|
||||
{
|
||||
output ("while (" + GetExpression (s.Expr, 0) + ")");
|
||||
GenerateStatement (s.Statement, true, true, false);
|
||||
}
|
||||
|
||||
void GenerateFor (For s)
|
||||
{
|
||||
output ("for (");
|
||||
if (! (s.InitStatement == EmptyStatement.Value))
|
||||
GenerateStatement (s.InitStatement, true, true, true);
|
||||
output ("; ");
|
||||
output (GetExpression (s.Test, 0));
|
||||
output ("; ");
|
||||
if (! (s.Increment == EmptyStatement.Value))
|
||||
GenerateStatement (s.Increment, true, true, true);
|
||||
output (") ");
|
||||
GenerateStatement (s.Statement, true, true, false);
|
||||
}
|
||||
|
||||
void GenerateReturn (Return s)
|
||||
{
|
||||
output ("return " +
|
||||
(s.Expr != null ?
|
||||
GetExpression (s.Expr, 0) : "" + ";") +
|
||||
";");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateGoto (Goto s)
|
||||
{
|
||||
output ("goto " + s.Target + ";");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateThrow (Throw s)
|
||||
{
|
||||
}
|
||||
|
||||
void GenerateStatementExpression (StatementExpression s)
|
||||
{
|
||||
output (GetExpression (s.Expr, 0) + ";");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateSwitchLabels (ArrayList labels)
|
||||
{
|
||||
foreach (SwitchLabel sl in labels){
|
||||
Expression lab = sl.Label;
|
||||
|
||||
if (lab == null){
|
||||
ioutput ("default:");
|
||||
newline ();
|
||||
} else {
|
||||
ioutput ("case " + GetExpression (lab, 0) + ":");
|
||||
newline ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateSwitch (Switch s)
|
||||
{
|
||||
output_newline ("switch (" + GetExpression (s.Expr, 0) + ")");
|
||||
foreach (SwitchSection ss in s.Sections){
|
||||
GenerateSwitchLabels (ss.Labels);
|
||||
GenerateBlock (ss.Block, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateChecked (Checked c)
|
||||
{
|
||||
output ("checked ");
|
||||
GenerateBlock (c.Block, false, false);
|
||||
}
|
||||
|
||||
void GenerateUnchecked (Unchecked c)
|
||||
{
|
||||
output ("unchecked ");
|
||||
GenerateBlock (c.Block, false, false);
|
||||
}
|
||||
|
||||
void GenerateCatchClauses (ArrayList list)
|
||||
{
|
||||
foreach (Catch c in list){
|
||||
space ();
|
||||
output ("catch ");
|
||||
|
||||
if (c.Type != null){
|
||||
output ("(" + c.Type +
|
||||
(c.Name != null ? " " + c.Name : "") + ")");
|
||||
}
|
||||
GenerateBlock (c.Block, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateTry (Try t)
|
||||
{
|
||||
output ("try");
|
||||
GenerateBlock (t.Block, false, false);
|
||||
|
||||
if (t.Specific != null){
|
||||
GenerateCatchClauses (t.Specific);
|
||||
}
|
||||
|
||||
if (t.General != null){
|
||||
space ();
|
||||
output ("catch");
|
||||
GenerateBlock (t.Block, false, false);
|
||||
}
|
||||
|
||||
if (t.Fini != null){
|
||||
GenerateBlock (t.Fini, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateStatement (Statement s, bool doPlacement, bool blockFlushesLine, bool embedded)
|
||||
{
|
||||
if (s == null){
|
||||
output ("WARNING: got a null Statement");
|
||||
newline ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (doPlacement){
|
||||
if (s is Block){
|
||||
GenerateBlock ((Block) s, doPlacement, embedded);
|
||||
return;
|
||||
} else
|
||||
newline ();
|
||||
}
|
||||
|
||||
space ();
|
||||
if (s is If)
|
||||
GenerateIf ((If) s);
|
||||
else if (s is Do)
|
||||
GenerateDo ((Do) s);
|
||||
else if (s is While)
|
||||
GenerateWhile ((While) s);
|
||||
else if (s is For)
|
||||
GenerateFor ((For) s);
|
||||
else if (s is Return)
|
||||
GenerateReturn ((Return) s);
|
||||
else if (s is Goto)
|
||||
GenerateGoto ((Goto) s);
|
||||
else if (s is Throw)
|
||||
GenerateThrow ((Throw) s);
|
||||
else if (s is Break)
|
||||
output_newline ("break;");
|
||||
else if (s is Continue)
|
||||
output_newline ("continue;");
|
||||
else if (s == EmptyStatement.Value)
|
||||
output_newline ("/* empty statement */;");
|
||||
else if (s is Block)
|
||||
GenerateBlock ((Block) s, doPlacement, embedded);
|
||||
else if (s is StatementExpression)
|
||||
GenerateStatementExpression ((StatementExpression) s);
|
||||
else if (s is Switch)
|
||||
GenerateSwitch ((Switch) s);
|
||||
else if (s is Checked)
|
||||
GenerateChecked ((Checked) s);
|
||||
else if (s is Unchecked)
|
||||
GenerateUnchecked ((Unchecked) s);
|
||||
else if (s is Try)
|
||||
GenerateTry ((Try) s);
|
||||
else {
|
||||
System.Type t = s.GetType ();
|
||||
|
||||
output ("\n*****UNKNOWN Statement:" + t.ToString ());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// embedded is used only for things like the For thing
|
||||
// that has blocks but for display purposes we want to keep
|
||||
// without newlines.
|
||||
void GenerateBlock (Block b, bool doPlacement, bool embedded)
|
||||
{
|
||||
if (b.Label != null)
|
||||
output (b.Label + ":");
|
||||
|
||||
if (!b.Implicit){
|
||||
if (!doPlacement)
|
||||
space ();
|
||||
|
||||
output ("{");
|
||||
if (!embedded)
|
||||
newline ();
|
||||
indent++;
|
||||
}
|
||||
|
||||
if (b.Variables != null){
|
||||
foreach (DictionaryEntry entry in b.Variables){
|
||||
VariableInfo vi = (VariableInfo) entry.Value;
|
||||
|
||||
space ();
|
||||
output_newline (
|
||||
vi.Type + " " +
|
||||
(string) entry.Key + ";");
|
||||
}
|
||||
newline ();
|
||||
}
|
||||
|
||||
foreach (Statement s in b.Statements){
|
||||
GenerateStatement (s, false, true, false);
|
||||
}
|
||||
|
||||
if (!b.Implicit){
|
||||
indent--;
|
||||
ioutput ("}");
|
||||
if (!embedded)
|
||||
newline ();
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateMethod (Method m)
|
||||
{
|
||||
ioutput (GetModifiers (m.ModFlags) +
|
||||
m.ReturnType + " " +
|
||||
m.Name + " (");
|
||||
GenerateParameters (m.Parameters);
|
||||
output_newline (")");
|
||||
|
||||
|
||||
GenerateBlock (m.Block, false, false);
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateInterfaceMethod (InterfaceMethod imethod)
|
||||
{
|
||||
space ();
|
||||
output (imethod.IsNew ? "new " : "");
|
||||
output (imethod.ReturnType + " " + imethod.Name + " (");
|
||||
GenerateParameters (imethod.Parameters);
|
||||
output (");");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateInterfaceProperty (InterfaceProperty iprop)
|
||||
{
|
||||
space ();
|
||||
output (iprop.IsNew ? "new " : "");
|
||||
output (iprop.Type + " " + iprop.Name + " { ");
|
||||
if (iprop.HasGet) output ("get; ");
|
||||
if (iprop.HasSet) output ("set; ");
|
||||
output ("}");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateInterfaceEvent (InterfaceEvent ievent)
|
||||
{
|
||||
space ();
|
||||
output ((ievent.IsNew ? "new " : "") + "event ");
|
||||
output (ievent.Type + " " + ievent.Name + ";");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateInterfaceIndexer (InterfaceIndexer iindexer)
|
||||
{
|
||||
space ();
|
||||
output (iindexer.IsNew ? "new " : "");
|
||||
output (iindexer.Type + " this [");
|
||||
output (iindexer.Parameters + "] {");
|
||||
if (iindexer.HasGet) output ("get; ");
|
||||
if (iindexer.HasSet) output ("set; ");
|
||||
output ("}");
|
||||
newline ();
|
||||
}
|
||||
|
||||
string GenIfaceBases (Interface iface)
|
||||
{
|
||||
return GenBases (iface.Bases);
|
||||
}
|
||||
|
||||
void GenerateInterface (Interface iface)
|
||||
{
|
||||
ioutput (GetModifiers (iface.ModFlags) + "interface " +
|
||||
ClassName (iface.Name) + GenIfaceBases (iface) + " {");
|
||||
newline ();
|
||||
indent++;
|
||||
|
||||
if (iface.InterfaceMethods != null){
|
||||
foreach (DictionaryEntry de in iface.InterfaceMethods){
|
||||
InterfaceMethod method = (InterfaceMethod) de.Value;
|
||||
GenerateInterfaceMethod (method);
|
||||
}
|
||||
}
|
||||
|
||||
if (iface.InterfaceProperties != null){
|
||||
foreach (DictionaryEntry de in iface.InterfaceProperties){
|
||||
InterfaceProperty iprop = (InterfaceProperty) de.Value;
|
||||
GenerateInterfaceProperty (iprop);
|
||||
}
|
||||
}
|
||||
|
||||
if (iface.InterfaceEvents != null){
|
||||
foreach (DictionaryEntry de in iface.InterfaceEvents){
|
||||
InterfaceEvent ievent = (InterfaceEvent) de.Value;
|
||||
GenerateInterfaceEvent (ievent);
|
||||
}
|
||||
}
|
||||
|
||||
if (iface.InterfaceIndexers != null){
|
||||
foreach (DictionaryEntry de in iface.InterfaceIndexers){
|
||||
InterfaceIndexer iindexer = (InterfaceIndexer) de.Value;
|
||||
GenerateInterfaceIndexer (iindexer);
|
||||
}
|
||||
}
|
||||
indent--;
|
||||
ioutput ("}");
|
||||
newline ();
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateField (Field f)
|
||||
{
|
||||
space ();
|
||||
output (GetModifiers (f.ModFlags) +
|
||||
f.Type + " " + f.Name);
|
||||
if (f.Initializer != null){
|
||||
if (f.Initializer is Expression)
|
||||
output (" = " + GetExpression ((Expression) f.Initializer, 0));
|
||||
else
|
||||
output ("ADD SUPPORT FOR ARRAYS");
|
||||
}
|
||||
output (";");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateConstructor (Constructor c)
|
||||
{
|
||||
ConstructorInitializer init = c.Initializer;
|
||||
|
||||
space ();
|
||||
output (GetModifiers (c.ModFlags) + c.Name + " (");
|
||||
GenerateParameters (c.Parameters);
|
||||
output (")");
|
||||
|
||||
if (init != null){
|
||||
if (init is ConstructorThisInitializer)
|
||||
output (": this (");
|
||||
else
|
||||
output (": base (");
|
||||
output (GetArguments (init.Arguments));
|
||||
output (")");
|
||||
}
|
||||
newline ();
|
||||
GenerateBlock (c.Block, false, false);
|
||||
}
|
||||
|
||||
void GenerateProperty (Property prop)
|
||||
{
|
||||
space ();
|
||||
output (GetModifiers (prop.ModFlags) + prop.Type +
|
||||
" " + prop.Name + " {");
|
||||
newline ();
|
||||
indent++;
|
||||
if (prop.Get != null){
|
||||
space ();
|
||||
output ("get ");
|
||||
GenerateBlock (prop.Get, false, false);
|
||||
newline ();
|
||||
}
|
||||
|
||||
if (prop.Set != null){
|
||||
space ();
|
||||
output ("set ");
|
||||
GenerateBlock (prop.Set, false, false);
|
||||
}
|
||||
indent--;
|
||||
space ();
|
||||
output ("}");
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateEnum (CIR.Enum e)
|
||||
{
|
||||
space ();
|
||||
output ("enum " + e.Name + " {");
|
||||
newline ();
|
||||
|
||||
indent++;
|
||||
foreach (string name in e.ValueNames){
|
||||
Expression expr = e [name];
|
||||
|
||||
space ();
|
||||
|
||||
output (name);
|
||||
if (expr != null)
|
||||
output (" = " + GetExpression (expr, 0));
|
||||
|
||||
output (",");
|
||||
newline ();
|
||||
}
|
||||
indent--;
|
||||
space ();
|
||||
output_newline ("}");
|
||||
}
|
||||
|
||||
void GenerateTypeContainerData (TypeContainer tc)
|
||||
{
|
||||
if (tc.Constants != null){
|
||||
foreach (Constant c in tc.Constants){
|
||||
space ();
|
||||
|
||||
output ("const " + c.ConstantType + " " + c.Name + " = " +
|
||||
GetExpression (c.Expr, 0) + ";");
|
||||
newline ();
|
||||
}
|
||||
newline ();
|
||||
}
|
||||
|
||||
if (tc.Enums != null){
|
||||
foreach (CIR.Enum e in tc.Enums)
|
||||
GenerateEnum (e);
|
||||
}
|
||||
|
||||
if (tc.Fields != null){
|
||||
foreach (Field f in tc.Fields)
|
||||
GenerateField (f);
|
||||
newline ();
|
||||
}
|
||||
|
||||
if (tc.Constructors != null){
|
||||
foreach (Constructor c in tc.Constructors)
|
||||
GenerateConstructor (c);
|
||||
|
||||
newline ();
|
||||
|
||||
}
|
||||
|
||||
if (tc.Properties != null){
|
||||
foreach (Property prop in tc.Properties)
|
||||
GenerateProperty (prop);
|
||||
}
|
||||
|
||||
GenerateFromTypes (tc);
|
||||
|
||||
if (tc.Methods != null){
|
||||
foreach (Method m in tc.Methods){
|
||||
GenerateMethod (m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string GetModifiers (int mod_flags)
|
||||
{
|
||||
string s = "";
|
||||
|
||||
for (int i = 1; i <= (int) CIR.Modifiers.TOP; i <<= 1){
|
||||
if ((mod_flags & i) != 0)
|
||||
s += Modifiers.Name (i) + " ";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
string ClassName (string name)
|
||||
{
|
||||
return name;
|
||||
//return name.Substring (1 + name.LastIndexOf ('.'));
|
||||
}
|
||||
|
||||
string GenBases (ArrayList bases)
|
||||
{
|
||||
if (bases == null)
|
||||
return "";
|
||||
|
||||
string res = ": ";
|
||||
int top = bases.Count;
|
||||
for (int i = 0; i < bases.Count; i++){
|
||||
Type t = (Type) bases [i];
|
||||
|
||||
res += t.Name;
|
||||
if (i + 1 != top)
|
||||
res += ", ";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
string GenClassBases (Class c)
|
||||
{
|
||||
return GenBases (c.Bases);
|
||||
}
|
||||
|
||||
void GenerateFromClass (Class c)
|
||||
{
|
||||
ioutput (GetModifiers (c.ModFlags) + "class " + ClassName (c.Name) +
|
||||
" " + GenClassBases (c) + " {");
|
||||
newline ();
|
||||
indent++;
|
||||
|
||||
GenerateTypeContainerData (c);
|
||||
|
||||
indent--;
|
||||
ioutput ("}");
|
||||
newline ();
|
||||
newline ();
|
||||
}
|
||||
|
||||
void GenerateFromStruct (Struct s)
|
||||
{
|
||||
GenerateTypeContainerData (s);
|
||||
}
|
||||
|
||||
void GenerateFromTypes (TypeContainer types)
|
||||
{
|
||||
if (types.Types == null)
|
||||
return;
|
||||
|
||||
foreach (DictionaryEntry de in types.Types){
|
||||
TypeContainer type = (TypeContainer) de.Value;
|
||||
|
||||
if (type is Class)
|
||||
GenerateFromClass ((Class) type);
|
||||
if (type is Struct)
|
||||
GenerateFromStruct ((Struct) type);
|
||||
|
||||
}
|
||||
|
||||
if (types.Interfaces != null){
|
||||
foreach (DictionaryEntry de in types.Interfaces){
|
||||
Interface iface = (Interface) de.Value;
|
||||
|
||||
GenerateInterface (iface);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Dump (Tree tree, StreamWriter output)
|
||||
{
|
||||
this.o = output;
|
||||
|
||||
indent = 0;
|
||||
GenerateFromTypes (tree.Types);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void ParseOptions (string options)
|
||||
{
|
||||
if (options == "tag")
|
||||
tag_values = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-3090
File diff suppressed because it is too large.
Load diff
Loaded 100 of 4252 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user