OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4816 | 4816 |
4817 // Fall back to %NewStrictArguments. | 4817 // Fall back to %NewStrictArguments. |
4818 __ bind(&too_big_for_new_space); | 4818 __ bind(&too_big_for_new_space); |
4819 __ PopReturnAddressTo(kScratchRegister); | 4819 __ PopReturnAddressTo(kScratchRegister); |
4820 __ Push(rdi); | 4820 __ Push(rdi); |
4821 __ PushReturnAddressFrom(kScratchRegister); | 4821 __ PushReturnAddressFrom(kScratchRegister); |
4822 __ TailCallRuntime(Runtime::kNewStrictArguments); | 4822 __ TailCallRuntime(Runtime::kNewStrictArguments); |
4823 } | 4823 } |
4824 | 4824 |
4825 | 4825 |
4826 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { | |
4827 Register context_reg = rsi; | |
4828 Register slot_reg = rbx; | |
4829 Register result_reg = rax; | |
4830 Label slow_case; | |
4831 | |
4832 // Go up context chain to the script context. | |
4833 for (int i = 0; i < depth(); ++i) { | |
4834 __ movp(rdi, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); | |
4835 context_reg = rdi; | |
4836 } | |
4837 | |
4838 // Load the PropertyCell value at the specified slot. | |
4839 __ movp(result_reg, ContextOperand(context_reg, slot_reg)); | |
4840 __ movp(result_reg, FieldOperand(result_reg, PropertyCell::kValueOffset)); | |
4841 | |
4842 // Check that value is not the_hole. | |
4843 __ CompareRoot(result_reg, Heap::kTheHoleValueRootIndex); | |
4844 __ j(equal, &slow_case, Label::kNear); | |
4845 __ Ret(); | |
4846 | |
4847 // Fallback to the runtime. | |
4848 __ bind(&slow_case); | |
4849 __ Integer32ToSmi(slot_reg, slot_reg); | |
4850 __ PopReturnAddressTo(kScratchRegister); | |
4851 __ Push(slot_reg); | |
4852 __ Push(kScratchRegister); | |
4853 __ TailCallRuntime(Runtime::kLoadGlobalViaContext); | |
4854 } | |
4855 | |
4856 | |
4857 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { | 4826 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
4858 Register context_reg = rsi; | 4827 Register context_reg = rsi; |
4859 Register slot_reg = rbx; | 4828 Register slot_reg = rbx; |
4860 Register value_reg = rax; | 4829 Register value_reg = rax; |
4861 Register cell_reg = r8; | 4830 Register cell_reg = r8; |
4862 Register cell_details_reg = rdx; | 4831 Register cell_details_reg = rdx; |
4863 Register cell_value_reg = r9; | 4832 Register cell_value_reg = r9; |
4864 Label fast_heapobject_case, fast_smi_case, slow_case; | 4833 Label fast_heapobject_case, fast_smi_case, slow_case; |
4865 | 4834 |
4866 if (FLAG_debug_code) { | 4835 if (FLAG_debug_code) { |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5361 kStackUnwindSpace, nullptr, return_value_operand, | 5330 kStackUnwindSpace, nullptr, return_value_operand, |
5362 NULL); | 5331 NULL); |
5363 } | 5332 } |
5364 | 5333 |
5365 #undef __ | 5334 #undef __ |
5366 | 5335 |
5367 } // namespace internal | 5336 } // namespace internal |
5368 } // namespace v8 | 5337 } // namespace v8 |
5369 | 5338 |
5370 #endif // V8_TARGET_ARCH_X64 | 5339 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |