| Index: pkg/compiler/lib/src/cps_ir/share_final_fields.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/share_final_fields.dart b/pkg/compiler/lib/src/cps_ir/share_final_fields.dart
|
| index 3308c00e2407724b41dfa8258a2de89a87eddbf8..d33fb05505e6bed3cb554ea0b4cec9ec962e3338 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/share_final_fields.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/share_final_fields.dart
|
| @@ -122,8 +122,8 @@ class ShareFinalFields extends TrampolineRecursiveVisitor implements Pass {
|
| // still in scope and safe (non-null). We will have to replace
|
| // primitive.object with the most constrained refinement still in scope.
|
| Continuation referencedLoop =
|
| - lowestCommonAncestor(loopHeaderFor[refinedReceiver],
|
| - currentLoopHeader);
|
| + loopHierarchy.lowestCommonAncestor(loopHeaderFor[refinedReceiver],
|
| + currentLoopHeader);
|
| if (referencedLoop != currentLoopHeader) {
|
| Continuation hoistTarget = getCurrentOuterLoop(scope: referencedLoop);
|
| LetCont loopBinding = hoistTarget.parent;
|
| @@ -157,25 +157,4 @@ class ShareFinalFields extends TrampolineRecursiveVisitor implements Pass {
|
| if (backend.isNative(field)) return false;
|
| return field.isFinal || field.isConst;
|
| }
|
| -
|
| - /// Returns the the innermost loop that effectively encloses both
|
| - /// c1 and c2 (or `null` if there is no such loop).
|
| - Continuation lowestCommonAncestor(Continuation c1, Continuation c2) {
|
| - int d1 = getDepth(c1), d2 = getDepth(c2);
|
| - while (c1 != c2) {
|
| - if (d1 <= d2) {
|
| - c2 = loopHierarchy.getEnclosingLoop(c2);
|
| - d2 = getDepth(c2);
|
| - } else {
|
| - c1 = loopHierarchy.getEnclosingLoop(c1);
|
| - d1 = getDepth(c1);
|
| - }
|
| - }
|
| - return c1;
|
| - }
|
| -
|
| - int getDepth(Continuation loop) {
|
| - if (loop == null) return -1;
|
| - return loopHierarchy.loopDepth[loop];
|
| - }
|
| }
|
|
|