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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 3413 matching lines...) Expand 10 before | Expand all | Expand 10 after
3424 3424
3425 __ JumpIfSmi(r3, if_false); 3425 __ JumpIfSmi(r3, if_false);
3426 __ CompareObjectType(r3, r4, r4, JS_DATE_TYPE); 3426 __ CompareObjectType(r3, r4, r4, JS_DATE_TYPE);
3427 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3427 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3428 Split(eq, if_true, if_false, fall_through); 3428 Split(eq, 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 = r3;
3443 Register result = r3;
3444 Register scratch0 = r11;
3445 Register scratch1 = r4;
3446
3447 if (index->value() == 0) {
3448 __ LoadP(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 __ mov(scratch1, Operand(stamp));
3454 __ LoadP(scratch1, MemOperand(scratch1));
3455 __ LoadP(scratch0, FieldMemOperand(object, JSDate::kCacheStampOffset));
3456 __ cmp(scratch1, scratch0);
3457 __ bne(&runtime);
3458 __ LoadP(result,
3459 FieldMemOperand(object, JSDate::kValueOffset +
3460 kPointerSize * index->value()),
3461 scratch0);
3462 __ b(&done);
3463 }
3464 __ bind(&runtime);
3465 __ PrepareCallCFunction(2, scratch1);
3466 __ LoadSmiLiteral(r4, index);
3467 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
3468 __ bind(&done);
3469 }
3470
3471 context()->Plug(result);
3472 }
3473
3474
3475 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { 3434 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3476 ZoneList<Expression*>* args = expr->arguments(); 3435 ZoneList<Expression*>* args = expr->arguments();
3477 DCHECK_EQ(3, args->length()); 3436 DCHECK_EQ(3, args->length());
3478 3437
3479 Register string = r3; 3438 Register string = r3;
3480 Register index = r4; 3439 Register index = r4;
3481 Register value = r5; 3440 Register value = r5;
3482 3441
3483 VisitForStackValue(args->at(0)); // index 3442 VisitForStackValue(args->at(0)); // index
3484 VisitForStackValue(args->at(1)); // value 3443 VisitForStackValue(args->at(1)); // value
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
4860 return ON_STACK_REPLACEMENT; 4819 return ON_STACK_REPLACEMENT;
4861 } 4820 }
4862 4821
4863 DCHECK(interrupt_address == 4822 DCHECK(interrupt_address ==
4864 isolate->builtins()->OsrAfterStackCheck()->entry()); 4823 isolate->builtins()->OsrAfterStackCheck()->entry());
4865 return OSR_AFTER_STACK_CHECK; 4824 return OSR_AFTER_STACK_CHECK;
4866 } 4825 }
4867 } // namespace internal 4826 } // namespace internal
4868 } // namespace v8 4827 } // namespace v8
4869 #endif // V8_TARGET_ARCH_PPC 4828 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698