OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 714 |
715 | 715 |
716 void FullCodeGenerator::EmitDeclaration(VariableProxy* proxy, | 716 void FullCodeGenerator::EmitDeclaration(VariableProxy* proxy, |
717 VariableMode mode, | 717 VariableMode mode, |
718 FunctionLiteral* function, | 718 FunctionLiteral* function, |
719 int* global_count) { | 719 int* global_count) { |
720 // If it was not possible to allocate the variable at compile time, we | 720 // If it was not possible to allocate the variable at compile time, we |
721 // need to "declare" it at runtime to make sure it actually exists in the | 721 // need to "declare" it at runtime to make sure it actually exists in the |
722 // local context. | 722 // local context. |
723 Variable* variable = proxy->var(); | 723 Variable* variable = proxy->var(); |
724 bool binding_needs_init = | 724 bool binding_needs_init = (function == NULL) && |
725 mode == CONST || mode == CONST_HARMONY || mode == LET; | 725 (mode == CONST || mode == CONST_HARMONY || mode == LET); |
726 switch (variable->location()) { | 726 switch (variable->location()) { |
727 case Variable::UNALLOCATED: | 727 case Variable::UNALLOCATED: |
728 ++(*global_count); | 728 ++(*global_count); |
729 break; | 729 break; |
730 | 730 |
731 case Variable::PARAMETER: | 731 case Variable::PARAMETER: |
732 case Variable::LOCAL: | 732 case Variable::LOCAL: |
733 if (function != NULL) { | 733 if (function != NULL) { |
734 Comment cmnt(masm_, "[ Declaration"); | 734 Comment cmnt(masm_, "[ Declaration"); |
735 VisitForAccumulatorValue(function); | 735 VisitForAccumulatorValue(function); |
(...skipping 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4319 *context_length = 0; | 4319 *context_length = 0; |
4320 return previous_; | 4320 return previous_; |
4321 } | 4321 } |
4322 | 4322 |
4323 | 4323 |
4324 #undef __ | 4324 #undef __ |
4325 | 4325 |
4326 } } // namespace v8::internal | 4326 } } // namespace v8::internal |
4327 | 4327 |
4328 #endif // V8_TARGET_ARCH_ARM | 4328 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |