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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 3251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3262 __ Addu(at, | 3262 __ Addu(at, |
3263 string, | 3263 string, |
3264 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); | 3264 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); |
3265 __ Addu(at, at, index); | 3265 __ Addu(at, at, index); |
3266 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); | 3266 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); |
3267 __ sh(value, MemOperand(at)); | 3267 __ sh(value, MemOperand(at)); |
3268 context()->Plug(string); | 3268 context()->Plug(string); |
3269 } | 3269 } |
3270 | 3270 |
3271 | 3271 |
3272 void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) { | |
3273 ZoneList<Expression*>* args = expr->arguments(); | |
3274 DCHECK(args->length() == 2); | |
3275 | |
3276 VisitForStackValue(args->at(0)); // Load the object. | |
3277 VisitForAccumulatorValue(args->at(1)); // Load the value. | |
3278 __ pop(a1); // v0 = value. a1 = object. | |
3279 | |
3280 Label done; | |
3281 // If the object is a smi, return the value. | |
3282 __ JumpIfSmi(a1, &done); | |
3283 | |
3284 // If the object is not a value type, return the value. | |
3285 __ GetObjectType(a1, a2, a2); | |
3286 __ Branch(&done, ne, a2, Operand(JS_VALUE_TYPE)); | |
3287 | |
3288 // Store the value. | |
3289 __ sw(v0, FieldMemOperand(a1, JSValue::kValueOffset)); | |
3290 // Update the write barrier. Save the value as it will be | |
3291 // overwritten by the write barrier code and is needed afterward. | |
3292 __ mov(a2, v0); | |
3293 __ RecordWriteField( | |
3294 a1, JSValue::kValueOffset, a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); | |
3295 | |
3296 __ bind(&done); | |
3297 context()->Plug(v0); | |
3298 } | |
3299 | |
3300 | |
3301 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { | 3272 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { |
3302 ZoneList<Expression*>* args = expr->arguments(); | 3273 ZoneList<Expression*>* args = expr->arguments(); |
3303 DCHECK_EQ(1, args->length()); | 3274 DCHECK_EQ(1, args->length()); |
3304 | 3275 |
3305 // Load the argument into v0 and convert it. | 3276 // Load the argument into v0 and convert it. |
3306 VisitForAccumulatorValue(args->at(0)); | 3277 VisitForAccumulatorValue(args->at(0)); |
3307 | 3278 |
3308 // Convert the object to an integer. | 3279 // Convert the object to an integer. |
3309 Label done_convert; | 3280 Label done_convert; |
3310 __ JumpIfSmi(v0, &done_convert); | 3281 __ JumpIfSmi(v0, &done_convert); |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4582 reinterpret_cast<uint32_t>( | 4553 reinterpret_cast<uint32_t>( |
4583 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4554 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4584 return OSR_AFTER_STACK_CHECK; | 4555 return OSR_AFTER_STACK_CHECK; |
4585 } | 4556 } |
4586 | 4557 |
4587 | 4558 |
4588 } // namespace internal | 4559 } // namespace internal |
4589 } // namespace v8 | 4560 } // namespace v8 |
4590 | 4561 |
4591 #endif // V8_TARGET_ARCH_MIPS | 4562 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |