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

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

Issue 10540048: Implement 'as' operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: No entries in language.status, vm and dartc already implemented 'as'. Created 8 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 | 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 /** 5 /**
6 * Instead of emitting each SSA instruction with a temporary variable 6 * Instead of emitting each SSA instruction with a temporary variable
7 * mark instructions that can be emitted at their use-site. 7 * mark instructions that can be emitted at their use-site.
8 * For example, in: 8 * For example, in:
9 * t0 = 4; 9 * t0 = 4;
10 * t1 = 3; 10 * t1 = 3;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void visitEquals(HEquals instruction) { 52 void visitEquals(HEquals instruction) {
53 if (!instruction.builtin) super.visitEquals(instruction); 53 if (!instruction.builtin) super.visitEquals(instruction);
54 // Otherwise do nothing. 54 // Otherwise do nothing.
55 } 55 }
56 56
57 // Identity operations must not have its input generated at use site, because 57 // Identity operations must not have its input generated at use site, because
58 // it's using it multiple times (because of null/undefined). 58 // it's using it multiple times (because of null/undefined).
59 void visitIdentity(HIdentity instruction) {} 59 void visitIdentity(HIdentity instruction) {}
60 60
61 void visitTypeConversion(HTypeConversion instruction) { 61 void visitTypeConversion(HTypeConversion instruction) {
62 if (!instruction.isChecked()) { 62 if (!instruction.isChecked) {
63 generateAtUseSite.add(instruction); 63 generateAtUseSite.add(instruction);
64 } else if (instruction.isCheckedModeCheck()) { 64 } else if (instruction.isCheckedModeCheck) {
65 // Checked mode checks compile to code that only use their input 65 // Checked mode checks compile to code that only use their input
66 // once, so we can safely visit them and try to merge the input. 66 // once, so we can safely visit them and try to merge the input.
67 visitInstruction(instruction); 67 visitInstruction(instruction);
68 } 68 }
69 } 69 }
70 70
71 void tryGenerateAtUseSite(HInstruction instruction) { 71 void tryGenerateAtUseSite(HInstruction instruction) {
72 if (instruction.isControlFlow()) return; 72 if (instruction.isControlFlow()) return;
73 generateAtUseSite.add(instruction); 73 generateAtUseSite.add(instruction);
74 } 74 }
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 }; 346 };
347 } 347 }
348 348
349 class JSBinaryOperatorPrecedence { 349 class JSBinaryOperatorPrecedence {
350 final int left; 350 final int left;
351 final int right; 351 final int right;
352 const JSBinaryOperatorPrecedence(this.left, this.right); 352 const JSBinaryOperatorPrecedence(this.left, this.right);
353 // All binary operators (excluding assignment) are left associative. 353 // All binary operators (excluding assignment) are left associative.
354 int get precedence() => left; 354 int get precedence() => left;
355 } 355 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698