     "from_value_struct" f %alien-invoke ;
 
 M:: ppc %restore-context ( temp1 temp2 -- )
-    temp1 "ctx" %load-vm-field-addr
-    temp1 temp1 0 LWZ
+    temp1 "ctx" %vm-field
     temp2 1 stack-frame get total-size>> ADDI
     temp2 temp1 "callstack-bottom" context-field-offset STW
-    ds-reg temp1 8 LWZ
-    rs-reg temp1 12 LWZ ;
+    ds-reg temp1 "datastack" context-field-offset LWZ
+    rs-reg temp1 "retainstack" context-field-offset LWZ ;
 
 M:: ppc %save-context ( temp1 temp2 -- )
-    temp1 "ctx" %load-vm-field-addr
-    temp1 temp1 0 LWZ
-    1 temp1 0 STW
-    ds-reg temp1 8 STW
-    rs-reg temp1 12 STW ;
+    temp1 "ctx" %vm-field-ptr
+    1 temp1 "callstack-bottom" context-field-offset STW
+    ds-reg temp1 "datastack" context-field-offset STW
+    rs-reg temp1 "retainstack" context-field-offset STW ;
 
 M: ppc %alien-invoke ( symbol dll -- )
     [ 11 ] 2dip %alien-global 11 MTLR BLRL ;

! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs sequences kernel combinators make math
math.order math.ranges system namespaces locals layouts words

M: ppc %set-alien-double -rot STFD ;

: load-zone-ptr ( reg -- )
    "nursery" %vm-field-ptr ;

: load-allot-ptr ( nursery-ptr allot-ptr -- )
    [ drop load-zone-ptr ] [ swap 0 LWZ ] 2bi ;
