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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 holder()); | 655 holder()); |
656 | 656 |
657 ExternalReference ref = ExternalReference( | 657 ExternalReference ref = ExternalReference( |
658 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate()); | 658 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate()); |
659 __ TailCallExternalReference( | 659 __ TailCallExternalReference( |
660 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); | 660 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); |
661 } | 661 } |
662 | 662 |
663 | 663 |
664 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 664 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
665 Handle<JSObject> object, Handle<Name> name, int accessor_index) { | 665 Handle<JSObject> object, Handle<Name> name, |
| 666 Handle<ExecutableAccessorInfo> callback) { |
666 Register holder_reg = Frontend(name); | 667 Register holder_reg = Frontend(name); |
667 | 668 |
668 __ Push(receiver(), holder_reg); // Receiver. | 669 __ Push(receiver(), holder_reg); // Receiver. |
669 __ li(at, Operand(Smi::FromInt(accessor_index))); | 670 // If the callback cannot leak, then push the callback directly, |
| 671 // otherwise wrap it in a weak cell. |
| 672 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
| 673 __ li(at, Operand(callback)); |
| 674 } else { |
| 675 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
| 676 __ li(at, Operand(cell)); |
| 677 } |
670 __ push(at); | 678 __ push(at); |
671 __ li(at, Operand(name)); | 679 __ li(at, Operand(name)); |
672 __ Push(at, value()); | 680 __ Push(at, value()); |
673 | 681 |
674 // Do tail-call to the runtime system. | 682 // Do tail-call to the runtime system. |
675 ExternalReference store_callback_property = | 683 ExternalReference store_callback_property = |
676 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 684 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
677 __ TailCallExternalReference(store_callback_property, 5, 1); | 685 __ TailCallExternalReference(store_callback_property, 5, 1); |
678 | 686 |
679 // Return the generated code. | 687 // Return the generated code. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 // Return the generated code. | 742 // Return the generated code. |
735 return GetCode(kind(), Code::NORMAL, name); | 743 return GetCode(kind(), Code::NORMAL, name); |
736 } | 744 } |
737 | 745 |
738 | 746 |
739 #undef __ | 747 #undef __ |
740 } | 748 } |
741 } // namespace v8::internal | 749 } // namespace v8::internal |
742 | 750 |
743 #endif // V8_TARGET_ARCH_MIPS | 751 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |