Mercurial > hg > xemacs-beta
annotate src/dump-data.c @ 5574:d4f334808463
Support inlining labels, bytecomp.el.
lisp/ChangeLog addition:
2011-10-02 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el (byte-compile-initial-macro-environment):
Add #'declare to this, so it doesn't need to rely on
#'cl-compiling file to determine when we're byte-compiling.
Update #'labels to support declaring labels inline, as Common Lisp
requires.
* bytecomp.el (byte-compile-function-form):
Don't error if FUNCTION is quoting a non-lambda, non-symbol, just
return it.
* cl-extra.el (cl-macroexpand-all):
If a label name has been quoted, expand to the label placeholder
quoted with 'function. This allows the byte compiler to
distinguish between uses of the placeholder as data and uses in
contexts where it should be inlined.
* cl-macs.el:
* cl-macs.el (cl-do-proclaim):
When proclaming something as inline, if it is bound as a label,
don't modify the symbol's plist; instead, treat the first element
of its placeholder constant vector as a place to store compile
information.
* cl-macs.el (declare):
Leave processing declarations while compiling to the
implementation of #'declare in
byte-compile-initial-macro-environment.
tests/ChangeLog addition:
2011-10-02 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
* automated/lisp-tests.el (+):
Test #'labels and inlining.
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Sun, 02 Oct 2011 15:32:16 +0100 |
| parents | 308d34e9f07d |
| children |
| rev | line source |
|---|---|
| 2015 | 1 /* Static array to put the dumped data in and its management |
| 2 Copyright (C) 2003 Olivier Galibert | |
| 3 | |
| 4 This file is part of XEmacs. | |
| 5 | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
6 XEmacs is free software: you can redistribute it and/or modify it |
| 2015 | 7 under the terms of the GNU General Public License as published by the |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
8 Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
9 option) any later version. |
| 2015 | 10 |
| 11 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 for more details. | |
| 15 | |
| 16 You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
2367
diff
changeset
|
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 2015 | 18 |
| 19 /* Synched up with: Not in FSF. */ | |
| 20 | |
| 21 /* Mule-ized? Mwahahahahahaha */ | |
| 22 | |
| 23 /* Magic values by Larry McVoy to prevent every known compiler, including | |
| 24 an especially perverse HP-UX one, from putting the array in BSS. | |
| 25 */ | |
| 26 | |
| 27 | |
| 28 #include <config.h> | |
| 29 #include "lisp.h" | |
| 30 #include "dump-data.h" | |
| 31 | |
| 32 /* 4 bytes for the data size, 4096 for alignment */ | |
| 33 | |
| 2367 | 34 static Rawbyte dumped_data[MAX_SIZE+4096+4] = { |
| 2015 | 35 255, |
| 36 6, | |
| 37 1, | |
| 38 2, | |
| 39 3, | |
| 40 4, | |
| 41 255, | |
| 42 3, | |
| 43 9, | |
| 44 62, | |
| 45 255, | |
| 46 10, | |
| 47 4, | |
| 48 61, | |
| 49 255 | |
| 50 }; | |
| 51 | |
| 52 size_t | |
| 2367 | 53 dumped_data_size (void) |
| 2015 | 54 { |
| 2367 | 55 return dumped_data[0] | (dumped_data[1] << 8) | (dumped_data[2] << 16) | |
| 56 (dumped_data[3] << 24); | |
| 2015 | 57 } |
| 58 | |
| 59 size_t | |
| 2367 | 60 dumped_data_max_size (void) |
| 2015 | 61 { |
| 62 return MAX_SIZE; | |
| 63 } | |
| 64 | |
| 65 size_t | |
| 2367 | 66 dumped_data_align_offset (void) |
| 2015 | 67 { |
| 2367 | 68 EMACS_INT iptr = (EMACS_INT) dumped_data; |
| 2015 | 69 EMACS_INT iptr2; |
| 2367 | 70 iptr2 = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; |
| 2015 | 71 |
| 2367 | 72 return iptr2 - iptr; |
| 2015 | 73 } |
| 74 | |
| 2367 | 75 Rawbyte * |
| 76 dumped_data_get (void) | |
| 2015 | 77 { |
| 2367 | 78 EMACS_INT iptr = (EMACS_INT) dumped_data; |
| 79 iptr = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; | |
| 80 return (Rawbyte *) iptr; | |
| 2015 | 81 } |
| 82 |
