mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:12:45 +00:00 
			
		
		
		
	JSSpecCompiler: Prepare for building SSA
This commit introduces NamedVariableDeclaration and SSAVariableDeclaration and allows storing both of them in Variable node. Also, it adds additional structures in FunctionDefinition and BasicBlock, which will be used to store SSA form related information.
This commit is contained in:
		
							parent
							
								
									23164bc570
								
							
						
					
					
						commit
						0aeb7a26e9
					
				
					 11 changed files with 173 additions and 13 deletions
				
			
		|  | @ -16,15 +16,28 @@ namespace JSSpecCompiler { | |||
| 
 | ||||
| class BasicBlock : public RefCounted<BasicBlock> { | ||||
| public: | ||||
|     struct PhiNode { | ||||
|         struct Branch { | ||||
|             BasicBlockRef block; | ||||
|             VariableRef value; | ||||
|         }; | ||||
| 
 | ||||
|         VariableRef var; | ||||
|         Vector<Branch> branches; | ||||
|     }; | ||||
| 
 | ||||
|     BasicBlock(size_t index, NonnullRefPtr<ControlFlowOperator> continuation) | ||||
|         : m_index(index) | ||||
|         , m_continuation(move(continuation)) | ||||
|         , m_immediate_dominator(nullptr) | ||||
|     { | ||||
|     } | ||||
| 
 | ||||
|     size_t m_index; | ||||
|     Vector<PhiNode> m_phi_nodes; | ||||
|     Vector<Tree> m_expressions; | ||||
|     NonnullRefPtr<ControlFlowOperator> m_continuation; | ||||
|     BasicBlockRef m_immediate_dominator; | ||||
| }; | ||||
| 
 | ||||
| class ControlFlowGraph : public RefCounted<ControlFlowGraph> { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Klishch
						Dan Klishch