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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 // case might cause a miss during the prototype check. | 604 // case might cause a miss during the prototype check. |
605 bool must_perform_prototype_check = | 605 bool must_perform_prototype_check = |
606 !holder().is_identical_to(it->GetHolder<JSObject>()); | 606 !holder().is_identical_to(it->GetHolder<JSObject>()); |
607 bool must_preserve_receiver_reg = | 607 bool must_preserve_receiver_reg = |
608 !receiver().is(holder_reg) && | 608 !receiver().is(holder_reg) && |
609 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check); | 609 (it->state() == LookupIterator::ACCESSOR || must_perform_prototype_check); |
610 | 610 |
611 // Save necessary data before invoking an interceptor. | 611 // Save necessary data before invoking an interceptor. |
612 // Requires a frame to make GC aware of pushed pointers. | 612 // Requires a frame to make GC aware of pushed pointers. |
613 { | 613 { |
614 FrameScope frame_scope(masm(), StackFrame::INTERNAL); | 614 FrameAndConstantPoolScope frame_scope(masm(), StackFrame::INTERNAL); |
615 if (must_preserve_receiver_reg) { | 615 if (must_preserve_receiver_reg) { |
616 __ Push(receiver(), holder_reg, this->name()); | 616 __ Push(receiver(), holder_reg, this->name()); |
617 } else { | 617 } else { |
618 __ Push(holder_reg, this->name()); | 618 __ Push(holder_reg, this->name()); |
619 } | 619 } |
620 InterceptorVectorSlotPush(holder_reg); | 620 InterceptorVectorSlotPush(holder_reg); |
621 // Invoke an interceptor. Note: map checks from receiver to | 621 // Invoke an interceptor. Note: map checks from receiver to |
622 // interceptor's holder has been compiled before (see a caller | 622 // interceptor's holder has been compiled before (see a caller |
623 // of this method.) | 623 // of this method.) |
624 CompileCallLoadPropertyWithInterceptor( | 624 CompileCallLoadPropertyWithInterceptor( |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 // Return the generated code. | 743 // Return the generated code. |
744 return GetCode(kind(), Code::NORMAL, name); | 744 return GetCode(kind(), Code::NORMAL, name); |
745 } | 745 } |
746 | 746 |
747 | 747 |
748 #undef __ | 748 #undef __ |
749 } | 749 } |
750 } // namespace v8::internal | 750 } // namespace v8::internal |
751 | 751 |
752 #endif // V8_TARGET_ARCH_ARM | 752 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |