| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 6303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6314 ASSERT(!is_illegal()); | 6314 ASSERT(!is_illegal()); |
| 6315 if (type_ != SLOT) { | 6315 if (type_ != SLOT) { |
| 6316 GetValue(typeof_state); | 6316 GetValue(typeof_state); |
| 6317 return; | 6317 return; |
| 6318 } | 6318 } |
| 6319 | 6319 |
| 6320 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); | 6320 Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot(); |
| 6321 ASSERT(slot != NULL); | 6321 ASSERT(slot != NULL); |
| 6322 if (slot->type() == Slot::LOOKUP || | 6322 if (slot->type() == Slot::LOOKUP || |
| 6323 slot->type() == Slot::CONTEXT || | 6323 slot->type() == Slot::CONTEXT || |
| 6324 slot->var()->mode() == Variable::CONST) { | 6324 slot->var()->mode() == Variable::CONST || |
| 6325 slot->is_arguments()) { |
| 6325 GetValue(typeof_state); | 6326 GetValue(typeof_state); |
| 6326 return; | 6327 return; |
| 6327 } | 6328 } |
| 6328 | 6329 |
| 6329 // Only non-constant, frame-allocated parameters and locals can reach | 6330 // Only non-constant, frame-allocated parameters and locals can |
| 6330 // here. | 6331 // reach here. Be careful not to use the optimizations for arguments |
| 6332 // object access since it may not have been initialized yet. |
| 6333 ASSERT(!slot->is_arguments()); |
| 6331 if (slot->type() == Slot::PARAMETER) { | 6334 if (slot->type() == Slot::PARAMETER) { |
| 6332 cgen_->frame()->TakeParameterAt(slot->index()); | 6335 cgen_->frame()->TakeParameterAt(slot->index()); |
| 6333 } else { | 6336 } else { |
| 6334 ASSERT(slot->type() == Slot::LOCAL); | 6337 ASSERT(slot->type() == Slot::LOCAL); |
| 6335 cgen_->frame()->TakeLocalAt(slot->index()); | 6338 cgen_->frame()->TakeLocalAt(slot->index()); |
| 6336 } | 6339 } |
| 6337 } | 6340 } |
| 6338 | 6341 |
| 6339 | 6342 |
| 6340 void Reference::SetValue(InitState init_state) { | 6343 void Reference::SetValue(InitState init_state) { |
| (...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7849 | 7852 |
| 7850 // Slow-case: Go through the JavaScript implementation. | 7853 // Slow-case: Go through the JavaScript implementation. |
| 7851 __ bind(&slow); | 7854 __ bind(&slow); |
| 7852 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 7855 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
| 7853 } | 7856 } |
| 7854 | 7857 |
| 7855 | 7858 |
| 7856 #undef __ | 7859 #undef __ |
| 7857 | 7860 |
| 7858 } } // namespace v8::internal | 7861 } } // namespace v8::internal |
| OLD | NEW |