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

Side by Side Diff: pkg/compiler/lib/src/ssa/codegen_helpers.dart

Issue 2960723004: Handle super-method call (Closed)
Patch Set: Updated cf. comments. Created 3 years, 5 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
« no previous file with comments | « pkg/compiler/lib/src/js_model/elements.dart ('k') | pkg/compiler/lib/src/world.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 import '../constants/values.dart'; 5 import '../constants/values.dart';
6 import '../elements/elements.dart'; 6 import '../elements/entities.dart';
7 import '../js_backend/js_backend.dart'; 7 import '../js_backend/js_backend.dart';
8 import '../js_backend/interceptor_data.dart'; 8 import '../js_backend/interceptor_data.dart';
9 import '../options.dart'; 9 import '../options.dart';
10 import '../types/types.dart'; 10 import '../types/types.dart';
11 import '../universe/selector.dart' show Selector; 11 import '../universe/selector.dart' show Selector;
12 import '../world.dart' show ClosedWorld; 12 import '../world.dart' show ClosedWorld;
13 import 'nodes.dart'; 13 import 'nodes.dart';
14 14
15 /** 15 /**
16 * Replaces some instructions with specialized versions to make codegen easier. 16 * Replaces some instructions with specialized versions to make codegen easier.
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 .isNotEmpty; 418 .isNotEmpty;
419 } 419 }
420 420
421 void visitInstruction(HInstruction instruction) { 421 void visitInstruction(HInstruction instruction) {
422 // A code motion invariant instruction is dealt before visiting it. 422 // A code motion invariant instruction is dealt before visiting it.
423 assert(!instruction.isCodeMotionInvariant()); 423 assert(!instruction.isCodeMotionInvariant());
424 analyzeInputs(instruction, 0); 424 analyzeInputs(instruction, 0);
425 } 425 }
426 426
427 void visitInvokeSuper(HInvokeSuper instruction) { 427 void visitInvokeSuper(HInvokeSuper instruction) {
428 MemberElement superMethod = instruction.element; 428 MemberEntity superMethod = instruction.element;
429 Selector selector = instruction.selector; 429 Selector selector = instruction.selector;
430 // If aliased super members cannot be used, we will generate code like 430 // If aliased super members cannot be used, we will generate code like
431 // 431 //
432 // C.prototype.method.call(instance) 432 // C.prototype.method.call(instance)
433 // 433 //
434 // where instance is the [this] object for the method. In such a case, the 434 // where instance is the [this] object for the method. In such a case, the
435 // get of prototype might be evaluated before instance is created if we 435 // get of prototype might be evaluated before instance is created if we
436 // generate instance at use site, which in turn might update the prototype 436 // generate instance at use site, which in turn might update the prototype
437 // after first access if we use lazy initialization. 437 // after first access if we use lazy initialization.
438 // In this case, we therefore don't allow the receiver (the first argument) 438 // In this case, we therefore don't allow the receiver (the first argument)
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 } 801 }
802 802
803 // If [thenInput] is defined in the first predecessor, then it is only used 803 // If [thenInput] is defined in the first predecessor, then it is only used
804 // by [phi] and can be generated at use site. 804 // by [phi] and can be generated at use site.
805 if (identical(thenInput.block, end.predecessors[0])) { 805 if (identical(thenInput.block, end.predecessors[0])) {
806 assert(thenInput.usedBy.length == 1); 806 assert(thenInput.usedBy.length == 1);
807 markAsGenerateAtUseSite(thenInput); 807 markAsGenerateAtUseSite(thenInput);
808 } 808 }
809 } 809 }
810 } 810 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_model/elements.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698