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

Side by Side Diff: src/ic/arm/handler-compiler-arm.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 | « no previous file | src/ic/arm64/handler-compiler-arm64.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_ARM 7 #if V8_TARGET_ARCH_ARM
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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 holder()); 664 holder());
665 665
666 ExternalReference ref = ExternalReference( 666 ExternalReference ref = ExternalReference(
667 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate()); 667 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
668 __ TailCallExternalReference( 668 __ TailCallExternalReference(
669 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); 669 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
670 } 670 }
671 671
672 672
673 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( 673 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
674 Handle<JSObject> object, Handle<Name> name, int accessor_index) { 674 Handle<JSObject> object, Handle<Name> name,
675 Handle<ExecutableAccessorInfo> callback) {
675 Register holder_reg = Frontend(name); 676 Register holder_reg = Frontend(name);
676 677
677 __ push(receiver()); // receiver 678 __ push(receiver()); // receiver
678 __ push(holder_reg); 679 __ push(holder_reg);
679 __ mov(ip, Operand(Smi::FromInt(accessor_index))); 680
681 // If the callback cannot leak, then push the callback directly,
682 // otherwise wrap it in a weak cell.
683 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) {
684 __ mov(ip, Operand(callback));
685 } else {
686 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback);
687 __ mov(ip, Operand(cell));
688 }
680 __ push(ip); 689 __ push(ip);
681 __ mov(ip, Operand(name)); 690 __ mov(ip, Operand(name));
682 __ Push(ip, value()); 691 __ Push(ip, value());
683 692
684 // Do tail-call to the runtime system. 693 // Do tail-call to the runtime system.
685 ExternalReference store_callback_property = 694 ExternalReference store_callback_property =
686 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); 695 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
687 __ TailCallExternalReference(store_callback_property, 5, 1); 696 __ TailCallExternalReference(store_callback_property, 5, 1);
688 697
689 // Return the generated code. 698 // Return the generated code.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 // Return the generated code. 752 // Return the generated code.
744 return GetCode(kind(), Code::NORMAL, name); 753 return GetCode(kind(), Code::NORMAL, name);
745 } 754 }
746 755
747 756
748 #undef __ 757 #undef __
749 } 758 }
750 } // namespace v8::internal 759 } // namespace v8::internal
751 760
752 #endif // V8_TARGET_ARCH_ARM 761 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698