| 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 5241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5252 } | 5252 } |
| 5253 __ B(&done_allocate); | 5253 __ B(&done_allocate); |
| 5254 | 5254 |
| 5255 // Fall back to %NewStrictArguments. | 5255 // Fall back to %NewStrictArguments. |
| 5256 __ Bind(&too_big_for_new_space); | 5256 __ Bind(&too_big_for_new_space); |
| 5257 __ Push(x1); | 5257 __ Push(x1); |
| 5258 __ TailCallRuntime(Runtime::kNewStrictArguments); | 5258 __ TailCallRuntime(Runtime::kNewStrictArguments); |
| 5259 } | 5259 } |
| 5260 | 5260 |
| 5261 | 5261 |
| 5262 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { | |
| 5263 Register context = cp; | |
| 5264 Register result = x0; | |
| 5265 Register slot = x2; | |
| 5266 Label slow_case; | |
| 5267 | |
| 5268 // Go up the context chain to the script context. | |
| 5269 for (int i = 0; i < depth(); ++i) { | |
| 5270 __ Ldr(result, ContextMemOperand(context, Context::PREVIOUS_INDEX)); | |
| 5271 context = result; | |
| 5272 } | |
| 5273 | |
| 5274 // Load the PropertyCell value at the specified slot. | |
| 5275 __ Add(result, context, Operand(slot, LSL, kPointerSizeLog2)); | |
| 5276 __ Ldr(result, ContextMemOperand(result)); | |
| 5277 __ Ldr(result, FieldMemOperand(result, PropertyCell::kValueOffset)); | |
| 5278 | |
| 5279 // If the result is not the_hole, return. Otherwise, handle in the runtime. | |
| 5280 __ JumpIfRoot(result, Heap::kTheHoleValueRootIndex, &slow_case); | |
| 5281 __ Ret(); | |
| 5282 | |
| 5283 // Fallback to runtime. | |
| 5284 __ Bind(&slow_case); | |
| 5285 __ SmiTag(slot); | |
| 5286 __ Push(slot); | |
| 5287 __ TailCallRuntime(Runtime::kLoadGlobalViaContext); | |
| 5288 } | |
| 5289 | |
| 5290 | |
| 5291 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { | 5262 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
| 5292 Register context = cp; | 5263 Register context = cp; |
| 5293 Register value = x0; | 5264 Register value = x0; |
| 5294 Register slot = x2; | 5265 Register slot = x2; |
| 5295 Register context_temp = x10; | 5266 Register context_temp = x10; |
| 5296 Register cell = x10; | 5267 Register cell = x10; |
| 5297 Register cell_details = x11; | 5268 Register cell_details = x11; |
| 5298 Register cell_value = x12; | 5269 Register cell_value = x12; |
| 5299 Register cell_value_map = x13; | 5270 Register cell_value_map = x13; |
| 5300 Register value_map = x14; | 5271 Register value_map = x14; |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5749 kStackUnwindSpace, NULL, spill_offset, | 5720 kStackUnwindSpace, NULL, spill_offset, |
| 5750 return_value_operand, NULL); | 5721 return_value_operand, NULL); |
| 5751 } | 5722 } |
| 5752 | 5723 |
| 5753 #undef __ | 5724 #undef __ |
| 5754 | 5725 |
| 5755 } // namespace internal | 5726 } // namespace internal |
| 5756 } // namespace v8 | 5727 } // namespace v8 |
| 5757 | 5728 |
| 5758 #endif // V8_TARGET_ARCH_ARM64 | 5729 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |