When a web page is displayed in a web browser, several files belonging to the web page are downloaded into the client's device. The larger these files, the longer the browser will take to download and display the ...
详细信息
This paper proposes a concurrency model for javascript with thread-like abstractions and cooperative cancellation. javascript uses an event-driven model, where an active computation runs until it completes or blocks f...
详细信息
ISBN:
(纸本)9781450391115
This paper proposes a concurrency model for javascript with thread-like abstractions and cooperative cancellation. javascript uses an event-driven model, where an active computation runs until it completes or blocks for an event while concurrent computations wait for other events as callbacks. With the introduction of Promises, the control flow of callbacks can be written in a more direct style. However, the event-based model is still a source of confusion with regard to execution order, race conditions, and termination. The thread model is a familiar concept to programmers and can help reduce concurrency errors in javascript programs. This work is a library-based design, which uses an abstraction based on the reader monad to pass a thread ID through a thread's computation. A thread can be cancelled, paused, and resumed with its thread ID. This design allows hierarchical cancellation where a child thread is cancelled if its parent is cancelled. It also defines synchronization primitives to protect shared states. A formal semantics is included to give a precise definition of the proposed model.
javascript, while already widely used in web applications, is also gaining popularity beyond the web, such as on the server as part of *** or on the desktop with the Electron framework (e.g., in the Slack application)...
详细信息
ISBN:
(纸本)9781665441735
javascript, while already widely used in web applications, is also gaining popularity beyond the web, such as on the server as part of *** or on the desktop with the Electron framework (e.g., in the Slack application). However, executing code written in this weakly and dynamically typed language efficiently, requires sophisticated Just-in-time (JIT) compilation. In this paper, we revisit the execution overheads of javascript. We perform a detailed analysis of the JetStream2 benchmark suite on Google's modern V8 javascript engine. We identify micro-architectural bottlenecks and runtime overheads that result from the speculations made by the JIT compiler when it generates machine code from javascript. We find that checks that verify assumptions made by the compiler have an average execution overhead of 8 %, 2-4x of what an earlier study reported on an older version of V8. For the check for Small Integers (SMI), we observe that the conditional branches are not the underlying cause but rather the computation of the condition itself. This indicates that these checks provide an attractive avenue for a HW/SW codesign solution. We present an extension for the ARMv8 instruction set that optimizes SMI load instructions and checks. We can improve execution time on SMI-heavy computations by up to 10 % ona prototype implementation of the new instructions in the gem5 simulator.
The memory isolation mechanism plays an essential role to provide security enforcement in javascript programs. Existing secure interaction libraries such as Google Caja, SES, and VM2 rely on built-in memory isolation ...
详细信息
ISBN:
(纸本)9781450381048
The memory isolation mechanism plays an essential role to provide security enforcement in javascript programs. Existing secure interaction libraries such as Google Caja, SES, and VM2 rely on built-in memory isolation mechanisms provided by *** and browsers, yet most of the other engines such as JerryScript and Duktape, which are implementations for IoT devices, do not support such isolation mechanisms. In this paper, we report about the design and implementation of SecureJS, a portable javascript-to-javascript compiler that enforces memory isolation. As it only uses standard features, the compiled code it generates can be used by any javascript engine. We validated empirically the semantics preservation and memory isolation of SecureJS compiled programs by using 10,490 test programs of ECMAScript Test262 test suite. We also developed a novel experiment to evaluate memory isolation property of compiled code by instrumented javascript engines.
Websites remain popular targets for web-based attacks such as Cross-Site Scripting (XSS). As a remedy, new research is needed to preemptively secure applications with the use of Automated Exploit Generation (AEG), whe...
详细信息
ISBN:
(纸本)9789897585241
Websites remain popular targets for web-based attacks such as Cross-Site Scripting (XSS). As a remedy, new research is needed to preemptively secure applications with the use of Automated Exploit Generation (AEG), whereby probing and patching of system vulnerabilities occurs autonomously. In this paper, we present HIJaX, a novel Natural Language-to-javascript generator prototype, that creates workable XSS exploit code from English sentences using neural machine translation. We train and test the HIJaX model with a variety of datasets containing benign and malicious intents along with differing numbers of baseline code entries to demonstrate how to best create datasets for XSS code generation. We also examine part-of-speech tagging algorithms and automated dataset expansion scripts to aid the dataset creation and code generation processes. Finally, we demonstrate the feasibility of deploying auto-generated XSS attacks against real-world websites.
Recently, researches have proposed application (app) migration approaches for javascript programs to enable a non-breaking user experience across different devices. To migrate a stateful javascript app's runtime, ...
详细信息
ISBN:
(纸本)9783030742966;9783030742959
Recently, researches have proposed application (app) migration approaches for javascript programs to enable a non-breaking user experience across different devices. To migrate a stateful javascript app's runtime, past studies have proposed snapshot-based techniques in which the app's runtime state is profiled and serialized into a text form that can be restored back later. A common limitation of existing literature, however, is that they are based on old javascript specifications. Since major updates introduced by ECMASCript2015 (a.k.a. ES6), javascript supports various features that cannot be migrated correctly with existing methods. Some of these features are in fact heavily used in today's real-world apps and thus greatly reduces the scope of previous works. In this paper, we analyze ES6 features such as block scopes, modules, and class syntax that were previously uncovered in app migration. We present an algorithm that enables migration of apps implemented with these new features. Based on the standards adopted in modern javascript engines, our approach serializes a running program into a scope tree and reorganizes it for snapshot code generation. We implement our idea on the open source V8 engine and experiment with complex benchmark programs of modern javascript. Results show that our approach correctly migrates 5 target programs between mobile devices. Our framework could migrate the most complex app of source code size 213KB in less than 200 ms in a X86 laptop and 800 ms in an embedded ARM board.
Programming Learning Assistant System (PLAS) has been developed as a web-based self-learning platform for programming. PLAS offers several types of exercise problems for code reading and code writing skills, namely, g...
详细信息
ISBN:
(纸本)9781665442466
Programming Learning Assistant System (PLAS) has been developed as a web-based self-learning platform for programming. PLAS offers several types of exercise problems for code reading and code writing skills, namely, grammar-concept understanding problem (GUP), value trace problem (VTP), element fill-in-blank problem (EFP), code completion problem (CCP), and code writing problem (CWP), to support studies at various levels for C, C++, Java, Python, and javascript programming and each problem has different targets for the students. javascript is commonly used together with HTML and CSS, to introduce dynamic behaviors of web pages in web application systems. Thus, javascript should be studied along with them for web client programming. In this paper, we propose a code modification problem (CMP) as a new type in PLAS, to study web client programming using javascript. Since a web page is made by using various functions together, reading and understanding sample source codes using them will be an effective way. Actually, students should have a lot of practices in code reading before implementing source codes from scratch. The CMP instance gives a source code using the functions to be studied and the screenshot of the web page generated by it. Then, it requests to modify the code to generate another web page given by the screenshot. The correctness of any answer is checked through string matching with the correct one. For the evaluation, we generated 25 CMP instances and assigned them to 23 students in Okayama University. Their solution results confirm the validity of the proposal.
When students in programming courses are taught event-driven programming (EDP) for the first time, they face new terminology and concepts that they should internalize. Moreover, they learn a fully new approach for rea...
详细信息
ISBN:
(纸本)9781450384889
When students in programming courses are taught event-driven programming (EDP) for the first time, they face new terminology and concepts that they should internalize. Moreover, they learn a fully new approach for reasoning about program logic and execution order. However, there is a lack of research in students' understanding of these concepts. In this paper, we describe a study, in which we asked web development students to explain their conception of EDP: what are the main concepts involved and how they interact. Moreover, we asked them to explain the execution of a short piece of javascript code that focuses on basic usage of events and event listeners. The answers, which we requested as concept maps and text, were analyzed using inductive content analysis. Our results clearly demonstrate shortcomings in the students' learning and illustrate various misunderstandings that they may have regarding EDP. Based on the findings, we give suggestions for improving the teaching of EDP.
Developers are starting to write large and complex applications in TypeScript, a typed dialect of javascript. TypeScript applications integrate javascript libraries via typed descriptions of their APIs called declarat...
详细信息
ISBN:
(纸本)9781450386753
Developers are starting to write large and complex applications in TypeScript, a typed dialect of javascript. TypeScript applications integrate javascript libraries via typed descriptions of their APIs called declaration files. DefinitelyTyped is the standard public repository for these files. The repository is populated and maintained manually by volunteers, which is error-prone and time consuming. Discrepancies between a declaration file and the javascript implementation lead to incorrect feedback from the TypeScript IDE and, thus, to incorrect uses of the underlying javascript library. This work presents dts-generate, a tool that generates TypeScript declaration files for javascript libraries uploaded to the NPM registry. It extracts code examples from the documentation written by the developer, executes the library driven by the examples, gathers run-time information, and generates a declaration file based on this information. To evaluate the tool, 249 declaration files were generated directly from an NPM module and 111 of these were compared with the corresponding declaration file provided on DefinitelyTyped. All these files either exhibited no differences at all or differences that can be resolved by extending the developer-provided examples.
暂无评论