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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 3413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3424 | 3424 |
3425 __ JumpIfSmi(v0, if_false); | 3425 __ JumpIfSmi(v0, if_false); |
3426 __ GetObjectType(v0, a1, a1); | 3426 __ GetObjectType(v0, a1, a1); |
3427 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3427 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3428 Split(eq, a1, Operand(JS_DATE_TYPE), if_true, if_false, fall_through); | 3428 Split(eq, a1, Operand(JS_DATE_TYPE), if_true, if_false, fall_through); |
3429 | 3429 |
3430 context()->Plug(if_true, if_false); | 3430 context()->Plug(if_true, if_false); |
3431 } | 3431 } |
3432 | 3432 |
3433 | 3433 |
3434 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { | |
3435 ZoneList<Expression*>* args = expr->arguments(); | |
3436 DCHECK(args->length() == 2); | |
3437 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); | |
3438 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); | |
3439 | |
3440 VisitForAccumulatorValue(args->at(0)); // Load the object. | |
3441 | |
3442 Register object = v0; | |
3443 Register result = v0; | |
3444 Register scratch0 = t1; | |
3445 Register scratch1 = a1; | |
3446 | |
3447 if (index->value() == 0) { | |
3448 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset)); | |
3449 } else { | |
3450 Label runtime, done; | |
3451 if (index->value() < JSDate::kFirstUncachedField) { | |
3452 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | |
3453 __ li(scratch1, Operand(stamp)); | |
3454 __ ld(scratch1, MemOperand(scratch1)); | |
3455 __ ld(scratch0, FieldMemOperand(object, JSDate::kCacheStampOffset)); | |
3456 __ Branch(&runtime, ne, scratch1, Operand(scratch0)); | |
3457 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset + | |
3458 kPointerSize * index->value())); | |
3459 __ jmp(&done); | |
3460 } | |
3461 __ bind(&runtime); | |
3462 __ PrepareCallCFunction(2, scratch1); | |
3463 __ li(a1, Operand(index)); | |
3464 __ Move(a0, object); | |
3465 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); | |
3466 __ bind(&done); | |
3467 } | |
3468 | |
3469 context()->Plug(result); | |
3470 } | |
3471 | |
3472 | |
3473 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { | 3434 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { |
3474 ZoneList<Expression*>* args = expr->arguments(); | 3435 ZoneList<Expression*>* args = expr->arguments(); |
3475 DCHECK_EQ(3, args->length()); | 3436 DCHECK_EQ(3, args->length()); |
3476 | 3437 |
3477 Register string = v0; | 3438 Register string = v0; |
3478 Register index = a1; | 3439 Register index = a1; |
3479 Register value = a2; | 3440 Register value = a2; |
3480 | 3441 |
3481 VisitForStackValue(args->at(0)); // index | 3442 VisitForStackValue(args->at(0)); // index |
3482 VisitForStackValue(args->at(1)); // value | 3443 VisitForStackValue(args->at(1)); // value |
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4884 reinterpret_cast<uint64_t>( | 4845 reinterpret_cast<uint64_t>( |
4885 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4846 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4886 return OSR_AFTER_STACK_CHECK; | 4847 return OSR_AFTER_STACK_CHECK; |
4887 } | 4848 } |
4888 | 4849 |
4889 | 4850 |
4890 } // namespace internal | 4851 } // namespace internal |
4891 } // namespace v8 | 4852 } // namespace v8 |
4892 | 4853 |
4893 #endif // V8_TARGET_ARCH_MIPS64 | 4854 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |