Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/SpecializationGroup.java @ 20940:476374f3fe9a
Truffle-DSL: generate better polymorphic execute signatures
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 15:12:48 +0200 |
parents | 18c0f02fa4d2 |
children |
rev | line source |
---|---|
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * accompanied this code). |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * questions. |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 */ |
16759
23415229349b
Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents:
16755
diff
changeset
|
23 package com.oracle.truffle.dsl.processor.parser; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
25 import java.util.*; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
26 |
20938
18c0f02fa4d2
Truffle-DSL: make type systems optional.
Christian Humer <christian.humer@gmail.com>
parents:
19291
diff
changeset
|
27 import javax.lang.model.type.*; |
18c0f02fa4d2
Truffle-DSL: make type systems optional.
Christian Humer <christian.humer@gmail.com>
parents:
19291
diff
changeset
|
28 |
16759
23415229349b
Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents:
16755
diff
changeset
|
29 import com.oracle.truffle.dsl.processor.model.*; |
23415229349b
Truffle-DSL: new package structure.
Christian Humer <christian.humer@gmail.com>
parents:
16755
diff
changeset
|
30 import com.oracle.truffle.dsl.processor.model.TemplateMethod.TypeSignature; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
31 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
32 /** |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
33 * Class creates groups of specializations to optimize the layout of generated executeAndSpecialize |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
34 * and generic execute methods. |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
35 */ |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
36 public final class SpecializationGroup { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
37 |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
38 private final List<TypeGuard> typeGuards; |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
39 private final List<GuardExpression> guards; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
40 |
11471
5d72a3f5a31d
Truffle-DSL: fixed a bug in else connections for specialization grouping.
Christian Humer <christian.humer@gmail.com>
parents:
11443
diff
changeset
|
41 private final NodeData node; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
42 private final SpecializationData specialization; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
43 private final List<SpecializationGroup> children = new ArrayList<>(); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
44 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
45 private SpecializationGroup parent; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
46 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
47 private SpecializationGroup(SpecializationData data) { |
11471
5d72a3f5a31d
Truffle-DSL: fixed a bug in else connections for specialization grouping.
Christian Humer <christian.humer@gmail.com>
parents:
11443
diff
changeset
|
48 this.node = data.getNode(); |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
49 this.typeGuards = new ArrayList<>(); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
50 this.guards = new ArrayList<>(); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
51 this.specialization = data; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
52 |
13527
25ecb47a6d0e
Truffle-DSL: Added support for references to child arrays in @ShortCircuit;
Christian Humer <christian.humer@gmail.com>
parents:
12401
diff
changeset
|
53 TypeSignature sig = data.getTypeSignature(); |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
54 for (int i = 1; i < sig.size(); i++) { |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
55 typeGuards.add(new TypeGuard(sig.get(i), i - 1)); |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
56 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
57 this.guards.addAll(data.getGuards()); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
58 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
59 |
19291
f4792a544170
Truffle-DSL: implement new assumptions semantics.
Christian Humer <christian.humer@gmail.com>
parents:
19289
diff
changeset
|
60 public SpecializationGroup(List<SpecializationGroup> children, List<TypeGuard> typeGuardsMatches, List<GuardExpression> guardMatches) { |
11471
5d72a3f5a31d
Truffle-DSL: fixed a bug in else connections for specialization grouping.
Christian Humer <christian.humer@gmail.com>
parents:
11443
diff
changeset
|
61 assert !children.isEmpty() : "children must not be empty"; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
62 this.typeGuards = typeGuardsMatches; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
63 this.guards = guardMatches; |
11471
5d72a3f5a31d
Truffle-DSL: fixed a bug in else connections for specialization grouping.
Christian Humer <christian.humer@gmail.com>
parents:
11443
diff
changeset
|
64 this.node = children.get(0).node; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
65 this.specialization = null; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
66 updateChildren(children); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
67 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
68 |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
69 public List<TypeGuard> getAllGuards() { |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
70 List<TypeGuard> collectedGuards = new ArrayList<>(); |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
71 collectedGuards.addAll(typeGuards); |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
72 if (parent != null) { |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
73 collectedGuards.addAll(parent.getAllGuards()); |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
74 } |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
75 return collectedGuards; |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
76 } |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
77 |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
78 public List<GuardExpression> findElseConnectableGuards() { |
19291
f4792a544170
Truffle-DSL: implement new assumptions semantics.
Christian Humer <christian.humer@gmail.com>
parents:
19289
diff
changeset
|
79 if (!getTypeGuards().isEmpty()) { |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
80 return Collections.emptyList(); |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
81 } |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
82 |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
83 if (getGuards().isEmpty()) { |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
84 return Collections.emptyList(); |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
85 } |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
86 |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
87 List<GuardExpression> elseConnectableGuards = new ArrayList<>(); |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
88 int guardIndex = 0; |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
89 while (guardIndex < getGuards().size() && findNegatedGuardInPrevious(getGuards().get(guardIndex)) != null) { |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
90 elseConnectableGuards.add(getGuards().get(guardIndex)); |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
91 guardIndex++; |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
92 } |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
93 |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
94 return elseConnectableGuards; |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
95 } |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
96 |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
97 private GuardExpression findNegatedGuardInPrevious(GuardExpression guard) { |
11481
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
98 SpecializationGroup previous = this.getPreviousGroup(); |
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
99 if (previous == null) { |
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
100 return null; |
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
101 } |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
102 List<GuardExpression> elseConnectedGuards = previous.findElseConnectableGuards(); |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
103 |
11481
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
104 if (previous == null || previous.getGuards().size() != elseConnectedGuards.size() + 1) { |
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
105 return null; |
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
106 } |
11507
d6a5ab791b0d
Truffle-DSL: fixed a bug in grouping of abstract guards.
Christian Humer <christian.humer@gmail.com>
parents:
11481
diff
changeset
|
107 |
12401
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
108 /* Guard is else branch can be connected in previous specialization. */ |
11507
d6a5ab791b0d
Truffle-DSL: fixed a bug in grouping of abstract guards.
Christian Humer <christian.humer@gmail.com>
parents:
11481
diff
changeset
|
109 if (elseConnectedGuards.contains(guard)) { |
d6a5ab791b0d
Truffle-DSL: fixed a bug in grouping of abstract guards.
Christian Humer <christian.humer@gmail.com>
parents:
11481
diff
changeset
|
110 return guard; |
d6a5ab791b0d
Truffle-DSL: fixed a bug in grouping of abstract guards.
Christian Humer <christian.humer@gmail.com>
parents:
11481
diff
changeset
|
111 } |
d6a5ab791b0d
Truffle-DSL: fixed a bug in grouping of abstract guards.
Christian Humer <christian.humer@gmail.com>
parents:
11481
diff
changeset
|
112 |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
113 GuardExpression previousGuard = previous.getGuards().get(elseConnectedGuards.size()); |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19282
diff
changeset
|
114 if (guard.equalsNegated(previousGuard)) { |
11481
a317acdd5f2c
Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents:
11471
diff
changeset
|
115 return guard; |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
116 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
117 return null; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
118 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
119 |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
120 private void updateChildren(List<SpecializationGroup> childs) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
121 if (!children.isEmpty()) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
122 children.clear(); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
123 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
124 this.children.addAll(childs); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
125 for (SpecializationGroup child : childs) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
126 child.parent = this; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
127 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
128 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
129 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
130 public SpecializationGroup getParent() { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
131 return parent; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
132 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
133 |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
134 public List<TypeGuard> getTypeGuards() { |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
135 return typeGuards; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
136 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
137 |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
138 public List<GuardExpression> getGuards() { |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
139 return guards; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
140 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
141 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
142 public List<SpecializationGroup> getChildren() { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
143 return children; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
144 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
145 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
146 public SpecializationData getSpecialization() { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
147 return specialization; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
148 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
149 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
150 private static SpecializationGroup combine(List<SpecializationGroup> groups) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
151 if (groups.isEmpty()) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
152 throw new IllegalArgumentException("empty combinations"); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
153 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
154 if (groups.size() == 1) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
155 return null; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
156 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
157 |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
158 List<TypeGuard> typeGuardsMatches = new ArrayList<>(); |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
159 List<GuardExpression> guardMatches = new ArrayList<>(); |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
160 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
161 SpecializationGroup first = groups.get(0); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
162 List<SpecializationGroup> others = groups.subList(1, groups.size()); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
163 |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
164 outer: for (TypeGuard typeGuard : first.typeGuards) { |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
165 for (SpecializationGroup other : others) { |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
166 if (!other.typeGuards.contains(typeGuard)) { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
167 // type guards can be combined unordered |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
168 continue outer; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
169 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
170 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
171 typeGuardsMatches.add(typeGuard); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
172 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
173 |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
174 outer: for (GuardExpression guard : first.guards) { |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
175 for (SpecializationGroup other : others) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
176 if (!other.guards.contains(guard)) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
177 // we must break here. One guard may depend on the other. |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
178 break outer; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
179 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
180 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
181 guardMatches.add(guard); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
182 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
183 |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
184 // check for guards for required type casts |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
185 for (Iterator<GuardExpression> iterator = guardMatches.iterator(); iterator.hasNext();) { |
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
186 GuardExpression guardMatch = iterator.next(); |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19282
diff
changeset
|
187 if (!guardMatch.getExpression().findBoundVariables().isEmpty()) { |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
188 iterator.remove(); |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
189 } |
19283
08aa0372dad4
Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19282
diff
changeset
|
190 // TODO we need to be smarter here with bound parameters. |
11442
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
191 } |
2868b55001d4
Truffle-DSL: fixed specializationg grouping failed with guards using base types.
Christian Humer <christian.humer@gmail.com>
parents:
11201
diff
changeset
|
192 |
19291
f4792a544170
Truffle-DSL: implement new assumptions semantics.
Christian Humer <christian.humer@gmail.com>
parents:
19289
diff
changeset
|
193 if (typeGuardsMatches.isEmpty() && guardMatches.isEmpty()) { |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
194 return null; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
195 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
196 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
197 for (SpecializationGroup group : groups) { |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
198 group.typeGuards.removeAll(typeGuardsMatches); |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
199 group.guards.removeAll(guardMatches); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
200 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
201 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
202 List<SpecializationGroup> newChildren = new ArrayList<>(groups); |
19291
f4792a544170
Truffle-DSL: implement new assumptions semantics.
Christian Humer <christian.humer@gmail.com>
parents:
19289
diff
changeset
|
203 return new SpecializationGroup(newChildren, typeGuardsMatches, guardMatches); |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
204 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
205 |
11443
b33783cbd8ce
Truffle-DSL: refactored redundant guard generation code.
Christian Humer <christian.humer@gmail.com>
parents:
11442
diff
changeset
|
206 public static SpecializationGroup create(SpecializationData specialization) { |
b33783cbd8ce
Truffle-DSL: refactored redundant guard generation code.
Christian Humer <christian.humer@gmail.com>
parents:
11442
diff
changeset
|
207 return new SpecializationGroup(specialization); |
b33783cbd8ce
Truffle-DSL: refactored redundant guard generation code.
Christian Humer <christian.humer@gmail.com>
parents:
11442
diff
changeset
|
208 } |
b33783cbd8ce
Truffle-DSL: refactored redundant guard generation code.
Christian Humer <christian.humer@gmail.com>
parents:
11442
diff
changeset
|
209 |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
210 public static SpecializationGroup create(List<SpecializationData> specializations) { |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
211 List<SpecializationGroup> groups = new ArrayList<>(); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
212 for (SpecializationData specialization : specializations) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
213 groups.add(new SpecializationGroup(specialization)); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
214 } |
19291
f4792a544170
Truffle-DSL: implement new assumptions semantics.
Christian Humer <christian.humer@gmail.com>
parents:
19289
diff
changeset
|
215 return new SpecializationGroup(createCombinationalGroups(groups), Collections.<TypeGuard> emptyList(), Collections.<GuardExpression> emptyList()); |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
216 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
217 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
218 @Override |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
219 public String toString() { |
19291
f4792a544170
Truffle-DSL: implement new assumptions semantics.
Christian Humer <christian.humer@gmail.com>
parents:
19289
diff
changeset
|
220 return "SpecializationGroup [typeGuards=" + typeGuards + ", guards=" + guards + "]"; |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
221 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
222 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
223 private static List<SpecializationGroup> createCombinationalGroups(List<SpecializationGroup> groups) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
224 if (groups.size() <= 1) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
225 return groups; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
226 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
227 List<SpecializationGroup> newGroups = new ArrayList<>(); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
228 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
229 int i = 0; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
230 for (i = 0; i < groups.size();) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
231 SpecializationGroup combined = null; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
232 for (int j = groups.size(); j > i + 1; j--) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
233 combined = combine(groups.subList(i, j)); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
234 if (combined != null) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
235 break; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
236 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
237 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
238 SpecializationGroup newGroup; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
239 if (combined == null) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
240 newGroup = groups.get(i); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
241 i++; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
242 } else { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
243 newGroup = combined; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
244 List<SpecializationGroup> originalGroups = new ArrayList<>(combined.children); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
245 combined.updateChildren(createCombinationalGroups(originalGroups)); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
246 i += originalGroups.size(); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
247 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
248 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
249 newGroups.add(newGroup); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
250 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
251 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
252 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
253 return newGroups; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
254 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
255 |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
256 public SpecializationGroup getPreviousGroup() { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
257 if (parent == null || parent.children.isEmpty()) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
258 return null; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
259 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
260 int index = parent.children.indexOf(this); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
261 if (index <= 0) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
262 return null; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
263 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
264 return parent.children.get(index - 1); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
265 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
266 |
12401
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
267 public int getUncheckedSpecializationIndex() { |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
268 int groupMaxIndex = getMaxSpecializationIndex(); |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
269 |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
270 int genericIndex = node.getSpecializations().indexOf(node.getGenericSpecialization()); |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
271 if (groupMaxIndex >= genericIndex) { |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
272 // no minimum state check for an generic index |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
273 groupMaxIndex = -1; |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
274 } |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
275 |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
276 if (groupMaxIndex > -1) { |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
277 // no minimum state check if already checked by parent group |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
278 int parentMaxIndex = -1; |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
279 if (getParent() != null) { |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
280 parentMaxIndex = getParent().getMaxSpecializationIndex(); |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
281 } |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
282 if (groupMaxIndex == parentMaxIndex) { |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
283 groupMaxIndex = -1; |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
284 } |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
285 } |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
286 return groupMaxIndex; |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
287 } |
85dcc7f59c34
Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents:
11507
diff
changeset
|
288 |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
289 public int getMaxSpecializationIndex() { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
290 if (specialization != null) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
291 return specialization.getNode().getSpecializations().indexOf(specialization); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
292 } else { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
293 int max = Integer.MIN_VALUE; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
294 for (SpecializationGroup childGroup : getChildren()) { |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
295 max = Math.max(max, childGroup.getMaxSpecializationIndex()); |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
296 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
297 return max; |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
298 } |
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
299 } |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
300 |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
301 public static final class TypeGuard { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
302 |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
303 private final int signatureIndex; |
20938
18c0f02fa4d2
Truffle-DSL: make type systems optional.
Christian Humer <christian.humer@gmail.com>
parents:
19291
diff
changeset
|
304 private final TypeMirror type; |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
305 |
20938
18c0f02fa4d2
Truffle-DSL: make type systems optional.
Christian Humer <christian.humer@gmail.com>
parents:
19291
diff
changeset
|
306 public TypeGuard(TypeMirror type, int signatureIndex) { |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
307 this.type = type; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
308 this.signatureIndex = signatureIndex; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
309 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
310 |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
311 @Override |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
312 public int hashCode() { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
313 final int prime = 31; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
314 int result = 1; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
315 result = prime * result + signatureIndex; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
316 result = prime * result + type.hashCode(); |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
317 return result; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
318 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
319 |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
320 @Override |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
321 public boolean equals(Object obj) { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
322 if (this == obj) { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
323 return true; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
324 } else if (obj == null) { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
325 return false; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
326 } else if (getClass() != obj.getClass()) { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
327 return false; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
328 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
329 |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
330 TypeGuard other = (TypeGuard) obj; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
331 if (signatureIndex != other.signatureIndex) { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
332 return false; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
333 } else if (!type.equals(other.type)) { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
334 return false; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
335 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
336 return true; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
337 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
338 |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
339 public int getSignatureIndex() { |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
340 return signatureIndex; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
341 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
342 |
20938
18c0f02fa4d2
Truffle-DSL: make type systems optional.
Christian Humer <christian.humer@gmail.com>
parents:
19291
diff
changeset
|
343 public TypeMirror getType() { |
11201
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
344 return type; |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
345 } |
7fc3e1fb3965
Truffle-DSL: specialization group fixes.
Christian Humer <christian.humer@gmail.com>
parents:
11195
diff
changeset
|
346 } |
16755
bd28da642eea
Truffle-DSL: Several new features implemented:
Christian Humer <christian.humer@gmail.com>
parents:
13527
diff
changeset
|
347 |
19289
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
348 public SpecializationGroup getPrevious() { |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
349 if (getParent() == null) { |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
350 return null; |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
351 } |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
352 |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
353 List<SpecializationGroup> parentChildren = getParent().getChildren(); |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
354 int index = parentChildren.indexOf(this); |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
355 if (index <= 0) { |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
356 return null; |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
357 } |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
358 return parentChildren.get(index - 1); |
62c43fcf5be2
Truffle-DSL: implement @Cached and fixes for the new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents:
19283
diff
changeset
|
359 } |
11195
4f52b08bd2f9
Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
360 } |