| 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/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 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3014 __ b(&done); | 3014 __ b(&done); |
| 3015 | 3015 |
| 3016 NopRuntimeCallHelper call_helper; | 3016 NopRuntimeCallHelper call_helper; |
| 3017 generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper); | 3017 generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper); |
| 3018 | 3018 |
| 3019 __ bind(&done); | 3019 __ bind(&done); |
| 3020 context()->Plug(result); | 3020 context()->Plug(result); |
| 3021 } | 3021 } |
| 3022 | 3022 |
| 3023 | 3023 |
| 3024 void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) { | |
| 3025 ZoneList<Expression*>* args = expr->arguments(); | |
| 3026 DCHECK(args->length() == 2); | |
| 3027 VisitForStackValue(args->at(0)); | |
| 3028 VisitForAccumulatorValue(args->at(1)); | |
| 3029 | |
| 3030 Register object = r4; | |
| 3031 Register index = r3; | |
| 3032 Register scratch = r6; | |
| 3033 Register result = r3; | |
| 3034 | |
| 3035 PopOperand(object); | |
| 3036 | |
| 3037 Label need_conversion; | |
| 3038 Label index_out_of_range; | |
| 3039 Label done; | |
| 3040 StringCharAtGenerator generator(object, index, scratch, result, | |
| 3041 &need_conversion, &need_conversion, | |
| 3042 &index_out_of_range, STRING_INDEX_IS_NUMBER); | |
| 3043 generator.GenerateFast(masm_); | |
| 3044 __ b(&done); | |
| 3045 | |
| 3046 __ bind(&index_out_of_range); | |
| 3047 // When the index is out of range, the spec requires us to return | |
| 3048 // the empty string. | |
| 3049 __ LoadRoot(result, Heap::kempty_stringRootIndex); | |
| 3050 __ b(&done); | |
| 3051 | |
| 3052 __ bind(&need_conversion); | |
| 3053 // Move smi zero into the result register, which will trigger | |
| 3054 // conversion. | |
| 3055 __ LoadSmiLiteral(result, Smi::FromInt(0)); | |
| 3056 __ b(&done); | |
| 3057 | |
| 3058 NopRuntimeCallHelper call_helper; | |
| 3059 generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper); | |
| 3060 | |
| 3061 __ bind(&done); | |
| 3062 context()->Plug(result); | |
| 3063 } | |
| 3064 | |
| 3065 | |
| 3066 void FullCodeGenerator::EmitCall(CallRuntime* expr) { | 3024 void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
| 3067 ZoneList<Expression*>* args = expr->arguments(); | 3025 ZoneList<Expression*>* args = expr->arguments(); |
| 3068 DCHECK_LE(2, args->length()); | 3026 DCHECK_LE(2, args->length()); |
| 3069 // Push target, receiver and arguments onto the stack. | 3027 // Push target, receiver and arguments onto the stack. |
| 3070 for (Expression* const arg : *args) { | 3028 for (Expression* const arg : *args) { |
| 3071 VisitForStackValue(arg); | 3029 VisitForStackValue(arg); |
| 3072 } | 3030 } |
| 3073 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); | 3031 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
| 3074 // Move target to r4. | 3032 // Move target to r4. |
| 3075 int const argc = args->length() - 2; | 3033 int const argc = args->length() - 2; |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3911 | 3869 |
| 3912 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3870 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3913 | 3871 |
| 3914 DCHECK(interrupt_address == | 3872 DCHECK(interrupt_address == |
| 3915 isolate->builtins()->OnStackReplacement()->entry()); | 3873 isolate->builtins()->OnStackReplacement()->entry()); |
| 3916 return ON_STACK_REPLACEMENT; | 3874 return ON_STACK_REPLACEMENT; |
| 3917 } | 3875 } |
| 3918 } // namespace internal | 3876 } // namespace internal |
| 3919 } // namespace v8 | 3877 } // namespace v8 |
| 3920 #endif // V8_TARGET_ARCH_PPC | 3878 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |