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