OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 __ sw(at, ContextOperand(cp, variable->index())); | 842 __ sw(at, ContextOperand(cp, variable->index())); |
843 // No write barrier since the_hole_value is in old space. | 843 // No write barrier since the_hole_value is in old space. |
844 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 844 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
845 } | 845 } |
846 break; | 846 break; |
847 | 847 |
848 case Variable::LOOKUP: { | 848 case Variable::LOOKUP: { |
849 Comment cmnt(masm_, "[ VariableDeclaration"); | 849 Comment cmnt(masm_, "[ VariableDeclaration"); |
850 __ li(a2, Operand(variable->name())); | 850 __ li(a2, Operand(variable->name())); |
851 // Declaration nodes are always introduced in one of four modes. | 851 // Declaration nodes are always introduced in one of four modes. |
852 ASSERT(mode == VAR || mode == LET || | 852 ASSERT(IsDeclaredVariableMode(mode)); |
853 mode == CONST || mode == CONST_HARMONY); | 853 PropertyAttributes attr = |
854 PropertyAttributes attr = (mode == CONST || mode == CONST_HARMONY) | 854 IsImmutableVariableMode(mode) ? READ_ONLY : NONE; |
855 ? READ_ONLY : NONE; | |
856 __ li(a1, Operand(Smi::FromInt(attr))); | 855 __ li(a1, Operand(Smi::FromInt(attr))); |
857 // Push initial value, if any. | 856 // Push initial value, if any. |
858 // Note: For variables we must not push an initial value (such as | 857 // Note: For variables we must not push an initial value (such as |
859 // 'undefined') because we may have a (legal) redeclaration and we | 858 // 'undefined') because we may have a (legal) redeclaration and we |
860 // must not destroy the current value. | 859 // must not destroy the current value. |
861 if (hole_init) { | 860 if (hole_init) { |
862 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); | 861 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); |
863 __ Push(cp, a2, a1, a0); | 862 __ Push(cp, a2, a1, a0); |
864 } else { | 863 } else { |
865 ASSERT(Smi::FromInt(0) == 0); | 864 ASSERT(Smi::FromInt(0) == 0); |
(...skipping 3747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4613 *context_length = 0; | 4612 *context_length = 0; |
4614 return previous_; | 4613 return previous_; |
4615 } | 4614 } |
4616 | 4615 |
4617 | 4616 |
4618 #undef __ | 4617 #undef __ |
4619 | 4618 |
4620 } } // namespace v8::internal | 4619 } } // namespace v8::internal |
4621 | 4620 |
4622 #endif // V8_TARGET_ARCH_MIPS | 4621 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |