05.08.2014 Views

here - Stefan-Marr.de

here - Stefan-Marr.de

here - Stefan-Marr.de

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.2. Virtual Machine Support<br />

1 void storeAndPopReceiverVariableByteco<strong>de</strong> () {<br />

2 if ( requires_<strong>de</strong>legation ( roots .rcvr ,<br />

3 Domain :: WriteToFieldMask )) {<br />

4 Oop value = stackTop ();<br />

5 Oop newTop = stackValue (1);<br />

6 pop (2);<br />

7 redirect_write_field ( roots .rcvr ,<br />

8 currentByteco<strong>de</strong> & 7,<br />

9 value , newTop );<br />

10 }<br />

11 else {<br />

12 fetchNextByteco<strong>de</strong> ();<br />

13 receiver_obj ()-> storePointer ( prevByteco<strong>de</strong> & 7, stackTop ());<br />

14 pop (1);<br />

15 }<br />

16 }<br />

17<br />

18 bool requires_<strong>de</strong>legation ( Oop rcvr , oop_int_t selector_mask ) {<br />

19 if ( executes_unenforced ())<br />

20 return false ;<br />

21<br />

22 Oop rcvr_domain = rcvr . as_object ()-> domain_oop ();<br />

23 Oop customization = rcvr_domain . customization_encoding ();<br />

24 return The_Domain . customizes_selectors ( customization ,<br />

25 selector_mask );<br />

26 }<br />

27<br />

28 void redirect_write_field ( Oop obj_oop , int idx ,<br />

29 Oop value , Oop newTop ) {<br />

30 Oop domain = obj_oop . as_object ()-> domain_oop ();<br />

31 set_argumentCount (4);<br />

32 roots . lkupClass = domain . fetchClass ();<br />

33 roots . messageSelector = The_Domain . write_field_with_return ();<br />

34 create_context_and_activate ( domain , value ,<br />

35 Oop :: from_int ( idx + 1) , obj_oop , newTop );<br />

36 }<br />

Listing 7.3: Implementation of store and pop byteco<strong>de</strong>s.<br />

193

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!