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_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 FrameScope scope(masm, StackFrame::INTERNAL); | 28 FrameAndConstantPoolScope 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 Loading... |
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 FrameScope scope(masm, StackFrame::INTERNAL); | 65 FrameAndConstantPoolScope 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 // case might cause a miss during the prototype check. | 642 // case might cause a miss during the prototype check. |
643 bool must_perform_prototype_check = | 643 bool must_perform_prototype_check = |
644 !holder().is_identical_to(it->GetHolder<JSObject>()); | 644 !holder().is_identical_to(it->GetHolder<JSObject>()); |
645 bool must_preserve_receiver_reg = | 645 bool must_preserve_receiver_reg = |
646 !receiver().is(holder_reg) && | 646 !receiver().is(holder_reg) && |
647 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check); | 647 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check); |
648 | 648 |
649 // Save necessary data before invoking an interceptor. | 649 // Save necessary data before invoking an interceptor. |
650 // Requires a frame to make GC aware of pushed pointers. | 650 // Requires a frame to make GC aware of pushed pointers. |
651 { | 651 { |
652 FrameScope frame_scope(masm(), StackFrame::INTERNAL); | 652 FrameAndConstantPoolScope frame_scope(masm(), StackFrame::INTERNAL); |
653 if (must_preserve_receiver_reg) { | 653 if (must_preserve_receiver_reg) { |
654 __ Push(receiver(), holder_reg, this->name()); | 654 __ Push(receiver(), holder_reg, this->name()); |
655 } else { | 655 } else { |
656 __ Push(holder_reg, this->name()); | 656 __ Push(holder_reg, this->name()); |
657 } | 657 } |
658 InterceptorVectorSlotPush(holder_reg); | 658 InterceptorVectorSlotPush(holder_reg); |
659 // Invoke an interceptor. Note: map checks from receiver to | 659 // Invoke an interceptor. Note: map checks from receiver to |
660 // interceptor's holder has been compiled before (see a caller | 660 // interceptor's holder has been compiled before (see a caller |
661 // of this method.) | 661 // of this method.) |
662 CompileCallLoadPropertyWithInterceptor( | 662 CompileCallLoadPropertyWithInterceptor( |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 // Return the generated code. | 781 // Return the generated code. |
782 return GetCode(kind(), Code::NORMAL, name); | 782 return GetCode(kind(), Code::NORMAL, name); |
783 } | 783 } |
784 | 784 |
785 | 785 |
786 #undef __ | 786 #undef __ |
787 } // namespace internal | 787 } // namespace internal |
788 } // namespace v8 | 788 } // namespace v8 |
789 | 789 |
790 #endif // V8_TARGET_ARCH_ARM | 790 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |