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 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3114 } | 3114 } |
3115 | 3115 |
3116 __ SmiUntag(value); | 3116 __ SmiUntag(value); |
3117 __ addi(ip, string, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); | 3117 __ addi(ip, string, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); |
3118 __ SmiToShortArrayOffset(r0, index); | 3118 __ SmiToShortArrayOffset(r0, index); |
3119 __ sthx(value, MemOperand(ip, r0)); | 3119 __ sthx(value, MemOperand(ip, r0)); |
3120 context()->Plug(string); | 3120 context()->Plug(string); |
3121 } | 3121 } |
3122 | 3122 |
3123 | 3123 |
3124 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { | |
3125 ZoneList<Expression*>* args = expr->arguments(); | |
3126 DCHECK_EQ(1, args->length()); | |
3127 | |
3128 // Load the argument into r3 and convert it. | |
3129 VisitForAccumulatorValue(args->at(0)); | |
3130 | |
3131 // Convert the object to an integer. | |
3132 Label done_convert; | |
3133 __ JumpIfSmi(r3, &done_convert); | |
3134 __ Push(r3); | |
3135 __ CallRuntime(Runtime::kToInteger); | |
3136 __ bind(&done_convert); | |
3137 context()->Plug(r3); | |
3138 } | |
3139 | |
3140 | |
3141 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 3124 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
3142 ZoneList<Expression*>* args = expr->arguments(); | 3125 ZoneList<Expression*>* args = expr->arguments(); |
3143 DCHECK(args->length() == 1); | 3126 DCHECK(args->length() == 1); |
3144 VisitForAccumulatorValue(args->at(0)); | 3127 VisitForAccumulatorValue(args->at(0)); |
3145 | 3128 |
3146 Label done; | 3129 Label done; |
3147 StringCharFromCodeGenerator generator(r3, r4); | 3130 StringCharFromCodeGenerator generator(r3, r4); |
3148 generator.GenerateFast(masm_); | 3131 generator.GenerateFast(masm_); |
3149 __ b(&done); | 3132 __ b(&done); |
3150 | 3133 |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4089 | 4072 |
4090 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 4073 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
4091 | 4074 |
4092 DCHECK(interrupt_address == | 4075 DCHECK(interrupt_address == |
4093 isolate->builtins()->OnStackReplacement()->entry()); | 4076 isolate->builtins()->OnStackReplacement()->entry()); |
4094 return ON_STACK_REPLACEMENT; | 4077 return ON_STACK_REPLACEMENT; |
4095 } | 4078 } |
4096 } // namespace internal | 4079 } // namespace internal |
4097 } // namespace v8 | 4080 } // namespace v8 |
4098 #endif // V8_TARGET_ARCH_PPC | 4081 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |