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. | |
antonm
2011/04/06 16:41:49
maybe assert this: ASSRT(context_->has_extension()
| |
9826 at_local_ = true; | |
9824 } | 9827 } |
9825 } | 9828 } |
9826 | 9829 |
9827 // More scopes? | 9830 // More scopes? |
9828 bool Done() { return context_.is_null(); } | 9831 bool Done() { return context_.is_null(); } |
9829 | 9832 |
9830 // Move to the next scope. | 9833 // Move to the next scope. |
9831 void Next() { | 9834 void Next() { |
9832 // If at a local scope mark the local scope as passed. | 9835 // If at a local scope mark the local scope as passed. |
9833 if (at_local_) { | 9836 if (at_local_) { |
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11940 } else { | 11943 } else { |
11941 // Handle last resort GC and make sure to allow future allocations | 11944 // Handle last resort GC and make sure to allow future allocations |
11942 // to grow the heap without causing GCs (if possible). | 11945 // to grow the heap without causing GCs (if possible). |
11943 isolate->counters()->gc_last_resort_from_js()->Increment(); | 11946 isolate->counters()->gc_last_resort_from_js()->Increment(); |
11944 isolate->heap()->CollectAllGarbage(false); | 11947 isolate->heap()->CollectAllGarbage(false); |
11945 } | 11948 } |
11946 } | 11949 } |
11947 | 11950 |
11948 | 11951 |
11949 } } // namespace v8::internal | 11952 } } // namespace v8::internal |
OLD | NEW |