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

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

Issue 965823002: Contribution of PowerPC port (continuation of 422063005) - currency (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/compiler/ppc/code-generator-ppc.cc ('k') | src/ppc/assembler-ppc.h » ('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_PPC 7 #if V8_TARGET_ARCH_PPC
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"
11 #include "src/ic/ic.h" 11 #include "src/ic/ic.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 #define __ ACCESS_MASM(masm) 16 #define __ ACCESS_MASM(masm)
17 17
18 18
19 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( 19 void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
20 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, 20 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder,
21 int accessor_index, int expected_arguments, Register scratch) { 21 int accessor_index, int expected_arguments, Register scratch) {
22 // ----------- S t a t e ------------- 22 // ----------- S t a t e -------------
23 // -- r3 : receiver 23 // -- r3 : receiver
24 // -- r5 : name 24 // -- r5 : name
25 // -- lr : return address 25 // -- lr : return address
26 // ----------------------------------- 26 // -----------------------------------
27 { 27 {
28 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 28 FrameScope scope(masm, StackFrame::INTERNAL);
29 29
30 if (accessor_index >= 0) { 30 if (accessor_index >= 0) {
31 DCHECK(!holder.is(scratch)); 31 DCHECK(!holder.is(scratch));
32 DCHECK(!receiver.is(scratch)); 32 DCHECK(!receiver.is(scratch));
33 // Call the JavaScript getter with the receiver on the stack. 33 // Call the JavaScript getter with the receiver on the stack.
34 if (map->IsJSGlobalObjectMap()) { 34 if (map->IsJSGlobalObjectMap()) {
35 // Swap in the global receiver. 35 // Swap in the global receiver.
36 __ LoadP(scratch, 36 __ LoadP(scratch,
37 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); 37 FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
38 receiver = scratch; 38 receiver = scratch;
(...skipping 16 matching lines...) Expand all
55 } 55 }
56 56
57 57
58 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( 58 void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
59 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, 59 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder,
60 int accessor_index, int expected_arguments, Register scratch) { 60 int accessor_index, int expected_arguments, Register scratch) {
61 // ----------- S t a t e ------------- 61 // ----------- S t a t e -------------
62 // -- lr : return address 62 // -- lr : return address
63 // ----------------------------------- 63 // -----------------------------------
64 { 64 {
65 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 65 FrameScope scope(masm, StackFrame::INTERNAL);
66 66
67 // Save value register, so we can restore it later. 67 // Save value register, so we can restore it later.
68 __ push(value()); 68 __ push(value());
69 69
70 if (accessor_index >= 0) { 70 if (accessor_index >= 0) {
71 DCHECK(!holder.is(scratch)); 71 DCHECK(!holder.is(scratch));
72 DCHECK(!receiver.is(scratch)); 72 DCHECK(!receiver.is(scratch));
73 DCHECK(!value().is(scratch)); 73 DCHECK(!value().is(scratch));
74 // Call the JavaScript setter with receiver and value on the stack. 74 // Call the JavaScript setter with receiver and value on the stack.
75 if (map->IsJSGlobalObjectMap()) { 75 if (map->IsJSGlobalObjectMap()) {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 // case might cause a miss during the prototype check. 610 // case might cause a miss during the prototype check.
611 bool must_perform_prototype_check = 611 bool must_perform_prototype_check =
612 !holder().is_identical_to(it->GetHolder<JSObject>()); 612 !holder().is_identical_to(it->GetHolder<JSObject>());
613 bool must_preserve_receiver_reg = 613 bool must_preserve_receiver_reg =
614 !receiver().is(holder_reg) && 614 !receiver().is(holder_reg) &&
615 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check); 615 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check);
616 616
617 // Save necessary data before invoking an interceptor. 617 // Save necessary data before invoking an interceptor.
618 // Requires a frame to make GC aware of pushed pointers. 618 // Requires a frame to make GC aware of pushed pointers.
619 { 619 {
620 FrameAndConstantPoolScope frame_scope(masm(), StackFrame::INTERNAL); 620 FrameScope frame_scope(masm(), StackFrame::INTERNAL);
621 if (must_preserve_receiver_reg) { 621 if (must_preserve_receiver_reg) {
622 __ Push(receiver(), holder_reg, this->name()); 622 __ Push(receiver(), holder_reg, this->name());
623 } else { 623 } else {
624 __ Push(holder_reg, this->name()); 624 __ Push(holder_reg, this->name());
625 } 625 }
626 InterceptorVectorSlotPush(holder_reg); 626 InterceptorVectorSlotPush(holder_reg);
627 // Invoke an interceptor. Note: map checks from receiver to 627 // Invoke an interceptor. Note: map checks from receiver to
628 // interceptor's holder has been compiled before (see a caller 628 // interceptor's holder has been compiled before (see a caller
629 // of this method.) 629 // of this method.)
630 CompileCallLoadPropertyWithInterceptor( 630 CompileCallLoadPropertyWithInterceptor(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 holder()); 662 holder());
663 663
664 ExternalReference ref = ExternalReference( 664 ExternalReference ref = ExternalReference(
665 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate()); 665 IC_Utility(IC::kLoadPropertyWithInterceptor), isolate());
666 __ TailCallExternalReference( 666 __ TailCallExternalReference(
667 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); 667 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1);
668 } 668 }
669 669
670 670
671 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( 671 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
672 Handle<JSObject> object, Handle<Name> name, int accessor_index) { 672 Handle<JSObject> object, Handle<Name> name,
673 Handle<ExecutableAccessorInfo> callback) {
673 Register holder_reg = Frontend(name); 674 Register holder_reg = Frontend(name);
674 675
675 __ Push(receiver(), holder_reg); // receiver 676 __ Push(receiver(), holder_reg); // receiver
676 __ LoadSmiLiteral(ip, Smi::FromInt(accessor_index)); 677
678 // If the callback cannot leak, then push the callback directly,
679 // otherwise wrap it in a weak cell.
680 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) {
681 __ mov(ip, Operand(callback));
682 } else {
683 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback);
684 __ mov(ip, Operand(cell));
685 }
677 __ push(ip); 686 __ push(ip);
678 __ mov(ip, Operand(name)); 687 __ mov(ip, Operand(name));
679 __ Push(ip, value()); 688 __ Push(ip, value());
680 689
681 // Do tail-call to the runtime system. 690 // Do tail-call to the runtime system.
682 ExternalReference store_callback_property = 691 ExternalReference store_callback_property =
683 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); 692 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
684 __ TailCallExternalReference(store_callback_property, 5, 1); 693 __ TailCallExternalReference(store_callback_property, 5, 1);
685 694
686 // Return the generated code. 695 // Return the generated code.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 // Return the generated code. 749 // Return the generated code.
741 return GetCode(kind(), Code::NORMAL, name); 750 return GetCode(kind(), Code::NORMAL, name);
742 } 751 }
743 752
744 753
745 #undef __ 754 #undef __
746 } 755 }
747 } // namespace v8::internal 756 } // namespace v8::internal
748 757
749 #endif // V8_TARGET_ARCH_ARM 758 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | src/ppc/assembler-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698