| 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
| 8 | 8 |
| 9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
| 10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 break; | 190 break; |
| 191 case CallOptimization::kHolderNotFound: | 191 case CallOptimization::kHolderNotFound: |
| 192 UNREACHABLE(); | 192 UNREACHABLE(); |
| 193 break; | 193 break; |
| 194 } | 194 } |
| 195 | 195 |
| 196 Isolate* isolate = masm->isolate(); | 196 Isolate* isolate = masm->isolate(); |
| 197 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 197 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 198 bool call_data_undefined = false; | 198 bool call_data_undefined = false; |
| 199 // Put call data in place. | 199 // Put call data in place. |
| 200 if (api_call_info->data()->IsUndefined()) { | 200 if (api_call_info->data()->IsUndefined(isolate)) { |
| 201 call_data_undefined = true; | 201 call_data_undefined = true; |
| 202 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); | 202 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
| 203 } else { | 203 } else { |
| 204 if (optimization.is_constant_call()) { | 204 if (optimization.is_constant_call()) { |
| 205 __ Ldr(data, | 205 __ Ldr(data, |
| 206 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 206 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
| 207 __ Ldr(data, | 207 __ Ldr(data, |
| 208 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 208 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
| 209 __ Ldr(data, | 209 __ Ldr(data, |
| 210 FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | 210 FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 Register holder_reg = Frontend(name); | 679 Register holder_reg = Frontend(name); |
| 680 | 680 |
| 681 // Stub never generated for non-global objects that require access checks. | 681 // Stub never generated for non-global objects that require access checks. |
| 682 DCHECK(holder()->IsJSGlobalProxy() || !holder()->IsAccessCheckNeeded()); | 682 DCHECK(holder()->IsJSGlobalProxy() || !holder()->IsAccessCheckNeeded()); |
| 683 | 683 |
| 684 // receiver() and holder_reg can alias. | 684 // receiver() and holder_reg can alias. |
| 685 DCHECK(!AreAliased(receiver(), scratch1(), scratch2(), value())); | 685 DCHECK(!AreAliased(receiver(), scratch1(), scratch2(), value())); |
| 686 DCHECK(!AreAliased(holder_reg, scratch1(), scratch2(), value())); | 686 DCHECK(!AreAliased(holder_reg, scratch1(), scratch2(), value())); |
| 687 // If the callback cannot leak, then push the callback directly, | 687 // If the callback cannot leak, then push the callback directly, |
| 688 // otherwise wrap it in a weak cell. | 688 // otherwise wrap it in a weak cell. |
| 689 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { | 689 if (callback->data()->IsUndefined(isolate()) || callback->data()->IsSmi()) { |
| 690 __ Mov(scratch1(), Operand(callback)); | 690 __ Mov(scratch1(), Operand(callback)); |
| 691 } else { | 691 } else { |
| 692 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | 692 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
| 693 __ Mov(scratch1(), Operand(cell)); | 693 __ Mov(scratch1(), Operand(cell)); |
| 694 } | 694 } |
| 695 __ Mov(scratch2(), Operand(name)); | 695 __ Mov(scratch2(), Operand(name)); |
| 696 __ Push(receiver(), holder_reg, scratch1(), scratch2(), value()); | 696 __ Push(receiver(), holder_reg, scratch1(), scratch2(), value()); |
| 697 __ Push(Smi::FromInt(language_mode)); | 697 __ Push(Smi::FromInt(language_mode)); |
| 698 | 698 |
| 699 // Do tail-call to the runtime system. | 699 // Do tail-call to the runtime system. |
| 700 __ TailCallRuntime(Runtime::kStoreCallbackProperty); | 700 __ TailCallRuntime(Runtime::kStoreCallbackProperty); |
| 701 | 701 |
| 702 // Return the generated code. | 702 // Return the generated code. |
| 703 return GetCode(kind(), name); | 703 return GetCode(kind(), name); |
| 704 } | 704 } |
| 705 | 705 |
| 706 | 706 |
| 707 #undef __ | 707 #undef __ |
| 708 } // namespace internal | 708 } // namespace internal |
| 709 } // namespace v8 | 709 } // namespace v8 |
| 710 | 710 |
| 711 #endif // V8_TARGET_ARCH_IA32 | 711 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |