Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java @ 21065:986f1c0d6f55
Truffle-DSL: do not generate polymorphic nodes for nodes with all parameters evaluated in all execute methods.
author | Christian Humer <christian.humer@oracle.com> |
---|---|
date | Fri, 17 Apr 2015 16:18:17 +0200 |
parents | 8dc73c226c63 |
children | b1530a6cce8c |
comparison
equal
deleted
inserted
replaced
21064:28117ede7606 | 21065:986f1c0d6f55 |
---|---|
502 | 502 |
503 static SpecializationNode insertSorted(SpecializationNode start, final SpecializationNode generated, final CharSequence message, final SpecializationNode merged) { | 503 static SpecializationNode insertSorted(SpecializationNode start, final SpecializationNode generated, final CharSequence message, final SpecializationNode merged) { |
504 if (merged == generated) { | 504 if (merged == generated) { |
505 // new node | 505 // new node |
506 if (start.count() == 2) { | 506 if (start.count() == 2) { |
507 insertAt(start, start.createPolymorphic(), "insert polymorphic"); | 507 SpecializationNode polymorphic = start.createPolymorphic(); |
508 /* | |
509 * For nodes with all parameters evaluated in the execute method we do not need a | |
510 * polymorphic node. the generated code returns null in createPolymorphic in this | |
511 * case. | |
512 */ | |
513 if (polymorphic != null) { | |
514 insertAt(start, polymorphic, "insert polymorphic"); | |
515 } | |
508 } | 516 } |
509 SpecializationNode current = start; | 517 SpecializationNode current = start; |
510 while (current != null && current.index < generated.index) { | 518 while (current != null && current.index < generated.index) { |
511 current = current.next; | 519 current = current.next; |
512 } | 520 } |