| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  | USING: compiler.cfg.write-barrier compiler.cfg.instructions | 
					
						
							| 
									
										
										
										
											2008-12-08 15:58:00 -05:00
										 |  |  | compiler.cfg.registers compiler.cfg.debugger cpu.architecture | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  | arrays tools.test vectors compiler.cfg kernel accessors | 
					
						
							|  |  |  | compiler.cfg.utilities ;
 | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  | IN: compiler.cfg.write-barrier.tests | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-26 20:31:19 -04:00
										 |  |  | : test-write-barrier ( insns -- insns )
 | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |     <simple-block> dup write-barriers-step instructions>> ;
 | 
					
						
							| 
									
										
										
										
											2009-05-26 20:31:19 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  | [ | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |     V{ | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |         T{ ##peek f V int-regs 4 D 0 f } | 
					
						
							|  |  |  |         T{ ##allot f V int-regs 7 24 array V int-regs 8 f } | 
					
						
							|  |  |  |         T{ ##load-immediate f V int-regs 9 8 f } | 
					
						
							|  |  |  |         T{ ##set-slot-imm f V int-regs 9 V int-regs 7 1 3 f } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##set-slot-imm f V int-regs 4 V int-regs 7 2 3 f } | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |         T{ ##replace f V int-regs 7 D 0 f } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##branch } | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |     } | 
					
						
							|  |  |  | ] [ | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 4 D 0 } | 
					
						
							|  |  |  |         T{ ##allot f V int-regs 7 24 array V int-regs 8 } | 
					
						
							|  |  |  |         T{ ##load-immediate f V int-regs 9 8 } | 
					
						
							|  |  |  |         T{ ##set-slot-imm f V int-regs 9 V int-regs 7 1 3 } | 
					
						
							|  |  |  |         T{ ##write-barrier f V int-regs 7 V int-regs 10 V int-regs 11 } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##set-slot-imm f V int-regs 4 V int-regs 7 2 3 } | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |         T{ ##write-barrier f V int-regs 7 V int-regs 12 V int-regs 13 } | 
					
						
							|  |  |  |         T{ ##replace f V int-regs 7 D 0 } | 
					
						
							| 
									
										
										
										
											2009-05-26 20:31:19 -04:00
										 |  |  |     } test-write-barrier | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |     V{ | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |         T{ ##load-immediate f V int-regs 4 24 } | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 5 D -1 } | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 6 D -2 } | 
					
						
							|  |  |  |         T{ ##set-slot-imm f V int-regs 5 V int-regs 6 3 2 } | 
					
						
							|  |  |  |         T{ ##write-barrier f V int-regs 6 V int-regs 7 V int-regs 8 } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##branch } | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |     } | 
					
						
							|  |  |  | ] [ | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         T{ ##load-immediate f V int-regs 4 24 } | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 5 D -1 } | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 6 D -2 } | 
					
						
							|  |  |  |         T{ ##set-slot-imm f V int-regs 5 V int-regs 6 3 2 } | 
					
						
							|  |  |  |         T{ ##write-barrier f V int-regs 6 V int-regs 7 V int-regs 8 } | 
					
						
							| 
									
										
										
										
											2009-05-26 20:31:19 -04:00
										 |  |  |     } test-write-barrier | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |     V{ | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |         T{ ##peek f V int-regs 19 D -3 } | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 22 D -2 } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##set-slot-imm f V int-regs 22 V int-regs 19 3 2 } | 
					
						
							|  |  |  |         T{ ##write-barrier f V int-regs 19 V int-regs 24 V int-regs 25 } | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |         T{ ##peek f V int-regs 28 D -1 } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##set-slot-imm f V int-regs 28 V int-regs 19 4 2 } | 
					
						
							|  |  |  |         T{ ##branch } | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |     } | 
					
						
							|  |  |  | ] [ | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 19 D -3 } | 
					
						
							|  |  |  |         T{ ##peek f V int-regs 22 D -2 } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##set-slot-imm f V int-regs 22 V int-regs 19 3 2 } | 
					
						
							|  |  |  |         T{ ##write-barrier f V int-regs 19 V int-regs 24 V int-regs 25 } | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  |         T{ ##peek f V int-regs 28 D -1 } | 
					
						
							| 
									
										
										
										
											2009-07-24 07:08:07 -04:00
										 |  |  |         T{ ##set-slot-imm f V int-regs 28 V int-regs 19 4 2 } | 
					
						
							|  |  |  |         T{ ##write-barrier f V int-regs 19 V int-regs 30 V int-regs 3 } | 
					
						
							| 
									
										
										
										
											2009-05-26 20:31:19 -04:00
										 |  |  |     } test-write-barrier | 
					
						
							| 
									
										
										
										
											2008-10-22 19:41:10 -04:00
										 |  |  | ] unit-test |