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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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
« no previous file with comments | « src/crankshaft/x87/lithium-x87.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
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 3412 matching lines...) Expand 10 before | Expand all | Expand 10 after
3423 3423
3424 __ JumpIfSmi(r0, if_false); 3424 __ JumpIfSmi(r0, if_false);
3425 __ CompareObjectType(r0, r1, r1, JS_DATE_TYPE); 3425 __ CompareObjectType(r0, r1, r1, JS_DATE_TYPE);
3426 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3426 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3427 Split(eq, if_true, if_false, fall_through); 3427 Split(eq, if_true, if_false, fall_through);
3428 3428
3429 context()->Plug(if_true, if_false); 3429 context()->Plug(if_true, if_false);
3430 } 3430 }
3431 3431
3432 3432
3433 void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
3434 ZoneList<Expression*>* args = expr->arguments();
3435 DCHECK(args->length() == 2);
3436 DCHECK_NOT_NULL(args->at(1)->AsLiteral());
3437 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
3438
3439 VisitForAccumulatorValue(args->at(0)); // Load the object.
3440
3441 Register object = r0;
3442 Register result = r0;
3443 Register scratch0 = r9;
3444 Register scratch1 = r1;
3445
3446 if (index->value() == 0) {
3447 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
3448 } else {
3449 Label runtime, done;
3450 if (index->value() < JSDate::kFirstUncachedField) {
3451 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
3452 __ mov(scratch1, Operand(stamp));
3453 __ ldr(scratch1, MemOperand(scratch1));
3454 __ ldr(scratch0, FieldMemOperand(object, JSDate::kCacheStampOffset));
3455 __ cmp(scratch1, scratch0);
3456 __ b(ne, &runtime);
3457 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset +
3458 kPointerSize * index->value()));
3459 __ jmp(&done);
3460 }
3461 __ bind(&runtime);
3462 __ PrepareCallCFunction(2, scratch1);
3463 __ mov(r1, Operand(index));
3464 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
3465 __ bind(&done);
3466 }
3467
3468 context()->Plug(result);
3469 }
3470
3471
3472 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { 3433 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
3473 ZoneList<Expression*>* args = expr->arguments(); 3434 ZoneList<Expression*>* args = expr->arguments();
3474 DCHECK_EQ(3, args->length()); 3435 DCHECK_EQ(3, args->length());
3475 3436
3476 Register string = r0; 3437 Register string = r0;
3477 Register index = r1; 3438 Register index = r1;
3478 Register value = r2; 3439 Register value = r2;
3479 3440
3480 VisitForStackValue(args->at(0)); // index 3441 VisitForStackValue(args->at(0)); // index
3481 VisitForStackValue(args->at(1)); // value 3442 VisitForStackValue(args->at(1)); // value
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
4922 DCHECK(interrupt_address == 4883 DCHECK(interrupt_address ==
4923 isolate->builtins()->OsrAfterStackCheck()->entry()); 4884 isolate->builtins()->OsrAfterStackCheck()->entry());
4924 return OSR_AFTER_STACK_CHECK; 4885 return OSR_AFTER_STACK_CHECK;
4925 } 4886 }
4926 4887
4927 4888
4928 } // namespace internal 4889 } // namespace internal
4929 } // namespace v8 4890 } // namespace v8
4930 4891
4931 #endif // V8_TARGET_ARCH_ARM 4892 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/crankshaft/x87/lithium-x87.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698