| 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 5010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5021 __ Pop(r2, r4); | 5021 __ Pop(r2, r4); |
| 5022 } | 5022 } |
| 5023 __ b(&done_allocate); | 5023 __ b(&done_allocate); |
| 5024 | 5024 |
| 5025 // Fall back to %NewStrictArguments. | 5025 // Fall back to %NewStrictArguments. |
| 5026 __ bind(&too_big_for_new_space); | 5026 __ bind(&too_big_for_new_space); |
| 5027 __ push(r3); | 5027 __ push(r3); |
| 5028 __ TailCallRuntime(Runtime::kNewStrictArguments); | 5028 __ TailCallRuntime(Runtime::kNewStrictArguments); |
| 5029 } | 5029 } |
| 5030 | 5030 |
| 5031 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { | |
| 5032 Register context = cp; | |
| 5033 Register result = r2; | |
| 5034 Register slot = r4; | |
| 5035 | |
| 5036 // Go up the context chain to the script context. | |
| 5037 for (int i = 0; i < depth(); ++i) { | |
| 5038 __ LoadP(result, ContextMemOperand(context, Context::PREVIOUS_INDEX)); | |
| 5039 context = result; | |
| 5040 } | |
| 5041 | |
| 5042 // Load the PropertyCell value at the specified slot. | |
| 5043 __ ShiftLeftP(r0, slot, Operand(kPointerSizeLog2)); | |
| 5044 __ AddP(result, context, r0); | |
| 5045 __ LoadP(result, ContextMemOperand(result)); | |
| 5046 __ LoadP(result, FieldMemOperand(result, PropertyCell::kValueOffset)); | |
| 5047 | |
| 5048 // If the result is not the_hole, return. Otherwise, handle in the runtime. | |
| 5049 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | |
| 5050 Label runtime; | |
| 5051 __ beq(&runtime); | |
| 5052 __ Ret(); | |
| 5053 __ bind(&runtime); | |
| 5054 | |
| 5055 // Fallback to runtime. | |
| 5056 __ SmiTag(slot); | |
| 5057 __ Push(slot); | |
| 5058 __ TailCallRuntime(Runtime::kLoadGlobalViaContext); | |
| 5059 } | |
| 5060 | |
| 5061 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { | 5031 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
| 5062 Register value = r2; | 5032 Register value = r2; |
| 5063 Register slot = r4; | 5033 Register slot = r4; |
| 5064 | 5034 |
| 5065 Register cell = r3; | 5035 Register cell = r3; |
| 5066 Register cell_details = r5; | 5036 Register cell_details = r5; |
| 5067 Register cell_value = r6; | 5037 Register cell_value = r6; |
| 5068 Register cell_value_map = r7; | 5038 Register cell_value_map = r7; |
| 5069 Register scratch = r8; | 5039 Register scratch = r8; |
| 5070 | 5040 |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5531 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5501 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5532 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5502 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5533 } | 5503 } |
| 5534 | 5504 |
| 5535 #undef __ | 5505 #undef __ |
| 5536 | 5506 |
| 5537 } // namespace internal | 5507 } // namespace internal |
| 5538 } // namespace v8 | 5508 } // namespace v8 |
| 5539 | 5509 |
| 5540 #endif // V8_TARGET_ARCH_S390 | 5510 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |