| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3266 __ SmiUntag(value, value); | 3266 __ SmiUntag(value, value); |
| 3267 __ add(ip, | 3267 __ add(ip, |
| 3268 string, | 3268 string, |
| 3269 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); | 3269 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); |
| 3270 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); | 3270 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); |
| 3271 __ strh(value, MemOperand(ip, index)); | 3271 __ strh(value, MemOperand(ip, index)); |
| 3272 context()->Plug(string); | 3272 context()->Plug(string); |
| 3273 } | 3273 } |
| 3274 | 3274 |
| 3275 | 3275 |
| 3276 void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) { | |
| 3277 ZoneList<Expression*>* args = expr->arguments(); | |
| 3278 DCHECK(args->length() == 2); | |
| 3279 VisitForStackValue(args->at(0)); // Load the object. | |
| 3280 VisitForAccumulatorValue(args->at(1)); // Load the value. | |
| 3281 __ pop(r1); // r0 = value. r1 = object. | |
| 3282 | |
| 3283 Label done; | |
| 3284 // If the object is a smi, return the value. | |
| 3285 __ JumpIfSmi(r1, &done); | |
| 3286 | |
| 3287 // If the object is not a value type, return the value. | |
| 3288 __ CompareObjectType(r1, r2, r2, JS_VALUE_TYPE); | |
| 3289 __ b(ne, &done); | |
| 3290 | |
| 3291 // Store the value. | |
| 3292 __ str(r0, FieldMemOperand(r1, JSValue::kValueOffset)); | |
| 3293 // Update the write barrier. Save the value as it will be | |
| 3294 // overwritten by the write barrier code and is needed afterward. | |
| 3295 __ mov(r2, r0); | |
| 3296 __ RecordWriteField( | |
| 3297 r1, JSValue::kValueOffset, r2, r3, kLRHasBeenSaved, kDontSaveFPRegs); | |
| 3298 | |
| 3299 __ bind(&done); | |
| 3300 context()->Plug(r0); | |
| 3301 } | |
| 3302 | |
| 3303 | |
| 3304 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { | 3276 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { |
| 3305 ZoneList<Expression*>* args = expr->arguments(); | 3277 ZoneList<Expression*>* args = expr->arguments(); |
| 3306 DCHECK_EQ(1, args->length()); | 3278 DCHECK_EQ(1, args->length()); |
| 3307 | 3279 |
| 3308 // Load the argument into r0 and convert it. | 3280 // Load the argument into r0 and convert it. |
| 3309 VisitForAccumulatorValue(args->at(0)); | 3281 VisitForAccumulatorValue(args->at(0)); |
| 3310 | 3282 |
| 3311 // Convert the object to an integer. | 3283 // Convert the object to an integer. |
| 3312 Label done_convert; | 3284 Label done_convert; |
| 3313 __ JumpIfSmi(r0, &done_convert); | 3285 __ JumpIfSmi(r0, &done_convert); |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4646 DCHECK(interrupt_address == | 4618 DCHECK(interrupt_address == |
| 4647 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4619 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 4648 return OSR_AFTER_STACK_CHECK; | 4620 return OSR_AFTER_STACK_CHECK; |
| 4649 } | 4621 } |
| 4650 | 4622 |
| 4651 | 4623 |
| 4652 } // namespace internal | 4624 } // namespace internal |
| 4653 } // namespace v8 | 4625 } // namespace v8 |
| 4654 | 4626 |
| 4655 #endif // V8_TARGET_ARCH_ARM | 4627 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |