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 9803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9814 if (context_->IsGlobalContext()) { | 9814 if (context_->IsGlobalContext()) { |
9815 // If there is a stack slot for .result then this local scope has been | 9815 // If there is a stack slot for .result then this local scope has been |
9816 // created for evaluating top level code and it is not a real local scope. | 9816 // created for evaluating top level code and it is not a real local scope. |
9817 // Checking for the existence of .result seems fragile, but the scope info | 9817 // Checking for the existence of .result seems fragile, but the scope info |
9818 // saved with the code object does not otherwise have that information. | 9818 // saved with the code object does not otherwise have that information. |
9819 int index = function_->shared()->scope_info()-> | 9819 int index = function_->shared()->scope_info()-> |
9820 StackSlotIndex(isolate_->heap()->result_symbol()); | 9820 StackSlotIndex(isolate_->heap()->result_symbol()); |
9821 at_local_ = index < 0; | 9821 at_local_ = index < 0; |
9822 } else if (context_->is_function_context()) { | 9822 } else if (context_->is_function_context()) { |
9823 at_local_ = true; | 9823 at_local_ = true; |
| 9824 } else if (context_->closure() != *function_) { |
| 9825 // The context_ is a with block from the outer function. |
| 9826 ASSERT(context_->has_extension()); |
| 9827 at_local_ = true; |
9824 } | 9828 } |
9825 } | 9829 } |
9826 | 9830 |
9827 // More scopes? | 9831 // More scopes? |
9828 bool Done() { return context_.is_null(); } | 9832 bool Done() { return context_.is_null(); } |
9829 | 9833 |
9830 // Move to the next scope. | 9834 // Move to the next scope. |
9831 void Next() { | 9835 void Next() { |
9832 // If at a local scope mark the local scope as passed. | 9836 // If at a local scope mark the local scope as passed. |
9833 if (at_local_) { | 9837 if (at_local_) { |
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11940 } else { | 11944 } else { |
11941 // Handle last resort GC and make sure to allow future allocations | 11945 // Handle last resort GC and make sure to allow future allocations |
11942 // to grow the heap without causing GCs (if possible). | 11946 // to grow the heap without causing GCs (if possible). |
11943 isolate->counters()->gc_last_resort_from_js()->Increment(); | 11947 isolate->counters()->gc_last_resort_from_js()->Increment(); |
11944 isolate->heap()->CollectAllGarbage(false); | 11948 isolate->heap()->CollectAllGarbage(false); |
11945 } | 11949 } |
11946 } | 11950 } |
11947 | 11951 |
11948 | 11952 |
11949 } } // namespace v8::internal | 11953 } } // namespace v8::internal |
OLD | NEW |