Compare commits

...

272 Commits

Author SHA1 Message Date
John Benediktsson cbdd559a75 misc/vim: some minor fixes.
- fix word definition to have dashes and other printables
- fix private to properly highlight and close the region
2020-09-29 10:04:43 -07:00
John Benediktsson ff6b75d030 misc/vim: remove TH{ syntax. 2020-09-28 16:32:33 -07:00
John Benediktsson 8fd437d877 Revert "core: Add TH{ for making assoc tuples."
This reverts commit e93d8f82bc.
2020-09-28 16:29:43 -07:00
John Benediktsson 36b2ac97ef sequences.extras: fix stack effect for filter-all-subseqs. 2020-09-28 12:30:15 -07:00
John Benediktsson f2a40f88dc bootstrap: rename layouts/layouts.factor to layouts.factor. 2020-09-26 21:29:52 -07:00
John Benediktsson fed5fd7c50 classes.tuple: speed up slots>tuple a bit.
Only get the initial values that are needed to supplement provided values.
2020-09-26 12:22:02 -07:00
John Benediktsson dc3a11bfc4 talks.tc-lisp-talk: fix typo. 2020-09-26 11:58:03 -07:00
John Benediktsson ae1890e0d7 vm: remove -console option, seems not necessary. 2020-09-26 11:46:56 -07:00
John Benediktsson 7bd1adb1c3 command-line: cleanup some documentation, change terminology slightly.
Refer to "options" instead of "VM args" or "Factor arguments".
2020-09-26 10:52:32 -07:00
John Benediktsson 5a71d98d29 compiler.tree.propagation.transforms: document not{ } as well. 2020-09-26 10:29:42 -07:00
John Benediktsson 09829bd506 compiler.tree.propagation.known-words: fix type in comment. 2020-09-26 10:29:25 -07:00
John Benediktsson 840159710e classes: update with quotation stack effects. 2020-09-26 10:28:35 -07:00
John Benediktsson dbdf4540bc hints: switch to using instance?. 2020-09-25 11:11:52 -07:00
John Benediktsson 96d7da0169 classes.builtin: remove bootstrap-type>class.
Not currently used, if adding more builtins maybe useful.
2020-09-23 19:49:35 -07:00
John Benediktsson 7789bbc79c classes.union: speed up instance? on unions of tuple-classes. 2020-09-23 19:32:15 -07:00
John Benediktsson 9f8a791a3b tools.completion: re-add chars-matching, not sure how i removed it. 2020-09-22 13:23:06 -07:00
John Benediktsson 16b144eaf5 fonts: simplify reverse-video-font 2020-09-22 13:05:17 -07:00
John Benediktsson 11f060719a benchmark.completion: fix use of name-completions. 2020-09-22 11:32:52 -07:00
John Benediktsson c200cfb8ca tools.completion: merge qualified and unqualified word completions. 2020-09-22 11:30:43 -07:00
John Benediktsson cc08ad38a4 tools.completion: allow fuzzy vocab name in qualified-matching. 2020-09-22 11:24:04 -07:00
John Benediktsson 03e62f3bc5 tools.completion: support qualified word completions. 2020-09-22 11:12:52 -07:00
John Benediktsson 979c13e156 math.complex: update test using. 2020-09-15 16:57:29 -07:00
John Benediktsson bc0789ca91 math.complex: move malformed-complex and parse-complex to math.complex.
They were incorrectly defined in syntax vocabulary.
2020-09-15 13:24:17 -07:00
John Benediktsson 115b7b62df basis: removing unnecessary method stack effects. 2020-09-09 15:00:54 -07:00
John Benediktsson f2deb82829 core: removing unnecessary method stack effects. 2020-09-09 15:00:53 -07:00
Doug Coleman f3ae869536 editors.visual-studio-code: Prefer code-insiders on macOS. 2020-09-02 19:08:56 -05:00
Doug Coleman 946bbd1597 vscode: Prefer code-insiders version if installed. 2020-09-02 17:47:08 -05:00
John Benediktsson 0b5cb42d95 cuda.libraries: remove duplicate definition of ?delete-at. 2020-09-01 13:20:49 -07:00
John Benediktsson c7959f2cb2 README: minor style tweak. 2020-08-30 16:58:41 -07:00
Doug Coleman 46be019527 assocs.extras: better implementation of rekey-new-assoc 2020-08-29 19:06:48 -05:00
Doug Coleman ce3049decd assocs.extra: Add a word to keep only certain keys in an assoc to the same assoc or to a new one. 2020-08-29 19:05:41 -05:00
Doug Coleman 87cce0ba6a build.sh: Warn if boot image url is nonexistent when falling back to master. 2020-08-29 18:22:38 -05:00
Doug Coleman 13b366e88b Revert "build.sh: Fix boot image download to current branch."
This reverts commit ec490587e7.

I didn't read the code, but the odds of a random branch working with master boot image are pretty low.
2020-08-29 18:04:19 -05:00
Doug Coleman 97d828a7f5 build.sh: recognize arm64 linux 2020-08-27 16:47:14 -05:00
Doug Coleman ec490587e7 build.sh: Fix boot image download to current branch. 2020-08-27 16:43:38 -05:00
Doug Coleman 3eb6e55ae4 db: Fix using list for walker. 2020-08-27 10:28:12 -05:00
John Benediktsson a861c4c732 assocs: improve stack effect for delete-at* and ?delete-at. 2020-08-23 13:04:48 -07:00
Alexander Iljin 00fc565111 sodium: add the "bindings" tag 2020-08-20 18:04:42 +00:00
John Benediktsson 3fdb0325ca misc: update vim syntax for ?change-at. 2020-08-17 10:14:13 -07:00
John Benediktsson 1ac7e08f59 assocs: adding ?change-at. 2020-08-17 10:08:41 -07:00
John Benediktsson 699ebc960b colors.hex: adding an invalid-hex-color error. 2020-08-17 08:04:04 -07:00
John Benediktsson ce871f99dd compiler.tree.escape-analysis.branches: no need for sift. 2020-08-14 13:43:02 -07:00
John Benediktsson 60dd083bcb misc/vim: highlight predicate classes. 2020-08-14 13:28:48 -07:00
John Benediktsson 5176b270d2 misc: more syntax tests. 2020-08-14 13:22:34 -07:00
John Benediktsson d535b62f50 vocabs.parser: faster name lookup. 2020-08-14 11:58:50 -07:00
John Benediktsson 8cc090950a tools.profiler.sampling: fixing missed rename. 2020-08-14 11:57:27 -07:00
John Benediktsson 997aaf005e Revert "Revert "vm: Allow larger 32bit code heaps.""
This reverts commit 0c0647f12c.
2020-08-14 10:47:18 -07:00
John Benediktsson 6e83e00d22 vm: rename primitive_sampling_profiler to primitive_set_profiling.
also rename the private primitives words in tools.profiler.sampling.
2020-08-14 10:40:54 -07:00
John Benediktsson e1085ffef4 vm: add some allocates memory comments. 2020-08-14 10:27:54 -07:00
John Benediktsson f21deee3df vm: change some bools from cell to bool. 2020-08-14 10:27:18 -07:00
John Benediktsson 0c0647f12c Revert "vm: Allow larger 32bit code heaps."
This reverts commit 723e0e2c1a.
2020-08-14 10:14:18 -07:00
John Benediktsson 8eb78b9212 Revert "checksums.multi: make multi-checksum an instance of checksum"
This reverts commit fbeb409979.
2020-08-13 16:09:31 -07:00
John Benediktsson 995d717277 tools.profiler.sampling: assert that profile-data is created. 2020-08-13 14:50:52 -07:00
John Benediktsson 5eaaaf06d6 xml.tests: fix USING. 2020-08-13 09:57:29 -07:00
John Benediktsson bb827a1565 furnace: require chloe-tags when loading furnace framework. 2020-08-13 09:17:43 -07:00
John Benediktsson 6bfc54b15c xml.tests: require 8-bit encodings. 2020-08-13 09:17:20 -07:00
John Benediktsson 24e1080362 alien.libraries.finder.macosx: fix test USING. 2020-08-12 15:01:51 -07:00
John Benediktsson 126f3acf63 math.bitwise: remove duplicate logic in bitfield. 2020-08-05 15:57:27 -07:00
John Benediktsson 70687a0eb3 alien.libraries.finder.linux: return fully-qualified path. 2020-08-05 10:59:01 -07:00
John Benediktsson 40aedcb346 alien.libraries.finder: cleanup, add windows tests. 2020-08-05 10:58:43 -07:00
John Benediktsson 564720281d command-line.startup: print default values for parameters. 2020-08-04 13:30:00 -07:00
Alexander Iljin 53d741a6ef L-system: rename some words to new conventions
Move the angle brackets from tuple names to their <constructors>.
2020-08-04 19:57:23 +00:00
Alexander Iljin 42855b4c44 L-system: reformat for brevity 2020-08-04 19:57:23 +00:00
Alexander Iljin 0bee527143 L-system: use named color constants 2020-08-04 19:57:23 +00:00
Alexander Iljin bfe2140148 L-system: fix compilation 2020-08-04 19:57:23 +00:00
Alexander Iljin 28bdbf8a2c L-system: resurrect from unmaintained to extra 2020-08-04 19:57:23 +00:00
Alexander Iljin 8a3d7a9d7f syntax-docs: add description of the vocab:word syntax 2020-08-01 22:32:55 +00:00
Alexander Iljin 21a1a6e7a1 syntax-docs: fix a typo 2020-08-01 22:32:55 +00:00
Alexander Iljin c496feb256 syntax-docs: remove mention of a nonexistent error 2020-08-01 22:32:55 +00:00
Alexander Iljin 5d0827ed4e totp[-docs]: accept TOTP keys in Base 32 encoding
Base 32 is the encoding, in which keys are given to Google Authenticator.
2020-07-29 17:44:07 +00:00
Alexander Iljin 92b7c32e19 totp[-docs]: change default totp-hash value to SHA-1
SHA-1 is the hash used by the Google Authenticator application, which this
vocab wanted to imitate in the first place.
2020-07-29 17:44:07 +00:00
Alexander Iljin 27d38225f4 checksums: inherit checksum-state from disposable
This allows the inherited tuples, including block-checksum-state, to be
treated like the normal disposable tuples, instead of imitating only part
of the interface.
2020-07-29 17:42:02 +00:00
Alexander Iljin fbeb409979 checksums.multi: make multi-checksum an instance of checksum
Previously it was declared to be an instance of block-checksum, which is
not necessarily the case, since the participating checksums don't have to
be block-checksums.
2020-07-29 17:42:02 +00:00
John Benediktsson 9c60c202e9 sequences.extras: move some words to assocs.extras. 2020-07-19 20:18:15 -07:00
Doug Coleman 2c488736e4 sequences.extras: Add {filter,reject}-{keys,values} 2020-07-19 10:41:51 -05:00
Alexander Iljin d1782a23cc io.pathnames-docs: fix a copy-paste error 2020-07-19 14:24:11 +00:00
Alexander Iljin 671aa228f3 math-docs: fix `times` documentation
The word `each` used to loop over integers in the past, but it does not
anymore.
2020-07-19 14:24:11 +00:00
Doug Coleman 5c3efc5cee build.sh: Fix update-boot-image help 2020-07-03 14:16:45 -05:00
Doug Coleman 464bd705f4 unix: Add more posix_spawnp and rename fork-process to call-fork.
- spawn-process will call posix_spawn()
- fork-process will call fork()

The environment variable should be used or else apps like VSCode won't open because the display isn't set.
2020-06-30 21:12:51 -05:00
John Benediktsson 3a091577ae vocabs.hierarchy: use ensure-vocab-root/prefix. 2020-06-26 20:19:24 -07:00
John Benediktsson d8f7bd067d vocabs.hierarchy: fix (disk-vocabs) on subvocabs. 2020-06-26 20:13:13 -07:00
Doug Coleman 35719d11b6 vocabs.hierarchy: Fix typo.
Closes #2314.
2020-06-26 19:17:11 -05:00
Doug Coleman 87022ea3b9 unix.linux.proc: Add cpuinfo flag "vmx flags".
Fixes #2315.

I'm not sure how this would have stopped a vocabulary from loading.

cpuinfo flags are in linux kernel repo:
 arch/x86/kernel/cpu/proc.c
2020-06-26 19:16:18 -05:00
Doug Coleman be6d8cae27 tools.dns.public: Add cloudflare dns 2020-06-23 18:20:39 -05:00
Doug Coleman b6373caa4f system-info.macosx: 11.0 2020-06-22 13:49:48 -05:00
Doug Coleman 8aa76be5ed system-info.macosx: Big Sur 2020-06-22 13:11:06 -05:00
Doug Coleman 6c02569916 build.sh: Recognize arm64 ipad/appletv. 2020-06-15 17:10:07 -05:00
John Benediktsson 0b7122350e Revert "ui.gadgets.borders: don't convert border-loc to fixnum."
This reverts commit eb7aad96c0.
2020-06-15 07:36:52 -07:00
Doug Coleman d88ed6ce63 help.cookbook: Fix typo.
Fixes #2307.
2020-06-13 08:48:00 -05:00
Doug Coleman e9ab963df9 math.bitwise: Fix example for bitfield* 2020-06-12 19:40:47 -05:00
Doug Coleman a7b058bed1 math.bitwise: I can't implement ``bitfield*`` as ``reverse bitfield``
I don't really know why. Add some tests in the docs and document bitfield*
2020-06-12 19:24:02 -05:00
Doug Coleman c87811f611 ui.backend.cocoa: fix bootstrap -- vocab does not exist. 2020-06-12 18:43:01 -05:00
Doug Coleman 8efe213273 vocabs: On use-vocab we should throw an error if the vocabulary does not exist.
Also ui.pixel-formats.private does not exist so remove that.

Fixes #2298.
2020-06-12 18:23:45 -05:00
Doug Coleman 8bc4a3f2b8 build.sh: Add OS detection for Haiku. 2020-06-10 17:05:47 +00:00
Dusk a67f2a4a05 vim/syntax: Even more fixups.
|:syn-priority| is respected now, :syn-skip & :syn-keepend are used
when appropriate, newlines don't jank stuff up, comments don't extend
match regions, numbers are much more reliable, and stack effect error
highlights return.

A feature request has even been sent to Bram.
https://github.com/vim/vim/issues/872#issuecomment-641025231
2020-06-10 03:12:30 +00:00
John Benediktsson d59cb0a672 misc/vim: change stack effects to not highlight when required
This is due to optional requirement in some forms, for example M:.
2020-06-08 12:03:54 -07:00
John Benediktsson c6f634d6a6 ui.tools.listener: re-order emacs keybinding docs. 2020-06-08 11:39:41 -07:00
John Benediktsson 0dd87cc282 misc/vim: fix NAN: highlighting, and private generic definitions. 2020-06-08 11:38:30 -07:00
John Benediktsson 17e862b801 misc: add private definitions to syntax-test file. 2020-06-08 11:21:09 -07:00
John Benediktsson f3bd6dd183 misc/vim/syntax: fix private word highlights. 2020-06-08 11:21:09 -07:00
John Benediktsson 440b56a9f0 misc/vim: dos2unix factor-docs.vim. 2020-06-08 11:21:09 -07:00
John Benediktsson d9210f738d editors.vim.generate-syntax: merge in factor.vim.fgen. 2020-06-08 11:21:09 -07:00
Doug Coleman b0b5c31821 build.sh: Change WORD size detection to use preprocessor. 2020-06-07 11:43:39 -05:00
Dusk 70cf73b032 fixup! [misc] vim/syntax: Fixups
(Thanks, @mrjbq7!) Now:
+ `CHAR:` literals highlight the whole next token.
+ `0b...` binary literals don't require invalid `+=0b` or `-=0b` syntax.
+ Float literals can't start with a `,` separator.
+ Float literals can have exponents with `,` separators.
+ `foo: ...` stack effects function as intended in general.
+ Syntax clusters might be a bit cleaner with `g:factor_syn_no_error`.
+ Error match priority should be cleaned up.
2020-06-07 05:35:13 +00:00
Dusk f70ce01b51 editors.vim.generate-syntax: Match new generation
Also update the vim/syntax README.
2020-06-06 20:32:17 -07:00
Dusk 35b8621306 [misc] vim/syntax: Fixups
(Thanks, @mrjbq7!) Now:
+ `CHAR:` literals highlight the whole next token.
+ `0b...` binary literals don't require invalid `+=0b` or `-=0b` syntax.
+ Float literals can't start with a `,` separator.
+ Float literals can have exponents with `,` separators.
+ `foo: ...` stack effects function as intended in general.
+ Syntax clusters might be a bit cleaner with `g:factor_syn_no_error`.
2020-06-06 20:31:59 -07:00
John Benediktsson 0a8cb5f2c1 misc: adding a syntax-test file. 2020-06-06 19:04:21 -07:00
John Benediktsson 61635500f2 vim: missed a char in 0b fix. 2020-06-06 19:02:21 -07:00
John Benediktsson ddf498d5ad vim: fix syntax highlighting of CHAR:, 0b, NAN:. 2020-06-06 19:00:41 -07:00
Dusk 14b1418f6a [misc] vim/syntax: Overhaul syntax highlighting
Also fixes comments in a lot more places than a few commits ago.

Syntax like the following is proper, and the comment highlighting fixes
from last commit make the incorrect highlighting here really stand out:

```factor
USE: ! only this line highlights
  kernel
```
2020-06-07 00:10:18 +00:00
Dusk 35799f8d2d [misc] vim/syntax: Avoid extra group captures 2020-06-07 00:10:18 +00:00
Dusk 686f707078 [misc] vim/syntax: Very magic patterns
From Vim's |pattern.txt|, |/\v| |/\V|:
> Use of "\v" means that after it, all ASCII characters except
> '0'-'9', 'a'-'z', 'A'-'Z' and '_' have special meaning: "very magic"

This mostly makes some upcoming syntax pattern refactoring cleaner,
though most patterns still get shorter here.
2020-06-07 00:10:18 +00:00
Dusk 11757d87fb [misc] vim/syntax: Proper comment precedence
Now comments, a lexer level feature, won't get beat out by rather normal
syntactic parser constructs like `STRUCT:`.
2020-06-07 00:10:18 +00:00
Dusk 710b54869a [misc] vim: Hygenic text width highlights
This lets Factor's overly long line highlighting avoid bleeding over
into documentation source buffers, or buffers of other non-Factor file
types entirely. Also, by taking `:2match` instead of `:match`,
clobbering of most user matches (or vice versa) can be avoided.

Unfortunately, the highlighting effects all windows in a multi-buffer
split setup, but since we can't reasonably make this a `:syntax match`
group, it'll have to do. (And this behavior isn't new.)
2020-06-07 00:10:18 +00:00
John Benediktsson 35681032d9 ui.tools.listener: change previous/next line to multiline-editor. 2020-06-06 16:47:30 -07:00
John Benediktsson 02386eebcc ui.tools.listener: document emacs-style keybindings for now. 2020-06-06 16:28:40 -07:00
John Benediktsson 4f51adf8bf Revert "ui: better support for Emacs-style key bindings."
This reverts commit 928b4c6abc.
2020-06-06 16:20:21 -07:00
John Benediktsson e446f34280 Revert "ui.gadgets.editors: adding Ctrl-u support."
This reverts commit 046d128c97.
2020-06-06 16:19:51 -07:00
John Benediktsson 5c04baf757 Revert "ui.gadgets.editors: make Ctrl-A select-all if at column 0."
This reverts commit 9287b05d57.
2020-06-06 16:19:50 -07:00
John Benediktsson 43c2ffead2 Revert "ui.tools: change Alt- to Ctrl-Shift- for tools."
This reverts commit 9c3908e003.
2020-06-06 16:19:43 -07:00
John Benediktsson a9ad206edc ui.backend.gtk: don't let input-methods steal key-presses. 2020-06-06 16:09:15 -07:00
John Benediktsson 9c3908e003 ui.tools: change Alt- to Ctrl-Shift- for tools. 2020-05-29 14:59:45 -07:00
John Benediktsson 9287b05d57 ui.gadgets.editors: make Ctrl-A select-all if at column 0. 2020-05-29 14:56:58 -07:00
John Benediktsson 09c867f747 images.pbm: use not. 2020-05-28 09:13:51 -07:00
John Benediktsson 6e23222187 logic: use not. 2020-05-28 09:13:44 -07:00
John Benediktsson 046d128c97 ui.gadgets.editors: adding Ctrl-u support. 2020-05-27 20:01:33 -07:00
John Benediktsson 928b4c6abc ui: better support for Emacs-style key bindings.
This changes a bunch of things like Ctrl-E for edit becomes Alt-E
(Cmd-E on macOS).  I think that's overall nicer, but let's play with it.
2020-05-27 19:49:30 -07:00
John Benediktsson 32fa577368 ui.gadgets.editors: can just use preedit-start>> as boolean. 2020-05-27 12:52:45 -07:00
John Benediktsson 258d7e05d6 models: cleanup docs for $slots. 2020-05-27 12:51:31 -07:00
John Benediktsson 82a34fe4b8 ui.gadgets.editors: fix off-by-one. 2020-05-27 11:50:04 -07:00
John Benediktsson c781933d6b ui.gadgets.editors: fix page-up/page-down behavior. 2020-05-27 11:43:29 -07:00
John Benediktsson f2189a32f4 ui.gadgets.editors: cleanup docs for $slots. 2020-05-27 11:43:12 -07:00
John Benediktsson c8afb239a0 ui.gestures: clean docs for $slots. 2020-05-27 11:18:20 -07:00
John Benediktsson d0a694a7fe ui.gadgets.tables: change hook>> to be called on all row-actions.
Not just when a selected-row was available and action>> was called.
Also, call the hook after the action, not before.
2020-05-27 09:59:42 -07:00
John Benediktsson 75d5a8a8f9 ui.gadgets.tables: cleanup docs for $slots. 2020-05-27 09:59:42 -07:00
John Benediktsson 3ee93ee68d lexer: cleanup docs for $slots. 2020-05-27 09:59:42 -07:00
John Benediktsson 10e19a3944 threads: cleanup docs for $slots. 2020-05-27 09:59:42 -07:00
Doug Coleman 0fb44180c0 db.sqlite.ffi: Update the sqlite3 bindings a bit. 2020-05-26 21:16:11 -05:00
John Benediktsson 130c1d8dd6 ui.gadgets.editors: fix page-up/page-down with one line. 2020-05-26 10:53:16 -07:00
John Benediktsson 8f3ce6f49a punycode: adding basic support for Punycode (RFC 3492). 2020-05-26 10:05:43 -07:00
Doug Coleman b1f29dc497 ui.backend.x11.keys: Enable numpad navigation keys for when numlock is off.
I recently got a Model F keyboard and the arrow keys weren't mapped.

To see the keycodes on Linux:

```
IN: ui.backend.x11.keys
: code>sym ( code -- name/code/f action? )
    dup . flush
    dup codes at* [ nip dup t and ] when ;
```

Also try ``USE: gesture-logger``
2020-05-22 18:18:31 -05:00
Doug Coleman 131c91b786 gesture-logger: Add as a demo! 2020-05-22 18:18:31 -05:00
John Benediktsson 02dd86a37d help.html: better tests, don't just drop the result. 2020-05-22 16:01:25 -07:00
John Benediktsson 0db8b2d012 help: some test fixes for recent behavior changes. 2020-05-22 14:41:00 -07:00
John Benediktsson ad1e4dcd11 help: change the "help" word-prop to store the actual documentation.
Change word-help to massage the $inputs and $outputs when requested.

Revert the help.lint.coverage checks to still look for $values.
2020-05-22 10:48:34 -07:00
John Benediktsson 409ce057f3 Revert "help.lint.coverage: change $values to $inputs and $outputs."
This reverts commit 61102548f4.
2020-05-22 10:47:27 -07:00
John Benediktsson 150c6a6554 help.html: adding back the link to factorcode.org.
It should probably be a cool logo or something...
2020-05-22 10:14:55 -07:00
timor 655f54af19 shell.nix: supply `wrapFactor` helper to make standalone factor binary
This adds the shell function `wrapFactor`.  This function is intended to wrap
the result of calling `build.sh` in the shell environment so it can be executed
outside of the nix shell.

Example:

```
$ nix-shell
[nix-shell] $ ./build.sh bootstrap
...build factor vm and image...
[nix-shell] $ wrapFactor .
exit
$ ./factor
```

`wrapFactor` takes the path to the factor root dir as argument, and expects the
binary `factor` and the image file `factor.image` there and uses Nixpkgs'
`makeWrapper` to wrap the `factor` executable in-place with the correct
`LD_LIBRARY_PATH`.  Afterwards, the factor executable can be called outside of
the nix-shell environment.
2020-05-22 17:11:26 +00:00
John Benediktsson 802bb073b0 help.html: better navbar on iPhone. 2020-05-22 10:03:39 -07:00
John Benediktsson e2fa0a6392 ui.backend.cocoa.views: fix jittery resize.
This could still be improved since this current approach pauses Factor
execution when the window is being resized, and it could instead
maybe detect inLiveResize or something and be smoother.
2020-05-22 08:23:20 -07:00
John Benediktsson 61102548f4 help.lint.coverage: change $values to $inputs and $outputs. 2020-05-22 08:06:36 -07:00
John Benediktsson eded28cc74 help: splitting $values into $inputs and $outputs.
This is an automatic conversion, so we can keep writing docs the way we
have been.
2020-05-21 19:47:28 -07:00
John Benediktsson 27215982e6 help.html: copy image resources to output directory.
This helps avoid needing so many different static responders in
webapps.help, and makes the documentation more self-contained.
2020-05-21 19:17:56 -07:00
John Benediktsson da8a378b38 ui.tools.error-list: changing icons from tiff to png. 2020-05-21 17:31:41 -07:00
John Benediktsson 4e498ad3b7 webapps.help: whoops. 2020-05-21 17:25:03 -07:00
John Benediktsson 2e2f1d673a help.html: support ui/tools/error-list/icons also. 2020-05-21 17:23:47 -07:00
John Benediktsson 868d970784 html.streams: move icon src mapping to help.html. 2020-05-21 17:19:36 -07:00
John Benediktsson d2114e913c syntax: allow anonymous MAIN:. 2020-05-21 14:19:43 -07:00
John Benediktsson 551e079da8 webbrowser: adding MAIN. 2020-05-20 20:26:02 -07:00
John Benediktsson 15b0f07b37 metar: add a main. 2020-05-20 19:47:47 -07:00
John Benediktsson 918436af7e websites.factorcode: update macos screenshot. 2020-05-20 11:11:57 -07:00
John Benediktsson 721cb84d2a definitions.icons: lighter open-vocab/unopen-vocab. 2020-05-20 10:46:34 -07:00
John Benediktsson e3fb39e3fe definitions.icons: prefer more isometric vocab icons. 2020-05-20 09:33:54 -07:00
John Benediktsson b277d96065 definitions.icons: fix unopen-vocab.png. 2020-05-19 21:46:46 -07:00
John Benediktsson ba80c1b6d6 definitions.icons: fix some 1x images. 2020-05-19 21:45:26 -07:00
John Benediktsson e28bcd400b help.html: use @2x images. 2020-05-19 20:53:08 -07:00
John Benediktsson 149cc270ff ui.images: fix for gl-scale-factor not being set. 2020-05-19 19:10:51 -07:00
John Benediktsson 27c9792108 ui.images: load 1x or 2x graphics. 2020-05-19 19:00:25 -07:00
timor 01a389cb68 compiler.tree.propagation.slots: remove unused word
The last use of `length-accessor?` has been removed in
8e227bc874, which obsoleted the `length` slot.
2020-05-19 10:18:15 -07:00
John Benediktsson e065e5b315 ui.theme: fix help-path-border-color to match toolbar-background. 2020-05-19 10:15:50 -07:00
John Benediktsson 1b007dd7fc Revert "ui.pens.image: allow float math."
This reverts commit 2d71fd9e22.
2020-05-19 10:00:05 -07:00
John Benediktsson fd4ddf588f ui: update more icons, including ui.tools.error-list. 2020-05-19 09:46:43 -07:00
John Benediktsson 1a3d061954 definitions.icons: minor tweak. 2020-05-19 08:25:49 -07:00
John Benediktsson 466f599d11 definitions.icons: minor tweaks. 2020-05-19 08:08:12 -07:00
John Benediktsson dc584bb671 unix.signals: bump time on tests. 2020-05-19 07:49:56 -07:00
John Benediktsson cc823e7db1 tools.profiler.sampling: bump runtime. 2020-05-19 07:46:25 -07:00
John Benediktsson 221b222f86 Revert "ui.baseline-alignment: allow floats in alignment."
This reverts commit c37e9551ad.
2020-05-19 07:41:06 -07:00
John Benediktsson 1ee94a168b ui.theme.images: minor scroll arrow fixes. 2020-05-18 21:20:10 -07:00
John Benediktsson 44003d802f ui.theme.images: minor cleanup. 2020-05-18 21:09:37 -07:00
John Benediktsson 2d71fd9e22 ui.pens.image: allow float math. 2020-05-18 20:57:03 -07:00
John Benediktsson cf5bc20b1b ui.gadgets.icons: draw icon on top of selected background. 2020-05-18 20:56:25 -07:00
John Benediktsson c37e9551ad ui.baseline-alignment: allow floats in alignment. 2020-05-18 20:53:14 -07:00
John Benediktsson c0ab4beb0c help.html: set the sizes of 2x definition icons. 2020-05-18 20:46:27 -07:00
John Benediktsson 65a3f0b6f4 ui.images: load all UI images as 2x for retina displays. 2020-05-18 20:45:58 -07:00
John Benediktsson 9635596b0b ui.gadgets.labels: only ceiling the height for now.
This might align to every other pixel on a 2x display but it fixes some
rendering artifacts with borders on subpixel boundaries.
2020-05-18 08:06:08 -07:00
John Benediktsson 06ff539b17 Revert "ui.gadgets.labels: make labels integer larger than text."
This reverts commit 0b294c5d50.
2020-05-18 08:02:06 -07:00
John Benediktsson 5d4a0b4f00 ui.gadgets.tracks: don't convert dims to floats in track-pref-dims-2. 2020-05-17 20:47:22 -07:00
John Benediktsson eb7aad96c0 ui.gadgets.borders: don't convert border-loc to fixnum. 2020-05-17 20:45:49 -07:00
John Benediktsson 0b294c5d50 ui.gadgets.labels: make labels integer larger than text. 2020-05-17 20:44:21 -07:00
John Benediktsson 65d7e3fad1 build.sh: make_boot_image can just use -run=bootstrap.image. 2020-05-17 19:55:59 -07:00
John Benediktsson d85d3e861c bootstrap.image: allow making other images in main. 2020-05-17 19:54:33 -07:00
Doug Coleman 160d1b4415 build.sh: Add self-bootstrap option. 2020-05-16 14:52:02 -05:00
Doug Coleman 75d8607643 build.sh: Only pull into current branch so we don't end up merging 2020-05-16 14:51:53 -05:00
John Benediktsson abb1755311 logic.examples.money: use lnth and leach. 2020-05-16 11:26:16 -07:00
John Benediktsson 457485dae7 ui.gadgets.labels: allow sub-pixel baseline and cap-height. 2020-05-16 11:18:11 -07:00
John Benediktsson 5f89facf9e basis/extra: replace "/ >integer" with "/i" in a few places. 2020-05-16 11:17:42 -07:00
John Benediktsson 68f6eeb3ad ui.gadgets.packs: change pack-layout not to round. 2020-05-16 11:10:18 -07:00
John Benediktsson 7b023ad59d brainfuck: inline (?) because it's not a language command. 2020-05-16 10:13:10 -07:00
John Benediktsson b3412e8930 ui.gadgets: formatting. 2020-05-16 10:07:35 -07:00
John Benediktsson 33e72abff9 ui.baseline-alignment: better stack effects. 2020-05-16 10:05:11 -07:00
John Benediktsson 824e239915 core-text: change metrics>dim not to ceiling. 2020-05-16 09:58:42 -07:00
Sergii Fesenko 4353b05cf1 io.standard-paths: fix standard-login-paths for fish shell
Fish shell automatically split variables whose name ends in "PATH" into lists,
and uses space as separator for output
Colons force fish to use standard $PATH representation
2020-05-16 07:03:23 -07:00
John Benediktsson 413cc49d3b urls: adding redacted-url to mask the password of a URL.
This is particularly useful for logging to avoid accidentally printing
passwords in web server logs.
2020-05-15 12:13:00 -07:00
Silvio Mayolo 454f192562 Added imenu tags to factor-mode for Emacs 2020-05-14 15:16:55 +00:00
Alexander Iljin 484d564b5d sodium.ffi: add the scrypt functions 2020-05-10 18:31:37 -05:00
Alexander Iljin 882050600e sodium: update copyright years in the header 2020-05-10 18:31:37 -05:00
Alexander Iljin 39ab923224 sodium: add sodium-bin>base64 2020-05-10 18:31:37 -05:00
Alexander Iljin cefb0c6e9e sodium: add sodium-base64>bin 2020-05-10 18:31:37 -05:00
John Benediktsson 05796cb497 math.bitwise: some docs cleanup. 2020-05-02 07:43:39 -07:00
Doug Coleman 94c6c8e5db math.bitwise: Add some more docs to find bits form >signed. 2020-05-01 22:49:14 -05:00
Doug Coleman c21608b0a0 math.bitwise: Add an in-order bitfield word called bitfield*. 2020-05-01 22:48:48 -05:00
John Benediktsson d27c259928 tensors: updated with the latest tensors vocab.
rebased and merged #2283
2020-04-27 20:15:33 -07:00
John Benediktsson 298bbddeb1 visionect: change http-backend to use CRLF. 2020-04-23 11:23:58 -07:00
John Benediktsson 2f8e96a6b6 visionect: handle non-post-data in visionect-post. 2020-04-21 21:18:42 -07:00
John Benediktsson eef4e17727 visionect: fix get-tclv and set-tclv. 2020-04-21 12:33:55 -07:00
John Benediktsson ecf9352a25 visionect: get http-backend working properly. 2020-04-21 12:25:37 -07:00
Steve Ayerhart e04a6e39f3 added srv parsing 2020-04-21 18:00:17 +00:00
Steve Ayerhart b9469a4acc incorrect SRV enum 2020-04-21 18:00:17 +00:00
John Benediktsson 34640fe559 bootstrap.image.upload: remove os hook from scp-name. 2020-04-21 07:05:19 -07:00
Doug Coleman bb1dbc887b bootstrap.image.upload: scp is included with windows git now.
pscp is not necessary anymore and in fact is a more effort to set up.
2020-04-21 01:18:38 -05:00
John Benediktsson 75d82c2a93 visionect: new vocab for Visionect Server Management API. 2020-04-20 14:58:51 -07:00
Doug Coleman e6b546c358 math.bitwise: Fix shift "right" to shift "left" for bitfield.
This word was really hard to understand so I reworked the docs and added another example.
2020-04-18 19:46:29 -05:00
John Benediktsson 8d4f0be202 io.files.trash: use normalize-path. 2020-04-18 09:58:40 -07:00
John Benediktsson 4cb4308a11 io.files.trash: add tags.txt for now. 2020-04-18 09:48:22 -07:00
John Benediktsson 8cf877a1cd websites.concatenative: rename cgi to gitweb. 2020-04-17 22:11:25 -07:00
Alexander Iljin a06e9cc3b2 io.files.trash.windows: convert input path to absolute in send-to-trash
The input path must be absolute, but normalize-path can't be used, because
that returns UNC path, and SHFileOperation fails on any path prefixed with
"\\?", see https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructa
Use absolute-path instead. The mixture of slashes and backslashes in the
path is tolerated, at least on Windows 10.

Add a simple unit-test.
2020-04-17 02:55:24 +00:00
Alexander Iljin 595cf81eb8 io.files.trash.windows: fix SHFILEOPSTRUCTW struct
Fix the incorrect field alignment. SHFileOperationW crashed with a memory
protection error while trying to dereference only part of the string
pointer.
2020-04-17 02:55:24 +00:00
Alexander Iljin d486e39255 ui.gadgets.charts: delete some obsolete implementation comments 2020-04-14 10:41:33 -07:00
Alexander Iljin d2b79e7185 images.viewer-docs: remove some extra spaces 2020-04-14 10:41:27 -07:00
Alexander Iljin 894571c484 compiler.tree.propagation.constraints: fix a harmless typo 2020-04-14 10:41:22 -07:00
Alexander Iljin a2978c8cb9 alien.data-docs: fix wording and punctuation in cast-array help 2020-04-14 10:41:18 -07:00
Alexander Iljin bcaba7b7c6 ui.gestures-docs: add code example to file-drop gesture documentation 2020-04-14 10:41:12 -07:00
Alexander Iljin 8af54ff2fa io.timeouts-docs: fix an example formatting
The help system highlights only the last line as the code "output", so in
this case it displayed only half of the text that way.
2020-04-14 10:41:04 -07:00
Doug Coleman 723e0e2c1a vm: Allow larger 32bit code heaps.
Code heap is artificially restricted on 32bit because PPC only had relative
jump instructions of a certain width and we punted on implementing
larger jumps.
2020-04-13 15:50:58 -07:00
John Benediktsson 5d818ccc71 mason.child: change windows code-heap from 200 to 100. 2020-04-13 13:36:10 -07:00
John Benediktsson a89474786e drive-strings: really move this time. 2020-04-13 12:53:13 -07:00
John Benediktsson 1e81dbdf17 drive-strings: move to windows.drive-strings. 2020-04-13 12:43:25 -07:00
Alexander Iljin 0b1a080bb0 sodium.secure-memory: fix a stack effect and add documentation 2020-04-13 19:33:42 +00:00
Alexander Iljin 7cda5f7e53 literals-docs: fix a copy-paste error 2020-04-13 19:33:42 +00:00
Alexander Iljin 97b07d9972 drive-strings: add a demo vocab for GetLogicalDriveStrings to extra 2020-04-13 19:33:42 +00:00
Alexander Iljin c98b49aaf4 windows.kernel32: add GetLogicalDriveStrings 2020-04-13 19:33:42 +00:00
Alexander Iljin 24eff67e60 windows.version: new vocab 2020-04-13 19:33:42 +00:00
Alexander Iljin 56ca2c3cb0 alien.data-docs: fix a typo 2020-04-13 19:33:42 +00:00
Alexander Iljin e14cd169e1 io.files.windows: rename a stack effect to make it more readable 2020-04-13 19:33:42 +00:00
John Benediktsson 61ae19d7e4 sodium: fix help-lint warnings. 2020-04-13 11:16:18 -07:00
John Benediktsson 799912b953 sodium.secure-memory: fix return type of secure-memory=. 2020-04-13 11:13:20 -07:00
John Benediktsson dc78ea1ac8 mirrors: make failures check error type. 2020-04-13 10:53:22 -07:00
Cat Stevens 90fcf7cfd5 mirrors: useless using 2020-04-13 17:52:09 +00:00
Cat Stevens 175a42bd49 mirrors: delete-at and clear-assoc are an error, fix #1757
M\ mirror delete-at and M\ mirror clear-assoc
	have been made to throw a new
	mirror-slot-removal error, because
	it doesn't make sense to remove a
	tuple slot, and this behaviour should
	not have been relied on.
2020-04-13 17:52:09 +00:00
John Benediktsson c56dd706ce io.directories: use factor for touch-file. 2020-04-13 10:28:16 -07:00
John Benediktsson f0013a8815 sodium.secure-memory: apply @AlexIljin patch for secure-memory=. 2020-04-13 09:53:39 -07:00
Alexander Iljin 87d7908063 sodium.secure-memory: new vocab 2020-04-13 15:32:00 +00:00
Alexander Iljin 7d87d1ee8a sodium.ffi: add 2020 to the copyright years 2020-04-13 15:32:00 +00:00
Alexander Iljin a2bb9f117b sodium.ffi: fix the pointer declaration syntax 2020-04-13 15:32:00 +00:00
Alexander Iljin 7a7b69c73d sodium.ffi: add the Argon2i header definitions 2020-04-13 15:32:00 +00:00
Alexander Iljin 2ba1db0362 sodium.ffi: fix the array parameters in the function declarations
Add a couple of necessary constants.
2020-04-13 15:32:00 +00:00
Alexander Iljin 142d02ce43 sodium.ffi: add some SHA hash and HMAC headers 2020-04-13 15:32:00 +00:00
Doug Coleman 1870c11c0b io.directories: The only truly cross-platform binary is Factor. 2020-04-12 13:25:24 -05:00
Doug Coleman 899c388ca7 benchmark.regex-dna: We have to read the input and output files with \n
line endings.
2020-04-12 11:23:38 -07:00
Doug Coleman 4a48297387 io: Really fix the tests. 2020-04-12 11:04:50 -05:00
Doug Coleman 32410ebca7 Windows: Handle three places where Windows line endings break the tests.
Usually we check out with Unix line endings, but if you don't set this
option, then get adds extra newlines to text files. Since there are
only three places, let's just fix them.

Fixes #2276
2020-04-12 00:05:44 -05:00
Doug Coleman 2b85b27c17 io.directories: Maybe echo is a good cross-platform test?
4a6bd57977 (commitcomment-38433000)
2020-04-11 12:48:08 -05:00
Doug Coleman 723072726e Revert "io.directories: Don't use ``touch`` because it's not default on Windows."
This reverts commit 4a6bd57977.

We don't test anything without try-process.
2020-04-11 12:39:22 -05:00
Doug Coleman 4a6bd57977 io.directories: Don't use ``touch`` because it's not default on Windows. 2020-04-10 21:44:38 -07:00
Doug Coleman cff2fde9f9 mason.child: Up the codeheap size on Windows mason tests. 2020-04-10 21:31:56 -07:00
John Benediktsson ce7cad8bd3 webbrowser: disable some tests that open windows. 2020-04-09 13:35:28 -07:00
Doug Coleman 0e5a3e2f6a openssl.libssl: Add functions to set options on SSL_CTX.
With these functions we can disable TLS1.0 and TLS1.1 someday.

Related to #2273.
2020-04-07 22:34:43 +00:00
John Benediktsson e219aad7e5 vm: lost a character somehow. 2020-04-07 11:40:04 -07:00
John Benediktsson 5c98ba78cb vm: quick fix for compilation warning. 2020-04-07 11:38:48 -07:00
Doug Coleman f5d0b8bfb0 sodium: Less stack shuffling in test. 2020-04-07 00:52:29 -05:00
John Benediktsson 2c014197c7 mason.test: change mason to load roots in order.
This will allow us to know when core depends on basis, or basis on
extra, because they should get load errors.
2020-04-03 09:44:45 -07:00
John Benediktsson 2c378da929 furnace.actions: better using. 2020-04-02 20:00:56 -07:00
531 changed files with 7616 additions and 2350 deletions

1
.gitattributes vendored
View File

@ -1,2 +1,3 @@
*.factor text eol=lf
*.html text eol=lf
misc/vim/*/*/generated.vim linguist-generated

View File

@ -38,7 +38,7 @@ build script:
* Windows: `build.cmd`
or download the correct boot image for your system from
http://downloads.factorcode.org/images/master/, put it in the factor
http://downloads.factorcode.org/images/master/, put it in the `factor`
directory and run:
* Unix: `make` and then `./factor -i=boot.unix-x86.64.image`

View File

@ -41,8 +41,8 @@ HELP: memory>byte-array
HELP: cast-array
{ $values { "byte-array" byte-array } { "c-type" "a C type" } { "array" "a specialized array" } }
{ $description "Converts a byte array into a specialized array by interpreting the bytes in as machine-specific values. Code which uses this word is unportable." }
{ $notes "The appropriate specialized array vocabulary must be loaded; otherwise, an error will be thrown. See the " { $vocab-link "specialized-arrays" } " vocabulary for details on the underlying sequence type constructed." }
{ $description "Converts a " { $link byte-array } " into a specialized array by interpreting the bytes in it as machine-specific values. Code using this word is unportable." }
{ $notes "The appropriate specialized array vocabulary must be loaded, otherwise an error will be thrown. See the " { $vocab-link "specialized-arrays" } " vocabulary for details on the underlying sequence type constructed." }
{ $errors "Throws an error if the type does not exist, the necessary specialized array vocabulary is not loaded, or the requested size is negative." } ;
HELP: malloc-array
@ -257,4 +257,4 @@ ARTICLE: "c-out-params" "Output parameters in C"
{ $code
"1234 { c-string } [ do_frob ] with-out-parameters"
}
"which would put the functions return value and error string on the stack." ;
"which would put the function's return value and error string on the stack." ;

View File

@ -1,5 +1,4 @@
USING: alien.libraries.finder sequences tools.test ;
IN: alien.libraries.finder.linux.tests
{ t } [ "libm.so" "m" find-library subseq? ] unit-test
{ t } [ "libc.so" "c" find-library subseq? ] unit-test

View File

@ -44,4 +44,4 @@ PRIVATE>
M: linux find-library*
"lib" prepend load-ldconfig-cache
[ ldconfig-matches? ] with find nip ?first ;
[ ldconfig-matches? ] with find nip ?last ;

View File

@ -1,9 +1,6 @@
USING: alien.libraries.finder
USING: alien.libraries.finder alien.libraries.finder.macosx
alien.libraries.finder.macosx.private sequences tools.test ;
IN: alien.libraries.finder.macosx
{
{
f

View File

@ -0,0 +1,3 @@
USING: alien.libraries.finder sequences tools.test ;
{ t } [ "kernel32.dll" "kernel32" find-library subseq? ] unit-test

View File

@ -166,10 +166,10 @@ ERROR: not-enough-bits n bit-reader ;
bs bytes>> subseq endian> execute( seq -- x )
n bs subseq-endian execute( bignum n bs -- bits ) ;
M: lsb0-bit-reader peek ( n bs -- bits )
M: lsb0-bit-reader peek
\ le> \ subseq>bits-le (peek) ;
M: msb0-bit-reader peek ( n bs -- bits )
M: msb0-bit-reader peek
\ be> \ subseq>bits-be (peek) ;
:: bit-writer-bytes ( writer -- bytes )

View File

@ -1,15 +1,15 @@
! Copyright (C) 2004, 2011 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs byte-arrays classes classes.builtin
classes.private classes.tuple classes.tuple.private combinators
combinators.short-circuit combinators.smart
compiler.codegen.relocation compiler.units fry generic
generic.single.private grouping hashtables hashtables.private io
io.binary io.encodings.binary io.files io.pathnames kernel
kernel.private layouts locals make math math.order namespaces
namespaces.private parser parser.notes prettyprint quotations
sequences sequences.private source-files strings system vectors
vocabs words ;
USING: accessors arrays assocs byte-arrays classes
classes.builtin classes.private classes.tuple
classes.tuple.private combinators combinators.short-circuit
combinators.smart command-line compiler.codegen.relocation
compiler.units fry generic generic.single.private grouping
hashtables hashtables.private io io.binary io.encodings.binary
io.files io.pathnames kernel kernel.private layouts locals make
math math.order namespaces namespaces.private parser
parser.notes prettyprint quotations sequences sequences.private
source-files strings system vectors vocabs words ;
IN: bootstrap.image
: arch-name ( os cpu -- arch )
@ -541,4 +541,7 @@ PRIVATE>
: make-my-image ( -- )
my-arch-name make-image ;
MAIN: make-my-image
: make-image-main ( -- )
command-line get [ make-my-image ] [ [ make-image ] each ] if-empty ;
MAIN: make-image-main

View File

@ -778,8 +778,8 @@ CONSTANT: all-primitives {
{
"tools.profiler.sampling.private"
{
{ "profiling" ( n -- ) "sampling_profiler" { object } { } f }
{ "(get-samples)" ( -- samples/f ) "get_samples" { } { object } f }
{ "set-profiling" ( n -- ) "set_profiling" { object } { } f }
{ "get-samples" ( -- samples/f ) "get_samples" { } { object } f }
}
}
{

View File

@ -47,14 +47,7 @@ SYMBOL: build-images-destination
] each
] with-file-writer ;
! Windows scp doesn't like pathnames with colons, it treats them as hostnames.
! Workaround for uploading checksums.txt created with temp-file.
! e.g. C:\Users\\Doug\\AppData\\Local\\Temp/factorcode.org\\Factor/checksums.txt
! ssh: Could not resolve hostname c: no address associated with name
HOOK: scp-name os ( -- path )
M: object scp-name "scp" ;
M: windows scp-name "pscp" ;
: scp-name ( -- path ) "scp" ;
: upload-images ( -- )
[

View File

@ -31,11 +31,11 @@ GENERIC: from ( channel -- value )
PRIVATE>
M: channel to ( value channel -- )
M: channel to
dup receivers>>
[ dup wait to ] [ nip (to) ] if-empty ;
M: channel from ( channel -- value )
M: channel from
[ self ] dip
notify senders>>
[ (from) ] unless-empty

View File

@ -60,10 +60,10 @@ C: <remote-channel> remote-channel
PRIVATE>
M: remote-channel to ( value remote-channel -- )
M: remote-channel to
[ id>> swap to-message boa ] keep send-message drop ;
M: remote-channel from ( remote-channel -- value )
M: remote-channel from
[ id>> from-message boa ] keep send-message ;
[

View File

@ -8,7 +8,7 @@ SINGLETON: adler-32
CONSTANT: adler-32-modulus 65521
M: adler-32 checksum-bytes ( bytes checksum -- value )
M: adler-32 checksum-bytes
drop
[ sum 1 + ]
[ [ dup length [1,b] <reversed> vdot ] [ length ] bi + ] bi

View File

@ -5,7 +5,7 @@ IN: checksums.bsd
SINGLETON: bsd
M: bsd checksum-bytes ( bytes checksum -- value )
M: bsd checksum-bytes
drop 0 [
[ [ -1 shift ] [ 1 bitand 15 shift ] bi + ] dip
+ 0xffff bitand

View File

@ -38,67 +38,67 @@ CONSTANT: fnv1-256-basis 0xdd268dbcaac550362d98c384c4e576ccc8b1536847b6bbb31023b
CONSTANT: fnv1-512-basis 0xb86db0b1171f4416dca1e50f309990acac87d059c90000000000000000000d21e948f68a34c192f62ea79bc942dbe7ce182036415f56e34bac982aac4afe9fd9
CONSTANT: fnv1-1024-basis 0x5f7a76758ecc4d32e56d5a591028b74b29fc4223fdada16c3bf34eda3674da9a21d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6d7eb6e73802734510a555f256cc005ae556bde8cc9c6a93b21aff4b16c71ee90b3
M: fnv1-32 checksum-bytes ( bytes checksum -- value )
M: fnv1-32 checksum-bytes
drop
fnv1-32-basis swap
[ swap fnv1-32-prime * bitxor fnv1-32-mod bitand ] each ;
M: fnv1a-32 checksum-bytes ( bytes checksum -- value )
M: fnv1a-32 checksum-bytes
drop
fnv1-32-basis swap
[ bitxor fnv1-32-prime * fnv1-32-mod bitand ] each ;
M: fnv1-64 checksum-bytes ( bytes checksum -- value )
M: fnv1-64 checksum-bytes
drop
fnv1-64-basis swap
[ swap fnv1-64-prime * bitxor fnv1-64-mod bitand ] each ;
M: fnv1a-64 checksum-bytes ( bytes checksum -- value )
M: fnv1a-64 checksum-bytes
drop
fnv1-64-basis swap
[ bitxor fnv1-64-prime * fnv1-64-mod bitand ] each ;
M: fnv1-128 checksum-bytes ( bytes checksum -- value )
M: fnv1-128 checksum-bytes
drop
fnv1-128-basis swap
[ swap fnv1-128-prime * bitxor fnv1-128-mod bitand ] each ;
M: fnv1a-128 checksum-bytes ( bytes checksum -- value )
M: fnv1a-128 checksum-bytes
drop
fnv1-128-basis swap
[ bitxor fnv1-128-prime * fnv1-128-mod bitand ] each ;
M: fnv1-256 checksum-bytes ( bytes checksum -- value )
M: fnv1-256 checksum-bytes
drop
fnv1-256-basis swap
[ swap fnv1-256-prime * bitxor fnv1-256-mod bitand ] each ;
M: fnv1a-256 checksum-bytes ( bytes checksum -- value )
M: fnv1a-256 checksum-bytes
drop
fnv1-256-basis swap
[ bitxor fnv1-256-prime * fnv1-256-mod bitand ] each ;
M: fnv1-512 checksum-bytes ( bytes checksum -- value )
M: fnv1-512 checksum-bytes
drop
fnv1-512-basis swap
[ swap fnv1-512-prime * bitxor fnv1-512-mod bitand ] each ;
M: fnv1a-512 checksum-bytes ( bytes checksum -- value )
M: fnv1a-512 checksum-bytes
drop
fnv1-512-basis swap
[ bitxor fnv1-512-prime * fnv1-512-mod bitand ] each ;
M: fnv1-1024 checksum-bytes ( bytes checksum -- value )
M: fnv1-1024 checksum-bytes
drop
fnv1-1024-basis swap
[ swap fnv1-1024-prime * bitxor fnv1-1024-mod bitand ] each ;
M: fnv1a-1024 checksum-bytes ( bytes checksum -- value )
M: fnv1a-1024 checksum-bytes
drop
fnv1-1024-basis swap
[ bitxor fnv1-1024-prime * fnv1-1024-mod bitand ] each ;

View File

@ -47,7 +47,7 @@ CONSTANT: n 0xe6546b64
PRIVATE>
M: murmur3-32 checksum-bytes ( bytes checksum -- value )
M: murmur3-32 checksum-bytes
seed>> 32 bits main-loop end-case avalanche ;
INSTANCE: murmur3-32 checksum

View File

@ -38,13 +38,13 @@ M: evp-md-context dispose*
: set-digest ( name ctx -- )
handle>> swap digest-named f EVP_DigestInit_ex ssl-error ;
M: openssl-checksum initialize-checksum-state ( checksum -- evp-md-context )
M: openssl-checksum initialize-checksum-state
maybe-init-ssl name>> <evp-md-context> [ set-digest ] keep ;
M: evp-md-context add-checksum-bytes ( ctx bytes -- ctx' )
M: evp-md-context add-checksum-bytes
[ dup handle>> ] dip dup length EVP_DigestUpdate ssl-error ;
M: evp-md-context get-checksum ( ctx -- value )
M: evp-md-context get-checksum
handle>>
{ { int EVP_MAX_MD_SIZE } int }
[ EVP_DigestFinal_ex ssl-error ] with-out-parameters

View File

@ -116,7 +116,7 @@ M: struct-mirror delete-at
M: struct-mirror clear-assoc
object>> reset-struct-slots ;
M: struct-mirror >alist ( mirror -- alist )
M: struct-mirror >alist
object>> [
[ drop "underlying" ] [ >c-ptr ] bi 2array 1array
] [

View File

@ -7,7 +7,7 @@ TUPLE: gray < color { gray read-only } { alpha read-only } ;
C: <gray> gray
M: gray >rgba ( gray -- rgba )
M: gray >rgba
[ gray>> dup dup ] [ alpha>> ] bi <rgba> ; inline
M: gray red>> gray>> ;

View File

@ -6,12 +6,15 @@ lexer math math.parser sequences ;
IN: colors.hex
ERROR: invalid-hex-color hex ;
: hex>rgba ( hex -- rgba )
dup length {
{ 6 [ 2 group [ hex> 255 /f ] map first3 1.0 ] }
{ 8 [ 2 group [ hex> 255 /f ] map first4 ] }
{ 3 [ [ digit> 15 /f ] { } map-as first3 1.0 ] }
{ 4 [ [ digit> 15 /f ] { } map-as first4 ] }
[ drop invalid-hex-color ]
} case <rgba> ;
: rgba>hex ( rgba -- hex )

View File

@ -29,7 +29,7 @@ C: <hsva> hsva
PRIVATE>
M: hsva >rgba ( hsva -- rgba )
M: hsva >rgba
[
dup Hi
{

View File

@ -61,7 +61,7 @@ C: <ryba> ryba
PRIVATE>
M: ryba >rgba ( ryba -- rgba )
M: ryba >rgba
[
[ red>> ] [ yellow>> ] [ blue>> ] tri
[ ryb>rgb ] normalized

View File

@ -1,11 +1,11 @@
USING: help.markup help.syntax strings system vocabs vocabs.loader ;
USING: help.markup help.syntax io.pathnames strings system vocabs vocabs.loader ;
IN: command-line
HELP: run-bootstrap-init
{ $description "Runs the bootstrap initialization file in the user's home directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-boot-rc" } "." } ;
{ $description "Runs the bootstrap initialization file in the user's " { $link home } " directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-boot-rc" } "." } ;
HELP: run-user-init
{ $description "Runs the startup initialization file in the user's home directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-rc" } "." } ;
{ $description "Runs the startup initialization file in the user's " { $link home } " directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-rc" } "." } ;
HELP: load-vocab-roots
{ $description "Loads the newline-separated list of additional vocabulary roots from the file named " { $snippet ".factor-roots" } "." } ;
@ -117,7 +117,7 @@ $nl
{ $subsections load-vocab-roots } ;
ARTICLE: "rc-files" "Running code on startup"
"Factor looks for three optional files in your home directory."
"Factor looks for three optional files in the user's " { $link home } " directory."
{ $subsections
".factor-boot-rc"
".factor-rc"
@ -125,12 +125,6 @@ ARTICLE: "rc-files" "Running code on startup"
}
"The " { $snippet "-no-user-init" } " command line switch will inhibit loading running of these files."
$nl
"If you are unsure where the files should be located, evaluate the following code:"
{ $code
"USE: command-line"
"\".factor-rc\" rc-path print"
"\".factor-boot-rc\" rc-path print"
}
"Here is an example " { $snippet ".factor-boot-rc" } " which sets up your developer name:"
{ $code
"USING: tools.scaffold namespaces ;"
@ -139,8 +133,8 @@ $nl
ARTICLE: "command-line" "Command line arguments"
"Factor command line usage:"
{ $code "factor [VM args...] [script] [args...]" }
"Zero or more VM arguments can be passed in, followed by an optional script file name. If the script file is specified, it will be run on startup using " { $link run-script } ". Any arguments after the script file are stored in the following variable, with no further processing by Factor itself:"
{ $code "factor [options] [script] [arguments]" }
"Zero or more options can be passed in, followed by an optional script file name. If the script file is specified, it will be run on startup using " { $link run-script } ". Any arguments after the script file are stored in the following variable, with no further processing by Factor itself:"
{ $subsections command-line }
"Instead of running a script, it is also possible to run a vocabulary; this invokes the vocabulary's " { $link POSTPONE: MAIN: } " word:"
{ $code "factor [system switches...] -run=<vocab name>" }

View File

@ -24,9 +24,6 @@ SYMBOL: command-line
: (command-line) ( -- args )
OBJ-ARGS special-object sift [ alien>native-string ] map ;
: rc-path ( name -- path )
home prepend-path ;
: try-user-init ( file -- )
"user-init" get swap '[
_ [ ?run-file ] [
@ -37,14 +34,14 @@ SYMBOL: command-line
] when ;
: run-bootstrap-init ( -- )
".factor-boot-rc" rc-path try-user-init ;
"~/.factor-boot-rc" try-user-init ;
: run-user-init ( -- )
".factor-rc" rc-path try-user-init ;
"~/.factor-rc" try-user-init ;
: load-vocab-roots ( -- )
"user-init" get [
".factor-roots" rc-path dup exists? [
"~/.factor-roots" dup exists? [
utf8 file-lines harvest [ add-vocab-root ] each
] [ drop ] if
"roots" get [

View File

@ -1,7 +1,7 @@
! Copyright (C) 2011 Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators command-line eval io io.pathnames kernel
namespaces system vocabs.loader ;
layouts math math.parser namespaces system vocabs.loader ;
IN: command-line.startup
: help? ( -- ? )
@ -9,35 +9,33 @@ IN: command-line.startup
os windows? [ script get "/?" = or ] when ;
: help. ( -- )
"Usage: " write vm-path file-name write " [Factor arguments] [script] [script arguments]
"Usage: " write vm-path file-name write " [options] [script] [arguments]
Factor arguments:
Options:
-help print this message and exit
-version print the Factor version and exit
-i=<image> load Factor image file <image> (default " write vm-path file-stem write ".image)
-i=<image> load Factor image file <image> [" write vm-path file-stem write ".image]
-run=<vocab> run the MAIN: entry point of <vocab>
-run=listener run terminal listener
-run=ui.tools run Factor development UI
-e=<code> evaluate <code>
-no-user-init suppress loading of .factor-rc
-datastack=<int> datastack size in KiB
-retainstack=<int> retainstack size in KiB
-callstack=<int> callstack size in KiB
-callbacks=<int> callback heap size in KiB
-young=<int> young gc generation 0 size in MiB
-aging=<int> aging gc generation 1 size in MiB
-tenured=<int> tenured gc generation 2 size in MiB
-codeheap=<int> codeheap size in MiB
-pic=<int> max pic size
-datastack=<int> datastack size in KiB [" write cell 32 * number>string write "]
-retainstack=<int> retainstack size in KiB [" write cell 32 * number>string write "]
-callstack=<int> callstack size in KiB [" write cell cpu ppc? 256 128 ? * number>string write "]
-callbacks=<int> callback heap size in KiB [256]
-young=<int> young gc generation 0 size in MiB [" write cell 4 / number>string write "]
-aging=<int> aging gc generation 1 size in MiB [" write cell 2 / number>string write "]
-tenured=<int> tenured gc generation 2 size in MiB [" write cell 24 * number>string write "]
-codeheap=<int> codeheap size in MiB [64]
-pic=<int> max pic size [3]
-fep enter fep mode immediately
-no-signals turn off OS signal handling
-console open console if possible
-roots=<paths> a list of \"" write os windows? ";" ":" ? write "\"-delimited extra vocab roots
-roots=<paths> '" write os windows? ";" ":" ? write "'-separated list of extra vocab root directories
Enter
\"command-line\" help
from within Factor for more information.
" write ;
: version? ( -- ? ) "version" get ;

View File

@ -95,7 +95,7 @@ IN: compiler.cfg.builder.alien
[ stack-params get [ caller-stack-cleanup ] keep ]
} cleave ;
M: #alien-invoke emit-node ( block node -- block' )
M: #alien-invoke emit-node
params>>
[
[ params>alien-insn-params ]
@ -104,7 +104,7 @@ M: #alien-invoke emit-node ( block node -- block' )
]
[ caller-return ] bi ;
M: #alien-indirect emit-node ( block node -- block' )
M: #alien-indirect emit-node
params>>
[
[ ds-pop ^^unbox-any-c-ptr ] dip
@ -113,7 +113,7 @@ M: #alien-indirect emit-node ( block node -- block' )
]
[ caller-return ] bi ;
M: #alien-assembly emit-node ( block node -- block' )
M: #alien-assembly emit-node
params>>
[
[ params>alien-insn-params ]
@ -167,7 +167,7 @@ M: #alien-assembly emit-node ( block node -- block' )
: emit-callback-outputs ( block params -- )
[ emit-callback-return ] keep callback-stack-cleanup ;
M: #alien-callback emit-node ( block node -- block' )
M: #alien-callback emit-node
dup params>> xt>> dup
[
t cfg get frame-pointer?<<

View File

@ -88,7 +88,7 @@ M: long-long-type unbox
int-rep long-long-on-stack? long-long-odd-register? 3array
int-rep long-long-on-stack? f 3array 2array record-reg-reps ;
M: struct-c-type unbox ( src c-type -- vregs reps )
M: struct-c-type unbox
[ ^^unbox-any-c-ptr ] dip explode-struct ;
: frob-struct ( c-type -- c-type )

View File

@ -8,11 +8,11 @@ SYMBOL: stack-params
GENERIC: alloc-stack-param ( rep -- n )
M: object alloc-stack-param ( rep -- n )
M: object alloc-stack-param
stack-params get
[ rep-size cell align stack-params +@ ] dip ;
M: float-rep alloc-stack-param ( rep -- n )
M: float-rep alloc-stack-param
stack-params get swap rep-size
[ cell align stack-params +@ ] keep
float-right-align-on-stack? [ + ] [ drop ] if ;

View File

@ -71,7 +71,7 @@ GENERIC: emit-node ( block node -- block' )
##branch, [ begin-basic-block ] dip
[ label>> id>> loops get set-at ] [ child>> emit-nodes ] 2bi ;
M: #recursive emit-node ( block node -- block' )
M: #recursive emit-node
dup label>> loop?>> [ emit-loop ] [ emit-recursive ] if ;
! #if
@ -109,28 +109,28 @@ M: #recursive emit-node ( block node -- block' )
! loc>vreg sync
ds-pop any-rep ^^copy f cc/= ##compare-imm-branch, emit-if ;
M: #if emit-node ( block node -- block' )
M: #if emit-node
{
{ [ dup trivial-if? ] [ drop emit-trivial-if ] }
{ [ dup trivial-not-if? ] [ drop emit-trivial-not-if ] }
[ emit-actual-if ]
} cond ;
M: #dispatch emit-node ( block node -- block' )
M: #dispatch emit-node
! Inputs to the final instruction need to be copied because of
! loc>vreg sync. ^^offset>slot always returns a fresh vreg,
! though.
ds-pop ^^offset>slot next-vreg ##dispatch, emit-if ;
M: #call emit-node ( block node -- block' )
M: #call emit-node
dup word>> dup "intrinsic" word-prop [
nip call( block #call -- block' )
] [ swap call-height emit-call ] if* ;
M: #call-recursive emit-node ( block node -- block' )
M: #call-recursive emit-node
[ label>> id>> ] [ call-height ] bi emit-call ;
M: #push emit-node ( block node -- block )
M: #push emit-node
literal>> ^^load-literal ds-push ;
! #shuffle
@ -157,7 +157,7 @@ M: #push emit-node ( block node -- block )
[ make-input-map ] [ mapping>> ] [ extract-outputs ] tri
[ [ of of peek-loc ] 2with map ] 2with map ;
M: #shuffle emit-node ( block node -- block )
M: #shuffle emit-node
[ out-vregs/stack ] keep store-height-changes
first2 [ ds-loc store-vregs ] [ rs-loc store-vregs ] bi* ;
@ -167,14 +167,14 @@ M: #shuffle emit-node ( block node -- block )
t >>kill-block?
##safepoint, ##epilogue, ##return, ;
M: #return emit-node ( block node -- block' )
M: #return emit-node
drop end-word ;
M: #return-recursive emit-node ( block node -- block' )
M: #return-recursive emit-node
label>> id>> loops get key? [ ] [ end-word ] if ;
! #terminate
M: #terminate emit-node ( block node -- block' )
M: #terminate emit-node
drop ##no-tco, end-basic-block f ;
! No-op nodes

View File

@ -35,7 +35,7 @@ GENERIC: visit-insn ( live-set insn -- )
: gen-uses ( live-set insn -- )
uses-vregs [ swap conjoin ] with each ; inline
M: vreg-insn visit-insn ( live-set insn -- )
M: vreg-insn visit-insn
[ kill-defs ] [ gen-uses ] 2bi ;
DEFER: lookup-base-pointer
@ -98,7 +98,7 @@ M: vreg-insn lookup-base-pointer* 2drop f ;
: fill-gc-map ( live-set gc-map -- )
[ gc-roots ] dip [ gc-roots<< ] [ derived-roots<< ] bi ;
M: gc-map-insn visit-insn ( live-set insn -- )
M: gc-map-insn visit-insn
[ kill-defs ] [ gc-map>> fill-gc-map ] [ gen-uses ] 2tri ;
M: ##phi visit-insn kill-defs ;

View File

@ -33,7 +33,7 @@ T{ error-type-holder
{ type +compiler-error+ }
{ word ":errors" }
{ plural "compiler errors" }
{ icon "vocab:ui/tools/error-list/icons/compiler-error.tiff" }
{ icon "vocab:ui/tools/error-list/icons/compiler-error.png" }
{ quot [ compiler-errors get values ] }
{ forget-quot [ compiler-errors get delete-at ] }
} define-error-type
@ -51,7 +51,7 @@ T{ error-type-holder
{ type +linkage-error+ }
{ word ":linkage" }
{ plural "linkage errors" }
{ icon "vocab:ui/tools/error-list/icons/linkage-error.tiff" }
{ icon "vocab:ui/tools/error-list/icons/linkage-error.png" }
{ quot [ linkage-errors get values ] }
{ forget-quot [ linkage-errors get delete-at ] }
{ fatal? f }
@ -77,7 +77,7 @@ T{ error-type-holder
{ type +user-init-error+ }
{ word ":user-init-errors" }
{ plural "rc file errors" }
{ icon "vocab:ui/tools/error-list/icons/user-init-error.tiff" }
{ icon "vocab:ui/tools/error-list/icons/user-init-error.png" }
{ quot [ user-init-errors get-global values ] }
{ forget-quot [ user-init-errors get-global delete-at ] }
} define-error-type

View File

@ -9,7 +9,7 @@ IN: compiler.tree.escape-analysis.branches
M: #branch escape-analysis*
[ in-d>> add-escaping-values ]
[ live-children sift [ (escape-analysis) ] each ]
[ live-children [ [ (escape-analysis) ] when* ] each ]
bi ;
: (merge-allocations) ( values -- allocation )

View File

@ -34,7 +34,7 @@ M: true-constraint satisfied?
TUPLE: false-constraint value ;
: =f ( value -- constriant ) resolve-copy false-constraint boa ;
: =f ( value -- constraint ) resolve-copy false-constraint boa ;
M: false-constraint assume*
[ \ f <class-info> swap value>> refine-value-info ]

View File

@ -358,7 +358,7 @@ generic-comparison-ops [
\ instance? [
! We need to force the caller word to recompile when the class
! is redefined, since now we're making assumptions but the
! is redefined, since now we're making assumptions about the
! class definition itself.
dup literal>> classoid?
[

View File

@ -47,9 +47,6 @@ IN: compiler.tree.propagation.slots
[ swap slot <literal-info> ]
} 2&& ;
: length-accessor? ( slot info -- ? )
[ 1 = ] [ length>> ] bi* and ;
: value-info-slot ( slot info -- info' )
{
{ [ over 0 = ] [ 2drop fixnum <class-info> ] }

View File

@ -196,7 +196,8 @@ ERROR: bad-partial-eval quot word ;
dup classoid?
[
predicate-def
! union{ and intersection{ have useless expansions, and recurse infinitely
! union{ and intersection{ and not{ have useless
! expansions, and recurse infinitely
dup { [ length 2 >= ] [ second \ instance? = ] } 1&& [
drop f
] when

View File

@ -68,11 +68,11 @@ C: <connection> connection
: send-to-connection ( message connection -- )
stream>> [ serialize flush ] with-stream* ;
M: remote-thread send ( message thread -- )
M: remote-thread send
[ id>> 2array ] [ node>> ] [ thread-connections at ] tri
[ nip send-to-connection ] [ send-remote-message ] if* ;
M: thread (serialize) ( obj -- )
M: thread (serialize)
id>> [ local-node get insecure>> ] dip <remote-thread> (serialize) ;
: stop-node ( -- )

View File

@ -13,7 +13,7 @@ M: thread mailbox-of
[ { mailbox } declare ]
[ <mailbox> [ >>mailbox drop ] keep ] ?if ; inline
M: thread send ( message thread -- )
M: thread send
mailbox-of mailbox-put ;
: my-mailbox ( -- mailbox ) self mailbox-of ; inline

View File

@ -77,9 +77,7 @@ render-loc render-dim ;
compute-height ;
: metrics>dim ( bounds -- dim )
[ width>> ] [ [ ascent>> ] [ descent>> ] bi + ] bi
[ ceiling >integer ]
bi@ 2array ;
[ width>> ] [ [ ascent>> ] [ descent>> ] bi + ] bi 2array ;
: fill-background ( context font dim -- )
[ background>> >rgba-components CGContextSetRGBFillColor ]
@ -88,7 +86,7 @@ render-loc render-dim ;
: selection-rect ( dim line selection -- rect )
[let [ start>> ] [ end>> ] [ string>> ] tri :> ( start end string )
start end [ 0 swap string subseq utf16n encode length 2 / >integer ] bi@
start end [ 0 swap string subseq utf16n encode length 2 /i ] bi@
]
[ f CTLineGetOffsetForStringIndex round ] bi-curry@ bi
[ drop nip 0 ] [ swap - swap second ] 3bi <CGRect> ;

View File

@ -18,7 +18,7 @@ SYMBOL: couch
TUPLE: couchdb-error { data assoc } ;
C: <couchdb-error> couchdb-error
M: couchdb-error error. ( error -- )
M: couchdb-error error.
"CouchDB Error: " write data>>
"error" over at [ print ] when*
"reason" of [ print ] when* ;

View File

@ -524,7 +524,7 @@ HOOK: immediate-bitwise? cpu ( n -- ? )
HOOK: immediate-comparand? cpu ( n -- ? )
HOOK: immediate-store? cpu ( n -- ? )
M: object immediate-comparand? ( n -- ? )
M: object immediate-comparand?
{
{ [ dup fixnum? ] [ tag-fixnum immediate-arithmetic? ] }
{ [ dup not ] [ drop t ] }

View File

@ -5,13 +5,13 @@ compiler.cfg.builder.alien.boxing sequences arrays
alien.c-types cpu.architecture cpu.ppc alien.complex ;
IN: cpu.ppc.32.linux
M: linux lr-save ( -- n ) 1 cells ;
M: linux lr-save 1 cells ;
M: linux has-toc ( -- ? ) f ;
M: linux has-toc f ;
M: linux reserved-area-size ( -- n ) 2 cells ;
M: linux reserved-area-size 2 cells ;
M: linux allows-null-dereference ( -- ? ) f ;
M: linux allows-null-dereference f ;
M: ppc param-regs
drop {
@ -35,7 +35,7 @@ M: ppc long-long-odd-register? t ;
M: ppc float-right-align-on-stack? f ;
M: ppc flatten-struct-type ( type -- seq )
M: ppc flatten-struct-type
{
{ [ dup lookup-c-type complex-double lookup-c-type = ]
[ drop { { int-rep f f } { int-rep f f }

View File

@ -7,11 +7,11 @@ IN: cpu.ppc.64.linux
M: linux lr-save 2 cells ;
M: linux has-toc ( -- ? ) t ;
M: linux has-toc t ;
M: linux reserved-area-size ( -- n ) 6 cells ;
M: linux reserved-area-size 6 cells ;
M: linux allows-null-dereference ( -- ? ) f ;
M: linux allows-null-dereference f ;
M: ppc param-regs
drop {
@ -33,7 +33,7 @@ M: ppc long-long-odd-register? f ;
M: ppc float-right-align-on-stack? t ;
M: ppc flatten-struct-type ( type -- seq )
M: ppc flatten-struct-type
{
{ [ dup lookup-c-type complex-double lookup-c-type = ]
[ drop { { double-rep f f } { double-rep f f } } ] }
@ -42,7 +42,7 @@ M: ppc flatten-struct-type ( type -- seq )
[ heap-size cell align cell /i { int-rep f f } <repetition> ]
} cond ;
M: ppc flatten-struct-type-return ( type -- seq )
M: ppc flatten-struct-type-return
{
{ [ dup lookup-c-type complex-double lookup-c-type = ]
[ drop { { double-rep f f } { double-rep f f } } ] }

View File

@ -115,16 +115,16 @@ IN: cpu.ppc.assembler
! 2.4 Branch Instructions
GENERIC: B ( target_addr/label -- )
M: integer B ( target_addr -- ) -2 shift 0 0 18 i-insn ;
M: integer B -2 shift 0 0 18 i-insn ;
GENERIC: BL ( target_addr/label -- )
M: integer BL ( target_addr -- ) -2 shift 0 1 18 i-insn ;
M: integer BL -2 shift 0 1 18 i-insn ;
: BA ( target_addr -- ) -2 shift 1 0 18 i-insn ;
: BLA ( target_addr -- ) -2 shift 1 1 18 i-insn ;
GENERIC: BC ( bo bi target_addr/label -- )
M: integer BC ( bo bi target_addr -- ) -2 shift 0 0 16 b-insn ;
M: integer BC -2 shift 0 0 16 b-insn ;
: BCA ( bo bi target_addr -- ) -2 shift 1 0 16 b-insn ;
: BCL ( bo bi target_addr -- ) -2 shift 0 1 16 b-insn ;

View File

@ -34,9 +34,9 @@ HOOK: has-toc os ( -- ? )
HOOK: reserved-area-size os ( -- n )
HOOK: allows-null-dereference os ( -- ? )
M: label B ( label -- ) [ 0 B ] dip rc-relative-ppc-3-pc label-fixup ;
M: label BL ( label -- ) [ 0 BL ] dip rc-relative-ppc-3-pc label-fixup ;
M: label BC ( bo bi label -- ) [ 0 BC ] dip rc-relative-ppc-2-pc label-fixup ;
M: label B [ 0 B ] dip rc-relative-ppc-3-pc label-fixup ;
M: label BL [ 0 BL ] dip rc-relative-ppc-3-pc label-fixup ;
M: label BC [ 0 BC ] dip rc-relative-ppc-2-pc label-fixup ;
CONSTANT: scratch-reg 30
CONSTANT: fp-scratch-reg 30
@ -44,16 +44,16 @@ CONSTANT: ds-reg 14
CONSTANT: rs-reg 15
CONSTANT: vm-reg 16
M: ppc machine-registers ( -- assoc )
M: ppc machine-registers
{
{ int-regs $[ 3 12 [a,b] 17 29 [a,b] append ] }
{ float-regs $[ 0 29 [a,b] ] }
} ;
M: ppc frame-reg ( -- reg ) 31 ;
M: ppc.32 vm-stack-space ( -- n ) 16 ;
M: ppc.64 vm-stack-space ( -- n ) 32 ;
M: ppc complex-addressing? ( -- ? ) f ;
M: ppc frame-reg 31 ;
M: ppc.32 vm-stack-space 16 ;
M: ppc.64 vm-stack-space 32 ;
M: ppc complex-addressing? f ;
! PW1-PW8 parameter save slots
: param-save-size ( -- n ) 8 cells ; foldable
@ -67,7 +67,7 @@ M: ppc complex-addressing? ( -- ? ) f ;
: param@ ( n -- offset )
reserved-area-size + ;
M: ppc gc-root-offset ( spill-slot -- n )
M: ppc gc-root-offset
n>> spill@ cell /i ;
: LOAD32 ( r n -- )
@ -129,12 +129,12 @@ HOOK: %load-cell-imm-rc cpu ( -- rel-class )
M: ppc.32 %load-cell-imm-rc rc-absolute-ppc-2/2 ;
M: ppc.64 %load-cell-imm-rc rc-absolute-ppc-2/2/2/2 ;
M: ppc.32 %load-immediate ( reg val -- )
M: ppc.32 %load-immediate
dup -0x8000 0x7fff between? [ LI ] [ LOAD32 ] if ;
M: ppc.64 %load-immediate ( reg val -- )
M: ppc.64 %load-immediate
dup -0x8000 0x7fff between? [ LI ] [ LOAD64 ] if ;
M: ppc %load-reference ( reg obj -- )
M: ppc %load-reference
[ [ 0 %load-cell-imm ] [ %load-cell-imm-rc rel-literal ] bi* ]
[ \ f type-number LI ]
if* ;
@ -156,11 +156,11 @@ M: ds-loc loc-reg drop ds-reg ;
M: rs-loc loc-reg drop rs-reg ;
! Load value at stack location loc into vreg.
M: ppc %peek ( vreg loc -- )
M: ppc %peek
[ loc-reg ] [ n>> cells neg ] bi %load-cell ;
! Replace value at stack location loc with value in vreg.
M: ppc %replace ( vreg loc -- )
M: ppc %replace
[ loc-reg ] [ n>> cells neg ] bi %store-cell ;
! Replace value at stack location with an immediate value.
@ -176,45 +176,45 @@ M:: ppc %replace-imm ( src loc -- )
} cond
scratch-reg reg offset %store-cell ;
M: ppc %clear ( loc -- )
M: ppc %clear
297 swap %replace-imm ;
! Increment stack pointer by n cells.
M: ppc %inc ( loc -- )
M: ppc %inc
[ ds-loc? [ ds-reg ds-reg ] [ rs-reg rs-reg ] if ] [ n>> ] bi cells ADDI ;
M: ppc stack-frame-size ( stack-frame -- i )
M: ppc stack-frame-size
(stack-frame-size)
reserved-area-size +
param-save-size +
factor-area-size +
16 align ;
M: ppc %call ( word -- )
M: ppc %call
0 BL rc-relative-ppc-3-pc rel-word-pic ;
: instrs ( n -- b ) 4 * ; inline
M: ppc %jump ( word -- )
M: ppc %jump
6 0 %load-cell-imm 1 instrs %load-cell-imm-rc rel-here
0 B rc-relative-ppc-3-pc rel-word-pic-tail ;
M: ppc %dispatch ( src temp -- )
M: ppc %dispatch
[ nip 0 %load-cell-imm 3 instrs %load-cell-imm-rc rel-here ]
[ swap dupd %load-cell-x ]
[ nip MTCTR ] 2tri BCTR ;
M: ppc %slot ( dst obj slot scale tag -- )
M: ppc %slot
[ 0 assert= ] bi@ %load-cell-x ;
M: ppc %slot-imm ( dst obj slot tag -- )
M: ppc %slot-imm
slot-offset scratch-reg swap LI
scratch-reg %load-cell-x ;
M: ppc %set-slot ( src obj slot scale tag -- )
M: ppc %set-slot
[ 0 assert= ] bi@ %store-cell-x ;
M: ppc %set-slot-imm ( src obj slot tag -- )
M: ppc %set-slot-imm
slot-offset [ scratch-reg ] dip LI scratch-reg %store-cell-x ;
M: ppc %jump-label B ;
@ -255,7 +255,7 @@ M: ppc.64 %log2 [ CNTLZD ] [ drop dup NEG ] [ drop dup 63 ADDI ] 2tri ;
M: ppc.32 %bit-count POPCNTW ;
M: ppc.64 %bit-count POPCNTD ;
M: ppc %copy ( dst src rep -- )
M: ppc %copy
2over eq? [ 3drop ] [
{
{ tagged-rep [ MR ] }
@ -276,15 +276,15 @@ M: ppc %copy ( dst src rep -- )
{ cc/o [ 0 label BNS ] }
} case ; inline
M: ppc %fixnum-add ( label dst src1 src2 cc -- )
M: ppc %fixnum-add
[ ADDO. ] overflow-template ;
M: ppc %fixnum-sub ( label dst src1 src2 cc -- )
M: ppc %fixnum-sub
[ SUBFO. ] overflow-template ;
M: ppc.32 %fixnum-mul ( label dst src1 src2 cc -- )
M: ppc.32 %fixnum-mul
[ MULLWO. ] overflow-template ;
M: ppc.64 %fixnum-mul ( label dst src1 src2 cc -- )
M: ppc.64 %fixnum-mul
[ MULLDO. ] overflow-template ;
M: ppc %add-float FADD ;
@ -292,11 +292,11 @@ M: ppc %sub-float FSUB ;
M: ppc %mul-float FMUL ;
M: ppc %div-float FDIV ;
M: ppc %min-float ( dst src1 src2 -- )
M: ppc %min-float
2dup [ scratch-reg ] 2dip FSUB
[ scratch-reg ] 2dip FSEL ;
M: ppc %max-float ( dst src1 src2 -- )
M: ppc %max-float
2dup [ scratch-reg ] 2dip FSUB
[ scratch-reg ] 2dip FSEL ;
@ -343,26 +343,26 @@ M:: ppc.64 %float>integer ( dst src -- )
} ;
! Return values of this class go here
M: ppc return-regs ( -- regs )
M: ppc return-regs
{
{ int-regs { 3 4 5 6 } }
{ float-regs { 1 2 3 4 } }
} ;
! Is this structure small enough to be returned in registers?
M: ppc return-struct-in-registers? ( c-type -- ? )
M: ppc return-struct-in-registers?
lookup-c-type return-in-registers?>> ;
! If t, the struct return pointer is never passed in a param reg
M: ppc struct-return-on-stack? ( -- ? ) f ;
M: ppc struct-return-on-stack? f ;
GENERIC: load-param ( reg src -- )
M: integer load-param ( reg src -- ) int-rep %copy ;
M: spill-slot load-param ( reg src -- ) [ 1 ] dip n>> spill@ %load-cell ;
M: integer load-param int-rep %copy ;
M: spill-slot load-param [ 1 ] dip n>> spill@ %load-cell ;
GENERIC: store-param ( reg dst -- )
M: integer store-param ( reg dst -- ) swap int-rep %copy ;
M: spill-slot store-param ( reg dst -- ) [ 1 ] dip n>> spill@ %store-cell ;
M: integer store-param swap int-rep %copy ;
M: spill-slot store-param [ 1 ] dip n>> spill@ %store-cell ;
M:: ppc %unbox ( dst src func rep -- )
3 src load-param
@ -459,10 +459,7 @@ M:: ppc %c-invoke ( name dll gc-map -- )
dead-outputs [ first2 discard-reg-param ] each
; inline
M: ppc %alien-invoke ( varargs? reg-inputs stack-inputs
reg-outputs dead-outputs
cleanup stack-size
symbols dll gc-map -- )
M: ppc %alien-invoke
'[ _ _ _ %c-invoke ] emit-alien-insn ;
M:: ppc %alien-indirect ( src
@ -483,36 +480,33 @@ M:: ppc %alien-indirect ( src
gc-map gc-map-here
] emit-alien-insn ;
M: ppc %alien-assembly ( varargs? reg-inputs stack-inputs
reg-outputs dead-outputs
cleanup stack-size
quot -- )
M: ppc %alien-assembly
'[ _ call( -- ) ] emit-alien-insn ;
M: ppc %callback-inputs ( reg-outputs stack-outputs -- )
M: ppc %callback-inputs
[ [ first3 load-reg-param ] each ]
[ [ first3 load-stack-param ] each ] bi*
3 vm-reg MR
4 0 LI
"begin_callback" f f %c-invoke ;
M: ppc %callback-outputs ( reg-inputs -- )
M: ppc %callback-outputs
3 vm-reg MR
"end_callback" f f %c-invoke
[ first3 store-reg-param ] each ;
M: ppc stack-cleanup ( stack-size return abi -- n )
M: ppc stack-cleanup
3drop 0 ;
M: ppc fused-unboxing? f ;
M: ppc %alien-global ( register symbol dll -- )
M: ppc %alien-global
[ 0 %load-cell-imm ] 2dip %load-cell-imm-rc rel-dlsym ;
M: ppc %vm-field ( dst field -- ) [ vm-reg ] dip %load-cell ;
M: ppc %set-vm-field ( src field -- ) [ vm-reg ] dip %store-cell ;
M: ppc %vm-field [ vm-reg ] dip %load-cell ;
M: ppc %set-vm-field [ vm-reg ] dip %store-cell ;
M: ppc %unbox-alien ( dst src -- )
M: ppc %unbox-alien
scratch-reg alien-offset LI scratch-reg %load-cell-x ;
! Convert a c-ptr object to a raw C pointer.
@ -706,7 +700,7 @@ M:: ppc.64 %convert-integer ( dst src c-type -- )
{ c:ulonglong [ ] }
} case ;
M: ppc.32 %load-memory-imm ( dst base offset rep c-type -- )
M: ppc.32 %load-memory-imm
[
pick %trap-null
{
@ -725,7 +719,7 @@ M: ppc.32 %load-memory-imm ( dst base offset rep c-type -- )
} case
] ?if ;
M: ppc.64 %load-memory-imm ( dst base offset rep c-type -- )
M: ppc.64 %load-memory-imm
[
pick %trap-null
{
@ -747,7 +741,7 @@ M: ppc.64 %load-memory-imm ( dst base offset rep c-type -- )
] ?if ;
M: ppc.32 %load-memory ( dst base displacement scale offset rep c-type -- )
M: ppc.32 %load-memory
[ [ 0 assert= ] bi@ ] 2dip
[
pick %trap-null
@ -767,7 +761,7 @@ M: ppc.32 %load-memory ( dst base displacement scale offset rep c-type -- )
} case
] ?if ;
M: ppc.64 %load-memory ( dst base displacement scale offset rep c-type -- )
M: ppc.64 %load-memory
[ [ 0 assert= ] bi@ ] 2dip
[
pick %trap-null
@ -790,7 +784,7 @@ M: ppc.64 %load-memory ( dst base displacement scale offset rep c-type -- )
] ?if ;
M: ppc.32 %store-memory-imm ( src base offset rep c-type -- )
M: ppc.32 %store-memory-imm
[
{
{ c:char [ STB ] }
@ -808,7 +802,7 @@ M: ppc.32 %store-memory-imm ( src base offset rep c-type -- )
} case
] ?if ;
M: ppc.64 %store-memory-imm ( src base offset rep c-type -- )
M: ppc.64 %store-memory-imm
[
{
{ c:char [ STB ] }
@ -828,7 +822,7 @@ M: ppc.64 %store-memory-imm ( src base offset rep c-type -- )
} case
] ?if ;
M: ppc.32 %store-memory ( src base displacement scale offset rep c-type -- )
M: ppc.32 %store-memory
[ [ 0 assert= ] bi@ ] 2dip
[
{
@ -847,7 +841,7 @@ M: ppc.32 %store-memory ( src base displacement scale offset rep c-type -- )
} case
] ?if ;
M: ppc.64 %store-memory ( src base displacement scale offset rep c-type -- )
M: ppc.64 %store-memory
[ [ 0 assert= ] bi@ ] 2dip
[
{
@ -914,7 +908,7 @@ M:: ppc %check-nursery-branch ( label size cc temp1 temp2 -- )
{ cc/<= [ 0 label BGT ] }
} case ;
M: ppc %call-gc ( gc-map -- )
M: ppc %call-gc
\ minor-gc %call gc-map-here ;
M:: ppc %prologue ( stack-size -- )
@ -1033,7 +1027,7 @@ M:: ppc %compare-float-unordered-branch ( label src1 src2 cc -- )
src1 src2 cc \ (%compare-float-unordered) (%compare-float) :> ( branch1 branch2 )
label branch1 branch2 (%branch) ;
M: ppc %spill ( src rep dst -- )
M: ppc %spill
n>> spill@ swap {
{ int-rep [ [ 1 ] dip %store-cell ] }
{ tagged-rep [ [ 1 ] dip %store-cell ] }
@ -1043,7 +1037,7 @@ M: ppc %spill ( src rep dst -- )
{ scalar-rep [ scratch-reg swap LI 1 scratch-reg STVX ] }
} case ;
M: ppc %reload ( dst rep src -- )
M: ppc %reload
n>> spill@ swap {
{ int-rep [ [ 1 ] dip %load-cell ] }
{ tagged-rep [ [ 1 ] dip %load-cell ] }
@ -1053,11 +1047,11 @@ M: ppc %reload ( dst rep src -- )
{ scalar-rep [ scratch-reg swap LI 1 scratch-reg LVX ] }
} case ;
M: ppc immediate-arithmetic? ( n -- ? ) -32768 32767 between? ;
M: ppc immediate-bitwise? ( n -- ? ) 0 65535 between? ;
M: ppc immediate-store? ( n -- ? ) immediate-comparand? ;
M: ppc immediate-arithmetic? -32768 32767 between? ;
M: ppc immediate-bitwise? 0 65535 between? ;
M: ppc immediate-store? immediate-comparand? ;
M: ppc enable-cpu-features ( -- )
M: ppc enable-cpu-features
enable-float-intrinsics ;
USE: vocabs

View File

@ -26,18 +26,18 @@ M: x86.32 rs-reg EDI ;
M: x86.32 stack-reg ESP ;
M: x86.32 frame-reg EBP ;
M: x86.32 immediate-comparand? ( obj -- ? ) drop t ;
M: x86.32 immediate-comparand? drop t ;
M:: x86.32 %load-vector ( dst val rep -- )
dst 0 [] rep copy-memory* val rc-absolute rel-binary-literal ;
M: x86.32 %vm-field ( dst field -- )
M: x86.32 %vm-field
[ 0 [] MOV ] dip rc-absolute-cell rel-vm ;
M: x86.32 %set-vm-field ( dst field -- )
M: x86.32 %set-vm-field
[ 0 [] swap MOV ] dip rc-absolute-cell rel-vm ;
M: x86.32 %vm-field-ptr ( dst field -- )
M: x86.32 %vm-field-ptr
[ 0 MOV ] dip rc-absolute-cell rel-vm ;
M: x86.32 %mark-card
@ -61,7 +61,7 @@ M: x86.32 vm-stack-space 16 ;
: save-vm-ptr ( n -- )
stack@ 0 MOV 0 rc-absolute-cell rel-vm ;
M: x86.32 return-struct-in-registers? ( c-type -- ? )
M: x86.32 return-struct-in-registers?
lookup-c-type
[ return-in-registers?>> ]
[ heap-size { 1 2 4 8 } member? ] bi
@ -87,7 +87,7 @@ M: x86.32 return-regs
M: x86.32 %prepare-jump
pic-tail-reg 0 MOV xt-tail-pic-offset rc-absolute-cell rel-here ;
M: x86.32 %load-stack-param ( dst rep n -- )
M: x86.32 %load-stack-param
next-stack@ swap pick register? [ %copy ] [
{
{ int-rep [ [ EAX ] dip MOV ?spill-slot EAX MOV ] }
@ -96,7 +96,7 @@ M: x86.32 %load-stack-param ( dst rep n -- )
} case
] if ;
M: x86.32 %store-stack-param ( src rep n -- )
M: x86.32 %store-stack-param
stack@ swap pick register? [ swapd %copy ] [
{
{ int-rep [ [ [ EAX ] dip ?spill-slot MOV ] [ EAX MOV ] bi* ] }
@ -115,7 +115,7 @@ M: x86.32 %store-stack-param ( src rep n -- )
dst ?spill-slot x87-insn execute
] if ; inline
M: x86.32 %load-reg-param ( vreg rep reg -- )
M: x86.32 %load-reg-param
swap {
{ int-rep [ int-rep %copy ] }
{ float-rep [ drop \ FSTPS float-rep load-float-return ] }
@ -132,14 +132,14 @@ M: x86.32 %load-reg-param ( vreg rep reg -- )
src ?spill-slot x87-insn execute
] if ; inline
M: x86.32 %store-reg-param ( vreg rep reg -- )
M: x86.32 %store-reg-param
swap {
{ int-rep [ swap int-rep %copy ] }
{ float-rep [ drop \ FLDS float-rep store-float-return ] }
{ double-rep [ drop \ FLDL double-rep store-float-return ] }
} case ;
M: x86.32 %discard-reg-param ( rep reg -- )
M: x86.32 %discard-reg-param
drop {
{ int-rep [ ] }
{ float-rep [ ST0 FSTP ] }
@ -179,12 +179,12 @@ M:: x86.32 %box-long-long ( dst src1 src2 func gc-map -- )
M: x86.32 %c-invoke
[ 0 CALL rc-relative rel-dlsym ] dip gc-map-here ;
M: x86.32 %begin-callback ( -- )
M: x86.32 %begin-callback
0 save-vm-ptr
4 stack@ 0 MOV
"begin_callback" f f %c-invoke ;
M: x86.32 %end-callback ( -- )
M: x86.32 %end-callback
0 save-vm-ptr
"end_callback" f f %c-invoke ;
@ -192,7 +192,7 @@ M: x86.32 %end-callback ( -- )
! MINGW ABI incompatibility disaster
[ large-struct? ] [ mingw eq? os windows? not or ] bi* and ;
M: x86.32 %prepare-var-args ( reg-inputs -- ) drop ;
M: x86.32 %prepare-var-args drop ;
M:: x86.32 stack-cleanup ( stack-size return abi -- n )
! a) Functions which are stdcall/fastcall/thiscall have to
@ -205,7 +205,7 @@ M:: x86.32 stack-cleanup ( stack-size return abi -- n )
[ 0 ]
} cond ;
M: x86.32 %cleanup ( n -- )
M: x86.32 %cleanup
[ ESP swap SUB ] unless-zero ;
M: x86.32 %safepoint
@ -224,7 +224,7 @@ M: x86.32 flatten-struct-type
M: x86.32 struct-return-on-stack? os linux? not ;
M: x86.32 (cpuid) ( eax ecx regs -- )
M: x86.32 (cpuid)
void { uint uint void* } cdecl [
! Save ds-reg, rs-reg
EDI PUSH

View File

@ -40,16 +40,16 @@ M: x86.64 machine-registers
: vm-reg ( -- reg ) R13 ; inline
: nv-reg ( -- reg ) RBX ; inline
M: x86.64 %vm-field ( dst offset -- )
M: x86.64 %vm-field
[ vm-reg ] dip [+] MOV ;
M:: x86.64 %load-vector ( dst val rep -- )
dst 0 [RIP+] rep copy-memory* val rc-relative rel-binary-literal ;
M: x86.64 %set-vm-field ( src offset -- )
M: x86.64 %set-vm-field
[ vm-reg ] dip [+] swap MOV ;
M: x86.64 %vm-field-ptr ( dst offset -- )
M: x86.64 %vm-field-ptr
[ vm-reg ] dip [+] LEA ;
M: x86.64 %prepare-jump
@ -83,7 +83,7 @@ M:: x86.64 %load-reg-param ( vreg rep reg -- )
M:: x86.64 %store-reg-param ( vreg rep reg -- )
reg vreg rep %copy ;
M: x86.64 %discard-reg-param ( rep reg -- )
M: x86.64 %discard-reg-param
2drop ;
M:: x86.64 %unbox ( dst src func rep -- )
@ -102,12 +102,12 @@ M: x86.64 %c-invoke
[ R11 0 MOV rc-absolute-cell rel-dlsym R11 CALL ] dip
gc-map-here ;
M: x86.64 %begin-callback ( -- )
M: x86.64 %begin-callback
param-reg-0 vm-reg MOV
param-reg-1 0 MOV
"begin_callback" f f %c-invoke ;
M: x86.64 %end-callback ( -- )
M: x86.64 %end-callback
param-reg-0 vm-reg MOV
"end_callback" f f %c-invoke ;
@ -122,7 +122,7 @@ M: x86.64 long-long-on-stack? f ;
M: x86.64 struct-return-on-stack? f ;
M: x86.64 (cpuid) ( rax rcx regs -- )
M: x86.64 (cpuid)
void { uint uint void* } cdecl [
RAX param-reg-0 MOV
RCX param-reg-1 MOV

View File

@ -38,14 +38,14 @@ M: x86.64 reserved-stack-space 0 ;
] [ reps ] if
] [ reps ] if ;
M: x86.64 flatten-struct-type ( c-type -- seq )
M: x86.64 flatten-struct-type
dup heap-size 16 <=
[ flatten-small-struct record-reg-reps ] [
call-next-method unrecord-reg-reps
[ first t f 3array ] map
] if ;
M: x86.64 return-struct-in-registers? ( c-type -- ? )
M: x86.64 return-struct-in-registers?
heap-size 2 cells <= ;
M: x86.64 dummy-stack-params? f ;
@ -54,6 +54,6 @@ M: x86.64 dummy-int-params? f ;
M: x86.64 dummy-fp-params? f ;
M: x86.64 %prepare-var-args ( reg-inputs -- )
M: x86.64 %prepare-var-args
[ second reg-class-of float-regs? ] count 8 min
[ EAX EAX XOR ] [ <byte> AL swap MOV ] if-zero ;

View File

@ -13,7 +13,7 @@ M: x86.64 param-regs
M: x86.64 reserved-stack-space 4 cells ;
M: x86.64 return-struct-in-registers? ( c-type -- ? )
M: x86.64 return-struct-in-registers?
heap-size { 1 2 4 8 } member? ;
M: x86.64 value-struct? heap-size { 1 2 4 8 } member? ;
@ -24,5 +24,4 @@ M: x86.64 dummy-int-params? t ;
M: x86.64 dummy-fp-params? t ;
M: x86.64 %prepare-var-args ( reg-inputs -- )
drop ;
M: x86.64 %prepare-var-args drop ;

View File

@ -338,7 +338,7 @@ M: immediate SBB { 0b011 t 0x80 } immediate-1/4 ;
M: operand SBB 0o030 2-operand ;
GENERIC: AND ( dst src -- )
M: immediate AND ( dst src -- )
M: immediate AND
maybe-zero-extend { 0b100 t 0x80 } immediate-1/4 ;
M: operand AND 0o040 2-operand ;
@ -357,13 +357,11 @@ M: immediate XOR { 0b110 t 0x80 } immediate-1/4 ;
M: operand XOR 0o060 2-operand ;
GENERIC: CMP ( dst src -- )
M: immediate CMP ( dst src -- )
{ 0b111 t 0x80 } immediate-1/4 ;
M: immediate CMP { 0b111 t 0x80 } immediate-1/4 ;
M: operand CMP 0o070 2-operand ;
GENERIC: TEST ( dst src -- )
M: immediate TEST ( dst src -- )
maybe-zero-extend { 0b0 t 0xf7 } immediate-4 ;
M: immediate TEST maybe-zero-extend { 0b0 t 0xf7 } immediate-4 ;
M: operand TEST 0o204 2-operand ;
: XCHG ( dst src -- ) 0o207 2-operand ;
@ -371,20 +369,20 @@ M: operand TEST 0o204 2-operand ;
: BSR ( dst src -- ) { 0x0f 0xbd } (2-operand) ;
GENERIC: BT ( value n -- )
M: immediate BT ( value n -- ) { 0b100 t { 0x0f 0xba } } immediate-1* ;
M: operand BT ( value n -- ) swap { 0x0f 0xa3 } (2-operand) ;
M: immediate BT { 0b100 t { 0x0f 0xba } } immediate-1* ;
M: operand BT swap { 0x0f 0xa3 } (2-operand) ;
GENERIC: BTC ( value n -- )
M: immediate BTC ( value n -- ) { 0b111 t { 0x0f 0xba } } immediate-1* ;
M: operand BTC ( value n -- ) swap { 0x0f 0xbb } (2-operand) ;
M: immediate BTC { 0b111 t { 0x0f 0xba } } immediate-1* ;
M: operand BTC swap { 0x0f 0xbb } (2-operand) ;
GENERIC: BTR ( value n -- )
M: immediate BTR ( value n -- ) { 0b110 t { 0x0f 0xba } } immediate-1* ;
M: operand BTR ( value n -- ) swap { 0x0f 0xb3 } (2-operand) ;
M: immediate BTR { 0b110 t { 0x0f 0xba } } immediate-1* ;
M: operand BTR swap { 0x0f 0xb3 } (2-operand) ;
GENERIC: BTS ( value n -- )
M: immediate BTS ( value n -- ) { 0b101 t { 0x0f 0xba } } immediate-1* ;
M: operand BTS ( value n -- ) swap { 0x0f 0xab } (2-operand) ;
M: immediate BTS { 0b101 t { 0x0f 0xba } } immediate-1* ;
M: operand BTS swap { 0x0f 0xab } (2-operand) ;
: NOT ( dst -- ) { 0b010 t 0xf7 } 1-operand ;
: NEG ( dst -- ) { 0b011 t 0xf7 } 1-operand ;

View File

@ -35,16 +35,16 @@ M: x86 integer-float-needs-stack-frame? f ;
M: x86 %integer>float [ drop dup XORPS ] [ CVTSI2SD ] 2bi ;
M: x86 %float>integer CVTTSD2SI ;
M: x86 %compare-float-ordered ( dst src1 src2 cc temp -- )
M: x86 %compare-float-ordered
[ COMISD ] (%compare-float) ;
M: x86 %compare-float-unordered ( dst src1 src2 cc temp -- )
M: x86 %compare-float-unordered
[ UCOMISD ] (%compare-float) ;
M: x86 %compare-float-ordered-branch ( label src1 src2 cc -- )
M: x86 %compare-float-ordered-branch
[ COMISD ] (%compare-float-branch) ;
M: x86 %compare-float-unordered-branch ( label src1 src2 cc -- )
M: x86 %compare-float-unordered-branch
[ UCOMISD ] (%compare-float-branch) ;
! SIMD
@ -262,7 +262,7 @@ M: x86 %shuffle-vector-halves-imm-reps
{ sse2? { double-2-rep } }
} available-reps ;
M: x86 %shuffle-vector ( dst src shuffle rep -- )
M: x86 %shuffle-vector
two-operand PSHUFB ;
M: x86 %shuffle-vector-reps
@ -331,14 +331,14 @@ M: x86 %unsigned-pack-vector-reps
{ sse4.1? { int-4-rep } }
} available-reps ;
M: x86 %tail>head-vector ( dst src rep -- )
M: x86 %tail>head-vector
dup {
{ float-4-rep [ drop UNPCKHPD ] }
{ double-2-rep [ drop UNPCKHPD ] }
[ drop [ %copy ] [ drop PUNPCKHQDQ ] 3bi ]
} case ;
M: x86 %unpack-vector-head ( dst src rep -- )
M: x86 %unpack-vector-head
{
{ char-16-rep [ PMOVSXBW ] }
{ uchar-16-rep [ PMOVZXBW ] }
@ -349,13 +349,13 @@ M: x86 %unpack-vector-head ( dst src rep -- )
{ float-4-rep [ CVTPS2PD ] }
} case ;
M: x86 %unpack-vector-head-reps ( -- reps )
M: x86 %unpack-vector-head-reps
{
{ sse2? { float-4-rep } }
{ sse4.1? { char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep } }
} available-reps ;
M: x86 %integer>float-vector ( dst src rep -- )
M: x86 %integer>float-vector
{
{ int-4-rep [ CVTDQ2PS ] }
} case ;
@ -365,7 +365,7 @@ M: x86 %integer>float-vector-reps
{ sse2? { int-4-rep } }
} available-reps ;
M: x86 %float>integer-vector ( dst src rep -- )
M: x86 %float>integer-vector
{
{ float-4-rep [ CVTTPS2DQ ] }
} case ;
@ -405,7 +405,7 @@ M: x86 %float>integer-vector-reps
{ cc> [ [ PCMPGTQ ] [ PCMPGTD ] [ PCMPGTW ] [ PCMPGTB ] (%compare-int-vector) ] }
} case ;
M: x86 %compare-vector ( dst src1 src2 rep cc -- )
M: x86 %compare-vector
[ [ two-operand ] keep ] dip
over float-vector-rep?
[ %compare-float-vector ]
@ -481,7 +481,7 @@ M: x86 %compare-vector-ccs
[ drop PMOVMSKB 0xffff ]
} case ;
M: x86 %move-vector-mask ( dst src rep -- )
M: x86 %move-vector-mask
(%move-vector-mask) drop ;
M: x86 %move-vector-mask-reps
@ -512,7 +512,7 @@ M: x86 %test-vector-reps
{ sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %add-vector ( dst src1 src2 rep -- )
M: x86 %add-vector
[ two-operand ] keep
{
{ float-4-rep [ ADDPS ] }
@ -533,7 +533,7 @@ M: x86 %add-vector-reps
{ sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %saturated-add-vector ( dst src1 src2 rep -- )
M: x86 %saturated-add-vector
[ two-operand ] keep
{
{ char-16-rep [ PADDSB ] }
@ -547,7 +547,7 @@ M: x86 %saturated-add-vector-reps
{ sse2? { char-16-rep uchar-16-rep short-8-rep ushort-8-rep } }
} available-reps ;
M: x86 %add-sub-vector ( dst src1 src2 rep -- )
M: x86 %add-sub-vector
[ two-operand ] keep
{
{ float-4-rep [ ADDSUBPS ] }
@ -559,7 +559,7 @@ M: x86 %add-sub-vector-reps
{ sse3? { float-4-rep double-2-rep } }
} available-reps ;
M: x86 %sub-vector ( dst src1 src2 rep -- )
M: x86 %sub-vector
[ two-operand ] keep
{
{ float-4-rep [ SUBPS ] }
@ -580,7 +580,7 @@ M: x86 %sub-vector-reps
{ sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %saturated-sub-vector ( dst src1 src2 rep -- )
M: x86 %saturated-sub-vector
[ two-operand ] keep
{
{ char-16-rep [ PSUBSB ] }
@ -594,7 +594,7 @@ M: x86 %saturated-sub-vector-reps
{ sse2? { char-16-rep uchar-16-rep short-8-rep ushort-8-rep } }
} available-reps ;
M: x86 %mul-vector ( dst src1 src2 rep -- )
M: x86 %mul-vector
[ two-operand ] keep
{
{ float-4-rep [ MULPS ] }
@ -612,7 +612,7 @@ M: x86 %mul-vector-reps
{ sse4.1? { int-4-rep uint-4-rep } }
} available-reps ;
M: x86 %mul-high-vector ( dst src1 src2 rep -- )
M: x86 %mul-high-vector
[ two-operand ] keep
{
{ short-8-rep [ PMULHW ] }
@ -624,7 +624,7 @@ M: x86 %mul-high-vector-reps
{ sse2? { short-8-rep ushort-8-rep } }
} available-reps ;
M: x86 %mul-horizontal-add-vector ( dst src1 src2 rep -- )
M: x86 %mul-horizontal-add-vector
[ two-operand ] keep
{
{ char-16-rep [ PMADDUBSW ] }
@ -638,7 +638,7 @@ M: x86 %mul-horizontal-add-vector-reps
{ ssse3? { char-16-rep uchar-16-rep } }
} available-reps ;
M: x86 %div-vector ( dst src1 src2 rep -- )
M: x86 %div-vector
[ two-operand ] keep
{
{ float-4-rep [ DIVPS ] }
@ -651,7 +651,7 @@ M: x86 %div-vector-reps
{ sse2? { double-2-rep } }
} available-reps ;
M: x86 %min-vector ( dst src1 src2 rep -- )
M: x86 %min-vector
[ two-operand ] keep
{
{ char-16-rep [ PMINSB ] }
@ -671,7 +671,7 @@ M: x86 %min-vector-reps
{ sse4.1? { char-16-rep ushort-8-rep int-4-rep uint-4-rep } }
} available-reps ;
M: x86 %max-vector ( dst src1 src2 rep -- )
M: x86 %max-vector
[ two-operand ] keep
{
{ char-16-rep [ PMAXSB ] }
@ -691,7 +691,7 @@ M: x86 %max-vector-reps
{ sse4.1? { char-16-rep ushort-8-rep int-4-rep uint-4-rep } }
} available-reps ;
M: x86 %avg-vector ( dst src1 src2 rep -- )
M: x86 %avg-vector
[ two-operand ] keep
{
{ uchar-16-rep [ PAVGB ] }
@ -726,7 +726,7 @@ M: x86 %sad-vector-reps
{ sse2? { uchar-16-rep } }
} available-reps ;
M: x86 %horizontal-add-vector ( dst src1 src2 rep -- )
M: x86 %horizontal-add-vector
[ two-operand ] keep
signed-rep {
{ float-4-rep [ HADDPS ] }
@ -741,7 +741,7 @@ M: x86 %horizontal-add-vector-reps
{ ssse3? { int-4-rep uint-4-rep short-8-rep ushort-8-rep } }
} available-reps ;
M: x86 %horizontal-shl-vector-imm ( dst src1 src2 rep -- )
M: x86 %horizontal-shl-vector-imm
two-operand PSLLDQ ;
M: x86 %horizontal-shl-vector-imm-reps
@ -749,7 +749,7 @@ M: x86 %horizontal-shl-vector-imm-reps
{ sse2? { char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep float-4-rep double-2-rep } }
} available-reps ;
M: x86 %horizontal-shr-vector-imm ( dst src1 src2 rep -- )
M: x86 %horizontal-shr-vector-imm
two-operand PSRLDQ ;
M: x86 %horizontal-shr-vector-imm-reps
@ -757,7 +757,7 @@ M: x86 %horizontal-shr-vector-imm-reps
{ sse2? { char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep float-4-rep double-2-rep } }
} available-reps ;
M: x86 %abs-vector ( dst src rep -- )
M: x86 %abs-vector
{
{ char-16-rep [ PABSB ] }
{ short-8-rep [ PABSW ] }
@ -769,7 +769,7 @@ M: x86 %abs-vector-reps
{ ssse3? { char-16-rep short-8-rep int-4-rep } }
} available-reps ;
M: x86 %sqrt-vector ( dst src rep -- )
M: x86 %sqrt-vector
{
{ float-4-rep [ SQRTPS ] }
{ double-2-rep [ SQRTPD ] }
@ -781,7 +781,7 @@ M: x86 %sqrt-vector-reps
{ sse2? { double-2-rep } }
} available-reps ;
M: x86 %and-vector ( dst src1 src2 rep -- )
M: x86 %and-vector
[ two-operand ] keep
{
{ float-4-rep [ ANDPS ] }
@ -795,7 +795,7 @@ M: x86 %and-vector-reps
{ sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %andn-vector ( dst src1 src2 rep -- )
M: x86 %andn-vector
[ two-operand ] keep
{
{ float-4-rep [ ANDNPS ] }
@ -809,7 +809,7 @@ M: x86 %andn-vector-reps
{ sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %or-vector ( dst src1 src2 rep -- )
M: x86 %or-vector
[ two-operand ] keep
{
{ float-4-rep [ ORPS ] }
@ -823,7 +823,7 @@ M: x86 %or-vector-reps
{ sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %xor-vector ( dst src1 src2 rep -- )
M: x86 %xor-vector
[ two-operand ] keep
{
{ float-4-rep [ XORPS ] }
@ -837,7 +837,7 @@ M: x86 %xor-vector-reps
{ sse2? { double-2-rep char-16-rep uchar-16-rep short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %shl-vector ( dst src1 src2 rep -- )
M: x86 %shl-vector
[ two-operand ] keep
{
{ short-8-rep [ PSLLW ] }
@ -853,7 +853,7 @@ M: x86 %shl-vector-reps
{ sse2? { short-8-rep ushort-8-rep int-4-rep uint-4-rep longlong-2-rep ulonglong-2-rep } }
} available-reps ;
M: x86 %shr-vector ( dst src1 src2 rep -- )
M: x86 %shr-vector
[ two-operand ] keep
{
{ short-8-rep [ PSRAW ] }
@ -911,9 +911,9 @@ M: x86 %integer>scalar drop MOVD ;
] }
} case ;
M: x86.32 %scalar>integer ( dst src rep -- ) %scalar>integer-32 ;
M: x86.32 %scalar>integer %scalar>integer-32 ;
M: x86.64 %scalar>integer ( dst src rep -- )
M: x86.64 %scalar>integer
{
{ longlong-scalar-rep [ MOVD ] }
{ ulonglong-scalar-rep [ MOVD ] }

View File

@ -46,7 +46,7 @@ HOOK: pic-tail-reg cpu ( -- reg )
: align-stack ( n -- n' ) 16 align ;
M: x86 stack-frame-size ( stack-frame -- i )
M: x86 stack-frame-size
(stack-frame-size)
reserved-stack-space +
cell +
@ -60,7 +60,7 @@ M: x86 test-instruction? t ;
M: x86 immediate-store? immediate-comparand? ;
M: x86 %load-immediate ( reg val -- )
M: x86 %load-immediate
{ fixnum } declare [ 32-bit-version-of dup XOR ] [ MOV ] if-zero ;
M: x86 %load-reference
@ -90,13 +90,13 @@ M: x86 %replace-imm
[ [ 0 MOV ] dip rc-absolute rel-literal ]
} cond ;
M: x86 %clear ( loc -- )
M: x86 %clear
297 swap %replace-imm ;
M: x86 %inc ( loc -- )
M: x86 %inc
[ n>> ] [ ds-loc? ds-reg rs-reg ? ] bi (%inc) ;
M: x86 %call ( word -- ) 0 CALL rc-relative rel-word-pic ;
M: x86 %call 0 CALL rc-relative rel-word-pic ;
: xt-tail-pic-offset ( -- n )
! See the comment in vm/cpu-x86.hpp
@ -104,21 +104,21 @@ M: x86 %call ( word -- ) 0 CALL rc-relative rel-word-pic ;
HOOK: %prepare-jump cpu ( -- )
M: x86 %jump ( word -- )
M: x86 %jump
%prepare-jump
0 JMP rc-relative rel-word-pic-tail ;
M: x86 %jump-label ( label -- ) 0 JMP rc-relative label-fixup ;
M: x86 %jump-label 0 JMP rc-relative label-fixup ;
M: x86 %return ( -- ) 0 RET ;
M: x86 %return 0 RET ;
: (%slot) ( obj slot scale tag -- op ) neg <indirect> ; inline
: (%slot-imm) ( obj slot tag -- op ) slot-offset [+] ; inline
M: x86 %slot ( dst obj slot scale tag -- ) (%slot) MOV ;
M: x86 %slot-imm ( dst obj slot tag -- ) (%slot-imm) MOV ;
M: x86 %set-slot ( src obj slot scale tag -- ) (%slot) swap MOV ;
M: x86 %set-slot-imm ( src obj slot tag -- ) (%slot-imm) swap MOV ;
M: x86 %slot (%slot) MOV ;
M: x86 %slot-imm (%slot-imm) MOV ;
M: x86 %set-slot (%slot) swap MOV ;
M: x86 %set-slot-imm (%slot-imm) swap MOV ;
:: two-operand ( dst src1 src2 rep -- dst src )
dst src2 eq? dst src1 eq? not and [ "Cannot handle this case" throw ] when
@ -130,13 +130,13 @@ M: x86 %set-slot-imm ( src obj slot tag -- ) (%slot-imm) swap MOV ;
dst ; inline
M: x86 %add 2over eq? [ nip ADD ] [ [+] LEA ] if ;
M: x86 %add-imm ( dst src1 src2 -- )
M: x86 %add-imm
2over eq? [
nip { { 1 [ INC ] } { -1 [ DEC ] } [ ADD ] } case
] [ [+] LEA ] if ;
M: x86 %sub int-rep two-operand SUB ;
M: x86 %sub-imm ( dst src1 src2 -- )
M: x86 %sub-imm
2over eq? [
nip { { 1 [ DEC ] } { -1 [ INC ] } [ SUB ] } case
] [ neg [+] LEA ] if ;
@ -173,7 +173,7 @@ M: object copy-memory* copy-register* ;
: ?spill-slot ( obj -- obj ) dup spill-slot? [ n>> spill@ ] when ;
M: x86 %copy ( dst src rep -- )
M: x86 %copy
2over eq? [ 3drop ] [
[ [ ?spill-slot ] bi@ ] dip
2over [ register? ] both? [ copy-register* ] [ copy-memory* ] if
@ -186,16 +186,16 @@ M: x86 %copy ( dst src rep -- )
{ cc/o [ JNO ] }
} case ; inline
M: x86 %fixnum-add ( label dst src1 src2 cc -- )
M: x86 %fixnum-add
[ ADD ] fixnum-overflow ;
M: x86 %fixnum-sub ( label dst src1 src2 cc -- )
M: x86 %fixnum-sub
[ SUB ] fixnum-overflow ;
M: x86 %fixnum-mul ( label dst src1 src2 cc -- )
M: x86 %fixnum-mul
[ IMUL2 ] fixnum-overflow ;
M: x86 %unbox-alien ( dst src -- )
M: x86 %unbox-alien
alien-offset [+] MOV ;
M:: x86 %unbox-any-c-ptr ( dst src -- )
@ -364,7 +364,7 @@ M: x86.64 has-small-reg? 2drop t ;
: %sign-extend ( dst src bits -- )
[ MOVSX ] (%convert-integer) ; inline
M: x86 %convert-integer ( dst src c-type -- )
M: x86 %convert-integer
{
{ c:char [ 8 %sign-extend ] }
{ c:uchar [ 8 %zero-extend ] }
@ -411,10 +411,10 @@ M: x86 %convert-integer ( dst src c-type -- )
} case
] [ nipd %copy ] ?if ;
M: x86 %load-memory ( dst base displacement scale offset rep c-type -- )
M: x86 %load-memory
(%memory) (%load-memory) ;
M: x86 %load-memory-imm ( dst base offset rep c-type -- )
M: x86 %load-memory-imm
(%memory-imm) (%load-memory) ;
: (%store-memory) ( src exclude address rep c-type -- )
@ -429,10 +429,10 @@ M: x86 %load-memory-imm ( dst base offset rep c-type -- )
} case
] [ [ nip swap ] dip %copy ] ?if ;
M: x86 %store-memory ( src base displacement scale offset rep c-type -- )
M: x86 %store-memory
(%memory) (%store-memory) ;
M: x86 %store-memory-imm ( src base offset rep c-type -- )
M: x86 %store-memory-imm
(%memory-imm) (%store-memory) ;
: shift-count? ( reg -- ? ) { ECX RCX } member-eq? ;
@ -510,16 +510,16 @@ M:: x86 %check-nursery-branch ( label size cc temp1 temp2 -- )
M: x86 gc-root-offset
n>> spill-offset special-offset cell + cell /i ;
M: x86 %call-gc ( gc-map -- )
M: x86 %call-gc
\ minor-gc %call
gc-map-here ;
M: x86 %alien-global ( dst symbol library -- )
M: x86 %alien-global
[ 0 MOV ] 2dip rc-absolute-cell rel-dlsym ;
M: x86 %prologue ( n -- ) cell - decr-stack-reg ;
M: x86 %prologue cell - decr-stack-reg ;
M: x86 %epilogue ( n -- ) cell - incr-stack-reg ;
M: x86 %epilogue cell - incr-stack-reg ;
:: (%boolean) ( dst temp insn -- )
dst \ f type-number MOV
@ -610,10 +610,10 @@ M:: x86 %dispatch ( src temp -- )
[ (align-code) ]
bi ;
M: x86 %spill ( src rep dst -- )
M: x86 %spill
-rot %copy ;
M: x86 %reload ( dst rep src -- )
M: x86 %reload
swap %copy ;
M:: x86 %local-allot ( dst size align offset -- )
@ -661,10 +661,7 @@ M:: x86 %alien-assembly ( varargs? reg-inputs stack-inputs
reg-outputs [ first3 %load-reg-param ] each
dead-outputs [ first2 %discard-reg-param ] each ;
M: x86 %alien-invoke ( varargs? reg-inputs stack-inputs
reg-outputs dead-outputs
cleanup stack-size
symbols dll gc-map -- )
M: x86 %alien-invoke
'[ _ _ _ %c-invoke ] %alien-assembly ;
M:: x86 %alien-indirect ( src
@ -681,14 +678,14 @@ M:: x86 %alien-indirect ( src
HOOK: %begin-callback cpu ( -- )
M: x86 %callback-inputs ( reg-outputs stack-outputs -- )
M: x86 %callback-inputs
[ [ first3 %load-reg-param ] each ]
[ [ first3 %load-stack-param ] each ] bi*
%begin-callback ;
HOOK: %end-callback cpu ( -- )
M: x86 %callback-outputs ( reg-inputs -- )
M: x86 %callback-outputs
%end-callback
[ first3 %store-reg-param ] each ;
@ -708,10 +705,10 @@ M: x86 long-long-odd-register? f ;
M: x86 float-right-align-on-stack? f ;
M: x86 immediate-arithmetic? ( n -- ? )
M: x86 immediate-arithmetic?
-0x80000000 0x7fffffff between? ;
M: x86 immediate-bitwise? ( n -- ? )
M: x86 immediate-bitwise?
-0x80000000 0x7fffffff between? ;
:: %cmov-float= ( dst src -- )
@ -778,7 +775,7 @@ M:: x86 %bit-test ( dst src1 src2 temp -- )
src1 src2 BT
dst temp \ CMOVB (%boolean) ;
M: x86 enable-cpu-features ( -- )
M: x86 enable-cpu-features
enable-min/max
enable-log2
enable-bit-test

View File

@ -86,14 +86,14 @@ M:: x86 %float>integer ( dst src -- )
src2 shuffle-down quot call
ST0 FSTP ; inline
M: x86 %compare-float-ordered ( dst src1 src2 cc temp -- )
M: x86 %compare-float-ordered
[ [ FCOMI ] compare-op ] (%compare-float) ;
M: x86 %compare-float-unordered ( dst src1 src2 cc temp -- )
M: x86 %compare-float-unordered
[ [ FUCOMI ] compare-op ] (%compare-float) ;
M: x86 %compare-float-ordered-branch ( label src1 src2 cc -- )
M: x86 %compare-float-ordered-branch
[ [ FCOMI ] compare-op ] (%compare-float-branch) ;
M: x86 %compare-float-unordered-branch ( label src1 src2 cc -- )
M: x86 %compare-float-unordered-branch
[ [ FUCOMI ] compare-op ] (%compare-float-branch) ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: classes kernel help.markup help.syntax sequences
alien assocs strings math quotations db.private ;
USING: alien assocs classes db.private help.markup help.syntax
kernel math quotations sequences strings ;
IN: db
HELP: db-connection

View File

@ -1,8 +1,7 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs classes continuations destructors kernel math
namespaces sequences classes.tuple words strings
tools.walker accessors combinators fry db.errors ;
USING: accessors assocs continuations destructors fry kernel
namespaces sequences strings ;
IN: db
TUPLE: db-connection
@ -27,7 +26,7 @@ HOOK: parse-db-error db-connection ( error -- error' )
: dispose-statements ( assoc -- ) values dispose-each ;
M: db-connection dispose ( db-connection -- )
M: db-connection dispose
dup db-connection [
[ dispose-statements H{ } clone ] change-insert-statements
[ dispose-statements H{ } clone ] change-update-statements
@ -77,7 +76,7 @@ GENERIC: bind-tuple ( tuple statement -- )
GENERIC: execute-statement* ( statement type -- )
M: object execute-statement* ( statement type -- )
M: object execute-statement*
'[
_ _ drop query-results dispose
] [
@ -139,9 +138,9 @@ HOOK: begin-transaction db-connection ( -- )
HOOK: commit-transaction db-connection ( -- )
HOOK: rollback-transaction db-connection ( -- )
M: db-connection begin-transaction ( -- ) "BEGIN" sql-command ;
M: db-connection commit-transaction ( -- ) "COMMIT" sql-command ;
M: db-connection rollback-transaction ( -- ) "ROLLBACK" sql-command ;
M: db-connection begin-transaction "BEGIN" sql-command ;
M: db-connection commit-transaction "COMMIT" sql-command ;
M: db-connection rollback-transaction "ROLLBACK" sql-command ;
: in-transaction? ( -- ? ) in-transaction get ;

View File

@ -13,7 +13,7 @@ TUPLE: db-pool < pool db ;
: with-db-pool ( db quot -- )
[ <db-pool> ] dip with-pool ; inline
M: db-pool make-connection ( pool -- conn )
M: db-pool make-connection
db>> db-open ;
: with-pooled-db ( pool quot -- )

View File

@ -31,7 +31,7 @@ IN: db.postgresql.lib
ERROR: postgresql-result-null ;
M: postgresql-result-null summary ( obj -- str )
M: postgresql-result-null summary
drop "PQexec returned f." ;
: postgresql-result-ok? ( res -- ? )
@ -126,7 +126,7 @@ M: postgresql-result-null summary ( obj -- str )
TUPLE: postgresql-malloc-destructor alien ;
C: <postgresql-malloc-destructor> postgresql-malloc-destructor
M: postgresql-malloc-destructor dispose ( obj -- )
M: postgresql-malloc-destructor dispose
alien>> PQfreemem ;
: &postgresql-free ( alien -- alien )

View File

@ -25,7 +25,7 @@ TUPLE: postgresql-statement < statement ;
TUPLE: postgresql-result-set < result-set ;
M: postgresql-db db-open ( db -- db-connection )
M: postgresql-db db-open
{
[ host>> ]
[ port>> ]
@ -36,46 +36,46 @@ M: postgresql-db db-open ( db -- db-connection )
[ password>> ]
} cleave connect-postgres <postgresql-db-connection> ;
M: postgresql-db-connection db-close ( handle -- ) PQfinish ;
M: postgresql-db-connection db-close PQfinish ;
M: postgresql-statement bind-statement* ( statement -- ) drop ;
M: postgresql-statement bind-statement* drop ;
GENERIC: postgresql-bind-conversion ( tuple object -- low-level-binding )
M: sql-spec postgresql-bind-conversion ( tuple spec -- object )
M: sql-spec postgresql-bind-conversion
slot-name>> swap get-slot-named <low-level-binding> ;
M: literal-bind postgresql-bind-conversion ( tuple literal-bind -- object )
M: literal-bind postgresql-bind-conversion
nip value>> <low-level-binding> ;
M: generator-bind postgresql-bind-conversion ( tuple generate-bind -- object )
M: generator-bind postgresql-bind-conversion
dup generator-singleton>> eval-generator
[ swap slot-name>> rot set-slot-named ] [ <low-level-binding> ] bi ;
M: postgresql-statement bind-tuple ( tuple statement -- )
M: postgresql-statement bind-tuple
[ nip ] [
in-params>>
[ postgresql-bind-conversion ] with map
] 2bi
>>bind-params drop ;
M: postgresql-result-set #rows ( result-set -- n )
M: postgresql-result-set #rows
handle>> PQntuples ;
M: postgresql-result-set #columns ( result-set -- n )
M: postgresql-result-set #columns
handle>> PQnfields ;
: result-handle-n ( result-set -- handle n )
[ handle>> ] [ n>> ] bi ;
M: postgresql-result-set row-column ( result-set column -- object )
M: postgresql-result-set row-column
[ result-handle-n ] dip pq-get-string ;
M: postgresql-result-set row-column-typed ( result-set column -- object )
M: postgresql-result-set row-column-typed
dup pick out-params>> nth type>>
[ result-handle-n ] 2dip postgresql-column-typed ;
M: postgresql-statement query-results ( query -- result-set )
M: postgresql-statement query-results
dup bind-params>> [
over [ bind-statement ] keep
do-postgresql-bound-statement
@ -85,17 +85,17 @@ M: postgresql-statement query-results ( query -- result-set )
postgresql-result-set new-result-set
dup init-result-set ;
M: postgresql-result-set advance-row ( result-set -- )
M: postgresql-result-set advance-row
[ 1 + ] change-n drop ;
M: postgresql-result-set more-rows? ( result-set -- ? )
M: postgresql-result-set more-rows?
[ n>> ] [ max>> ] bi < ;
M: postgresql-statement dispose ( query -- )
M: postgresql-statement dispose
dup handle>> PQclear
f >>handle drop ;
M: postgresql-result-set dispose ( result-set -- )
M: postgresql-result-set dispose
[ handle>> PQclear ]
[
0 >>n
@ -103,27 +103,27 @@ M: postgresql-result-set dispose ( result-set -- )
f >>handle drop
] bi ;
M: postgresql-statement prepare-statement ( statement -- )
M: postgresql-statement prepare-statement
dup
[ db-connection get handle>> f ] dip
[ sql>> ] [ in-params>> ] bi
length f PQprepare postgresql-error
>>handle drop ;
M: postgresql-db-connection <simple-statement> ( sql in out -- statement )
M: postgresql-db-connection <simple-statement>
postgresql-statement new-statement ;
M: postgresql-db-connection <prepared-statement> ( sql in out -- statement )
M: postgresql-db-connection <prepared-statement>
<simple-statement> dup prepare-statement ;
: bind-name% ( -- )
CHAR: $ 0,
sql-counter [ inc ] [ get 0# ] bi ;
M: postgresql-db-connection bind% ( spec -- )
M: postgresql-db-connection bind%
bind-name% 1, ;
M: postgresql-db-connection bind# ( spec object -- )
M: postgresql-db-connection bind#
[ bind-name% f swap type>> ] dip
<literal-bind> 1, ;
@ -169,7 +169,7 @@ M: postgresql-db-connection bind# ( spec object -- )
"_seq'');' language sql;" 0%
] query-make ;
M: postgresql-db-connection create-sql-statement ( class -- seq )
M: postgresql-db-connection create-sql-statement
[
[ create-table-sql , ] keep
dup db-assigned? [ create-function-sql , ] [ drop ] if
@ -189,13 +189,13 @@ M: postgresql-db-connection create-sql-statement ( class -- seq )
"drop table " 0% 0% drop
] query-make ;
M: postgresql-db-connection drop-sql-statement ( class -- seq )
M: postgresql-db-connection drop-sql-statement
[
[ drop-table-sql , ] keep
dup db-assigned? [ drop-function-sql , ] [ drop ] if
] { } make ;
M: postgresql-db-connection <insert-db-assigned-statement> ( class -- statement )
M: postgresql-db-connection <insert-db-assigned-statement>
[
"select add_" 0% 0%
"(" 0%
@ -205,7 +205,7 @@ M: postgresql-db-connection <insert-db-assigned-statement> ( class -- statement
");" 0%
] query-make ;
M: postgresql-db-connection <insert-user-assigned-statement> ( class -- statement )
M: postgresql-db-connection <insert-user-assigned-statement>
[
"insert into " 0% 0%
"(" 0%
@ -228,10 +228,10 @@ M: postgresql-db-connection <insert-user-assigned-statement> ( class -- statemen
");" 0%
] query-make ;
M: postgresql-db-connection insert-tuple-set-key ( tuple statement -- )
M: postgresql-db-connection insert-tuple-set-key
query-modify-tuple ;
M: postgresql-db-connection persistent-table ( -- hashtable )
M: postgresql-db-connection persistent-table
H{
{ +db-assigned-id+ { "integer" "serial" f } }
{ +user-assigned-id+ { f f f } }
@ -271,7 +271,7 @@ M: postgresql-db-connection persistent-table ( -- hashtable )
} ;
ERROR: no-compound-found string object ;
M: postgresql-db-connection compound ( string object -- string' )
M: postgresql-db-connection compound
over {
{ "default" [ first number>string " " glue ] }
{ "varchar" [ first number>string "(" ")" surround append ] }

View File

@ -33,7 +33,7 @@ SINGLETON: retryable
] if
] 2map >>bind-params ;
M: retryable execute-statement* ( statement type -- )
M: retryable execute-statement*
drop [ retries>> <iota> ] [
[
nip
@ -62,7 +62,7 @@ M: retryable execute-statement* ( statement type -- )
dup column-name>> 0% " = " 0% bind%
] interleave ;
M: db-connection <update-tuple-statement> ( class -- statement )
M: db-connection <update-tuple-statement>
[
"update " 0% 0%
" set " 0%
@ -71,7 +71,7 @@ M: db-connection <update-tuple-statement> ( class -- statement )
where-primary-key%
] query-make ;
M: random-id-generator eval-generator ( singleton -- obj )
M: random-id-generator eval-generator
drop
system-random-generator get [
63 [ random-bits ] keep 1 - set-bit
@ -102,32 +102,32 @@ M: random-id-generator eval-generator ( singleton -- obj )
: in-parens ( quot -- )
"(" 0% call ")" 0% ; inline
M: interval where ( spec obj -- )
M: interval where
[
[ from>> "from" where-interval ] [
nip infinite-interval? [ " and " 0% ] unless
] [ to>> "to" where-interval ] 2tri
] in-parens ;
M: sequence where ( spec obj -- )
M: sequence where
[
[ " or " 0% ] [ dupd where ] interleave drop
] in-parens ;
M: byte-array where ( spec obj -- )
M: byte-array where
over column-name>> 0% " = " 0% bind# ;
M: NULL where ( spec obj -- )
M: NULL where
drop column-name>> 0% " is NULL" 0% ;
: object-where ( spec obj -- )
over column-name>> 0% " = " 0% bind# ;
M: object where ( spec obj -- ) object-where ;
M: object where object-where ;
M: integer where ( spec obj -- ) object-where ;
M: integer where object-where ;
M: string where ( spec obj -- ) object-where ;
M: string where object-where ;
: filter-slots ( tuple specs -- specs' )
[
@ -145,7 +145,7 @@ M: string where ( spec obj -- ) object-where ;
: where-clause ( tuple specs -- )
dupd filter-slots [ drop ] [ many-where ] if-empty ;
M: db-connection <delete-tuples-statement> ( tuple table -- sql )
M: db-connection <delete-tuples-statement>
[
"delete from " 0% 0%
where-clause
@ -153,7 +153,7 @@ M: db-connection <delete-tuples-statement> ( tuple table -- sql )
ERROR: all-slots-ignored class ;
M: db-connection <select-by-slots-statement> ( tuple class -- statement )
M: db-connection <select-by-slots-statement>
[
"select " 0%
[ dupd filter-ignores ] dip
@ -188,13 +188,13 @@ M: db-connection <select-by-slots-statement> ( tuple class -- statement )
[ offset>> [ do-offset ] [ drop ] if* ]
} 2cleave ;
M: db-connection query>statement ( query -- tuple )
M: db-connection query>statement
[ tuple>> dup class-of ] keep
[ <select-by-slots-statement> ] dip make-query* ;
! select ID, NAME, SCORE from EXAM limit 1 offset 3
M: db-connection <count-statement> ( query -- statement )
M: db-connection <count-statement>
[ tuple>> dup class-of ] keep
[ [ "select count(*) from " 0% 0% where-clause ] query-make ]
dip make-query* ;

View File

@ -13,35 +13,37 @@ IN: db.sqlite.ffi
} cond cdecl add-library >>
! Return values from sqlite functions
CONSTANT: SQLITE_OK 0 ! Successful result
CONSTANT: SQLITE_ERROR 1 ! SQL error or missing database
CONSTANT: SQLITE_INTERNAL 2 ! An internal logic error in SQLite
CONSTANT: SQLITE_PERM 3 ! Access permission denied
CONSTANT: SQLITE_ABORT 4 ! Callback routine requested an abort
CONSTANT: SQLITE_BUSY 5 ! The database file is locked
CONSTANT: SQLITE_LOCKED 6 ! A table in the database is locked
CONSTANT: SQLITE_NOMEM 7 ! A malloc() failed
CONSTANT: SQLITE_READONLY 8 ! Attempt to write a readonly database
CONSTANT: SQLITE_INTERRUPT 9 ! Operation terminated by sqlite_interrupt()
CONSTANT: SQLITE_IOERR 10 ! Some kind of disk I/O error occurred
CONSTANT: SQLITE_CORRUPT 11 ! The database disk image is malformed
CONSTANT: SQLITE_NOTFOUND 12 ! (Internal Only) Table or record not found
CONSTANT: SQLITE_FULL 13 ! Insertion failed because database is full
CONSTANT: SQLITE_CANTOPEN 14 ! Unable to open the database file
CONSTANT: SQLITE_PROTOCOL 15 ! Database lock protocol error
CONSTANT: SQLITE_EMPTY 16 ! (Internal Only) Database table is empty
CONSTANT: SQLITE_SCHEMA 17 ! The database schema changed
CONSTANT: SQLITE_TOOBIG 18 ! Too much data for one row of a table
CONSTANT: SQLITE_CONSTRAINT 19 ! Abort due to contraint violation
CONSTANT: SQLITE_MISMATCH 20 ! Data type mismatch
CONSTANT: SQLITE_MISUSE 21 ! Library used incorrectly
CONSTANT: SQLITE_NOLFS 22 ! Uses OS features not supported on host
CONSTANT: SQLITE_AUTH 23 ! Authorization denied
CONSTANT: SQLITE_FORMAT 24 ! Auxiliary database format error
CONSTANT: SQLITE_RANGE 25 ! 2nd parameter to sqlite3_bind out of range
CONSTANT: SQLITE_NOTADB 26 ! File opened that is not a database file
CONSTANT: SQLITE_OK 0 ! Successful result
CONSTANT: SQLITE_ERROR 1 ! SQL error or missing database
CONSTANT: SQLITE_INTERNAL 2 ! An internal logic error in SQLite
CONSTANT: SQLITE_PERM 3 ! Access permission denied
CONSTANT: SQLITE_ABORT 4 ! Callback routine requested an abort
CONSTANT: SQLITE_BUSY 5 ! The database file is locked
CONSTANT: SQLITE_LOCKED 6 ! A table in the database is locked
CONSTANT: SQLITE_NOMEM 7 ! A malloc() failed
CONSTANT: SQLITE_READONLY 8 ! Attempt to write a readonly database
CONSTANT: SQLITE_INTERRUPT 9 ! Operation terminated by sqlite_interrupt()
CONSTANT: SQLITE_IOERR 10 ! Some kind of disk I/O error occurred
CONSTANT: SQLITE_CORRUPT 11 ! The database disk image is malformed
CONSTANT: SQLITE_NOTFOUND 12 ! (Internal Only) Table or record not found
CONSTANT: SQLITE_FULL 13 ! Insertion failed because database is full
CONSTANT: SQLITE_CANTOPEN 14 ! Unable to open the database file
CONSTANT: SQLITE_PROTOCOL 15 ! Database lock protocol error
CONSTANT: SQLITE_EMPTY 16 ! (Internal Only) Database table is empty
CONSTANT: SQLITE_SCHEMA 17 ! The database schema changed
CONSTANT: SQLITE_TOOBIG 18 ! Too much data for one row of a table
CONSTANT: SQLITE_CONSTRAINT 19 ! Abort due to contraint violation
CONSTANT: SQLITE_MISMATCH 20 ! Data type mismatch
CONSTANT: SQLITE_MISUSE 21 ! Library used incorrectly
CONSTANT: SQLITE_NOLFS 22 ! Uses OS features not supported on host
CONSTANT: SQLITE_AUTH 23 ! Authorization denied
CONSTANT: SQLITE_FORMAT 24 ! Auxiliary database format error
CONSTANT: SQLITE_RANGE 25 ! 2nd parameter to sqlite3_bind out of range
CONSTANT: SQLITE_NOTADB 26 ! File opened that is not a database file
CONSTANT: SQLITE_NOTICE 27 ! Notifications from sqlite3_log()
CONSTANT: SQLITE_WARNING 28 ! Warnings from sqlite3_log()
: sqlite-error-messages ( -- seq ) {
CONSTANT: sqlite-error-messages {
"Successful result"
"SQL error or missing database"
"An internal logic error in SQLite"
@ -69,7 +71,9 @@ CONSTANT: SQLITE_NOTADB 26 ! File opened that is not a database file
"Auxiliary database format error"
"2nd parameter to sqlite3_bind out of range"
"File opened that is not a database file"
} ;
"Notifications from sqlite3_log()"
"Warnings from sqlite3_log()"
}
! Return values from sqlite3_step
CONSTANT: SQLITE_ROW 100
@ -101,19 +105,240 @@ CONSTANT: SQLITE_OPEN_MASTER_JOURNAL 0x00004000
C-TYPE: sqlite3
C-TYPE: sqlite3_stmt
C-TYPE: sqlite3_value
C-TYPE: sqlite3_context
C-TYPE: sqlite3_file
TYPEDEF: longlong sqlite3_int64
TYPEDEF: ulonglong sqlite3_uint64
LIBRARY: sqlite
FUNCTION: int sqlite3_open ( c-string filename, void* ppDb )
! FUNCTION: char sqlite3_version[]
FUNCTION: char* sqlite3_libversion ( )
FUNCTION: char* sqlite3_sourceid ( )
FUNCTION: int sqlite3_libversion_number ( )
FUNCTION: int sqlite3_compileoption_used ( char* zOptName )
FUNCTION: char* sqlite3_compileoption_get ( int N )
FUNCTION: int sqlite3_threadsafe ( )
FUNCTION: int sqlite3_close ( sqlite3* pDb )
FUNCTION: int sqlite3_close_v2 ( sqlite3* pDb )
FUNCTION: int sqlite3_exec (
sqlite3* pDb,
char* sql,
void* callback,
void* arg,
char** errmsg
)
FUNCTION: int sqlite3_initialize ( )
FUNCTION: int sqlite3_shutdown ( )
FUNCTION: int sqlite3_os_init ( )
FUNCTION: int sqlite3_os_end ( )
FUNCTION: int sqlite3_extended_result_codes ( sqlite3* pDb, int onoff )
FUNCTION: sqlite3_uint64 sqlite3_last_insert_rowid ( sqlite3* pDb )
FUNCTION: sqlite3_uint64 sqlite3_set_last_insert_rowid ( sqlite3* pDb, sqlite3_int64 n )
FUNCTION: int sqlite3_changes ( sqlite3* pDb )
FUNCTION: int sqlite3_total_changes ( sqlite3* pDb )
FUNCTION: void sqlite3_interrupt ( sqlite3* pDb )
FUNCTION: int sqlite3_complete ( c-string sql )
FUNCTION: int sqlite3_complete16 ( void *sql )
FUNCTION: void *sqlite3_malloc ( int i )
FUNCTION: void *sqlite3_malloc64 ( sqlite3_uint64 u )
FUNCTION: void *sqlite3_realloc ( void* ptr, int i )
FUNCTION: void *sqlite3_realloc64 ( void* ptr, sqlite3_uint64 u )
FUNCTION: void sqlite3_free ( void* ptr )
FUNCTION: sqlite3_uint64 sqlite3_msize ( void* ptr )
FUNCTION: sqlite3_int64 sqlite3_memory_used ( )
FUNCTION: sqlite3_int64 sqlite3_memory_highwater ( int resetFlag )
FUNCTION: void sqlite3_randomness ( int N, void *P )
FUNCTION: int sqlite3_set_authorizer (
sqlite3* pDb,
void* cb, ! int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
void* pUserData
)
FUNCTION: int sqlite3_trace_v2 (
sqlite3* pDb,
uint uMask,
void* cb, ! int(*xCallback)(unsigned,void*,void*,void*),
void* pCtx
)
FUNCTION: void sqlite3_progress_handler ( sqlite3* pDb, int arg1, void* cb, void* arg2 )
FUNCTION: int sqlite3_open (
c-string filename, ! Database filename (UTF-8)
sqlite3** ppDb ! OUT: SQLite db handle
)
FUNCTION: int sqlite3_open16 (
c-string filename, ! Database filename (UTF-16)
sqlite3** ppDb ! OUT: SQLite db handle
)
FUNCTION: int sqlite3_open_v2 (
c-string filename, ! Database filename (UTF-8)
sqlite3** ppDb, ! OUT: SQLite db handle
int flags, ! Flags
c-string zVfs ! Name of VFS module to use
)
FUNCTION: c-string sqlite3_uri_parameter ( c-string zFilename, c-string zParam )
FUNCTION: int sqlite3_uri_boolean ( c-string zFile, c-string zParam, int bDefault )
FUNCTION: sqlite3_int64 sqlite3_uri_int64 ( c-string str1, c-string str2, sqlite3_int64 i )
FUNCTION: c-string sqlite3_uri_key ( c-string zFilename, int N )
FUNCTION: c-string sqlite3_filename_database ( c-string str )
FUNCTION: c-string sqlite3_filename_journal ( c-string str )
FUNCTION: c-string sqlite3_filename_wal ( c-string str )
FUNCTION: sqlite3_file* sqlite3_database_file_object ( c-string str )
FUNCTION: char* sqlite3_create_filename (
c-string zDatabase,
c-string zJournal,
c-string zWal,
int nParam,
c-string *azParam
)
FUNCTION: void sqlite3_free_filename ( c-string name )
FUNCTION: int sqlite3_errcode ( sqlite3 *db )
FUNCTION: int sqlite3_extended_errcode ( sqlite3 *db )
FUNCTION: c-string sqlite3_errmsg ( sqlite3* pDb )
FUNCTION: int sqlite3_prepare ( sqlite3* pDb, c-string zSql, int nBytes, void* ppStmt, void* pzTail )
FUNCTION: int sqlite3_prepare_v2 ( sqlite3* pDb, c-string zSql, int nBytes, void* ppStmt, void* pzTail )
FUNCTION: void *sqlite3_errmsg16 ( sqlite3* pDb )
FUNCTION: c-string sqlite3_errstr ( int N )
FUNCTION: int sqlite3_limit ( sqlite3* pDb, int id, int newVal )
! FUNCTION: int sqlite3_prepare ( sqlite3* pDb, c-string zSql, int nBytes, void* ppStmt, void* pzTail )
! FUNCTION: int sqlite3_prepare_v2 ( sqlite3* pDb, c-string zSql, int nBytes, void* ppStmt, void* pzTail )
FUNCTION: int sqlite3_prepare (
sqlite3* db, ! Database handle
c-string zSql, ! SQL statement, UTF-8 encoded
int nByte, ! Maximum length of zSql in bytes.
sqlite3_stmt** ppStmt, ! OUT: Statement handle
char** pzTail ! OUT: Pointer to unused portion of zSql
)
FUNCTION: int sqlite3_prepare_v2 (
sqlite3* db, ! Database handle
c-string zSql, ! SQL statement, UTF-8 encoded
int nByte, ! Maximum length of zSql in bytes.
sqlite3_stmt** ppStmt, ! OUT: Statement handle
char** pzTail ! OUT: Pointer to unused portion of zSql
)
FUNCTION: int sqlite3_prepare_v3 (
sqlite3* db, ! Database handle
c-string zSql, ! SQL statement, UTF-8 encoded
int nByte, ! Maximum length of zSql in bytes.
uint prepFlags, ! Zero or more SQLITE_PREPARE_ flags
sqlite3_stmt** ppStmt, ! OUT: Statement handle
char** pzTail ! OUT: Pointer to unused portion of zSql
)
FUNCTION: int sqlite3_prepare16 (
sqlite3* db, ! Database handle
c-string zSql, ! SQL statement, UTF-16 encoded
int nByte, ! Maximum length of zSql in bytes.
sqlite3_stmt** ppStmt, ! OUT: Statement handle
void** pzTail ! OUT: Pointer to unused portion of zSql
)
FUNCTION: int sqlite3_prepare16_v2 (
sqlite3* db, ! Database handle
c-string zSql, ! SQL statement, UTF-16 encoded
int nByte, ! Maximum length of zSql in bytes.
sqlite3_stmt** ppStmt, ! OUT: Statement handle
void** pzTail ! OUT: Pointer to unused portion of zSql
)
FUNCTION: int sqlite3_prepare16_v3 (
sqlite3* db, ! Database handle
c-string zSql, ! SQL statement, UTF-16 encoded
int nByte, ! Maximum length of zSql in bytes.
uint prepFlags, ! Zero or more SQLITE_PREPARE_ flags
sqlite3_stmt** ppStmt, ! OUT: Statement handle
void** pzTail ! OUT: Pointer to unused portion of zSql
)
FUNCTION: char *sqlite3_sql ( sqlite3_stmt *pStmt )
FUNCTION: char *sqlite3_expanded_sql ( sqlite3_stmt *pStmt )
FUNCTION: char *sqlite3_normalized_sql ( sqlite3_stmt *pStmt )
FUNCTION: int sqlite3_stmt_readonly ( sqlite3_stmt *pStmt )
FUNCTION: int sqlite3_stmt_isexplain ( sqlite3_stmt *pStmt )
FUNCTION: int sqlite3_stmt_busy ( sqlite3_stmt *pStmt )
FUNCTION: int sqlite3_bind_parameter_count ( sqlite3_stmt* pStmt )
FUNCTION: char* sqlite3_bind_parameter_name ( sqlite3_stmt* pStmt, int N )
FUNCTION: int sqlite3_bind_parameter_index ( sqlite3_stmt* pStmt, c-string zName )
FUNCTION: int sqlite3_clear_bindings ( sqlite3_stmt* pStmt )
FUNCTION: int sqlite3_column_count ( sqlite3_stmt* pStmt )
FUNCTION: char* sqlite3_column_name ( sqlite3_stmt* pStmt, int N )
FUNCTION: void* sqlite3_column_name16 ( sqlite3_stmt* pStmt, int N )
FUNCTION: char* sqlite3_column_database_name ( sqlite3_stmt* pStmt, int N )
FUNCTION: void* sqlite3_column_database_name16 ( sqlite3_stmt* pStmt, int N )
FUNCTION: char* sqlite3_column_table_name ( sqlite3_stmt* pStmt, int N )
FUNCTION: void* sqlite3_column_table_name16 ( sqlite3_stmt* pStmt, int N )
FUNCTION: char* sqlite3_column_origin_name ( sqlite3_stmt* pStmt, int N )
FUNCTION: void* sqlite3_column_origin_name16 ( sqlite3_stmt* pStmt, int N )
FUNCTION: c-string sqlite3_column_decltype ( sqlite3_stmt* pStmt, int col )
FUNCTION: void* sqlite3_column_decltype16 ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_step ( sqlite3_stmt* pStmt )
FUNCTION: void* sqlite3_column_blob ( sqlite3_stmt* pStmt, int col )
FUNCTION: double sqlite3_column_double ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_column_int ( sqlite3_stmt* pStmt, int col )
FUNCTION: sqlite3_int64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col )
! Bind the same function as above, but for unsigned 64bit integers
FUNCTION-ALIAS: sqlite3_column_uint64
sqlite3_uint64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col )
FUNCTION: c-string sqlite3_column_text ( sqlite3_stmt* pStmt, int col )
FUNCTION: c-string sqlite3_column_text16 ( sqlite3_stmt* pStmt, int col )
FUNCTION: sqlite3_value* sqlite3_column_value ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_column_bytes ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_column_bytes16 ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_column_type ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_finalize ( sqlite3_stmt* pStmt )
FUNCTION: int sqlite3_reset ( sqlite3_stmt* pStmt )
FUNCTION: int sqlite3_step ( sqlite3_stmt* pStmt )
FUNCTION: sqlite3_uint64 sqlite3_last_insert_rowid ( sqlite3* pStmt )
FUNCTION: void* sqlite3_value_blob ( sqlite3_value* value )
FUNCTION: double sqlite3_value_double ( sqlite3_value* value )
FUNCTION: int sqlite3_value_int ( sqlite3_value* value )
FUNCTION: sqlite3_int64 sqlite3_value_int64 ( sqlite3_value* value )
FUNCTION: void* sqlite3_value_pointer ( sqlite3_value* value, char* value )
FUNCTION: uchar* sqlite3_value_text ( sqlite3_value* value )
FUNCTION: void* sqlite3_value_text16 ( sqlite3_value* value )
FUNCTION: void* sqlite3_value_text16le ( sqlite3_value* value )
FUNCTION: void* sqlite3_value_text16be ( sqlite3_value* value )
FUNCTION: int sqlite3_value_bytes ( sqlite3_value* value )
FUNCTION: int sqlite3_value_bytes16 ( sqlite3_value* value )
FUNCTION: int sqlite3_value_type ( sqlite3_value* value )
FUNCTION: int sqlite3_value_numeric_type ( sqlite3_value* value )
FUNCTION: int sqlite3_value_nochange ( sqlite3_value* value )
FUNCTION: int sqlite3_value_frombind ( sqlite3_value* value )
FUNCTION: uint sqlite3_value_subtype ( sqlite3_value* value )
FUNCTION: sqlite3_value *sqlite3_value_dup ( sqlite3_value* value )
FUNCTION: void sqlite3_value_free ( sqlite3_value* value )
FUNCTION: int sqlite3_data_count ( sqlite3_stmt *pStmt )
FUNCTION: int sqlite3_bind_blob ( sqlite3_stmt* pStmt, int index, void* ptr, int len, int destructor )
FUNCTION: int sqlite3_bind_double ( sqlite3_stmt* pStmt, int index, double x )
FUNCTION: int sqlite3_bind_int ( sqlite3_stmt* pStmt, int index, int n )
@ -123,18 +348,89 @@ FUNCTION-ALIAS: sqlite3-bind-uint64
int sqlite3_bind_int64 ( sqlite3_stmt* pStmt, int index, sqlite3_uint64 in64 )
FUNCTION: int sqlite3_bind_null ( sqlite3_stmt* pStmt, int n )
FUNCTION: int sqlite3_bind_text ( sqlite3_stmt* pStmt, int index, c-string text, int len, int destructor )
FUNCTION: int sqlite3_bind_parameter_index ( sqlite3_stmt* pStmt, c-string name )
FUNCTION: int sqlite3_clear_bindings ( sqlite3_stmt* pStmt )
FUNCTION: int sqlite3_column_count ( sqlite3_stmt* pStmt )
FUNCTION: void* sqlite3_column_blob ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_column_bytes ( sqlite3_stmt* pStmt, int col )
FUNCTION: c-string sqlite3_column_decltype ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_column_int ( sqlite3_stmt* pStmt, int col )
FUNCTION: sqlite3_int64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col )
! Bind the same function as above, but for unsigned 64bit integers
FUNCTION-ALIAS: sqlite3_column_uint64
sqlite3_uint64 sqlite3_column_int64 ( sqlite3_stmt* pStmt, int col )
FUNCTION: double sqlite3_column_double ( sqlite3_stmt* pStmt, int col )
FUNCTION: c-string sqlite3_column_name ( sqlite3_stmt* pStmt, int col )
FUNCTION: c-string sqlite3_column_text ( sqlite3_stmt* pStmt, int col )
FUNCTION: int sqlite3_column_type ( sqlite3_stmt* pStmt, int col )
FUNCTION: void* sqlite3_aggregate_context ( sqlite3_context* context, int nBytes )
FUNCTION: void* sqlite3_user_data ( sqlite3_context* context )
FUNCTION: sqlite3 *sqlite3_context_db_handle ( sqlite3_context* context )
FUNCTION: void *sqlite3_get_auxdata ( sqlite3_context* context, int N )
FUNCTION: void sqlite3_set_auxdata ( sqlite3_context* context, int N, void* arg, void* arg2 )
FUNCTION: void sqlite3_result_blob ( sqlite3_context* context, void* arg, int arg2, void* cb )
FUNCTION: void sqlite3_result_blob64 ( sqlite3_context* context, void* arg1, sqlite3_uint64 arg2, void* cb )
FUNCTION: void sqlite3_result_double ( sqlite3_context* context, double d )
FUNCTION: void sqlite3_result_error ( sqlite3_context* context, char* arg1, int arg2 )
FUNCTION: void sqlite3_result_error16 ( sqlite3_context* context, void* arg1, int arg2 )
FUNCTION: void sqlite3_result_error_toobig ( sqlite3_context* context )
FUNCTION: void sqlite3_result_error_nomem ( sqlite3_context* context )
FUNCTION: void sqlite3_result_error_code ( sqlite3_context* context, int i )
FUNCTION: void sqlite3_result_int ( sqlite3_context* context, int i )
FUNCTION: void sqlite3_result_int64 ( sqlite3_context* context, sqlite3_int64 i )
FUNCTION: void sqlite3_result_null ( sqlite3_context* context )
FUNCTION: void sqlite3_result_text ( sqlite3_context* context, char* c, int i, void* cb )
FUNCTION: void sqlite3_result_text64 ( sqlite3_context* context, char* c, sqlite3_uint64 ui, void* v, uchar encoding )
FUNCTION: void sqlite3_result_text16 ( sqlite3_context* context, void* arg, int arg2, void* arg3 )
FUNCTION: void sqlite3_result_text16le ( sqlite3_context* context, void* arg1, int arg2, void* arg3 )
FUNCTION: void sqlite3_result_text16be ( sqlite3_context* context, void* arg1, int arg2, void* arg3 )
FUNCTION: void sqlite3_result_value ( sqlite3_context* context, sqlite3_value* value )
FUNCTION: void sqlite3_result_pointer ( sqlite3_context* context, void* arg1, char* arg2, void* ptr )
FUNCTION: void sqlite3_result_zeroblob ( sqlite3_context* context, int n )
FUNCTION: int sqlite3_result_zeroblob64 ( sqlite3_context* context, sqlite3_uint64 n )
FUNCTION: void sqlite3_result_subtype ( sqlite3_context* context, uint u )
FUNCTION: int sqlite3_create_collation (
sqlite3* pDb,
c-string zName,
int eTextRep,
void* pArg,
void* cb ! int(*xCompare)(void*,int,const void*,int,const void*)
)
FUNCTION: int sqlite3_create_collation_v2 (
sqlite3* pDb,
c-string zName,
int eTextRep,
void *pArg,
void* cb1, ! int(*xCompare)(void*,int,const void*,int,const void*),
void* cb2, ! void(*xDestroy)(void*)
)
FUNCTION: int sqlite3_create_collation16 (
sqlite3* pDb,
void *zName,
int eTextRep,
void* pArg,
void* cb ! int(*xCompare)(void*,int,const void*,int,const void*)
)
FUNCTION: int sqlite3_collation_needed (
sqlite3* pDb,
void* ptr,
void* cb ! void(*)(void*,sqlite3*,int eTextRep,const char*)
)
FUNCTION: int sqlite3_collation_needed16 (
sqlite3* pDb,
void* ptr,
void* cb ! void(*)(void*,sqlite3*,int eTextRep,const void*)
)
FUNCTION: int sqlite3_sleep ( int n )
C-GLOBAL: c-string sqlite3_temp_directory
C-GLOBAL: c-string sqlite3_data_directory
FUNCTION: int sqlite3_win32_set_directory (
ulong type, ! Identifier for directory being set or reset
void* zValue ! New value for directory being set or reset
)
FUNCTION: int sqlite3_win32_set_directory8 ( ulong type, c-string zValue )
FUNCTION: int sqlite3_win32_set_directory16 ( ulong type, c-string zValue )
CONSTANT: SQLITE_WIN32_DATA_DIRECTORY_TYPE 1
CONSTANT: SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2
FUNCTION: int sqlite3_get_autocommit ( sqlite3* pDb )
FUNCTION: sqlite3* sqlite3_db_handle ( sqlite3_stmt* pStmt )
FUNCTION: c-string sqlite3_db_filename ( sqlite3* db, c-string zDbName )
FUNCTION: int sqlite3_db_readonly ( sqlite3* db, c-string zDbName )

View File

@ -22,19 +22,19 @@ TUPLE: sqlite-db-connection < db-connection ;
PRIVATE>
M: sqlite-db db-open ( db -- db-connection )
M: sqlite-db db-open
path>> sqlite-open <sqlite-db-connection> ;
M: sqlite-db-connection db-close ( handle -- ) sqlite-close ;
M: sqlite-db-connection db-close sqlite-close ;
TUPLE: sqlite-statement < statement ;
TUPLE: sqlite-result-set < result-set has-more? ;
M: sqlite-db-connection <simple-statement> ( str in out -- obj )
M: sqlite-db-connection <simple-statement>
<prepared-statement> ;
M: sqlite-db-connection <prepared-statement> ( str in out -- obj )
M: sqlite-db-connection <prepared-statement>
sqlite-statement new-statement ;
: sqlite-maybe-prepare ( statement -- statement )
@ -43,22 +43,22 @@ M: sqlite-db-connection <prepared-statement> ( str in out -- obj )
>>handle
] unless ;
M: sqlite-statement dispose ( statement -- )
M: sqlite-statement dispose
handle>>
[ [ sqlite3_reset drop ] keep sqlite-finalize ] when* ;
M: sqlite-result-set dispose ( result-set -- )
M: sqlite-result-set dispose
f >>handle drop ;
: reset-bindings ( statement -- )
sqlite-maybe-prepare
handle>> [ sqlite3_reset drop ] [ sqlite3_clear_bindings drop ] bi ;
M: sqlite-statement low-level-bind ( statement -- )
M: sqlite-statement low-level-bind
[ handle>> ] [ bind-params>> ] bi
[ [ key>> ] [ value>> ] [ type>> ] tri sqlite-bind-type ] with each ;
M: sqlite-statement bind-statement* ( statement -- )
M: sqlite-statement bind-statement*
sqlite-maybe-prepare
dup bound?>> [ dup reset-bindings ] when
low-level-bind ;
@ -72,12 +72,12 @@ TUPLE: sqlite-low-level-binding < low-level-binding key type ;
swap >>value
swap >>key ;
M: sql-spec sqlite-bind-conversion ( tuple spec -- array )
M: sql-spec sqlite-bind-conversion
[ column-name>> ":" prepend ]
[ slot-name>> rot get-slot-named ]
[ type>> ] tri <sqlite-low-level-binding> ;
M: literal-bind sqlite-bind-conversion ( tuple literal-bind -- array )
M: literal-bind sqlite-bind-conversion
nip [ key>> ] [ value>> ] [ type>> ] tri
<sqlite-low-level-binding> ;
@ -87,7 +87,7 @@ M:: generator-bind sqlite-bind-conversion ( tuple generate-bind -- array )
obj name tuple set-slot-named
generate-bind key>> obj generate-bind type>> <sqlite-low-level-binding> ;
M: sqlite-statement bind-tuple ( tuple statement -- )
M: sqlite-statement bind-tuple
[
in-params>> [ sqlite-bind-conversion ] with map
] keep bind-statement ;
@ -98,31 +98,31 @@ ERROR: sqlite-last-id-fail ;
db-connection get handle>> sqlite3_last_insert_rowid
dup zero? [ sqlite-last-id-fail ] when ;
M: sqlite-db-connection insert-tuple-set-key ( tuple statement -- )
M: sqlite-db-connection insert-tuple-set-key
execute-statement last-insert-id swap set-primary-key ;
M: sqlite-result-set #columns ( result-set -- n )
M: sqlite-result-set #columns
handle>> sqlite-#columns ;
M: sqlite-result-set row-column ( result-set n -- obj )
M: sqlite-result-set row-column
[ handle>> ] [ sqlite-column ] bi* ;
M: sqlite-result-set row-column-typed ( result-set n -- obj )
M: sqlite-result-set row-column-typed
dup pick out-params>> nth type>>
[ handle>> ] 2dip sqlite-column-typed ;
M: sqlite-result-set advance-row ( result-set -- )
M: sqlite-result-set advance-row
dup handle>> sqlite-next >>has-more? drop ;
M: sqlite-result-set more-rows? ( result-set -- ? )
M: sqlite-result-set more-rows?
has-more?>> ;
M: sqlite-statement query-results ( query -- result-set )
M: sqlite-statement query-results
sqlite-maybe-prepare
dup handle>> sqlite-result-set new-result-set
dup advance-row ;
M: sqlite-db-connection <insert-db-assigned-statement> ( class -- statement )
M: sqlite-db-connection <insert-db-assigned-statement>
[
"insert into " 0% 0%
"(" 0%
@ -143,19 +143,19 @@ M: sqlite-db-connection <insert-db-assigned-statement> ( class -- statement )
");" 0%
] query-make ;
M: sqlite-db-connection <insert-user-assigned-statement> ( class -- statement )
M: sqlite-db-connection <insert-user-assigned-statement>
<insert-db-assigned-statement> ;
M: sqlite-db-connection bind# ( spec obj -- )
M: sqlite-db-connection bind#
[
[ column-name>> ":" next-sql-counter surround dup 0% ]
[ type>> ] bi
] dip <literal-bind> 1, ;
M: sqlite-db-connection bind% ( spec -- )
M: sqlite-db-connection bind%
dup 1, column-name>> ":" prepend 0% ;
M: sqlite-db-connection persistent-table ( -- assoc )
M: sqlite-db-connection persistent-table
H{
{ +db-assigned-id+ { "integer" "integer" f } }
{ +user-assigned-id+ { f f f } }
@ -314,16 +314,16 @@ M: sqlite-db-connection persistent-table ( -- assoc )
");" 0%
] 2bi ;
M: sqlite-db-connection create-sql-statement ( class -- statement )
M: sqlite-db-connection create-sql-statement
[
[ sqlite-create-table ]
[ drop create-db-triggers ] 2bi
] query-make ;
M: sqlite-db-connection drop-sql-statement ( class -- statements )
M: sqlite-db-connection drop-sql-statement
[ nip "drop table " 0% 0% ";" 0% ] query-make ;
M: sqlite-db-connection compound ( string seq -- new-string )
M: sqlite-db-connection compound
over {
{ "default" [ first number>string " " glue ] }
{ "references" [ >reference-string ] }

View File

@ -4,6 +4,6 @@ USING: debugger io kernel prettyprint sequences system
unix.signals ;
IN: debugger.unix
M: unix signal-error. ( obj -- )
M: unix signal-error.
"Unix signal #" write
third [ pprint ] [ signal-name. ] bi nl ;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -21,7 +21,7 @@ M: macosx find-atom
f
] if* ;
M: atom-editor editor-command ( file line -- command )
M: atom-editor editor-command
[
atom-path get [ find-atom ] unless* ,
number>string ":" glue ,

View File

@ -4,6 +4,6 @@ IN: editors.bbedit
SINGLETON: bbedit
bbedit editor-class set-global
M: bbedit editor-command ( file line -- command )
M: bbedit editor-command
drop
[ "open" , "-a" , "BBEdit" , , ] { } make ;

View File

@ -16,7 +16,7 @@ M: macosx brackets-path
f
] if* ;
M: brackets-editor editor-command ( file line -- command )
M: brackets-editor editor-command
[ brackets-path "brackets" or , drop , ] { } make ;
os windows? [ "editors.brackets.windows" require ] when

View File

@ -12,5 +12,5 @@ coteditor editor-class set-global
f
] if* ;
M: coteditor editor-command ( file line -- command )
M: coteditor editor-command
[ find-cot-bundle-path , "-l" , number>string , , ] { } make ;

View File

@ -14,7 +14,7 @@ editpadpro editor-class set-global
} 0||
] unless* ;
M: editpadpro editor-command ( file line -- command )
M: editpadpro editor-command
[
editpadpro-path , number>string "/l" prepend , ,
] { } make ;

View File

@ -11,7 +11,7 @@ editplus editor-class set-global
[ "editplus.exe" ] unless*
] unless* ;
M: editplus editor-command ( file line -- command )
M: editplus editor-command
[
editplus-path , "-cursor" , number>string , ,
] { } make ;

View File

@ -10,7 +10,7 @@ SYMBOL: emacsclient-args
HOOK: find-emacsclient os ( -- path )
M: object find-emacsclient ( -- path )
M: object find-emacsclient
"emacsclient" ?find-in-path ;
M: windows find-emacsclient
@ -20,7 +20,7 @@ M: windows find-emacsclient
[ "emacsclient.exe" ]
} 0|| ;
M: emacsclient editor-command ( file line -- command )
M: emacsclient editor-command
[
emacsclient-path get [ find-emacsclient ] unless* ,
emacsclient-args get [ { "-a=emacs" "--no-wait" } ] unless* %

View File

@ -11,7 +11,7 @@ emeditor editor-class set-global
[ "EmEditor.exe" ] unless*
] unless* ;
M: emeditor editor-command ( file line -- command )
M: emeditor editor-command
[
emeditor-path , "/l" , number>string , ,
] { } make ;

View File

@ -13,7 +13,7 @@ etexteditor editor-class set-global
[ "e.exe" ] unless*
] unless* ;
M: etexteditor editor-command ( file line -- command )
M: etexteditor editor-command
[
etexteditor-path ,
[ , ] [ "--line" , number>string , ] bi*

Some files were not shown because too many files have changed in this diff Show More