summaryrefslogtreecommitdiff
path: root/Userland/Utilities
AgeCommit message (Collapse)Author
2021-06-17js: Add print_number method and use it to print out TypedArray valuesLuke
We can't construct Values with u64 and i64. I tried adding these constructors, but then it refuses to build in lagom.
2021-06-17Userland: Allow multiple files to be run by jssin-ack
js only accepted a single script file to run before this. With this patch, multiple scripts can be run in the same execution environment, allowing the user to specify a "preamble script" to be executed before the main script.
2021-06-15Userland: Teach the file utility that empty files also existValtteri Koskivuori
Previously, empty files with no identifiable file type extension would show up as `text/plain`. This fixes it up to show empty files as what they really are - full of nothing.
2021-06-15LibJS: Add a basic pass manager and add some basic passesAli Mohammad Pur
This commit adds a bunch of passes, the most interesting of which is a pass that merges blocks together, and a pass that places blocks that flow into each other next to each other, and a very simply pass that removes duplicate basic blocks. Note that this does not remove the jump at the end of each block in that pass to avoid scope creep in the passes.
2021-06-14Userland: Fix double line spacing in grepSahan Fernando
2021-06-14LibJS: Add the DataView built-in objectIdan Horowitz
2021-06-13LibJS: Make StringOrSymbol always be FlyString in the string caseAndreas Kling
This makes equality checking O(1) instead of O(n).
2021-06-13Utilites: Implement `unzip -q`Jelle Raaijmakers
2021-06-13Utilities: Change `unzip -o` option to `-d`Jelle Raaijmakers
Other `unzip` implementations universally use `-d` to indicate the output directory, so let's follow this convention.
2021-06-13LibJS: Add the Map built-in objectIdan Horowitz
2021-06-12AK: Rename Vector::append(Vector) => Vector::extend(Vector)Andreas Kling
Let's make it a bit more clear when we're appending the elements from one vector to the end of another vector.
2021-06-11Utilities/du: Add -h optionMarcus Nilsson
Add -h/--human-readable option to du.
2021-06-11Utilities: Add a simple utility to test the IMAP libraryx-yl
test-imap is a very simple tool which runs through some of the IMAP commands and makes sure they don't crash.
2021-06-10Userland: Fix incorrect iflag/oflag printing in `stty`Daniel Bertalan
The `c_iflag` and `c_oflag` fields were swapped in the source code which caused the bit values to be interpreted as the wrong flag. It was a stupid mistake on my part.
2021-06-10LibJS: Show the VM's last value after executing bytecode programsGunnar Beutner
2021-06-10LibJS: Don't generate bytecode after we've encountered a parser errorGunnar Beutner
2021-06-09Meta: Disable -Wmaybe-uninitializedAli Mohammad Pur
It's prone to finding "technically uninitialized but can never happen" cases, particularly in Optional<T> and Variant<Ts...>. The general case seems to be that it cannot infer the dependency between Variant's index (or Optional's boolean state) and a particular alternative (or Optional's buffer) being untouched. So it can flag cases like this: ```c++ if (index == StaticIndexForF) new (new_buffer) F(move(*bit_cast<F*>(old_buffer))); ``` The code in that branch can _technically_ make a partially initialized `F`, but that path can never be taken since the buffer holding an object of type `F` and the condition being true are correlated, and so will never be taken _unless_ the buffer holds an object of type `F`. This commit also removed the various 'diagnostic ignored' pragmas used to work around this warning, as they no longer do anything.
2021-06-09wasm: Add a help command to the shell mode and start it on --shellAli Mohammad Pur
2021-06-09LibJS: Store strings in a string tableGunnar Beutner
Instead of using Strings in the bytecode ops this adds a global string table to the Executable struct which individual operations can refer to using indices. This brings bytecode ops one step closer to being pointer free.
2021-06-09LibJS: Add the Set built-in objectIdan Horowitz
2021-06-09LibJS: Generate bytecode in basic blocks instead of one big blockAli Mohammad Pur
This limits the size of each block (currently set to 1K), and gets us closer to a canonical, more easily analysable bytecode format. As a result of this, "Labels" are now simply entries to basic blocks. Since there is no more 'conditional' jump (as all jumps are always taken), JumpIf{True,False} are unified to JumpConditional, and JumpIfNullish is renamed to JumpNullish. Also fixes #7914 as a result of reimplementing the loop logic.
2021-06-09Utilities: Do not allow creating users with existing usernamesbrapru
Previously useradd would not check if a username already existed on the system, and would instead add the user anyway and just increment the uid. useradd should instead return an error when the user attempts to create already existing users.
2021-06-08LibJS: Handle Proxy with Array target in IsArray() abstract operationLinus Groh
This was missing from Value::is_array(), which is equivalent to the spec's IsArray() abstract operation - it treats a Proxy value with an Array target object as being an Array. It can throw, so needs both the global object and an exception check now.
2021-06-08gron: Handle invalid input gracefullySam Atkins
Print an error and return 1, instead of asserting.
2021-06-08gron: Make gron read from stdin if no file is providedSam Atkins
2021-06-08Utilities: Make `xargs` stop parsing options on first non-optionJelle Raaijmakers
2021-06-08Utilities: Make `watch` stop parsing options on first non-optionJelle Raaijmakers
2021-06-08Utilities: Make `strace` stop parsing options on first non-optionJelle Raaijmakers
2021-06-08Userland: Let `env` parse options up to first non-optionJelle Raaijmakers
2021-06-08LibCore: Support fine-grained failure behavior for ArgsParserJelle Raaijmakers
2021-06-07js: Exit the program after dumping and/or running bytecodeAndreas Kling
Otherwise we'd run the same program again in the AST interpreter.
2021-06-07LibJS: Start fleshing out a bytecode for the JavaScript engine :^)Andreas Kling
This patch begins the work of implementing JavaScript execution in a bytecode VM instead of an AST tree-walk interpreter. It's probably quite naive, but we have to start somewhere. The basic idea is that you call Bytecode::Generator::generate() on an AST node and it hands you back a Bytecode::Block filled with instructions that can then be interpreted by a Bytecode::Interpreter. This first version only implements two instructions: Load and Add. :^) Each bytecode block has infinity registers, and the interpreter resizes its register file to fit the block being executed. Two new `js` options are added in this patch as well: `-d` will dump the generated bytecode `-b` will execute the generated bytecode Note that unless `-d` and/or `-b` are specified, none of the bytecode related stuff in LibJS runs at all. This is implemented in parallel with the existing AST interpreter. :^)
2021-06-06Utilities: Add support for testing null deferencing a RefPtrGunnar Beutner
This adds the new flag -R for the crash utility which tests what happens when we dereference a null RefPtr. This is useful for testing the output of the assertion message.
2021-06-06Userland: Fix matroska utility displaying invalid track dataFalseHonesty
2021-06-06Userland: Add matroska program to test parsing Matroska container filesFalseHonesty
2021-06-06LibProtocol: Use URL class in RequestClient::start_request argumentMax Wipfli
This changes the RequestClient::start_request() method to take a URL object instead of a URL string as argument. All callers of the method already had a URL object anyway, and start_request() in turn parses the URL string back into a URL object. This removes this unnecessary conversion.
2021-06-05ifconfig: Use shorter argument namesMaciej Zygmanowski
The previous argument names were so long that they won't fit into the terminal, making help message unreadable.
2021-06-05LibWasm: Move Wasm::BytecodeInterpreter into its own headerSahan Fernando
2021-06-05rm: Allow empty paths if -f is specifiedTim Schumacher
On most (if not all) systems rm ignores an empty paths array if -f or --force is specified. This helps with scripts that may pass an empty variable where the file paths are supposed to go.
2021-06-04hostname: Handle 'sethostname' errorsMaciej Zygmanowski
2021-06-04LibWasm+wasm: Switch to east-const to comply with project styleAli Mohammad Pur
Against my better judgement, this change is mandated by the project code style rules, even if it's not actually enforced.
2021-06-04Userland/wasm: Replace manual noop export with an automatic oneAli Mohammad Pur
Instead of manually specifying the types and names of imports to stub out, `--export-noop` can be used to export stub functions for any unresolved function import. This makes running and debugging random wasm files much easier.
2021-06-04LibWasm: Load and instantiate tablesAli Mohammad Pur
This commit is a fairly large refactor, mainly because it unified the two different ways that existed to represent references. Now Reference values are also a kind of value. It also implements a printer for values/references instead of copying the implementation everywhere.
2021-06-03Everywhere: Remove accidental '\n' from various outln() invocationsAndreas Kling
Also convert outln(stderr, ...) to warnln(...)
2021-06-03Utilities: Make sure columns for ps are properly alignedGunnar Beutner
This updates ps so that it calculates the ideal column width instead of relying on hard-coded values. Previously the STATE column was too small to fit the state for "FinalizerTask".
2021-06-03AK: Remove unused JsonValue <=> IPv4Address conversion codeGunnar Beutner
This removes code that isn't used anywhere.
2021-06-02Utilities: Add support for relative paths in open commandFilip Kania
2021-06-02wasm: Add a way to create dummy function exportsAli Mohammad Pur
This should allow running modules with their imports stubbed out in wasm, to debug them.
2021-06-02LibWasm: Implement reference instructions (ref.{null,func,is_null})Ali Mohammad Pur
2021-06-02Utilities: Report correct memory addresses for pmapGunnar Beutner
While I think negative memory might be an interesting concept to investigate I don't think we're quite ready for it yet: 7ca71000 8192 r-xs- libcrypt.so: .text 7ca73000 4096 r---- libcrypt.so: .relro 7ca74000 4096 rw--- libcrypt.so: .data -6d391000 45056 r-xs- libttf.so: .text -6d385000 4096 r---- libttf.so: .relro -6d384000 4096 rw--- libttf.so: .data