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

Unified Diff: lib/compiler/implementation/ssa/nodes.dart

Issue 10668021: Distinguish statement and expression foreign code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: After rebase no need for parenthesis anymore. Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/native_handler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/nodes.dart
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index f657bfcc4bbc28b8987838ea9aa22b6a44f0942a..f98fb57b73453cc7a94c06d6bb642971e383ad93 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -1321,10 +1321,16 @@ class HLocalSet extends HFieldSet {
}
class HForeign extends HInstruction {
+ final bool _isStatement;
Lasse Reichstein Nielsen 2012/06/27 08:10:16 Just make this non-private and final. No need to w
floitsch 2012/06/27 12:04:43 Done.
final DartString code;
final HType foreignType;
HForeign(this.code, DartString declaredType, List<HInstruction> inputs)
: foreignType = computeTypeFromDeclaredType(declaredType),
+ _isStatement = false,
+ super(inputs);
+ HForeign.statement(this.code, List<HInstruction> inputs)
+ : foreignType = HType.UNKNOWN,
+ _isStatement = true,
super(inputs);
accept(HVisitor visitor) => visitor.visitForeign(this);
@@ -1339,9 +1345,7 @@ class HForeign extends HInstruction {
HType get guaranteedType() => foreignType;
- // Be conservative and treat all [HForeign] as statements, even
- // though some are just expressions.
- bool isStatement() => true;
+ bool isStatement() => _isStatement;
}
class HForeignNew extends HForeign {
« no previous file with comments | « lib/compiler/implementation/native_handler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698