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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 | 585 |
586 | 586 |
587 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { | 587 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { |
588 // Return the constant value. | 588 // Return the constant value. |
589 __ Move(r3, value); | 589 __ Move(r3, value); |
590 __ Ret(); | 590 __ Ret(); |
591 } | 591 } |
592 | 592 |
593 | 593 |
594 void NamedLoadHandlerCompiler::GenerateLoadCallback( | 594 void NamedLoadHandlerCompiler::GenerateLoadCallback( |
595 Register reg, Handle<ExecutableAccessorInfo> callback) { | 595 Register reg, Handle<AccessorInfo> callback) { |
596 // Build AccessorInfo::args_ list on the stack and push property name below | 596 // Build AccessorInfo::args_ list on the stack and push property name below |
597 // the exit frame to make GC aware of them and store pointers to them. | 597 // the exit frame to make GC aware of them and store pointers to them. |
598 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); | 598 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0); |
599 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); | 599 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1); |
600 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); | 600 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2); |
601 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); | 601 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3); |
602 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); | 602 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); |
603 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); | 603 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); |
604 STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); | 604 STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); |
605 DCHECK(!scratch2().is(reg)); | 605 DCHECK(!scratch2().is(reg)); |
606 DCHECK(!scratch3().is(reg)); | 606 DCHECK(!scratch3().is(reg)); |
607 DCHECK(!scratch4().is(reg)); | 607 DCHECK(!scratch4().is(reg)); |
608 __ push(receiver()); | 608 __ push(receiver()); |
609 // Push data from ExecutableAccessorInfo. | 609 // Push data from AccessorInfo. |
610 Handle<Object> data(callback->data(), isolate()); | 610 Handle<Object> data(callback->data(), isolate()); |
611 if (data->IsUndefined() || data->IsSmi()) { | 611 if (data->IsUndefined() || data->IsSmi()) { |
612 __ Move(scratch3(), data); | 612 __ Move(scratch3(), data); |
613 } else { | 613 } else { |
614 Handle<WeakCell> cell = | 614 Handle<WeakCell> cell = |
615 isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); | 615 isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); |
616 // The callback is alive if this instruction is executed, | 616 // The callback is alive if this instruction is executed, |
617 // so the weak cell is not cleared and points to data. | 617 // so the weak cell is not cleared and points to data. |
618 __ GetWeakValue(scratch3(), cell); | 618 __ GetWeakValue(scratch3(), cell); |
619 } | 619 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 DCHECK(holder()->HasNamedInterceptor()); | 704 DCHECK(holder()->HasNamedInterceptor()); |
705 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 705 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
706 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 706 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
707 holder()); | 707 holder()); |
708 | 708 |
709 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); | 709 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
710 } | 710 } |
711 | 711 |
712 | 712 |
713 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 713 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
714 Handle<JSObject> object, Handle<Name> name, | 714 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback) { |
715 Handle<ExecutableAccessorInfo> callback) { | |
716 Register holder_reg = Frontend(name); | 715 Register holder_reg = Frontend(name); |
717 | 716 |
718 __ Push(receiver(), holder_reg); // receiver | 717 __ Push(receiver(), holder_reg); // receiver |
719 | 718 |
720 // If the callback cannot leak, then push the callback directly, | 719 // If the callback cannot leak, then push the callback directly, |
721 // otherwise wrap it in a weak cell. | 720 // otherwise wrap it in a weak cell. |
722 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { | 721 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
723 __ mov(ip, Operand(callback)); | 722 __ mov(ip, Operand(callback)); |
724 } else { | 723 } else { |
725 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | 724 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 // Return the generated code. | 786 // Return the generated code. |
788 return GetCode(kind(), Code::NORMAL, name); | 787 return GetCode(kind(), Code::NORMAL, name); |
789 } | 788 } |
790 | 789 |
791 | 790 |
792 #undef __ | 791 #undef __ |
793 } // namespace internal | 792 } // namespace internal |
794 } // namespace v8 | 793 } // namespace v8 |
795 | 794 |
796 #endif // V8_TARGET_ARCH_ARM | 795 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |