| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 5086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5097 __ Pop(r3, r5); | 5097 __ Pop(r3, r5); |
| 5098 } | 5098 } |
| 5099 __ b(&done_allocate); | 5099 __ b(&done_allocate); |
| 5100 | 5100 |
| 5101 // Fall back to %NewStrictArguments. | 5101 // Fall back to %NewStrictArguments. |
| 5102 __ bind(&too_big_for_new_space); | 5102 __ bind(&too_big_for_new_space); |
| 5103 __ push(r4); | 5103 __ push(r4); |
| 5104 __ TailCallRuntime(Runtime::kNewStrictArguments); | 5104 __ TailCallRuntime(Runtime::kNewStrictArguments); |
| 5105 } | 5105 } |
| 5106 | 5106 |
| 5107 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { | |
| 5108 Register context = cp; | |
| 5109 Register result = r3; | |
| 5110 Register slot = r5; | |
| 5111 | |
| 5112 // Go up the context chain to the script context. | |
| 5113 for (int i = 0; i < depth(); ++i) { | |
| 5114 __ LoadP(result, ContextMemOperand(context, Context::PREVIOUS_INDEX)); | |
| 5115 context = result; | |
| 5116 } | |
| 5117 | |
| 5118 // Load the PropertyCell value at the specified slot. | |
| 5119 __ ShiftLeftImm(r0, slot, Operand(kPointerSizeLog2)); | |
| 5120 __ add(result, context, r0); | |
| 5121 __ LoadP(result, ContextMemOperand(result)); | |
| 5122 __ LoadP(result, FieldMemOperand(result, PropertyCell::kValueOffset)); | |
| 5123 | |
| 5124 // If the result is not the_hole, return. Otherwise, handle in the runtime. | |
| 5125 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | |
| 5126 __ Ret(ne); | |
| 5127 | |
| 5128 // Fallback to runtime. | |
| 5129 __ SmiTag(slot); | |
| 5130 __ Push(slot); | |
| 5131 __ TailCallRuntime(Runtime::kLoadGlobalViaContext); | |
| 5132 } | |
| 5133 | |
| 5134 | |
| 5135 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { | 5107 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
| 5136 Register value = r3; | 5108 Register value = r3; |
| 5137 Register slot = r5; | 5109 Register slot = r5; |
| 5138 | 5110 |
| 5139 Register cell = r4; | 5111 Register cell = r4; |
| 5140 Register cell_details = r6; | 5112 Register cell_details = r6; |
| 5141 Register cell_value = r7; | 5113 Register cell_value = r7; |
| 5142 Register cell_value_map = r8; | 5114 Register cell_value_map = r8; |
| 5143 Register scratch = r9; | 5115 Register scratch = r9; |
| 5144 | 5116 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5614 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 5586 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
| 5615 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5587 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5616 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5588 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5617 } | 5589 } |
| 5618 | 5590 |
| 5619 #undef __ | 5591 #undef __ |
| 5620 } // namespace internal | 5592 } // namespace internal |
| 5621 } // namespace v8 | 5593 } // namespace v8 |
| 5622 | 5594 |
| 5623 #endif // V8_TARGET_ARCH_PPC | 5595 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |