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

Side by Side Diff: dart/lib/compiler/implementation/ssa/closure.dart

Issue 10454005: Make sure [this] is available for super sends. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case Created 8 years, 7 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 | dart/tests/language/closure_with_super_send_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class ClosureFieldElement extends Element { 5 class ClosureFieldElement extends Element {
6 ClosureFieldElement(SourceString name, ClassElement enclosing) 6 ClosureFieldElement(SourceString name, ClassElement enclosing)
7 : super(name, ElementKind.FIELD, enclosing); 7 : super(name, ElementKind.FIELD, enclosing);
8 8
9 bool isInstanceMember() => true; 9 bool isInstanceMember() => true;
10 bool isAssignable() => false; 10 bool isAssignable() => false;
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 node.visitChildren(this); 248 node.visitChildren(this);
249 } 249 }
250 250
251 visitSend(Send node) { 251 visitSend(Send node) {
252 Element element = elements[node]; 252 Element element = elements[node];
253 if (Elements.isLocal(element)) { 253 if (Elements.isLocal(element)) {
254 useLocal(element); 254 useLocal(element);
255 } else if (node.receiver === null && 255 } else if (node.receiver === null &&
256 Elements.isInstanceSend(node, elements)) { 256 Elements.isInstanceSend(node, elements)) {
257 useLocal(closureData.thisElement); 257 useLocal(closureData.thisElement);
258 } else if (node.isSuperCall) {
259 useLocal(closureData.thisElement);
258 } 260 }
259 node.visitChildren(this); 261 node.visitChildren(this);
260 } 262 }
261 263
262 // If variables that are declared in the [node] scope are captured and need 264 // If variables that are declared in the [node] scope are captured and need
263 // to be boxed create a box-element and update the [capturingScopes] in the 265 // to be boxed create a box-element and update the [capturingScopes] in the
264 // current [closureData]. 266 // current [closureData].
265 // The boxed variables are updated in the [capturedVariableMapping]. 267 // The boxed variables are updated in the [capturedVariableMapping].
266 void attachCapturedScopeVariables(Node node) { 268 void attachCapturedScopeVariables(Node node) {
267 Element box = null; 269 Element box = null;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 declareLocal(elements[node]); 434 declareLocal(elements[node]);
433 } 435 }
434 436
435 visitTryStatement(TryStatement node) { 437 visitTryStatement(TryStatement node) {
436 // TODO(ngeoffray): implement finer grain state. 438 // TODO(ngeoffray): implement finer grain state.
437 inTryCatchOrFinally = true; 439 inTryCatchOrFinally = true;
438 node.visitChildren(this); 440 node.visitChildren(this);
439 inTryCatchOrFinally = false; 441 inTryCatchOrFinally = false;
440 } 442 }
441 } 443 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/language/closure_with_super_send_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698