The Trunk: Tests-eem.340.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tests-eem.340.mcz

commits-2
Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.340.mcz

==================== Summary ====================

Name: Tests-eem.340
Author: eem
Time: 13 May 2016, 12:39:54.269153 pm
UUID: 8d0d2cc1-ea8a-4517-a986-8ff469407533
Ancestors: Tests-ul.339

Add tests for the new bytecode scanning machinery (see Compiler-eem.322).  Nuke some misplaced class vars.

=============== Diff against Tests-ul.339 ===============

Item was added:
+ LongTestCase subclass: #BytecodeDecodingTests
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Tests-Compiler'!

Item was added:
+ ----- Method: BytecodeDecodingTests>>testPCPreviousTo (in category 'tests') -----
+ testPCPreviousTo
+ "Check that the pcPreviousTo machinery answers the truth for all bytecodes."
+ self systemNavigation allSelect:
+ [:m| | ec is prevPC prevBlockCreationPC exclude |
+ m isQuick ifFalse:
+ [ec := m encoderClass.
+ is:= InstructionStream on: m.
+ exclude := OrderedCollection new.
+ m embeddedBlockClosures do:
+ [:ebc| | followingpc |
+ followingpc := ebc endPC + (ec bytecodeSize: (m at: ebc endPC)).
+ exclude addLast: ebc startpc; addLast: followingpc..
+ self assert: nil
+ equals: (ec pcPreviousTo: ebc startpc in: m for: nil).
+ self assert: (ec pcOfBlockCreationBytecodeForBlockStartingAt: ebc startpc in: m)
+ equals: (ec pcPreviousTo: followingpc in: m for: nil)].
+ is scanFor:
+ [:b|
+ (exclude includes: is pc) ifFalse:
+ [self assert: prevPC
+ equals: (ec pcPreviousTo: is pc in: m for: nil)].
+ prevPC := is pc.
+ b = ec createClosureCode ifTrue: [prevBlockCreationPC := prevPC].
+ false].].
+ false]!

Item was added:
+ ----- Method: BytecodeDecodingTests>>testWillReallyStore (in category 'tests') -----
+ testWillReallyStore
+ "Check that the willReallyStore machinery answers the truth for all bytecodes."
+ self systemNavigation allSelect:
+ [:m| | is sawITV pnac |
+ m isQuick ifFalse:
+ [sawITV := false. pnac := m encoderClass pushNewArrayCode.
+ is:= InstructionStream on: m.
+ is scanFor:
+ [:b|
+ sawITV
+ ifTrue:
+ [self assert: (m encoderClass isSyntheticStoreAt: is pc in: m for: nil)]
+ ifFalse:
+ [self deny: (m encoderClass isSyntheticStoreAt: is pc in: m for: nil)].
+ "The only bytecode following a pushNewArrayCode that creates an empty array should be a synthetic store."
+ sawITV := b = pnac and: [is secondByte <= 127].
+ false]].
+ false]!

Item was changed:
  TestCase subclass: #ClosureCompilerTest
  instanceVariableNames: ''
+ classVariableNames: ''
- classVariableNames: 'CmpRR CogRTLOpcodes Jump MoveCqR Nop'
  poolDictionaries: ''
  category: 'Tests-Compiler'!