compiler/benchmarks/PPCBenchmarkResources.st
changeset 432 fde2d5969fbb
parent 422 116d2b2af905
child 438 20598d7ce9fa
equal deleted inserted replaced
431:dd353f15b0ef 432:fde2d5969fbb
     7 	classVariableNames:'javaCache'
     7 	classVariableNames:'javaCache'
     8 	poolDictionaries:''
     8 	poolDictionaries:''
     9 	category:'PetitCompiler-Benchmarks-Core'
     9 	category:'PetitCompiler-Benchmarks-Core'
    10 !
    10 !
    11 
    11 
       
    12 
    12 !PPCBenchmarkResources methodsFor:'as yet unclassified'!
    13 !PPCBenchmarkResources methodsFor:'as yet unclassified'!
    13 
    14 
    14 changesSized: size
    15 changesSized: size
    15 	| string changes |
    16 	| string changes |
    16 	changes := PharoFilesOpener default changesFileOrNil contents.
    17 	changes := PharoFilesOpener default changesFileOrNil contents.
    22 javaInDirectory: directory
    23 javaInDirectory: directory
    23 	| files |
    24 	| files |
    24 	files := self readDirectory: directory.
    25 	files := self readDirectory: directory.
    25 	files := self files: files withExtension: 'java'.
    26 	files := self files: files withExtension: 'java'.
    26 	
    27 	
    27 	^ files collect: [ :f | (FileStream fileNamed: f) contents ]
    28 	^ files collect: [ :f | (FileStream fileNamed: f) contents asString ]
    28 !
    29 !
    29 
    30 
    30 javaLangClass
    31 javaLangClass
    31 !
    32 !
    32 
    33 
    33 javaLangMath
    34 javaLangMath
    34 	^ (FileStream fileNamed: '../java-src/java/lang/Math.java') contents
    35 	^ (FileStream fileNamed: '../java-src/java/lang/Math.java') contents asString
    35 !
    36 !
    36 
    37 
    37 javaSourcesBig
    38 javaSourcesBig
    38 	^ self javaInDirectory: '../java-src/java/util'.
    39 	^ self javaInDirectory: '../java-src/java/util'.
    39 	"^ self workingJavaInDirectory: '../java-src/java/util'"
    40 	"^ self workingJavaInDirectory: '../java-src/java/util'"
  3961 smalltalkInDirectory: directory
  3962 smalltalkInDirectory: directory
  3962 	| files |
  3963 	| files |
  3963 	files := self readDirectory: directory.
  3964 	files := self readDirectory: directory.
  3964 	files := self files: files withExtension: 'st'.
  3965 	files := self files: files withExtension: 'st'.
  3965 	
  3966 	
  3966 	^ files collect: [ :f | (FileStream fileNamed: f) contents ]
  3967 	^ files collect: [ :f | (FileStream fileNamed: f) contents asString ]
  3967 !
  3968 !
  3968 
  3969 
  3969 smalltalkObjectMethods
  3970 smalltalkObjectMethods
  3970 	^ Object allMethods collect: [ :m | m sourceCode ].
  3971 	^ Object allMethods collect: [ :m | m sourceCode ].
  3971 !
  3972 !
  3995 ! !
  3996 ! !
  3996 
  3997 
  3997 !PPCBenchmarkResources methodsFor:'private utilities'!
  3998 !PPCBenchmarkResources methodsFor:'private utilities'!
  3998 
  3999 
  3999 files: files withExtension: extension
  4000 files: files withExtension: extension
  4000 	^ files select: [ :f | f extension = extension ] 
  4001     ( (Smalltalk respondsTo: #isSmalltalkX) and:[ Smalltalk isSmalltalkX ] ) ifTrue:[ 
       
  4002         ^ files select: [ :f | f suffix = extension ] 
       
  4003     ] ifFalse:[ 
       
  4004         "Assuming Pharo..."    
       
  4005         ^ files select: [ :f | f extension = extension ] 
       
  4006     ]
       
  4007 
       
  4008     "Modified: / 20-04-2015 / 10:58:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4001 !
  4009 !
  4002 
  4010 
  4003 readDirectory: directory
  4011 readDirectory: directory
  4004 	| file |
  4012         | file |
  4005 	file := directory asFileReference.
  4013 
  4006 	file exists ifTrue: [ 
  4014         ( (Smalltalk respondsTo: #isSmalltalkX) and:[ Smalltalk isSmalltalkX ] ) ifTrue:[ 
  4007 		^ file allFiles
  4015             file := directory asFilename.
  4008 	].
  4016             file exists ifFalse:[  
  4009 	^ #()
  4017                 self error: 'Directory does not exist'.
       
  4018             ].
       
  4019             ^ file recursiveDirectoryContentsAsFilenames select:[:each | each isRegularFile ]
       
  4020         ] ifFalse:[ 
       
  4021             "Assuming Pharo..."
       
  4022 
       
  4023             file := directory asFileReference.
       
  4024             file exists ifFalse: [ 
       
  4025                 self error: 'Directory does not exist'.
       
  4026             ].
       
  4027             ^ file allFiles
       
  4028         ]
       
  4029 
       
  4030     "Modified: / 20-04-2015 / 11:12:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  4010 ! !
  4031 ! !
  4011 
  4032 
       
  4033 !PPCBenchmarkResources class methodsFor:'documentation'!
       
  4034 
       
  4035 version_HG
       
  4036 
       
  4037     ^ '$Changeset: <not expanded> $'
       
  4038 ! !
       
  4039