compiler/benchmarks/PPCBenchmark.st
changeset 537 fb212e14d1f4
parent 529 439c4057517f
child 538 16e8536f5cfb
--- a/compiler/benchmarks/PPCBenchmark.st	Mon Sep 07 08:03:02 2015 +0100
+++ b/compiler/benchmarks/PPCBenchmark.st	Mon Sep 07 08:20:46 2015 +0100
@@ -4,7 +4,7 @@
 
 Object subclass:#PPCBenchmark
 	instanceVariableNames:'sources report contextClass compile parser context input
-		configuration profile repetitions'
+		compiler profile repetitions'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'PetitCompiler-Benchmarks-Core'
@@ -322,16 +322,22 @@
 
 benchmarkSmalltalkParserCompiled
     | time |
-    
-    configuration := PPCConfiguration default.
-    parser := PPSmalltalkParser new compileWithConfiguration: configuration.
+
+    compiler := PPCCompiler default.
+    parser := PPSmalltalkParser new compileUsingCompiler:compiler.
     context := PPCContext new.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources smalltalkSourcesBig.
-
-    time := [ input do: [ :source | parser parse: source withContext: context ]] timeToRun asMilliSeconds.
-    
-        self reportInput: input time: time name: 'Smalltalk Parser Compiled'.
+    time := [
+            input do:[:source | 
+                parser parse:source withContext:context
+            ]
+        ] timeToRun 
+            asMilliSeconds.
+    self 
+        reportInput:input
+        time:time
+        name:'Smalltalk Parser Compiled'.
 ! !
 
 !PPCBenchmark methodsFor:'benchmarks-CalipeL'!
@@ -547,24 +553,22 @@
 !
 
 setupExpressionGrammarCompiled
-    
-    configuration := PPCConfiguration universal.
-    configuration options parserName: #PPCompiledExpressionGrammar.
-    configuration options scannerName: #PPCompiledExpressionScanner.
-    parser := PPExpressionGrammar new compileWithConfiguration: configuration.
+    compiler := PPCCompiler universal.
+    compiler options parserName:#PPCompiledExpressionGrammar.
+    compiler options scannerName:#PPCompiledExpressionScanner.
+    parser := PPExpressionGrammar new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources expressionSourcesMedium.
 !
 
 setupExpressionGrammarTokenized
-    
-    configuration := PPCConfiguration tokenizing.
-    configuration options parserName: #PPTokenizedExpressionGrammar.
-    configuration options scannerName: #PPTokenizedExpressionScanner.
-    parser := PPExpressionGrammar new compileWithConfiguration: configuration.
+    compiler := PPCCompiler tokenizing.
+    compiler options parserName:#PPTokenizedExpressionGrammar.
+    compiler options scannerName:#PPTokenizedExpressionScanner.
+    parser := PPExpressionGrammar new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources expressionSourcesMedium.
 !
 
@@ -598,24 +602,22 @@
 !
 
 setupLL1ExpressionGrammarCompiled
-    
-    configuration := PPCConfiguration universal.
-    configuration options parserName: #PPCompiledLL1ExpressionGrammar.
-    configuration options scannerName: #PPCompiledLL1ExpressionScanner.
-    parser := PPLL1ExpressionGrammar new compileWithConfiguration: configuration.
+    compiler := PPCCompiler universal.
+    compiler options parserName:#PPCompiledLL1ExpressionGrammar.
+    compiler options scannerName:#PPCompiledLL1ExpressionScanner.
+    parser := PPLL1ExpressionGrammar new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources expressionSourcesBig.
 !
 
 setupLL1ExpressionGrammarTokenized
-    
-    configuration := PPCConfiguration tokenizing.
-    configuration options parserName: #PPTokenizedLL1ExpressionGrammar.
-    configuration options scannerName: #PPTokenizedLL1ExpressionScanner.
-    parser := PPLL1ExpressionGrammar new compileWithConfiguration: configuration.
+    compiler := PPCCompiler tokenizing.
+    compiler options parserName:#PPTokenizedLL1ExpressionGrammar.
+    compiler options scannerName:#PPTokenizedLL1ExpressionScanner.
+    parser := PPLL1ExpressionGrammar new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources expressionSourcesBig.
 !
 
@@ -630,11 +632,10 @@
 !
 
 setupLRPParserCompiled
-
-    configuration := PPCConfiguration universal.
-    parser := PPCLRPParser new compileWithConfiguration: configuration.
+    compiler := PPCCompiler universal.
+    parser := PPCLRPParser new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := PPCLRPSourcesResource current sources
 
     "Created: / 18-08-2015 / 16:35:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -664,56 +665,49 @@
 !
 
 setupSmalltalkGrammarCompiled
-
-    configuration := PPCConfiguration universal.
-    configuration options parserName: #PPSmalltalkGrammarC_Unviersal.
-    configuration options profile: profile.
-    
-    parser := PPSmalltalkGrammar new compileWithConfiguration: configuration.
+    compiler := PPCCompiler universal.
+    compiler options parserName:#'PPSmalltalkGrammarC_Unviersal'.
+    compiler options profile:profile.
+    parser := PPSmalltalkGrammar new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
-    
-    profile ifTrue: [ 
-        input := sources smalltalkSourcesSmall.	
-    ] ifFalse: [ 
-        input := sources smalltalkSourcesBig.	
+    context initializeFor:parser.
+    profile ifTrue:[
+        input := sources smalltalkSourcesSmall.
+    ] ifFalse:[
+        input := sources smalltalkSourcesBig.
     ]
 !
 
 setupSmalltalkGrammarTokenized
-
-    configuration := PPCConfiguration tokenizing.
-    configuration options parserName: #PPSmalltalkGrammarC_Tokenizing.
-    configuration options scannerName: #PPSmalltalkGrammarC_Scanner.
-    configuration options profile: profile.
-    
-    parser := PPSmalltalkGrammar new compileWithConfiguration: configuration.
+    compiler := PPCCompiler tokenizing.
+    compiler options parserName:#'PPSmalltalkGrammarC_Tokenizing'.
+    compiler options scannerName:#'PPSmalltalkGrammarC_Scanner'.
+    compiler options profile:profile.
+    parser := PPSmalltalkGrammar new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
-    profile ifTrue: [ 
-        input := sources smalltalkSourcesSmall.	
-    ] ifFalse: [ 
-        input := sources smalltalkSourcesBig.	
+    context initializeFor:parser.
+    profile ifTrue:[
+        input := sources smalltalkSourcesSmall.
+    ] ifFalse:[
+        input := sources smalltalkSourcesBig.
     ]
 !
 
 setupSmalltalkNoopParserCompiled
-
-    configuration := PPCConfiguration universal.
-    parser := PPCSmalltalkNoopParser new compileWithConfiguration: configuration.
+    compiler := PPCCompiler universal.
+    parser := PPCSmalltalkNoopParser new compileUsingCompiler:compiler.
     context := PPCContext new.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources smalltalkSourcesBig.
 
     "Created: / 16-05-2015 / 09:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 setupSmalltalkNoopParserTokenized
-
-    configuration := PPCConfiguration tokenizing.
-    parser := PPCSmalltalkNoopParser new compileWithConfiguration: configuration.
+    compiler := PPCCompiler tokenizing.
+    parser := PPCSmalltalkNoopParser new compileUsingCompiler:compiler.
     context := PPCContext new.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources smalltalkSourcesBig.
 
     "Created: / 16-05-2015 / 09:44:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -728,20 +722,18 @@
 !
 
 setupSmalltalkParserCompiled
-
-    configuration := PPCConfiguration universal.
-    parser := PPSmalltalkParser new compileWithConfiguration: configuration.
+    compiler := PPCCompiler universal.
+    parser := PPSmalltalkParser new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources smalltalkSourcesBig.
 !
 
 setupSmalltalkParserTokenized
-
-    configuration := PPCConfiguration tokenizing.
-    parser := PPSmalltalkParser new compileWithConfiguration: configuration.
+    compiler := PPCCompiler tokenizing.
+    parser := PPSmalltalkParser new compileUsingCompiler:compiler.
     context := self context.
-    context initializeFor: parser.
+    context initializeFor:parser.
     input := sources smalltalkSourcesBig.
 !