summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-06-21LibJS: Rename EnvironmentRecord::parent() => outer_environment()Andreas Kling
This name matches the spec (corresponds to the [[OuterEnv]] slot.)
2021-06-21LibJS: Convert EnvironmentRecord & friends to east-const styleAndreas Kling
2021-06-21LibJS: Rename Environment Records so they match the spec :^)Andreas Kling
This patch makes the following name changes: - ScopeObject => EnvironmentRecord - LexicalEnvironment => DeclarativeEnvironmentRecord - WithScope => ObjectEnvironmentRecord
2021-06-22LibWasm: Limit the call stack depth and the number of executed instsAli Mohammad Pur
These limits are described in the spec, and we're supposed to stop execution at some point. The limits are arbitrarily chosen.
2021-06-22LibWasm: Trap if a non-Value is used as a ValueAli Mohammad Pur
Otherwise we'd just crash, which is not a good thing
2021-06-22Meta+LibWasm: Add support for module linking testsAli Mohammad Pur
This commit makes the linking tests in the wasm spec test run.
2021-06-22LibWeb: Implement the WebAssembly Memory object and Memory importsAli Mohammad Pur
2021-06-22LibJS: Don't assert for empty reciever if AllowSideEffects::No is givenAli Mohammad Pur
This parameter is only used if AllowSideEffects::Yes, so there's no reason to pass anything to it if that's not used.
2021-06-22LibWeb: Cache the WebAssembly objects that we hand out to JSAli Mohammad Pur
The spec requires this behaviour, and it's generally faster to do this instead of re-resolving and re-creating the instances anyway.
2021-06-22LibWeb: Use SignedBigInteger::create() to create wasm i64 valuesAli Mohammad Pur
...instead of the terrible from_base10(...to_base10()) hack.
2021-06-22LibWeb: Avoid resolving the wasm call address type on every invocationAli Mohammad Pur
This is a waste of time, and it's not a cheap operation.
2021-06-21LibJS: Add VM::dump_scope_chain()Andreas Kling
This is a handy helper that dumps the current scope chain, starting at the innermost scope.
2021-06-21LibJS: Rename Parser::m_parser_state => m_stateAndreas Kling
Also remove the "m_" prefix from all the public data members.
2021-06-21LibJS: Fix spelling mistake in VariableDeclaration::execute()Andreas Kling
2021-06-21LibC: Add P_tmpdir macroDaniel Bertalan
2021-06-21SoundPlayer: Handle any input file sample rateNick Miller
This commit addresses two issues: 1. If you play a 96 KHz Wave file, the slider position is incorrect, because it is assumed all files are 44.1 KHz. 2. For high-bitrate files, there are audio dropouts due to not buffering enough audio data. Issue 1 is addressed by scaling the number of played samples by the ratio between the source and destination sample rates. Issue 2 is addressed by buffering a certain number of milliseconds worth of audio data (instead of a fixed number of bytes). This makes the the buffer size independent of the source sample rate. Some of the code is redesigned to be simpler. The code that did the book-keeping of which buffers need to be loaded and which have been already played has been removed. Instead, we enqueue a new buffer based on a low watermark of samples remaining in the audio server queue. Other small fixes include: 1. Disable the stop button when playback is finished. 2. Remove hard-coded instances of 44100. 3. Update the GUI every 50 ms (was 100), which improves visualizations.
2021-06-21LibAudio: Sleep less when the audio buffer is fullNick Miller
When using `aplay` to play audio files with a sample rate of 96000, there were occasional one-second gaps in playback. This is because the Audio::ClientConnection sleeps for a full second when the audio buffer is full. One second is too long to sleep, especially for high-bitrate files. Changing the sleep to a more reasonable value like 100 ms ensures we attempt to enqueue again before the audio buffer runs empty.
2021-06-21LibAudio: Avoid reading past the end of sample dataNick Miller
Prior code in `WavLoader::get_more_samples()` would attempt to read the requested number of samples without actually checking whether that many samples were remaining in the stream. This was the cause of an audible pop at the end of a track, due to reading non-audio data that is sometimes at the end of a Wave file. Now we only attempt to read up to the end of sample data, but no further. Also, added comments to clarify the meaning of "sample", and how it should be independent of the number of channels.
2021-06-21LibJS: Add bytecode support for regexp literalsMatthew Olsson
2021-06-20LibGUI/TabWidget: Make sure we don't act on two mouseup eventsMarcus Nilsson
Make sure that even if we get two mouseup events, we do not try to remove the same widget twice.
2021-06-20LibWeb: Fix redirects when a response has no dataGil Mendes
This makes redirects work when the HTTP server responds with just headers and no data.
2021-06-20LibJS: Implement support for the [[IsHTMLDDA]] internal slotLinus Groh
Best regards from Annex B and document.all :^)
2021-06-20LibGUI/TabWidget: Add close button to tabsMarcus Nilsson
This adds an optional close button to tabs, useful in for example browser and pixelpaint.
2021-06-20LibJS: Let if yield undefined for branches that don't yield a valueGunnar Beutner
According to 13.6.7 the return value for if expressions should be undefined when the branch statements don't yield a value.
2021-06-20WindowServer: Add API to set/get screen layoutsTom
This sets the stage so that DisplaySettings can configure the screen layout and set various screen resolutions in one go. It also allows for an easy "atomic" revert of the previous settings.
2021-06-20WindowServer: Add initial support for rendering on multiple screensTom
This allows WindowServer to use multiple framebuffer devices and compose the desktop with any arbitrary layout. Currently, it is assumed that it is configured contiguous and non-overlapping, but this should eventually be enforced. To make rendering efficient, each window now also tracks on which screens it needs to be rendered. This way we don't have to iterate all the windows for each screen but instead use the same rendering loop and then only render to the screen (or screens) that the window actually uses.
2021-06-20LibGfx: Add a Line class and a Rect<T>::RelativeLocation classTom
These helpers will be useful in preparation for supporting multiple displays, e.g. to measure distances to other screens or figure out where rectangles are located relative to each other.
2021-06-20LibCore: Call optional did_construct() method when constucting objectsAli Mohammad Pur
Some objects need to perform tasks during construction that require the object to be fully constructed, which can't be done in the constructor. This allows postponing such tasks into a did_construct method that will be called right after the object was fully constructed.
2021-06-20LibJS: Use OrdinaryCreateFromConstructor() in a bunch of constructorsLinus Groh
Resolves various FIXMEs :^)
2021-06-20LibJS: Consistently make prototype the last argument in Object ctorsLinus Groh
This is so that we can reliably allocate them in a template function, e.g. in ordinary_create_from_constructor(): global_object.heap().allocate<T>( global_object, forward<Args>(args)..., *prototype); The majority of objects already take the prototype as the last argument, so I updated the ones that didn't.
2021-06-20LibJS: Implement the OrdinaryCreateFromConstructor() abstract operationLinus Groh
2021-06-20LibJS: Implement the GetPrototypeFromConstructor() abstract operationLinus Groh
2021-06-20LibJS: Implement the GetFunctionRealm() abstract operationLinus Groh
2021-06-20LibJS: Introduce AbstractOperations.{cpp,h} and move various AOs thereLinus Groh
Value.{cpp,h} has become a dumping ground, let's change that. Things that are directly related to Values (e.g. bitwise/binary ops, equality related functions) can remain, but everything else that's not a Value or Object method and globally required (not just a static function somewhere) is being moved. Also convert to east-const while we're here. I haven't touched IteratorOperations.{cpp,h}, it seems fine to still have those separately.
2021-06-20LibCoreDump: Don't subtract one from the first stack frame's EIPGunnar Beutner
The first stack frame represents the current instruction pointer rather than the return address so we shouldn't subtract one from it. Fixes #8162.
2021-06-20LibWasm: Remove empty AbstractMachine/Interpreter.cppLinus Groh
This was moved to BytecodeInterpreter.cpp, so this is unused now.
2021-06-19LibSQL: Database layerJan de Visser
This patch implements the beginnings of a database API allowing for the creation of tables, inserting rows in those tables, and retrieving those rows.
2021-06-19LibSQL: Hash index implementation for the SQL storage layerJan de Visser
This patch implements a basic hash index. It uses the extendible hashing algorith. Also includes a test file.
2021-06-19LibSQL: BTree index, Heap, and Meta objects for SQL Storage layerJan de Visser
Unfortunately this patch is quite large. The main functionality included are a BTree index implementation and the Heap class which manages persistent storage. Also included are a Key subclass of the Tuple class, which is a specialization for index key tuples. This "dragged in" the Meta layer, which has classes defining SQL objects like tables and indexes.
2021-06-19LibSQL: Basic dynamic value classes for SQL Storage layerJan de Visser
This patch adds the basic dynamic value classes used by the SQL Storage layer. The most elementary class is Value, which holds a typed Value which can be converted to standard C++ types. A Tuple is a collection of Values described by a TupleDescriptor, which specifies the names, types, and ordering of the elements in the Tuple. Tuples and Values can be serialized and deserialized to and from ByteBuffers. This is mechanism which is used to save them to disk. Tuples are used as keys in SQL indexes and rows in SQL tables. Also included is a test file.
2021-06-19LibSymbolication+Utilities: Show inlined functions for btGunnar Beutner
2021-06-19LibJS: Add the Number.prototype.toFixed methodIdan Horowitz
2021-06-19LibDebug: Convert LibDebug to east-const styleItamar
2021-06-19LibCoreDump: Include source locations of inlined functions in backtraceItamar
2021-06-19LibDebug: Add DebugInfo::get_source_position_with_inlinesItamar
This function returns the source position of a given address in the program. If that address exists in an inline chain, then it also returns the source positions that are in the chain.
2021-06-19LibDebug: Add DwarfInfo::get_cached_die_at_offsetItamar
This function returns a DIE object from the cache with the given offset in the debug_info section.
2021-06-19LibDebug:: Add DwarfInfo::get_die_at_addressItamar
This function returns the die object whose address range intersects with the given address. This function will also construct the DIE cache, if it hasn't been constructed yet.
2021-06-19LibDebug: Add caches of DIE objects to DwarfInfoItamar
There is one cache that indexes DIE objects by the start address of their range, and another cache that indexes by their offset in the debug_info section. Both caches are implemented with RedBlackTree, and are optional - they will only be populated if 'build_cached_dies' is invoked.
2021-06-19LibDebug: Store optional parent_offset in Dwarf::DIE objectsItamar
In the current implementation, only DIE objects that are created via DIE::for_each_child() will have parent offsets. DIE objects that are created with CompilationUnit::get_die_at_offset() do not currently store a parent offset. We may improve this in the future, but this is enough for what we currently need.
2021-06-19LibDebug: Add AttributeForm field to Dwarf::AttributeValueItamar
In some contexts, it's helpful to also know the "Attribute Form", in addition to the "Attribute Type". An example for such context is the interpretation of the "DW_AT_high_pc" attribute, which has different meaning if the form is an address or a constant.