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

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

Issue 1574223002: Revert of [builtins] Refactor the remaining Date builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
3434 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { 3473 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3435 ZoneList<Expression*>* args = expr->arguments(); 3474 ZoneList<Expression*>* args = expr->arguments();
3436 DCHECK_EQ(3, args->length()); 3475 DCHECK_EQ(3, args->length());
3437 3476
3438 Register string = v0; 3477 Register string = v0;
3439 Register index = a1; 3478 Register index = a1;
3440 Register value = a2; 3479 Register value = a2;
3441 3480
3442 VisitForStackValue(args->at(0)); // index 3481 VisitForStackValue(args->at(0)); // index
3443 VisitForStackValue(args->at(1)); // value 3482 VisitForStackValue(args->at(1)); // value
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
4845 reinterpret_cast<uint64_t>( 4884 reinterpret_cast<uint64_t>(
4846 isolate->builtins()->OsrAfterStackCheck()->entry())); 4885 isolate->builtins()->OsrAfterStackCheck()->entry()));
4847 return OSR_AFTER_STACK_CHECK; 4886 return OSR_AFTER_STACK_CHECK;
4848 } 4887 }
4849 4888
4850 4889
4851 } // namespace internal 4890 } // namespace internal
4852 } // namespace v8 4891 } // namespace v8
4853 4892
4854 #endif // V8_TARGET_ARCH_MIPS64 4893 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698