compiler/PPCInliningVisitor.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 24 Jul 2015 15:06:54 +0100
changeset 502 1e45d3c96ec5
parent 464 f6d77fee9811
child 503 ff58cd9f1f3c
child 515 b5316ef15274
permissions -rw-r--r--
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12 Name: PetitCompiler-JanVrany.135 Author: JanVrany Time: 22-07-2015, 06:53:29.127 PM UUID: 890178b5-275d-46af-a2ad-1738998f07cb Ancestors: PetitCompiler-JanVrany.134 Name: PetitCompiler-Tests-JanKurs.93 Author: JanKurs Time: 20-07-2015, 11:30:10.283 PM UUID: 6473e671-ad70-42ca-b6c3-654b78edc531 Ancestors: PetitCompiler-Tests-JanKurs.92 Name: PetitCompiler-Extras-Tests-JanVrany.16 Author: JanVrany Time: 22-07-2015, 05:18:22.387 PM UUID: 8f6f9129-dbba-49b1-9402-038470742f98 Ancestors: PetitCompiler-Extras-Tests-JanKurs.15 Name: PetitCompiler-Benchmarks-JanKurs.12 Author: JanKurs Time: 06-07-2015, 02:10:06.901 PM UUID: cb24f1ac-46a4-494d-9780-64576f0f0dba Ancestors: PetitCompiler-Benchmarks-JanKurs.11, PetitCompiler-Benchmarks-JanVrany.e29bd90f388e.20150619081300
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/petitparser/compiler' }"
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Smalltalk }"
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
PPCNodeVisitor subclass:#PPCInliningVisitor
464
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
     6
	instanceVariableNames:'canInline acceptedNodes'
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'PetitCompiler-Visitors'
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
!PPCInliningVisitor methodsFor:'initialization'!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
initialize
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    15
    super 	initialize.
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    16
        
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    17
    acceptedNodes := 0
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
! !
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
!PPCInliningVisitor methodsFor:'testing'!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
canInline
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    23
    ^ acceptedNodes > 1
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
! !
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
!PPCInliningVisitor methodsFor:'visiting'!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
beforeAccept: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    29
    acceptedNodes := acceptedNodes + 1.
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    30
    super beforeAccept: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
markForInline: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    34
    self canInline ifTrue: [ 
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    35
        node markForInline.
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    36
    ].
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    37
    ^ node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
502
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    40
visitActionNode: node
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    41
    node child markForInline.
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    42
    ^ super visitActionNode: node.
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    43
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    44
    "Created: / 13-05-2015 / 16:25:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    45
!
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    46
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
visitCharSetPredicateNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    48
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
visitCharacterNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    52
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
visitLiteralNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    56
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
visitMessagePredicateNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    60
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
visitNilNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    64
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
visitNotCharSetPredicateNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    68
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
visitNotLiteralNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    72
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
visitNotMessagePredicateNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    76
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
visitPluggableNode: node
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    "Sadly, on Smalltalk/X blocks cannot be inlined because
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
     the VM does not provide enough information to map
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
     it back to source code. Very bad indeed!!"
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
    ((Smalltalk respondsTo:#isSmalltalkX) and:[ Smalltalk isSmalltalkX ]) ifFalse:[
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    84
			self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
    ].
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    ^ super visitPluggableNode: node.
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
    "Modified: / 23-04-2015 / 12:15:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
464
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    91
visitStarCharSetPredicateNode: node
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    92
    ^ self markForInline: node
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    93
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    94
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    95
visitStarMessagePredicateNode: node
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    96
    ^ self markForInline: node
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    97
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 459
diff changeset
    98
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
    99
visitTokenConsumeNode: node
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   100
    super visitTokenConsumeNode: node.
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   101
    node name isNil ifTrue: [ 
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   102
        self markForInline: node
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   103
    ].
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   104
    ^ node
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   105
!
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   106
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
visitTokenStarMessagePredicateNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   108
    ^ self markForInline: node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
!
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
visitTokenStarSeparatorNode: node
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   112
    ^ self markForInline: node
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   113
!
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   114
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   115
visitTokenWhitespaceNode: node
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   116
    super visitTokenWhitespaceNode: node.
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   117
    self markForInline: node.
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 438
diff changeset
   118
    ^ node
459
4751c407bb40 Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 452
diff changeset
   119
!
4751c407bb40 Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 452
diff changeset
   120
4751c407bb40 Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 452
diff changeset
   121
visitTokenizingParserNode: node
4751c407bb40 Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 452
diff changeset
   122
    self visit: node tokenizer.
4751c407bb40 Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 452
diff changeset
   123
    self visit: node parser.
4751c407bb40 Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 452
diff changeset
   124
    ^ node
438
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
! !
20598d7ce9fa Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126