OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } else if (node->type()->IsLikelySmi()) { | 240 } else if (node->type()->IsLikelySmi()) { |
241 var->type()->SetAsLikelySmi(); | 241 var->type()->SetAsLikelySmi(); |
242 } | 242 } |
243 | 243 |
244 if (!var->is_this() && | 244 if (!var->is_this() && |
245 !Heap::result_symbol()->Equals(*var->name())) { | 245 !Heap::result_symbol()->Equals(*var->name())) { |
246 func_name_inferrer_.PushName(var->name()); | 246 func_name_inferrer_.PushName(var->name()); |
247 } | 247 } |
248 | 248 |
249 if (FLAG_safe_int32_compiler) { | 249 if (FLAG_safe_int32_compiler) { |
250 if (var->IsStackAllocated() && !var->is_arguments()) { | 250 if (var->IsStackAllocated() && |
| 251 !var->is_arguments() && |
| 252 var->mode() != Variable::CONST) { |
251 node->set_side_effect_free(true); | 253 node->set_side_effect_free(true); |
252 } | 254 } |
253 } | 255 } |
254 } | 256 } |
255 } | 257 } |
256 | 258 |
257 | 259 |
258 void AstOptimizer::VisitLiteral(Literal* node) { | 260 void AstOptimizer::VisitLiteral(Literal* node) { |
259 Handle<Object> literal = node->handle(); | 261 Handle<Object> literal = node->handle(); |
260 if (literal->IsSmi()) { | 262 if (literal->IsSmi()) { |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 optimizer.Optimize(body); | 952 optimizer.Optimize(body); |
951 if (optimizer.HasStackOverflow()) { | 953 if (optimizer.HasStackOverflow()) { |
952 return false; | 954 return false; |
953 } | 955 } |
954 } | 956 } |
955 return true; | 957 return true; |
956 } | 958 } |
957 | 959 |
958 | 960 |
959 } } // namespace v8::internal | 961 } } // namespace v8::internal |
OLD | NEW |