| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 4889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4900 } | 4900 } |
| 4901 __ b(&done_allocate); | 4901 __ b(&done_allocate); |
| 4902 | 4902 |
| 4903 // Fall back to %NewStrictArguments. | 4903 // Fall back to %NewStrictArguments. |
| 4904 __ bind(&too_big_for_new_space); | 4904 __ bind(&too_big_for_new_space); |
| 4905 __ push(r1); | 4905 __ push(r1); |
| 4906 __ TailCallRuntime(Runtime::kNewStrictArguments); | 4906 __ TailCallRuntime(Runtime::kNewStrictArguments); |
| 4907 } | 4907 } |
| 4908 | 4908 |
| 4909 | 4909 |
| 4910 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { | |
| 4911 Register context = cp; | |
| 4912 Register result = r0; | |
| 4913 Register slot = r2; | |
| 4914 | |
| 4915 // Go up the context chain to the script context. | |
| 4916 for (int i = 0; i < depth(); ++i) { | |
| 4917 __ ldr(result, ContextMemOperand(context, Context::PREVIOUS_INDEX)); | |
| 4918 context = result; | |
| 4919 } | |
| 4920 | |
| 4921 // Load the PropertyCell value at the specified slot. | |
| 4922 __ add(result, context, Operand(slot, LSL, kPointerSizeLog2)); | |
| 4923 __ ldr(result, ContextMemOperand(result)); | |
| 4924 __ ldr(result, FieldMemOperand(result, PropertyCell::kValueOffset)); | |
| 4925 | |
| 4926 // If the result is not the_hole, return. Otherwise, handle in the runtime. | |
| 4927 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | |
| 4928 __ Ret(ne); | |
| 4929 | |
| 4930 // Fallback to runtime. | |
| 4931 __ SmiTag(slot); | |
| 4932 __ push(slot); | |
| 4933 __ TailCallRuntime(Runtime::kLoadGlobalViaContext); | |
| 4934 } | |
| 4935 | |
| 4936 | |
| 4937 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { | 4910 void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
| 4938 Register value = r0; | 4911 Register value = r0; |
| 4939 Register slot = r2; | 4912 Register slot = r2; |
| 4940 | 4913 |
| 4941 Register cell = r1; | 4914 Register cell = r1; |
| 4942 Register cell_details = r4; | 4915 Register cell_details = r4; |
| 4943 Register cell_value = r5; | 4916 Register cell_value = r5; |
| 4944 Register cell_value_map = r6; | 4917 Register cell_value_map = r6; |
| 4945 Register scratch = r9; | 4918 Register scratch = r9; |
| 4946 | 4919 |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5366 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5339 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 5367 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5340 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 5368 } | 5341 } |
| 5369 | 5342 |
| 5370 #undef __ | 5343 #undef __ |
| 5371 | 5344 |
| 5372 } // namespace internal | 5345 } // namespace internal |
| 5373 } // namespace v8 | 5346 } // namespace v8 |
| 5374 | 5347 |
| 5375 #endif // V8_TARGET_ARCH_ARM | 5348 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |