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 3243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3254 } | 3254 } |
3255 | 3255 |
3256 __ SmiUntag(value); | 3256 __ SmiUntag(value); |
3257 __ addi(ip, string, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); | 3257 __ addi(ip, string, Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); |
3258 __ SmiToShortArrayOffset(r0, index); | 3258 __ SmiToShortArrayOffset(r0, index); |
3259 __ sthx(value, MemOperand(ip, r0)); | 3259 __ sthx(value, MemOperand(ip, r0)); |
3260 context()->Plug(string); | 3260 context()->Plug(string); |
3261 } | 3261 } |
3262 | 3262 |
3263 | 3263 |
3264 void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) { | |
3265 ZoneList<Expression*>* args = expr->arguments(); | |
3266 DCHECK(args->length() == 2); | |
3267 VisitForStackValue(args->at(0)); // Load the object. | |
3268 VisitForAccumulatorValue(args->at(1)); // Load the value. | |
3269 __ pop(r4); // r3 = value. r4 = object. | |
3270 | |
3271 Label done; | |
3272 // If the object is a smi, return the value. | |
3273 __ JumpIfSmi(r4, &done); | |
3274 | |
3275 // If the object is not a value type, return the value. | |
3276 __ CompareObjectType(r4, r5, r5, JS_VALUE_TYPE); | |
3277 __ bne(&done); | |
3278 | |
3279 // Store the value. | |
3280 __ StoreP(r3, FieldMemOperand(r4, JSValue::kValueOffset), r0); | |
3281 // Update the write barrier. Save the value as it will be | |
3282 // overwritten by the write barrier code and is needed afterward. | |
3283 __ mr(r5, r3); | |
3284 __ RecordWriteField(r4, JSValue::kValueOffset, r5, r6, kLRHasBeenSaved, | |
3285 kDontSaveFPRegs); | |
3286 | |
3287 __ bind(&done); | |
3288 context()->Plug(r3); | |
3289 } | |
3290 | |
3291 | |
3292 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { | 3264 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { |
3293 ZoneList<Expression*>* args = expr->arguments(); | 3265 ZoneList<Expression*>* args = expr->arguments(); |
3294 DCHECK_EQ(1, args->length()); | 3266 DCHECK_EQ(1, args->length()); |
3295 | 3267 |
3296 // Load the argument into r3 and convert it. | 3268 // Load the argument into r3 and convert it. |
3297 VisitForAccumulatorValue(args->at(0)); | 3269 VisitForAccumulatorValue(args->at(0)); |
3298 | 3270 |
3299 // Convert the object to an integer. | 3271 // Convert the object to an integer. |
3300 Label done_convert; | 3272 Label done_convert; |
3301 __ JumpIfSmi(r3, &done_convert); | 3273 __ JumpIfSmi(r3, &done_convert); |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4567 return ON_STACK_REPLACEMENT; | 4539 return ON_STACK_REPLACEMENT; |
4568 } | 4540 } |
4569 | 4541 |
4570 DCHECK(interrupt_address == | 4542 DCHECK(interrupt_address == |
4571 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4543 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4572 return OSR_AFTER_STACK_CHECK; | 4544 return OSR_AFTER_STACK_CHECK; |
4573 } | 4545 } |
4574 } // namespace internal | 4546 } // namespace internal |
4575 } // namespace v8 | 4547 } // namespace v8 |
4576 #endif // V8_TARGET_ARCH_PPC | 4548 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |