summaryrefslogtreecommitdiff
path: root/cli/ops.rs
AgeCommit message (Collapse)Author
2019-06-05RecursiveLoad shouldn't own the Isolate (#2453)Ryan Dahl
This patch makes it so that RecursiveLoad doesn't own the Isolate, so Worker::execute_mod_async does not consume itself. Previously Worker implemented Loader, but now ThreadSafeState does. This is necessary preparation work for dynamic import (#1789) and import maps (#1921)
2019-05-29TS compiler refactorRyan Dahl
* Compiler no longer has its own Tokio runtime. Compiler handles one message and then exits. * Uses the simpler ts.CompilerHost interface instead of ts.LanguageServiceHost. * avoids recompiling the same module by introducing a hacky but simple `hashset<string>` that stores the module names that have been already compiled. * Removes the CompilerConfig op. * Removes a lot of the mocking stuff in compiler.ts like `this._ts`. It is not useful as we don't even have tests. * Turns off checkJs because it causes fmt_test to die with OOM.
2019-05-29Correct tokio_util::block_on() and op_fetch_module_meta_dataRyan Dahl
op_fetch_module_meta_data is an op that is used by the TypeScript compiler. TypeScript requires this op to be sync. However the implementation of the op does things on the event loop (like fetching HTTP resources). In certain situations this can lead to deadlocks. The runtime's thread pool can be filled with ops waiting on the result of op_fetch_module_meta_data. The runtime has a maximum number of threads it can use (the number of logical CPUs on the system). This patch changes tokio_util::block_on to launch a new Tokio runtime for evaluating the future, thus bipassing the max-thread problem. This is only an issue in op_fetch_module_meta_data. Other synchronous ops are truly synchornous, not interacting with the event loop. TODO comments are added to direct future development.
2019-05-23re-fix permissions for dial and listen (#2400)Bartek Iwańczuk
Closes #2397
2019-05-23Rename --allow-high-precision to --allow-hrtime (#2398)Ryan Dahl
2019-05-22Revert "Fix permissions for dial and listen (#2373)"Bert Belder
This reverts commit 7219787894f13b1920b3b6b49203cdcb8f672c00.
2019-05-17Fix permissions for dial and listen (#2373)Bartek Iwańczuk
2019-05-17Add crypto.getRandomValues() (#2327)chiefbiiko
2019-05-15Remove FileInfo.pathRyan Dahl
2019-05-11Add progress bar (#2309)Ryan Dahl
2019-05-09core: Privatize ModuleNameMap SymbolicModule deno_buf (#2324)Bartek Iwańczuk
2019-05-09fix: support relative path for whitelisting (#2317)Kevin (Kun) "Kassimo" Qian
Using `std::fs::canonicalize` to expand path to full existing path, such that later attempt to loop-pop and compare path segment would work.
2019-05-08First pass at permissions whitelist (#2129)andy finch
2019-05-07Add Deno.chown (#2292)Yingbo (Max) Wang
2019-05-03feat(cli cmd): deno xeval (#2260)Kevin (Kun) "Kassimo" Qian
2019-05-03add --no-fetch CLI flag to prevent remote downloads (#2213)Bartek Iwańczuk
2019-05-03Optimize read and write ops (#2259)Ryan Dahl
2019-05-03core,cli: fix clippy warningsBert Belder
2019-05-01core: express op as enum (#2255)Ryan Dahl
2019-05-01Refactor zero-copy buffers for performance and to prevent memory leaksBert Belder
* In order to prevent ArrayBuffers from getting garbage collected by V8, we used to store a v8::Persistent<ArrayBuffer> in a map. This patch introduces a custom ArrayBuffer allocator which doesn't use Persistent handles, but instead stores a pointer to the actual ArrayBuffer data alongside with a reference count. Since creating Persistent handles has quite a bit of overhead, this change significantly increases performance. Various HTTP server benchmarks report about 5-10% more requests per second than before. * Previously the Persistent handle that prevented garbage collection had to be released manually, and this wasn't always done, which was causing memory leaks. This has been resolved by introducing a new `PinnedBuf` type in both Rust and C++ that automatically re-enables garbage collection when it goes out of scope. * Zero-copy buffers are now correctly wrapped in an Option if there is a possibility that they're not present. This clears up a correctness issue where we were creating zero-length slices from a null pointer, which is against the rules.
2019-05-01fs: add Deno.utime/Deno.utimeSync (#2241)Kevin (Kun) "Kassimo" Qian
2019-04-29Add support for custom tsconfig.json (#2089)Kitson Kelly
Use `--config`
2019-04-21Add Deno.kill(pid, signo) and process.kill(signo) (Unix only) (#2177)Kevin (Kun) "Kassimo" Qian
2019-04-21Refactor CLI entry point (#2157)Bartek Iwańczuk
Changes "deno --types" to "deno types" and "deno --prefetch" to "deno prefetch"
2019-04-17Fix clippy warningsBert Belder
2019-04-16Implement async module loading in CLI (#2084)Ryan Dahl
2019-04-11Improve op dispatch (#2088)andy finch
2019-04-09Silence clippy warnings and format source codeBert Belder
2019-04-09core: Rename Behavior to Dispatch (#2082)Ryan Dahl
And rename IsolateState to ThreadSafeState. Also make ThreadSafeState directly implement Dispatch. This is simpler.
2019-04-08Merge Worker and Isolate types (#2078)Ryan Dahl
Reduces generics.
2019-04-08Allow high precision performance.now() (#1977)Vincent LE GOFF
2019-04-08core: snapshot improvements (#2052)Ryan Dahl
* Moves how snapshots are supplied to the Isolate. Previously they were given by Behavior::startup_data() but it was only called once at startup. It makes more sense (and simplifies Behavior) to pass it to the constructor of Isolate. * Adds new libdeno type deno_snapshot instead of overloading deno_buf. * Adds new libdeno method to delete snapshot deno_snapshot_delete(). * Renames deno_get_snapshot() to deno_snapshot_new(). * Makes StartupData hold references to snapshots. This was implicit when it previously held a deno_buf but is made explicit now. Note that include_bytes!() returns a &'static [u8] and we want to avoid copying that.
2019-04-08Add link/linkSync fs call for hardlinks (#2074)Kevin (Kun) "Kassimo" Qian
2019-04-02Clippy fixesBert Belder
2019-04-01Add web worker JS API (#1993)andy finch
* Refactored the way worker polling is scheduled and errors are handled. * Share the worker future as a Shared
2019-03-30Rename crate deno_core to deno (#2022)Ryan Dahl
2019-03-28Merge the --recompile and --reload flags (#2003)Ryan Dahl
2019-03-27Rewrite readFile and writeFile (#2000)Bartek Iwańczuk
Using open/read/write
2019-03-26namespace reorg: libdeno and DenoCore to Deno.core (#1998)Kitson Kelly
2019-03-21Remove dead code (#1983)andy finch
2019-03-20Fix clippy errors and upgrade Rust to 1.33.0 in CI (#1945)Ryan Dahl
2019-03-20Add more async module loading function (#1974)Ryan Dahl
* get_source_code_async * fetch_module_meta_data_async * fetch_module_meta_data_and_maybe_compile_async
2019-03-19Separate behavior for the compiler isolate (#1973)andy finch
2019-03-19Remove old Buf definition in cli.rs (#1971)andy finch
2019-03-19Rename //src/ to //cli/ (#1962)Ryan Dahl
To better distinguish the deno_core crate from the executable deno, which will now be called "the cli" internally.