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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2940 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 2940 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
2941 __ b(&done); | 2941 __ b(&done); |
2942 | 2942 |
2943 NopRuntimeCallHelper call_helper; | 2943 NopRuntimeCallHelper call_helper; |
2944 generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper); | 2944 generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper); |
2945 | 2945 |
2946 __ bind(&done); | 2946 __ bind(&done); |
2947 context()->Plug(result); | 2947 context()->Plug(result); |
2948 } | 2948 } |
2949 | 2949 |
2950 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { | |
2951 ZoneList<Expression*>* args = expr->arguments(); | |
2952 DCHECK(args->length() == 2); | |
2953 VisitForStackValue(args->at(0)); | |
2954 VisitForAccumulatorValue(args->at(1)); | |
2955 | |
2956 Register object = r3; | |
2957 Register index = r2; | |
2958 Register scratch = r5; | |
2959 Register result = r2; | |
2960 | |
2961 PopOperand(object); | |
2962 | |
2963 Label need_conversion; | |
2964 Label index_out_of_range; | |
2965 Label done; | |
2966 StringCharAtGenerator generator(object, index, scratch, result, | |
2967 &need_conversion, &need_conversion, | |
2968 &index_out_of_range, STRING_INDEX_IS_NUMBER); | |
2969 generator.GenerateFast(masm_); | |
2970 __ b(&done); | |
2971 | |
2972 __ bind(&index_out_of_range); | |
2973 // When the index is out of range, the spec requires us to return | |
2974 // the empty string. | |
2975 __ LoadRoot(result, Heap::kempty_stringRootIndex); | |
2976 __ b(&done); | |
2977 | |
2978 __ bind(&need_conversion); | |
2979 // Move smi zero into the result register, which will trigger | |
2980 // conversion. | |
2981 __ LoadSmiLiteral(result, Smi::FromInt(0)); | |
2982 __ b(&done); | |
2983 | |
2984 NopRuntimeCallHelper call_helper; | |
2985 generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper); | |
2986 | |
2987 __ bind(&done); | |
2988 context()->Plug(result); | |
2989 } | |
2990 | |
2991 void FullCodeGenerator::EmitCall(CallRuntime* expr) { | 2950 void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
2992 ZoneList<Expression*>* args = expr->arguments(); | 2951 ZoneList<Expression*>* args = expr->arguments(); |
2993 DCHECK_LE(2, args->length()); | 2952 DCHECK_LE(2, args->length()); |
2994 // Push target, receiver and arguments onto the stack. | 2953 // Push target, receiver and arguments onto the stack. |
2995 for (Expression* const arg : *args) { | 2954 for (Expression* const arg : *args) { |
2996 VisitForStackValue(arg); | 2955 VisitForStackValue(arg); |
2997 } | 2956 } |
2998 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); | 2957 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
2999 // Move target to r3. | 2958 // Move target to r3. |
3000 int const argc = args->length() - 2; | 2959 int const argc = args->length() - 2; |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3819 DCHECK(kOSRBranchInstruction == br_instr); | 3778 DCHECK(kOSRBranchInstruction == br_instr); |
3820 | 3779 |
3821 DCHECK(interrupt_address == | 3780 DCHECK(interrupt_address == |
3822 isolate->builtins()->OnStackReplacement()->entry()); | 3781 isolate->builtins()->OnStackReplacement()->entry()); |
3823 return ON_STACK_REPLACEMENT; | 3782 return ON_STACK_REPLACEMENT; |
3824 } | 3783 } |
3825 | 3784 |
3826 } // namespace internal | 3785 } // namespace internal |
3827 } // namespace v8 | 3786 } // namespace v8 |
3828 #endif // V8_TARGET_ARCH_S390 | 3787 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |