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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 if (!var->is_this() && | 243 if (!var->is_this() && |
244 !Heap::result_symbol()->Equals(*var->name())) { | 244 !Heap::result_symbol()->Equals(*var->name())) { |
245 func_name_inferrer_.PushName(var->name()); | 245 func_name_inferrer_.PushName(var->name()); |
246 } | 246 } |
247 | 247 |
248 if (var->slot() != NULL) { | 248 if (var->slot() != NULL) { |
249 Slot* slot = var->slot(); | 249 Slot* slot = var->slot(); |
250 node->set_side_effect_free( | 250 node->set_side_effect_free( |
251 (slot->type() == Slot::LOCAL && !slot->is_arguments()) || | 251 (slot->type() == Slot::LOCAL && !slot->is_arguments()) || |
252 slot->type() == Slot::PARAMETER)); | 252 slot->type() == Slot::PARAMETER); |
253 // stack_height and expression_size remain 0. | 253 // stack_height and expression_size remain 0. |
254 } | 254 } |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 | 258 |
259 void AstOptimizer::VisitLiteral(Literal* node) { | 259 void AstOptimizer::VisitLiteral(Literal* node) { |
260 Handle<Object> literal = node->handle(); | 260 Handle<Object> literal = node->handle(); |
261 if (literal->IsSmi()) { | 261 if (literal->IsSmi()) { |
262 node->type()->SetAsLikelySmi(); | 262 node->type()->SetAsLikelySmi(); |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 optimizer.Optimize(body); | 903 optimizer.Optimize(body); |
904 if (optimizer.HasStackOverflow()) { | 904 if (optimizer.HasStackOverflow()) { |
905 return false; | 905 return false; |
906 } | 906 } |
907 } | 907 } |
908 return true; | 908 return true; |
909 } | 909 } |
910 | 910 |
911 | 911 |
912 } } // namespace v8::internal | 912 } } // namespace v8::internal |
OLD | NEW |