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

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

Issue 10452029: Fix bug when a variable is used in try/catch and accessed trough HFieldGet and HFieldSet: reference… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
===================================================================
--- lib/compiler/implementation/ssa/codegen.dart (revision 7979)
+++ lib/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1568,7 +1568,7 @@
}
visitFieldGet(HFieldGet node) {
- if (node.receiver !== null) {
+ if (!node.isFromActivation()) {
String name =
compiler.namer.instanceFieldName(currentLibrary, node.name);
beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
@@ -1577,13 +1577,13 @@
buffer.add(name);
beginExpression(JSPrecedence.MEMBER_PRECEDENCE);
} else {
- buffer.add(JsNames.getValid(node.name.slowToString()));
+ use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE);
}
}
visitFieldSet(HFieldSet node) {
String name;
- if (node.receiver !== null) {
+ if (!node.isFromActivation()) {
name =
compiler.namer.instanceFieldName(currentLibrary, node.name);
beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE);
@@ -1593,8 +1593,10 @@
} else {
// TODO(ngeoffray): Remove the 'var' once we don't globally box
// variables used in a try/catch.
- name = JsNames.getValid(node.name.slowToString());
- declareVariable(name);
+ if (!isGeneratingExpression()) {
+ buffer.add('var ');
+ }
+ use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE);
}
buffer.add(' = ');
use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE);
@@ -1742,7 +1744,11 @@
visitParameterValue(HParameterValue node) {
assert(isGenerateAtUseSite(node));
- buffer.add(parameterNames[node.element]);
+ if (parameterNames[node.element] == null) {
+ buffer.add(temporary(node));
+ } else {
+ buffer.add(parameterNames[node.element]);
+ }
}
visitPhi(HPhi node) {
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698