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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2828 __ LoadP(r4, MemOperand(sp, (argc + 1) * kPointerSize)); | 2828 __ LoadP(r4, MemOperand(sp, (argc + 1) * kPointerSize)); |
2829 // Call the target. | 2829 // Call the target. |
2830 __ mov(r3, Operand(argc)); | 2830 __ mov(r3, Operand(argc)); |
2831 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2831 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2832 OperandStackDepthDecrement(argc + 1); | 2832 OperandStackDepthDecrement(argc + 1); |
2833 RestoreContext(); | 2833 RestoreContext(); |
2834 // Discard the function left on TOS. | 2834 // Discard the function left on TOS. |
2835 context()->DropAndPlug(1, r3); | 2835 context()->DropAndPlug(1, r3); |
2836 } | 2836 } |
2837 | 2837 |
2838 | |
2839 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | |
2840 ZoneList<Expression*>* args = expr->arguments(); | |
2841 VisitForAccumulatorValue(args->at(0)); | |
2842 | |
2843 Label materialize_true, materialize_false; | |
2844 Label* if_true = NULL; | |
2845 Label* if_false = NULL; | |
2846 Label* fall_through = NULL; | |
2847 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | |
2848 &if_false, &fall_through); | |
2849 | |
2850 __ lwz(r3, FieldMemOperand(r3, String::kHashFieldOffset)); | |
2851 // PPC - assume ip is free | |
2852 __ mov(ip, Operand(String::kContainsCachedArrayIndexMask)); | |
2853 __ and_(r0, r3, ip, SetRC); | |
2854 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
2855 Split(eq, if_true, if_false, fall_through, cr0); | |
2856 | |
2857 context()->Plug(if_true, if_false); | |
2858 } | |
2859 | |
2860 | |
2861 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) { | |
2862 ZoneList<Expression*>* args = expr->arguments(); | |
2863 DCHECK(args->length() == 1); | |
2864 VisitForAccumulatorValue(args->at(0)); | |
2865 | |
2866 __ AssertString(r3); | |
2867 | |
2868 __ lwz(r3, FieldMemOperand(r3, String::kHashFieldOffset)); | |
2869 __ IndexFromHash(r3, r3); | |
2870 | |
2871 context()->Plug(r3); | |
2872 } | |
2873 | |
2874 | |
2875 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { | 2838 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { |
2876 ZoneList<Expression*>* args = expr->arguments(); | 2839 ZoneList<Expression*>* args = expr->arguments(); |
2877 DCHECK_EQ(1, args->length()); | 2840 DCHECK_EQ(1, args->length()); |
2878 VisitForAccumulatorValue(args->at(0)); | 2841 VisitForAccumulatorValue(args->at(0)); |
2879 __ AssertFunction(r3); | 2842 __ AssertFunction(r3); |
2880 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); | 2843 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
2881 __ LoadP(r3, FieldMemOperand(r3, Map::kPrototypeOffset)); | 2844 __ LoadP(r3, FieldMemOperand(r3, Map::kPrototypeOffset)); |
2882 context()->Plug(r3); | 2845 context()->Plug(r3); |
2883 } | 2846 } |
2884 | 2847 |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3655 | 3618 |
3656 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3619 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3657 | 3620 |
3658 DCHECK(interrupt_address == | 3621 DCHECK(interrupt_address == |
3659 isolate->builtins()->OnStackReplacement()->entry()); | 3622 isolate->builtins()->OnStackReplacement()->entry()); |
3660 return ON_STACK_REPLACEMENT; | 3623 return ON_STACK_REPLACEMENT; |
3661 } | 3624 } |
3662 } // namespace internal | 3625 } // namespace internal |
3663 } // namespace v8 | 3626 } // namespace v8 |
3664 #endif // V8_TARGET_ARCH_PPC | 3627 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |