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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // if naccesses_ == 0). | 182 // if naccesses_ == 0). |
183 // NOTE: When loading parameters in the global scope, we must take | 183 // NOTE: When loading parameters in the global scope, we must take |
184 // care not to access them as properties of the global object, but | 184 // care not to access them as properties of the global object, but |
185 // instead load them directly from the stack. Currently, the only | 185 // instead load them directly from the stack. Currently, the only |
186 // such parameter is 'this' which is passed on the stack when | 186 // such parameter is 'this' which is passed on the stack when |
187 // invoking scripts | 187 // invoking scripts |
188 Variable* var = | 188 Variable* var = |
189 variables_.Declare(this, Factory::this_symbol(), Variable::VAR, | 189 variables_.Declare(this, Factory::this_symbol(), Variable::VAR, |
190 false, Variable::THIS); | 190 false, Variable::THIS); |
191 var->rewrite_ = new Slot(var, Slot::PARAMETER, -1); | 191 var->rewrite_ = new Slot(var, Slot::PARAMETER, -1); |
192 receiver_ = new VariableProxy(Factory::this_symbol(), true, false); | 192 receiver_ = var; |
193 receiver_->BindTo(var); | |
194 | 193 |
195 if (is_function_scope()) { | 194 if (is_function_scope()) { |
196 // Declare 'arguments' variable which exists in all functions. | 195 // Declare 'arguments' variable which exists in all functions. |
197 // Note that it might never be accessed, in which case it won't be | 196 // Note that it might never be accessed, in which case it won't be |
198 // allocated during variable allocation. | 197 // allocated during variable allocation. |
199 variables_.Declare(this, Factory::arguments_symbol(), Variable::VAR, | 198 variables_.Declare(this, Factory::arguments_symbol(), Variable::VAR, |
200 true, Variable::ARGUMENTS); | 199 true, Variable::ARGUMENTS); |
201 } | 200 } |
202 } | 201 } |
203 | 202 |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && | 954 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && |
956 !must_have_local_context) { | 955 !must_have_local_context) { |
957 num_heap_slots_ = 0; | 956 num_heap_slots_ = 0; |
958 } | 957 } |
959 | 958 |
960 // Allocation done. | 959 // Allocation done. |
961 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); | 960 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
962 } | 961 } |
963 | 962 |
964 } } // namespace v8::internal | 963 } } // namespace v8::internal |
OLD | NEW |