| 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 3610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3621 for (int i = 1; i < context_chain_length; i++) { | 3621 for (int i = 1; i < context_chain_length; i++) { |
| 3622 movq(dst, Operand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX))); | 3622 movq(dst, Operand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX))); |
| 3623 } | 3623 } |
| 3624 } else { | 3624 } else { |
| 3625 // Slot is in the current function context. Move it into the | 3625 // Slot is in the current function context. Move it into the |
| 3626 // destination register in case we store into it (the write barrier | 3626 // destination register in case we store into it (the write barrier |
| 3627 // cannot be allowed to destroy the context in rsi). | 3627 // cannot be allowed to destroy the context in rsi). |
| 3628 movq(dst, rsi); | 3628 movq(dst, rsi); |
| 3629 } | 3629 } |
| 3630 | 3630 |
| 3631 // We should not have found a 'with' context by walking the context chain | 3631 // We should not have found a with or catch context by walking the context |
| 3632 // (i.e., the static scope chain and runtime context chain do not agree). | 3632 // chain (i.e., the static scope chain and runtime context chain do not |
| 3633 // A variable occurring in such a scope should have slot type LOOKUP and | 3633 // agree). A variable occurring in such a scope should have slot type |
| 3634 // not CONTEXT. | 3634 // LOOKUP and not CONTEXT. |
| 3635 if (emit_debug_code()) { | 3635 if (emit_debug_code()) { |
| 3636 cmpq(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX))); | 3636 CompareRoot(FieldOperand(dst, HeapObject::kMapOffset), |
| 3637 Check(equal, "Yo dawg, I heard you liked function contexts " | 3637 Heap::kWithContextMapRootIndex); |
| 3638 "so I put function contexts in all your contexts"); | 3638 Check(not_equal, "Variable resolved to with context."); |
| 3639 CompareRoot(FieldOperand(dst, HeapObject::kMapOffset), |
| 3640 Heap::kCatchContextMapRootIndex); |
| 3641 Check(not_equal, "Variable resolved to catch context."); |
| 3639 } | 3642 } |
| 3640 } | 3643 } |
| 3641 | 3644 |
| 3642 #ifdef _WIN64 | 3645 #ifdef _WIN64 |
| 3643 static const int kRegisterPassedArguments = 4; | 3646 static const int kRegisterPassedArguments = 4; |
| 3644 #else | 3647 #else |
| 3645 static const int kRegisterPassedArguments = 6; | 3648 static const int kRegisterPassedArguments = 6; |
| 3646 #endif | 3649 #endif |
| 3647 | 3650 |
| 3648 void MacroAssembler::LoadGlobalFunction(int index, Register function) { | 3651 void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3743 CPU::FlushICache(address_, size_); | 3746 CPU::FlushICache(address_, size_); |
| 3744 | 3747 |
| 3745 // Check that the code was patched as expected. | 3748 // Check that the code was patched as expected. |
| 3746 ASSERT(masm_.pc_ == address_ + size_); | 3749 ASSERT(masm_.pc_ == address_ + size_); |
| 3747 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 3750 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 3748 } | 3751 } |
| 3749 | 3752 |
| 3750 } } // namespace v8::internal | 3753 } } // namespace v8::internal |
| 3751 | 3754 |
| 3752 #endif // V8_TARGET_ARCH_X64 | 3755 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |