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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/unsugar.dart

Issue 1090203002: Repair a CPS integrity violation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library dart2js.unsugar_cps; 1 library dart2js.unsugar_cps;
2 2
3 import '../../cps_ir/cps_ir_nodes.dart'; 3 import '../../cps_ir/cps_ir_nodes.dart';
4 4
5 // TODO(karlklose): share the [ParentVisitor]. 5 // TODO(karlklose): share the [ParentVisitor].
6 import '../../cps_ir/optimizers.dart'; 6 import '../../cps_ir/optimizers.dart';
7 import '../../constants/expressions.dart'; 7 import '../../constants/expressions.dart';
8 import '../../constants/values.dart'; 8 import '../../constants/values.dart';
9 import '../../elements/elements.dart' 9 import '../../elements/elements.dart'
10 show ClassElement, FieldElement, FunctionElement, Element; 10 show ClassElement, FieldElement, FunctionElement, Element;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 assert(stackTraceParameter.hasNoUses); 105 assert(stackTraceParameter.hasNoUses);
106 node.handler.parameters.removeLast(); 106 node.handler.parameters.removeLast();
107 } 107 }
108 108
109 processThrow(Throw node) { 109 processThrow(Throw node) {
110 // The subexpression of throw is wrapped in the JavaScript output. 110 // The subexpression of throw is wrapped in the JavaScript output.
111 Parameter value = new Parameter(null); 111 Parameter value = new Parameter(null);
112 insertStaticCall(_glue.getWrapExceptionHelper(), [node.value.definition], 112 insertStaticCall(_glue.getWrapExceptionHelper(), [node.value.definition],
113 value, node); 113 value, node);
114 node.value.unlink();
114 node.value = new Reference<Primitive>(value); 115 node.value = new Reference<Primitive>(value);
115 } 116 }
116 117
117 processInvokeMethod(InvokeMethod node) { 118 processInvokeMethod(InvokeMethod node) {
118 Selector selector = node.selector; 119 Selector selector = node.selector;
119 // TODO(karlklose): should we rewrite all selectors? 120 // TODO(karlklose): should we rewrite all selectors?
120 if (!_glue.isInterceptedSelector(selector)) return; 121 if (!_glue.isInterceptedSelector(selector)) return;
121 122
122 Primitive receiver = node.receiver.definition; 123 Primitive receiver = node.receiver.definition;
123 Set<ClassElement> interceptedClasses = 124 Set<ClassElement> interceptedClasses =
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 new LetPrim(i, 157 new LetPrim(i,
157 new Branch(new IsTrue(i), 158 new Branch(new IsTrue(i),
158 node.trueContinuation.definition, 159 node.trueContinuation.definition,
159 node.falseContinuation.definition))); 160 node.falseContinuation.definition)));
160 condition.value.unlink(); 161 condition.value.unlink();
161 node.trueContinuation.unlink(); 162 node.trueContinuation.unlink();
162 node.falseContinuation.unlink(); 163 node.falseContinuation.unlink();
163 parent.body = newNode; 164 parent.body = newNode;
164 } 165 }
165 } 166 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698