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

Side by Side Diff: src/data-flow.cc

Issue 849003: Fix treatment of const variables in assigned variable analysis.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 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 | test/mjsunit/regress/regress-641.js » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 av_.Add(BitIndex(var)); 1118 av_.Add(BitIndex(var));
1119 } 1119 }
1120 } 1120 }
1121 1121
1122 1122
1123 void AssignedVariablesAnalyzer::MarkIfTrivial(Expression* expr) { 1123 void AssignedVariablesAnalyzer::MarkIfTrivial(Expression* expr) {
1124 Variable* var = expr->AsVariableProxy()->AsVariable(); 1124 Variable* var = expr->AsVariableProxy()->AsVariable();
1125 if (var != NULL && 1125 if (var != NULL &&
1126 var->IsStackAllocated() && 1126 var->IsStackAllocated() &&
1127 !var->is_arguments() && 1127 !var->is_arguments() &&
1128 var->mode() != Variable::CONST &&
1128 (var->is_this() || !av_.Contains(BitIndex(var)))) { 1129 (var->is_this() || !av_.Contains(BitIndex(var)))) {
1129 expr->AsVariableProxy()->set_is_trivial(true); 1130 expr->AsVariableProxy()->set_is_trivial(true);
1130 } 1131 }
1131 } 1132 }
1132 1133
1133 1134
1134 void AssignedVariablesAnalyzer::ProcessExpression(Expression* expr) { 1135 void AssignedVariablesAnalyzer::ProcessExpression(Expression* expr) {
1135 BitVector saved_av(av_); 1136 BitVector saved_av(av_);
1136 av_.Clear(); 1137 av_.Clear();
1137 Visit(expr); 1138 Visit(expr);
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 for (int i = postorder->length() - 1; i >= 0; i--) { 1832 for (int i = postorder->length() - 1; i >= 0; i--) {
1832 postorder->at(i)->PrintText(); 1833 postorder->at(i)->PrintText();
1833 } 1834 }
1834 } 1835 }
1835 1836
1836 1837
1837 #endif // defined(DEBUG) 1838 #endif // defined(DEBUG)
1838 1839
1839 1840
1840 } } // namespace v8::internal 1841 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-641.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698