javascript is the most popular programming language for the Web. Although the language is prototype-based, developers can emulate class-based abstractions in javascript to master the increasing complexity of their app...
详细信息
javascript is the most popular programming language for the Web. Although the language is prototype-based, developers can emulate class-based abstractions in javascript to master the increasing complexity of their applications. Identifying classes in legacy javascript code can support these developers at least in the following activities: (1) program comprehension;(2) migration to the new javascript syntax that supports classes;and (3) implementation of supporting tools, including IDEs with class-based views and reverse engineering tools. In this paper, we propose a strategy to detect class-based abstractions in the source code of legacy javascript systems. We report on a large and in-depth study to understand how class emulation is employed, using a dataset of 918 javascript applications available on GitHub. We found that almost 70% of the javascript systems we study make some usage of classes. We also performed a field study with the main developers of 60 popular javascript systems to validate our findings. The overall results range from 97% to 100% for precision, from 70% to 89% for recall, and from 82% to 94% for F-score.
The migration of application logic to the client side of modern web applications and the use of javascript as the main language for client-side development have made memory leaks in javascript an issue for web applica...
详细信息
The migration of application logic to the client side of modern web applications and the use of javascript as the main language for client-side development have made memory leaks in javascript an issue for web applications. Client-side web applications communicate with the server asynchronously, remaining on the same web page during their lifetime. Thus, even minor memory leaks can eventually lead to excessive memory usage, negatively affecting user-perceived response time and possibly causing page crashes. To detect memory leaks and guide developers in fixing the leaks quickly and easily, this paper introduces LeakSpot, a tool that creates a run-time heap model by modifying the application code in a browser-agnostic way to record object allocations, accesses, and references created to objects. LeakSpot reports those allocation sites causing the leaks instead of all the leaky allocation sites. It also identifies the locations in the code where leaked objects are accumulated, for example, the locations where a reference from a data structure is created but forgotten to be removed by the developer. To facilitate debugging and fixing the leaks, for every leaked object, LeakSpot reports all the locations in the code that create a reference to the object. To confirm usefulness and efficacy of LeakSpot experimentally, we have used LeakSpot to find and fix four memory leaks in a javascript benchmark suite and in open-source web applications. LeakSpot is also shown to be effective in pointing out the potential causes of three leaks in large and popular web applications. Copyright (c) 2016 John Wiley & Sons, Ltd.
Thread-level speculation can be used to take advantage of multicore architectures for javascript in web applications. We extend previous studies with these main contributions;we implement thread-level speculation in t...
详细信息
Thread-level speculation can be used to take advantage of multicore architectures for javascript in web applications. We extend previous studies with these main contributions;we implement thread-level speculation in the state-of-the art just-in-time-enabled javascript engine V8 and make the measurements in the Chromium web browser both from Google instead of using an interpreted javascript engine. We evaluate the thread-level speculation and just-in-time compilation combination on 15 very popular web applications, 20 HTML5 demos from the JS1K competition, and 4 Google Maps use cases. The performance is evaluated on two, four, and eight cores. The results clearly show that it is possible to successfully combine thread-level speculation and just-in-time compilation. This makes it possible to take advantage of multicore architectures for web applications while hiding the details of parallel programming from the programmer. Further, our results show an average speedup for the thread-level speculation and just-in-time compilation combination by a factor of almost 3 on four cores and over 4 on eight cores, without changing any of the javascript source code. Copyright (c) 2016 John Wiley & Sons, Ltd.
暂无评论