OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
6 | 6 |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 | 8 |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 __ bind(&success); | 555 __ bind(&success); |
556 } | 556 } |
557 } | 557 } |
558 | 558 |
559 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { | 559 void NamedLoadHandlerCompiler::GenerateLoadConstant(Handle<Object> value) { |
560 // Return the constant value. | 560 // Return the constant value. |
561 __ Move(r2, value); | 561 __ Move(r2, value); |
562 __ Ret(); | 562 __ Ret(); |
563 } | 563 } |
564 | 564 |
565 void NamedLoadHandlerCompiler::GenerateLoadCallback( | |
566 Register reg, Handle<AccessorInfo> callback) { | |
567 DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), receiver())); | |
568 DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg)); | |
569 | |
570 // Build v8::PropertyCallbackInfo::args_ array on the stack and push property | |
571 // name below the exit frame to make GC aware of them. | |
572 STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0); | |
573 STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1); | |
574 STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2); | |
575 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3); | |
576 STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4); | |
577 STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5); | |
578 STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6); | |
579 STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7); | |
580 | |
581 __ Push(receiver()); | |
582 // Push data from AccessorInfo. | |
583 Handle<Object> data(callback->data(), isolate()); | |
584 if (data->IsUndefined() || data->IsSmi()) { | |
585 __ Move(scratch2(), data); | |
586 } else { | |
587 Handle<WeakCell> cell = | |
588 isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data)); | |
589 // The callback is alive if this instruction is executed, | |
590 // so the weak cell is not cleared and points to data. | |
591 __ GetWeakValue(scratch2(), cell); | |
592 } | |
593 __ push(scratch2()); | |
594 __ LoadRoot(scratch2(), Heap::kUndefinedValueRootIndex); | |
595 __ Push(scratch2(), scratch2()); | |
596 __ mov(scratch2(), Operand(ExternalReference::isolate_address(isolate()))); | |
597 // should_throw_on_error -> false | |
598 __ mov(scratch3(), Operand(Smi::FromInt(0))); | |
599 __ Push(scratch2(), reg, scratch3(), name()); | |
600 | |
601 // Abi for CallApiGetter | |
602 Register getter_address_reg = ApiGetterDescriptor::function_address(); | |
603 | |
604 Address getter_address = v8::ToCData<Address>(callback->getter()); | |
605 ApiFunction fun(getter_address); | |
606 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; | |
607 ExternalReference ref = ExternalReference(&fun, type, isolate()); | |
608 __ mov(getter_address_reg, Operand(ref)); | |
609 | |
610 CallApiGetterStub stub(isolate()); | |
611 __ TailCallStub(&stub); | |
612 } | |
613 | |
614 void NamedLoadHandlerCompiler::GenerateLoadInterceptorWithFollowup( | 565 void NamedLoadHandlerCompiler::GenerateLoadInterceptorWithFollowup( |
615 LookupIterator* it, Register holder_reg) { | 566 LookupIterator* it, Register holder_reg) { |
616 DCHECK(holder()->HasNamedInterceptor()); | 567 DCHECK(holder()->HasNamedInterceptor()); |
617 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 568 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
618 | 569 |
619 // Compile the interceptor call, followed by inline code to load the | 570 // Compile the interceptor call, followed by inline code to load the |
620 // property from further up the prototype chain if the call fails. | 571 // property from further up the prototype chain if the call fails. |
621 // Check that the maps haven't changed. | 572 // Check that the maps haven't changed. |
622 DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1())); | 573 DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1())); |
623 | 574 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 692 |
742 // Return the generated code. | 693 // Return the generated code. |
743 return GetCode(kind(), name); | 694 return GetCode(kind(), name); |
744 } | 695 } |
745 | 696 |
746 #undef __ | 697 #undef __ |
747 } // namespace internal | 698 } // namespace internal |
748 } // namespace v8 | 699 } // namespace v8 |
749 | 700 |
750 #endif // V8_TARGET_ARCH_ARM | 701 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |