Mark Shannon · 2006
Compiler design for stack machines, in particular register allocation, is an under researched area. In this thesis I present a framework for analysing and developing register allocation techniques for stack machines. Using this framework, I analyse previous register allocation methods and develop two new algorithms for global register allocation, both of which outperform previous algorithms, and lay the groundwork for future enhancements. Finally I discuss how effective global register allocation for stack machines can influence the design of high performance stack architectures. Included with this thesis is a portable C compiler for stack machines, which incorporates these new register allocation methods. The C compiler and associated tools (assembler, linker and simulator) are included in the CD. Acknowledgements This work was done as part of the UFO project, to develop a soft-core stack processor utilising the latest research on stack based architectures. Its aim
Cited by 0
Peter Molnar, Andreas Krall, Florian Brandner et al. · 2013
Stack allocation of objects reduces the cost of object allocation and garbage collection and can thus lead to large reductions in runtime. Escape analysis can statically determine which objects are eligible to stack allocation by examining the escape behavior of allocation sites. If objects created at a particular allocation site do not escape, i.e., are guaranteed not to leave the scope of the allocation site, stack allocation instead of expensive heap allocation can be applied. We have implemented a lightweight and fast escape analysis within the CACAO Java Virtual Machine to enable stack allocation. The analysis proceeds in two stages: an intraprocedural analysis computes escape information for each allocation site within a single method and builds call-context agnostic summary information for the method. The summary information is then used during interprocedural analysis to capture the escape behavior of method arguments. The computed escape information is finally used to allocate a subset of thread-local Java objects on the call stack. The implementation has been evaluated using the SPEC JVM98 and the dacapo benchmark suites. For the SPEC benchmarks up to 90 % of all objects allocated at runtime can be allocated on the call stack, leading to a speed up of up to 69%. The more complex dacapo benchmarks still show speedups of up to 10%, with up to 20 % of all objects being allocated on the stack.
Cited by 0
Wendi Zheng, Bochao Lv, Zhenguo Shao et al. · International Journal of Hydrogen Energy · 2023
Cited by 38
Xinyu Lu, Banghua Du, Shenpei Zhou et al. · International Journal of Hydrogen Energy · 2022
Cited by 142
D. Julia. M. Davies · The Computer Journal · 1982
Recent papers by Reeves on modelling memory allocation analyse the distributions of allocated and free blocks under random allocations and releases. Here we offer an interpretation for the lack of a mathematical equilibrium solution at low storage utilizations. Insight into the physical reasons for that situation is obtained by comparison with stack allocation, and with spaghetti stack' allocation systems.
Cited by 1Open access
Dapeng Jin, Fengxu Han, Ai Huang Guo et al. · Energies · 2024
In order to enhance the efficiency, extend the service life, and minimize hydrogen consumption of the fuel cell hybrid power system (FCHPS), an adaptive power allocation method considering stack operation performance is proposed. The method utilizes the minimum instantaneous optimization of equivalent hydrogen consumption to achieve power distribution between fuel cells and lithium batteries. Additionally, a power adaptive allocation method is proposed to address performance inconsistencies in PEMFC systems, effectively reducing operating pressure for improved service life and overall system efficiency. This approach ensures stable and efficient operation of high-power vehicle fuel cell hybrid power systems.
Cited by 0Open access
Yuo-Tern Tsai, Kuan-Hong Lin, Chunsheng Chen · Journal of the Chinese Institute of Engineers · 2023
Tolerance designing is a critical job for the assemblies to ensure their precision and functions. Tolerance design must consider manufacturing capability for ensuring the feasibility of the designs in the following processing. This paper presents the available methods of determining tolerance sizes and tolerance analysis to improve assembly precision. An injection mold consisting of hundreds of parts is used as an example to depict the methods of tolerance designing. The precision grades and the corresponding tolerance ranges applied in engineering fits are introduced for giving reasonable tolerances in designing. The defect rates of the designed tolerances to the machining precisions are investigated for observing the effects of manufacturing capabilities. An approach based on block assembly is proposed for eliminating tolerance stack-up, as well as improving assembly precision. The assembly tolerances can be reduced from 0.071 to 0.032 mm by using the proposed method, and the defect rates in manufacturing can be improved from 9.05% to 0.02%. It means that a larger range of tolerances can be designed to meet the specifications, as well as reduce the manufacturing costs.
Cited by 2
2016
ory allocation analyse the distributions of allocated and free blocks under random alloca-tions and releases. Here we offer an interpreta-tion for the lack of a mathematical equilibrium solution at low storage utilizations. Insight into the physical reasons for that situation is obtained by comparison with stack allocation, and with •spaghetti stack ' allocation systems. Recently, Reeves has presented an approach to analysing dynamic memory allocation,1'2 with particular attention to random allocation of memory cells from the free blocks available, and with a random cell release process. He derives solutions for the equilibrium distribu-tion of allocated blocks in runs of various
Cited by 0
Limin Jia, Frances Spalding, David Walker et al. · 2008
This paper describes an assembly-language type system capable of ensuring memory safety in the presence of both heap and stack allocation. The type system uses linear logic and a set of domain-specific predicates to specify invariants about the shape of the store. Part of the model for our logic is a tree of “stack tags ” that tracks the evolution of the stack over time. To demonstrate the expressiveness of the type system, we define Micro-CLI, a simple imperative language that captures the essence of stack allocation in the Common Language Infrastructure. We show how to compile well-typed Micro-CLI into well-typed assembly. 1
Cited by 0
Thomas Richard Novak · 2008
This thesis contributes an updated method of stack frame allocation that eliminates false depen-dences between sibling procedure calls by guaranteeing that the stack space occupied by each is mutually exclusive. To make this guarantee, frames are allocated as in a queue or freelist, and the corresponding memory is managed by an efficient stack compactor. Though this method increases dynamic instruction counts by an average of 7.5%, we show that this is necessary to enable a suf-ficiently inclined execution paradigm to effectively disseminate parallelism. We also show that the memory management required has little to no impact on performance. Furthermore, freelist-based stack frame allocation is shown to succeed in reducing stack stores with antidependences of distance less than 100 dynamic instructions from 27 % of all program stores to 3.5%, effectively renaming stack frames. iii To Mom and Dad. iv
Cited by 0
Alastair Reid, John McCorquodale, Jason D. Baker et al. · 1999
Modern programming languages such as Java are increasingly being used to write systems programs. By "systems programs," we mean programs that provide critical services (compilers), are long-running (Web servers), or have time-critical aspects (databases or query engines). One of the requirements of such programs is predictable behavior. Unfortunately, predictability is often compromised by the presence of garbage collection. Various researchers have examined the feasibility of replacing garbage collection with forms of stack allocation that are more predictable than GC, but the applicability of such research to systems programs has not been studied or measured. A particularly promising approach allocates objects in the nth stack frame (instead of just the topmost frame): we call this deep stack allocation. We present dynamic profiling results for several Java programs to show that deep stack allocation should benefit systems programs, and we describe the approach that we are developin...
Cited by 7
Alastair Reid John · 1999
Modern programming languages such as Java are increasingly being used to write systems programs. By "systems programs," we mean programs that provide critical services (compilers), are long-running (Web servers), or have time-critical aspects (databases or query engines). One of the requirements of such programs is predictable behavior. Unfortunately, predictability is often compromised by the presence of garbage collection. Various researchers have examined the feasibility of replacing garbage collection with forms of stack allocation that are more predictable than GC, but the applicability of such research to systems programs has not been studied or measured. A particularly promising approach allocates objects in the nth stack frame (instead of just the topmost frame): we call this deep stack allocation. We present dynamic profiling results for several Java programs to show that deep stack allocation should benefit systems programs, and we describe the approach that we are developing...
Cited by 0
Robert Hieb, R. Kent Dybvig, Carl Bruggeman · ACM SIGPLAN Notices · 1990
Languages such as Scheme and Smalltalk that provide continuations as first-class data objects present a challenge to efficient implementation. Allocating activation records in a heap has proven unsatisfactory because of increased frame linkage costs, increased garbage collection overhead, and decreased locality of reference. However, simply allocating activation records on a stack and copying them when a continuation is created results in unbounded copying overhead. This paper describes a new approach based on stack allocation that does not require the stack to be copied when a continuation is created and that allows us to place a small upper bound on the amount copied when a continuation is reinstated. This new approach is faster than the naive stack allocation approach, and it does not suffer from the problems associated with unbounded copying. For continuation-intensive programs, our approach is at worst a constant factor slower than the heap allocation approach, and for typical programs, it is significantly faster. An important additional benefit is that recovery from stack overflow is handled gracefully and efficiently.
Cited by 35
Greg Morrisett, Karl Crary, David Walker et al. · Digital Access to Scholarship at Harvard (DASH) (Harvard University) · 1998
In previous work, we presented a Typed Assembly Language (TAL). TAL is sufficiently expressive to serve as a target language for compilers of high-level languages such as ML. This work assumed such a compiler would perform a continuation-passing style transform and eliminate the control stack by heap-allocating activation records. However, most compilers are based on stack allocation. This paper presents STAL, an extension of TAL with stack constructs and stack types to support the stack allocation style. We show that STAL is sufficiently expressive to support languages such as Java, Pascal, and ML; constructs such as exceptions and displays; and optimizations such as tail call elimination and callee-saves registers. This paper also formalizes the typing connection between CPS-based compilation and stack-based compilation and illustrates how STAL can formally model calling conventions by specifying them as formal translations of source function types to STAL types.
Cited by 37Open access
YiFan Liang, Qianchao Liang, Jianfeng Zhao et al. · Frontiers in Energy Research · 2022
In high-powered application scenarios, a multi-stack fuel cell system (MFCS) could have advantages such as higher robustness, lifetime, and reliability than a single-stack fuel cell system. In particular, MFCS could maintain a high efficiency and increase system redundancy by power configuration between subsystems. In order to reduce the operational expenses for systems, a reasonable power management strategy is necessary to minimize the hydrogen consumption of MFCS. First, the power-hydrogen consumption curve of the single-stack fuel cell system is discretized from experimental measurements. Next, the discrete data are reassembled by the inverse derivation of the dynamic programming method to produce a minimum solution for the hydrogen consumption in the output power range. It is found that the strategy varies depending on activated state On or Off. Finally, two power allocation strategies are developed and modeled in a lookup-table block considering the activated state. The optimal stack output power strategy is analyzed with four stacks. The results indicate that the hydrogen consumption is smaller and more efficient than the other allocation strategies. It can respond to the load demand with a high efficiency sooner than the average strategy.
Cited by 9Open access
Farooq Hamid · Zenodo (CERN European Organization for Nuclear Research) · 2025
This paper presents the mathematical core of the Thermostat Commons, a cybernetic model for a post-scarcity society. We formalize the integration of the golden ratio (Φ ≈ 1.618, φ ≈ 0.618) as a foundational constant governing the system's key dynamics. The specification defines: 1) the Φ-Decay Function, a voucher depreciation curve ensuring flow over hoarding; 2) the Labour Margin Homeostat, targeting 61.8% utilization (38.2% surplus) for antifragile resilience; 3) the Structural Allocation Ratio (Φ:1) between necessity (Commons) and aspiration (Sterling) infrastructure; 4) a Φ-progressing Mastery Hierarchy. Together, these form a coherent Φ-Stack—a resonant social architecture where operational parameters are derived from a universal optimization constant, aligning human systems with natural patterns of balanced growth and decay.
Cited by 0Open access
Beril T�mer, Deniz Yıldız, Yaman Arkun · Systems and Control Transactions · 2025
A dual-stack fuel cell model was developed to simulate the hydrogen consumption a fuel cell-powered vehicle for a specific drive cycle. Two fuel cell stacks, each consisting of 65 parallel cells at different aging status and thus with different efficiency profiles (i.e., low and high) were considered. A constrained optimization for power distribution between individual stacks was performed where the objective function was to minimize the hydrogen consumption while meeting the total demand. For proper power management each stack has its own power controller which manipulates the stack current to control the stack power at its desired-set point. Computed optimal power values constitute the desired set-points for the local power PID controllers of the individual stacks. Closed-loop simulations were performed by simulating the developed mechanistic model together with optimization and PID controllers in SIMULINK platform. The closed loop simulations demonstrate how well the power demand of the drive cycle is tracked and the hydrogen consumption is minimized. To assess the impact of optimization strategy used, hydrogen consumption is compared to that of equal power sharing and a daisy-chain strategies. The results demonstrate that the optimization strategy effectively reduces the total hydrogen consumption.
Cited by 0Open access
Lan Wu, Wei Zhang · Journal of Computing Science and Engineering · 2018
Recently, hybrid SPM-cache (HSC) architectures that combine caches and scratch-pad memories (SPMs) have been increasingly used in commercial processors and research prototypes. However, most SPM allocation algorithms do not make use of the cache in parallel, so they cannot harness the full potential of the HSC architecture. In this paper, we explore six SPM allocation algorithms, including four heuristic-based algorithms and two optimal algorithms based on model checking. Our experimental results show that the greedy stack distance based allocation for energy (GSDA-E) can also reduce the energy by as much or by nearly as much as the optimal results attained by the optimal stack distance based allocation for energy (OSDA-E), while also achieving performance close to those of the OSDA and GSDA.
Cited by 0
Zhiwei Tang, Yonglu Zhou, Hongbing Dai et al. · 2023
Currently, Forth real-time systems are a research focus in the field of stack processors. Significant progress has been made, but in cases involving multiple periodic real-time tasks, instances of missed deadlines can occur. Additionally, there are issues with suboptimal allocation of task stack space resources in memory management. To address the characteristics of the Forth language using the stack as a channel, the LLF (Least Laxity First) task scheduling algorithm and a clock-interrupt-based preemptive scheduling algorithm are employed to implement a Forth-based periodic task scheduling mechanism. This mechanism introduces a dynamic priority calculation based on runtime and deadline, as well as dynamic allocation of task stack memory. Experimental results indicate that the current Forth task scheduling mechanism, compared to the previous Forth scheduling mechanism, is able to schedule multiple periodic real-time tasks without missing deadlines on a stack processor simulator, and it dynamically reclaims memory space used by tasks.
Cited by 1
Mouhamad Houjayrie, Catherine Cadet, Berenguer · 2025
Multi-stack proton exchange membrane fuel cells (PEMFCs) offer a promising pathway for highpower, carbon-free energy systems, yet durability and cost challenges hinder their commercialization.While degradation is influenced by operating parameters, optimizing dynamic power allocation across stacks could mitigate performance loss.However, this requires robust degradation models that account for complex, loaddependent mechanisms.This work introduces a degradation model for multi-stack PEMFCs, integrating two critical health indices: electrochemical surface area (ECSA) loss and rising internal resistance.The model links these degradation pathways to operational voltage, enabling real-time assessment of performance decay.By coupling degradation dynamics with load allocation strategies, the framework supports lifespan extension and efficiency optimization in multi-stack architectures, advancing scalable PEMFC deployment for sustainable energy applications.
Cited by 0Open access