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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 int offset = Context::SlotOffset(slot->index()); | 730 int offset = Context::SlotOffset(slot->index()); |
731 __ mov(ebx, esi); | 731 __ mov(ebx, esi); |
732 __ RecordWrite(ebx, offset, result_register(), ecx); | 732 __ RecordWrite(ebx, offset, result_register(), ecx); |
733 } | 733 } |
734 break; | 734 break; |
735 | 735 |
736 case Slot::LOOKUP: { | 736 case Slot::LOOKUP: { |
737 __ push(esi); | 737 __ push(esi); |
738 __ push(Immediate(variable->name())); | 738 __ push(Immediate(variable->name())); |
739 // Declaration nodes are always introduced in one of two modes. | 739 // Declaration nodes are always introduced in one of two modes. |
740 ASSERT(mode == Variable::VAR || mode == Variable::CONST); | 740 ASSERT(mode == Variable::VAR || |
741 PropertyAttributes attr = (mode == Variable::VAR) ? NONE : READ_ONLY; | 741 mode == Variable::CONST || |
| 742 mode == Variable::LET); |
| 743 PropertyAttributes attr = (mode == Variable::CONST) ? READ_ONLY : NONE; |
742 __ push(Immediate(Smi::FromInt(attr))); | 744 __ push(Immediate(Smi::FromInt(attr))); |
743 // Push initial value, if any. | 745 // Push initial value, if any. |
744 // Note: For variables we must not push an initial value (such as | 746 // Note: For variables we must not push an initial value (such as |
745 // 'undefined') because we may have a (legal) redeclaration and we | 747 // 'undefined') because we may have a (legal) redeclaration and we |
746 // must not destroy the current value. | 748 // must not destroy the current value. |
747 increment_stack_height(3); | 749 increment_stack_height(3); |
748 if (mode == Variable::CONST) { | 750 if (mode == Variable::CONST) { |
749 __ push(Immediate(isolate()->factory()->the_hole_value())); | 751 __ push(Immediate(isolate()->factory()->the_hole_value())); |
750 increment_stack_height(); | 752 increment_stack_height(); |
751 } else if (function != NULL) { | 753 } else if (function != NULL) { |
(...skipping 3617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4369 __ add(Operand(edx), Immediate(masm_->CodeObject())); | 4371 __ add(Operand(edx), Immediate(masm_->CodeObject())); |
4370 __ jmp(Operand(edx)); | 4372 __ jmp(Operand(edx)); |
4371 } | 4373 } |
4372 | 4374 |
4373 | 4375 |
4374 #undef __ | 4376 #undef __ |
4375 | 4377 |
4376 } } // namespace v8::internal | 4378 } } // namespace v8::internal |
4377 | 4379 |
4378 #endif // V8_TARGET_ARCH_IA32 | 4380 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |