Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: src/ic/mips64/handler-compiler-mips64.cc

Issue 926293004: Embed store callback in handler via weak cell. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: typo Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 holder()); 656 holder());
657 657
658 ExternalReference ref = ExternalReference( 658 ExternalReference ref = ExternalReference(
659 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate()); 659 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
660 __ TailCallExternalReference( 660 __ TailCallExternalReference(
661 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); 661 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
662 } 662 }
663 663
664 664
665 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( 665 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
666 Handle<JSObject> object, Handle<Name> name, int accessor_index) { 666 Handle<JSObject> object, Handle<Name> name,
667 Handle<ExecutableAccessorInfo> callback) {
667 Register holder_reg = Frontend(name); 668 Register holder_reg = Frontend(name);
668 669
669 __ Push(receiver(), holder_reg); // Receiver. 670 __ Push(receiver(), holder_reg); // Receiver.
670 __ li(at, Operand(Smi::FromInt(accessor_index))); 671 // If the callback cannot leak, then push the callback directly,
672 // otherwise wrap it in a weak cell.
673 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) {
674 __ li(at, Operand(callback));
675 } else {
676 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback);
677 __ li(at, Operand(cell));
678 }
671 __ push(at); 679 __ push(at);
672 __ li(at, Operand(name)); 680 __ li(at, Operand(name));
673 __ Push(at, value()); 681 __ Push(at, value());
674 682
675 // Do tail-call to the runtime system. 683 // Do tail-call to the runtime system.
676 ExternalReference store_callback_property = 684 ExternalReference store_callback_property =
677 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); 685 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
678 __ TailCallExternalReference(store_callback_property, 5, 1); 686 __ TailCallExternalReference(store_callback_property, 5, 1);
679 687
680 // Return the generated code. 688 // Return the generated code.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 // Return the generated code. 743 // Return the generated code.
736 return GetCode(kind(), Code::NORMAL, name); 744 return GetCode(kind(), Code::NORMAL, name);
737 } 745 }
738 746
739 747
740 #undef __ 748 #undef __
741 } 749 }
742 } // namespace v8::internal 750 } // namespace v8::internal
743 751
744 #endif // V8_TARGET_ARCH_MIPS64 752 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698