Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 1579613002: [builtins] Refactor the remaining Date builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: As per offline discussion, remove the weird test, which does not add a lot of value. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after
3419 3419
3420 __ JumpIfSmi(v0, if_false); 3420 __ JumpIfSmi(v0, if_false);
3421 __ GetObjectType(v0, a1, a1); 3421 __ GetObjectType(v0, a1, a1);
3422 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3422 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3423 Split(eq, a1, Operand(JS_DATE_TYPE), if_true, if_false, fall_through); 3423 Split(eq, a1, Operand(JS_DATE_TYPE), if_true, if_false, fall_through);
3424 3424
3425 context()->Plug(if_true, if_false); 3425 context()->Plug(if_true, if_false);
3426 } 3426 }
3427 3427
3428 3428
3429 void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
3430 ZoneList<Expression*>* args = expr->arguments();
3431 DCHECK(args->length() == 2);
3432 DCHECK_NOT_NULL(args->at(1)->AsLiteral());
3433 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
3434
3435 VisitForAccumulatorValue(args->at(0)); // Load the object.
3436
3437 Register object = v0;
3438 Register result = v0;
3439 Register scratch0 = t5;
3440 Register scratch1 = a1;
3441
3442 if (index->value() == 0) {
3443 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset));
3444 } else {
3445 Label runtime, done;
3446 if (index->value() < JSDate::kFirstUncachedField) {
3447 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
3448 __ li(scratch1, Operand(stamp));
3449 __ lw(scratch1, MemOperand(scratch1));
3450 __ lw(scratch0, FieldMemOperand(object, JSDate::kCacheStampOffset));
3451 __ Branch(&runtime, ne, scratch1, Operand(scratch0));
3452 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset +
3453 kPointerSize * index->value()));
3454 __ jmp(&done);
3455 }
3456 __ bind(&runtime);
3457 __ PrepareCallCFunction(2, scratch1);
3458 __ li(a1, Operand(index));
3459 __ Move(a0, object);
3460 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
3461 __ bind(&done);
3462 }
3463
3464 context()->Plug(result);
3465 }
3466
3467
3468 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { 3429 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3469 ZoneList<Expression*>* args = expr->arguments(); 3430 ZoneList<Expression*>* args = expr->arguments();
3470 DCHECK_EQ(3, args->length()); 3431 DCHECK_EQ(3, args->length());
3471 3432
3472 Register string = v0; 3433 Register string = v0;
3473 Register index = a1; 3434 Register index = a1;
3474 Register value = a2; 3435 Register value = a2;
3475 3436
3476 VisitForStackValue(args->at(0)); // index 3437 VisitForStackValue(args->at(0)); // index
3477 VisitForStackValue(args->at(1)); // value 3438 VisitForStackValue(args->at(1)); // value
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
4871 reinterpret_cast<uint32_t>( 4832 reinterpret_cast<uint32_t>(
4872 isolate->builtins()->OsrAfterStackCheck()->entry())); 4833 isolate->builtins()->OsrAfterStackCheck()->entry()));
4873 return OSR_AFTER_STACK_CHECK; 4834 return OSR_AFTER_STACK_CHECK;
4874 } 4835 }
4875 4836
4876 4837
4877 } // namespace internal 4838 } // namespace internal
4878 } // namespace v8 4839 } // namespace v8
4879 4840
4880 #endif // V8_TARGET_ARCH_MIPS 4841 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698