parent
							
								
									fa190a8329
								
							
						
					
					
						commit
						48e6455186
					
				| 
						 | 
					@ -32,9 +32,6 @@ M: x86.32 immediate-comparand? ( obj -- ? ) drop t ;
 | 
				
			||||||
M:: x86.32 %load-vector ( dst val rep -- )
 | 
					M:: x86.32 %load-vector ( dst val rep -- )
 | 
				
			||||||
    dst 0 [] rep copy-memory* val rc-absolute rel-binary-literal ;
 | 
					    dst 0 [] rep copy-memory* val rc-absolute rel-binary-literal ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: x86.32 %mov-vm-ptr ( reg -- )
 | 
					 | 
				
			||||||
    0 MOV 0 rc-absolute-cell rel-vm ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
M: x86.32 %vm-field ( dst field -- )
 | 
					M: x86.32 %vm-field ( dst field -- )
 | 
				
			||||||
    [ 0 [] MOV ] dip rc-absolute-cell rel-vm ;
 | 
					    [ 0 [] MOV ] dip rc-absolute-cell rel-vm ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,9 +42,6 @@ M: x86.64 machine-registers
 | 
				
			||||||
: vm-reg ( -- reg ) R13 ; inline
 | 
					: vm-reg ( -- reg ) R13 ; inline
 | 
				
			||||||
: nv-reg ( -- reg ) RBX ; inline
 | 
					: nv-reg ( -- reg ) RBX ; inline
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: x86.64 %mov-vm-ptr ( reg -- )
 | 
					 | 
				
			||||||
    vm-reg MOV ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
M: x86.64 %vm-field ( dst offset -- )
 | 
					M: x86.64 %vm-field ( dst offset -- )
 | 
				
			||||||
    [ vm-reg ] dip [+] MOV ;
 | 
					    [ vm-reg ] dip [+] MOV ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,13 +90,13 @@ M: x86.64 %discard-reg-param ( rep reg -- )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M:: x86.64 %unbox ( dst src func rep -- )
 | 
					M:: x86.64 %unbox ( dst src func rep -- )
 | 
				
			||||||
    param-reg-0 src tagged-rep %copy
 | 
					    param-reg-0 src tagged-rep %copy
 | 
				
			||||||
    param-reg-1 %mov-vm-ptr
 | 
					    param-reg-1 vm-reg MOV
 | 
				
			||||||
    func f f %c-invoke
 | 
					    func f f %c-invoke
 | 
				
			||||||
    dst rep %load-return ;
 | 
					    dst rep %load-return ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M:: x86.64 %box ( dst src func rep gc-map -- )
 | 
					M:: x86.64 %box ( dst src func rep gc-map -- )
 | 
				
			||||||
    0 rep reg-class-of cdecl param-regs at nth src rep %copy
 | 
					    0 rep reg-class-of cdecl param-regs at nth src rep %copy
 | 
				
			||||||
    rep int-rep? os windows? or param-reg-1 param-reg-0 ? %mov-vm-ptr
 | 
					    rep int-rep? os windows? or param-reg-1 param-reg-0 ? vm-reg MOV
 | 
				
			||||||
    func f gc-map %c-invoke
 | 
					    func f gc-map %c-invoke
 | 
				
			||||||
    dst int-rep %load-return ;
 | 
					    dst int-rep %load-return ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -108,12 +105,12 @@ M: x86.64 %c-invoke
 | 
				
			||||||
    gc-map-here ;
 | 
					    gc-map-here ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: x86.64 %begin-callback ( -- )
 | 
					M: x86.64 %begin-callback ( -- )
 | 
				
			||||||
    param-reg-0 %mov-vm-ptr
 | 
					    param-reg-0 vm-reg MOV
 | 
				
			||||||
    param-reg-1 0 MOV
 | 
					    param-reg-1 0 MOV
 | 
				
			||||||
    "begin_callback" f f %c-invoke ;
 | 
					    "begin_callback" f f %c-invoke ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: x86.64 %end-callback ( -- )
 | 
					M: x86.64 %end-callback ( -- )
 | 
				
			||||||
    param-reg-0 %mov-vm-ptr
 | 
					    param-reg-0 vm-reg MOV
 | 
				
			||||||
    "end_callback" f f %c-invoke ;
 | 
					    "end_callback" f f %c-invoke ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: x86.64 %prepare-var-args ( -- ) RAX RAX XOR ;
 | 
					M: x86.64 %prepare-var-args ( -- ) RAX RAX XOR ;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -106,15 +106,3 @@ HELP: copy-register*
 | 
				
			||||||
    "0000000533c61fe0: 0f28ca  movaps xmm1, xmm2"
 | 
					    "0000000533c61fe0: 0f28ca  movaps xmm1, xmm2"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
} ;
 | 
					} ;
 | 
				
			||||||
 | 
					 | 
				
			||||||
HELP: %mov-vm-ptr
 | 
					 | 
				
			||||||
{ $values { "reg" "a register symbol" } }
 | 
					 | 
				
			||||||
{ $description
 | 
					 | 
				
			||||||
  "Emits machine code for moving the vm pointer to a register." }
 | 
					 | 
				
			||||||
{ $examples
 | 
					 | 
				
			||||||
  { $unchecked-example
 | 
					 | 
				
			||||||
    "USING: cpu.x86.64 make ;"
 | 
					 | 
				
			||||||
    "[ RAX %mov-vm-ptr ] B{ } make disassemble"
 | 
					 | 
				
			||||||
    "0000000002290b30: 4c89e8  mov rax, r13"
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
} ;
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -457,8 +457,6 @@ M: x86 %shl int-rep two-operand [ SHL ] emit-shift ;
 | 
				
			||||||
M: x86 %shr int-rep two-operand [ SHR ] emit-shift ;
 | 
					M: x86 %shr int-rep two-operand [ SHR ] emit-shift ;
 | 
				
			||||||
M: x86 %sar int-rep two-operand [ SAR ] emit-shift ;
 | 
					M: x86 %sar int-rep two-operand [ SAR ] emit-shift ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HOOK: %mov-vm-ptr cpu ( reg -- )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
HOOK: %vm-field-ptr cpu ( reg offset -- )
 | 
					HOOK: %vm-field-ptr cpu ( reg offset -- )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: load-zone-offset ( nursery-ptr -- )
 | 
					: load-zone-offset ( nursery-ptr -- )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue