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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 // No write barrier since the hole value is in old space. | 803 // No write barrier since the hole value is in old space. |
804 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 804 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
805 } | 805 } |
806 break; | 806 break; |
807 | 807 |
808 case Variable::LOOKUP: { | 808 case Variable::LOOKUP: { |
809 Comment cmnt(masm_, "[ VariableDeclaration"); | 809 Comment cmnt(masm_, "[ VariableDeclaration"); |
810 __ push(esi); | 810 __ push(esi); |
811 __ push(Immediate(variable->name())); | 811 __ push(Immediate(variable->name())); |
812 // VariableDeclaration nodes are always introduced in one of four modes. | 812 // VariableDeclaration nodes are always introduced in one of four modes. |
813 ASSERT(mode == VAR || mode == LET || | 813 ASSERT(IsDeclaredVariableMode(mode)); |
814 mode == CONST || mode == CONST_HARMONY); | 814 PropertyAttributes attr = |
815 PropertyAttributes attr = (mode == CONST || mode == CONST_HARMONY) | 815 IsImmutableVariableMode(mode) ? READ_ONLY : NONE; |
816 ? READ_ONLY : NONE; | |
817 __ push(Immediate(Smi::FromInt(attr))); | 816 __ push(Immediate(Smi::FromInt(attr))); |
818 // Push initial value, if any. | 817 // Push initial value, if any. |
819 // Note: For variables we must not push an initial value (such as | 818 // Note: For variables we must not push an initial value (such as |
820 // 'undefined') because we may have a (legal) redeclaration and we | 819 // 'undefined') because we may have a (legal) redeclaration and we |
821 // must not destroy the current value. | 820 // must not destroy the current value. |
822 if (hole_init) { | 821 if (hole_init) { |
823 __ push(Immediate(isolate()->factory()->the_hole_value())); | 822 __ push(Immediate(isolate()->factory()->the_hole_value())); |
824 } else { | 823 } else { |
825 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. | 824 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. |
826 } | 825 } |
(...skipping 3728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4555 *stack_depth = 0; | 4554 *stack_depth = 0; |
4556 *context_length = 0; | 4555 *context_length = 0; |
4557 return previous_; | 4556 return previous_; |
4558 } | 4557 } |
4559 | 4558 |
4560 #undef __ | 4559 #undef __ |
4561 | 4560 |
4562 } } // namespace v8::internal | 4561 } } // namespace v8::internal |
4563 | 4562 |
4564 #endif // V8_TARGET_ARCH_IA32 | 4563 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |