Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart

Issue 11421056: Re-apply issue 11308169: GVN getInterceptor and use the interceptor constant when the type is known. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of ssa; 5 part of ssa;
6 6
7 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitBailoutTarget(HBailoutTarget node); 9 R visitBailoutTarget(HBailoutTarget node);
10 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 class HInterceptor extends HInstruction { 2372 class HInterceptor extends HInstruction {
2373 final Set<ClassElement> interceptedClasses; 2373 final Set<ClassElement> interceptedClasses;
2374 HInterceptor(this.interceptedClasses, HInstruction receiver) 2374 HInterceptor(this.interceptedClasses, HInstruction receiver)
2375 : super(<HInstruction>[receiver]); 2375 : super(<HInstruction>[receiver]);
2376 String toString() => 'interceptor on $interceptedClasses'; 2376 String toString() => 'interceptor on $interceptedClasses';
2377 accept(HVisitor visitor) => visitor.visitInterceptor(this); 2377 accept(HVisitor visitor) => visitor.visitInterceptor(this);
2378 HInstruction get receiver => inputs[0]; 2378 HInstruction get receiver => inputs[0];
2379 2379
2380 void prepareGvn(HTypeMap types) { 2380 void prepareGvn(HTypeMap types) {
2381 clearAllSideEffects(); 2381 clearAllSideEffects();
2382 setUseGvn();
2382 } 2383 }
2383 2384
2384 int typeCode() => HInstruction.INTERCEPTOR_TYPECODE; 2385 int typeCode() => HInstruction.INTERCEPTOR_TYPECODE;
2386 bool typeEquals(other) => other is HInterceptor;
2385 } 2387 }
2386 2388
2387 /** An [HLazyStatic] is a static that is initialized lazily at first read. */ 2389 /** An [HLazyStatic] is a static that is initialized lazily at first read. */
2388 class HLazyStatic extends HStatic { 2390 class HLazyStatic extends HStatic {
2389 HLazyStatic(Element element) : super(element); 2391 HLazyStatic(Element element) : super(element);
2390 2392
2391 void prepareGvn(HTypeMap types) { 2393 void prepareGvn(HTypeMap types) {
2392 // TODO(4931): The first access has side-effects, but we afterwards we 2394 // TODO(4931): The first access has side-effects, but we afterwards we
2393 // should be able to GVN. 2395 // should be able to GVN.
2394 setAllSideEffects(); 2396 setAllSideEffects();
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
2932 HBasicBlock get start => expression.start; 2934 HBasicBlock get start => expression.start;
2933 HBasicBlock get end { 2935 HBasicBlock get end {
2934 // We don't create a switch block if there are no cases. 2936 // We don't create a switch block if there are no cases.
2935 assert(!statements.isEmpty); 2937 assert(!statements.isEmpty);
2936 return statements.last.end; 2938 return statements.last.end;
2937 } 2939 }
2938 2940
2939 bool accept(HStatementInformationVisitor visitor) => 2941 bool accept(HStatementInformationVisitor visitor) =>
2940 visitor.visitSwitchInfo(this); 2942 visitor.visitSwitchInfo(this);
2941 } 2943 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698