| 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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 if (MustAllocate(var) && var->rewrite_ == NULL) { | 819 if (MustAllocate(var) && var->rewrite_ == NULL) { |
| 820 if (MustAllocateInContext(var)) { | 820 if (MustAllocateInContext(var)) { |
| 821 AllocateHeapSlot(var); | 821 AllocateHeapSlot(var); |
| 822 } else { | 822 } else { |
| 823 AllocateStackSlot(var); | 823 AllocateStackSlot(var); |
| 824 } | 824 } |
| 825 } | 825 } |
| 826 } | 826 } |
| 827 | 827 |
| 828 | 828 |
| 829 DECLARE_bool(usage_computation); | |
| 830 | |
| 831 void Scope::AllocateNonParameterLocals() { | 829 void Scope::AllocateNonParameterLocals() { |
| 832 // Each variable occurs exactly once in the locals_ list; all | 830 // Each variable occurs exactly once in the locals_ list; all |
| 833 // variables that have no rewrite yet are non-parameter locals. | 831 // variables that have no rewrite yet are non-parameter locals. |
| 834 | 832 |
| 835 // Sort them according to use such that the locals with more uses | 833 // Sort them according to use such that the locals with more uses |
| 836 // get allocated first. | 834 // get allocated first. |
| 837 if (FLAG_usage_computation) { | 835 if (FLAG_usage_computation) { |
| 838 // This is currently not implemented. | 836 // This is currently not implemented. |
| 839 } | 837 } |
| 840 | 838 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && | 886 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && |
| 889 !must_have_local_context) { | 887 !must_have_local_context) { |
| 890 num_heap_slots_ = 0; | 888 num_heap_slots_ = 0; |
| 891 } | 889 } |
| 892 | 890 |
| 893 // Allocation done. | 891 // Allocation done. |
| 894 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); | 892 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
| 895 } | 893 } |
| 896 | 894 |
| 897 } } // namespace v8::internal | 895 } } // namespace v8::internal |
| OLD | NEW |