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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 holder()); | 728 holder()); |
729 | 729 |
730 ExternalReference ref = ExternalReference( | 730 ExternalReference ref = ExternalReference( |
731 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate()); | 731 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate()); |
732 __ TailCallExternalReference( | 732 __ TailCallExternalReference( |
733 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); | 733 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); |
734 } | 734 } |
735 | 735 |
736 | 736 |
737 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 737 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
738 Handle<JSObject> object, Handle<Name> name, int accessor_index) { | 738 Handle<JSObject> object, Handle<Name> name, |
| 739 Handle<ExecutableAccessorInfo> callback) { |
739 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreCallback"); | 740 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreCallback"); |
740 Register holder_reg = Frontend(name); | 741 Register holder_reg = Frontend(name); |
741 | 742 |
742 // Stub never generated for non-global objects that require access checks. | 743 // Stub never generated for non-global objects that require access checks. |
743 DCHECK(holder()->IsJSGlobalProxy() || !holder()->IsAccessCheckNeeded()); | 744 DCHECK(holder()->IsJSGlobalProxy() || !holder()->IsAccessCheckNeeded()); |
744 | 745 |
745 // receiver() and holder_reg can alias. | 746 // receiver() and holder_reg can alias. |
746 DCHECK(!AreAliased(receiver(), scratch1(), scratch2(), value())); | 747 DCHECK(!AreAliased(receiver(), scratch1(), scratch2(), value())); |
747 DCHECK(!AreAliased(holder_reg, scratch1(), scratch2(), value())); | 748 DCHECK(!AreAliased(holder_reg, scratch1(), scratch2(), value())); |
748 __ Mov(scratch1(), Operand(Smi::FromInt(accessor_index))); | 749 // If the callback cannot leak, then push the callback directly, |
| 750 // otherwise wrap it in a weak cell. |
| 751 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
| 752 __ Mov(scratch1(), Operand(callback)); |
| 753 } else { |
| 754 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
| 755 __ Mov(scratch1(), Operand(cell)); |
| 756 } |
749 __ Mov(scratch2(), Operand(name)); | 757 __ Mov(scratch2(), Operand(name)); |
750 __ Push(receiver(), holder_reg, scratch1(), scratch2(), value()); | 758 __ Push(receiver(), holder_reg, scratch1(), scratch2(), value()); |
751 | 759 |
752 // Do tail-call to the runtime system. | 760 // Do tail-call to the runtime system. |
753 ExternalReference store_callback_property = | 761 ExternalReference store_callback_property = |
754 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 762 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
755 __ TailCallExternalReference(store_callback_property, 5, 1); | 763 __ TailCallExternalReference(store_callback_property, 5, 1); |
756 | 764 |
757 // Return the generated code. | 765 // Return the generated code. |
758 return GetCode(kind(), Code::FAST, name); | 766 return GetCode(kind(), Code::FAST, name); |
759 } | 767 } |
760 | 768 |
761 | 769 |
762 #undef __ | 770 #undef __ |
763 } | 771 } |
764 } // namespace v8::internal | 772 } // namespace v8::internal |
765 | 773 |
766 #endif // V8_TARGET_ARCH_IA32 | 774 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |