OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |