stop pinning self and frame

before: r0-message , r1-self , r2-frame , r3-new_message , r4 + tmps
now: r0-message , r1-new_message , r2 + tmps
programs got smaller, less fuss
also fix in return implementation that got the address from the wrong
message
This commit is contained in:
Torsten Ruger
2015-10-18 17:20:19 +03:00
parent da5502e301
commit 6c7e4c0fe2
19 changed files with 98 additions and 94 deletions

View File

@ -29,7 +29,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant,SetSlot] , [Virtual::MethodReturn]]
@expect = [[Virtual::MethodEnter,LoadConstant,GetSlot,SetSlot] , [Virtual::MethodReturn]]
check
end
@ -42,7 +42,7 @@ end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant,LoadConstant,
OperatorInstruction,SetSlot],[Virtual::MethodReturn]]
OperatorInstruction,GetSlot,SetSlot],[Virtual::MethodReturn]]
check
end
@ -55,7 +55,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant,SetSlot] , [Virtual::MethodReturn]]
@expect = [[Virtual::MethodEnter,LoadConstant,GetSlot,SetSlot] , [Virtual::MethodReturn]]
check
end
@ -67,7 +67,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant, SetSlot] , [Virtual::MethodReturn]]
@expect = [[Virtual::MethodEnter,LoadConstant, GetSlot,SetSlot] , [Virtual::MethodReturn]]
check
end
@ -79,8 +79,8 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,GetSlot,SetSlot, LoadConstant,
SetSlot,Virtual::MethodCall,GetSlot,SetSlot] , [Virtual::MethodReturn]]
@expect = [[Virtual::MethodEnter,GetSlot,GetSlot,SetSlot, LoadConstant,SetSlot,
Virtual::MethodCall,GetSlot,GetSlot,SetSlot] , [Virtual::MethodReturn]]
check
end
end

View File

@ -17,7 +17,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant,GetSlot,
@expect = [[Virtual::MethodEnter,GetSlot,LoadConstant,
SetSlot,LoadConstant,SetSlot,Virtual::MethodCall,GetSlot] ,
[Virtual::MethodReturn]]
check
@ -37,7 +37,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant,GetSlot,
@expect = [[Virtual::MethodEnter,GetSlot,LoadConstant,
SetSlot,LoadConstant,SetSlot,Virtual::MethodCall,GetSlot] ,
[Virtual::MethodReturn]]
check
@ -57,8 +57,8 @@ class Object
end
end
HERE
@expect = [ [Virtual::MethodEnter,LoadConstant,SetSlot,GetSlot,
GetSlot,SetSlot,LoadConstant,SetSlot,Virtual::MethodCall,
@expect = [ [Virtual::MethodEnter,LoadConstant,GetSlot,SetSlot,GetSlot,
GetSlot,GetSlot,SetSlot,LoadConstant,SetSlot,Virtual::MethodCall,
GetSlot] ,[Virtual::MethodReturn] ]
check
end
@ -77,13 +77,13 @@ class Object
end
end
HERE
@expect = [ [Virtual::MethodEnter,GetSlot,GetSlot,SetSlot,
@expect = [ [Virtual::MethodEnter,GetSlot,GetSlot,GetSlot,SetSlot,
LoadConstant,SetSlot,Virtual::MethodCall,
GetSlot] ,[Virtual::MethodReturn] ]
check
end
def test_puts_string
def test_call_puts
@string_input = <<HERE
class Object
int puts(Word str)
@ -94,7 +94,7 @@ int main()
end
end
HERE
@expect = [ [Virtual::MethodEnter , GetSlot,SetSlot,LoadConstant,SetSlot,LoadConstant,
@expect = [ [Virtual::MethodEnter , GetSlot,GetSlot,SetSlot,LoadConstant,SetSlot,LoadConstant,
SetSlot,Virtual::MethodCall,GetSlot],
[Virtual::MethodReturn]]
check

View File

@ -26,7 +26,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,GetSlot] , [Virtual::MethodReturn]]
@expect = [[Virtual::MethodEnter,GetSlot,GetSlot] , [Virtual::MethodReturn]]
check
end
@ -39,7 +39,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant, SetSlot,GetSlot] , [Virtual::MethodReturn]]
@expect = [[Virtual::MethodEnter,LoadConstant,GetSlot,SetSlot,GetSlot,GetSlot] , [Virtual::MethodReturn]]
check
end
@ -52,7 +52,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,GetSlot] , [Virtual::MethodReturn]]
@expect = [[Virtual::MethodEnter,GetSlot,GetSlot] , [Virtual::MethodReturn]]
check
end
@ -64,7 +64,7 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,GetSlot,SetSlot, LoadConstant,
@expect = [[Virtual::MethodEnter,GetSlot,GetSlot,SetSlot, LoadConstant,
SetSlot,Virtual::MethodCall,GetSlot] , [Virtual::MethodReturn]]
check
end

View File

@ -31,8 +31,8 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant,SetSlot],[GetSlot,LoadConstant,OperatorInstruction,
IsZeroBranch,GetSlot,LoadConstant,OperatorInstruction,SetSlot,AlwaysBranch],
@expect = [[Virtual::MethodEnter,LoadConstant,GetSlot,SetSlot],[GetSlot,GetSlot,LoadConstant,OperatorInstruction,
IsZeroBranch,GetSlot,GetSlot,LoadConstant,OperatorInstruction,GetSlot,SetSlot,AlwaysBranch],
[],[Virtual::MethodReturn]]
check
end
@ -50,9 +50,9 @@ class Object
end
end
HERE
@expect = [[Virtual::MethodEnter,LoadConstant,SetSlot],
[GetSlot,LoadConstant,OperatorInstruction,IsZeroBranch,
GetSlot,LoadConstant,OperatorInstruction,SetSlot,
@expect = [[Virtual::MethodEnter,LoadConstant,GetSlot,SetSlot],
[GetSlot,GetSlot,LoadConstant,OperatorInstruction,IsZeroBranch,GetSlot,
GetSlot,LoadConstant,OperatorInstruction,GetSlot,SetSlot,GetSlot,
GetSlot,AlwaysBranch] ,
[],[Virtual::MethodReturn]]
check