| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 int offset = Context::SlotOffset(slot->index()); | 705 int offset = Context::SlotOffset(slot->index()); |
| 706 __ movq(rbx, rsi); | 706 __ movq(rbx, rsi); |
| 707 __ RecordWrite(rbx, offset, result_register(), rcx); | 707 __ RecordWrite(rbx, offset, result_register(), rcx); |
| 708 } | 708 } |
| 709 break; | 709 break; |
| 710 | 710 |
| 711 case Slot::LOOKUP: { | 711 case Slot::LOOKUP: { |
| 712 __ push(rsi); | 712 __ push(rsi); |
| 713 __ Push(variable->name()); | 713 __ Push(variable->name()); |
| 714 // Declaration nodes are always introduced in one of two modes. | 714 // Declaration nodes are always introduced in one of two modes. |
| 715 ASSERT(mode == Variable::VAR || mode == Variable::CONST); | 715 ASSERT(mode == Variable::VAR || |
| 716 PropertyAttributes attr = (mode == Variable::VAR) ? NONE : READ_ONLY; | 716 mode == Variable::CONST || |
| 717 mode == Variable::LET); |
| 718 PropertyAttributes attr = (mode == Variable::CONST) ? READ_ONLY : NONE; |
| 717 __ Push(Smi::FromInt(attr)); | 719 __ Push(Smi::FromInt(attr)); |
| 718 // Push initial value, if any. | 720 // Push initial value, if any. |
| 719 // Note: For variables we must not push an initial value (such as | 721 // Note: For variables we must not push an initial value (such as |
| 720 // 'undefined') because we may have a (legal) redeclaration and we | 722 // 'undefined') because we may have a (legal) redeclaration and we |
| 721 // must not destroy the current value. | 723 // must not destroy the current value. |
| 722 if (mode == Variable::CONST) { | 724 if (mode == Variable::CONST) { |
| 723 __ PushRoot(Heap::kTheHoleValueRootIndex); | 725 __ PushRoot(Heap::kTheHoleValueRootIndex); |
| 724 } else if (function != NULL) { | 726 } else if (function != NULL) { |
| 725 VisitForStackValue(function); | 727 VisitForStackValue(function); |
| 726 } else { | 728 } else { |
| (...skipping 3508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4235 __ jmp(rdx); | 4237 __ jmp(rdx); |
| 4236 } | 4238 } |
| 4237 | 4239 |
| 4238 | 4240 |
| 4239 #undef __ | 4241 #undef __ |
| 4240 | 4242 |
| 4241 | 4243 |
| 4242 } } // namespace v8::internal | 4244 } } // namespace v8::internal |
| 4243 | 4245 |
| 4244 #endif // V8_TARGET_ARCH_X64 | 4246 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |