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

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

Issue 1191283003: [date] Use explicit control flow to replace %_ThrowIfNotADate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | src/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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3888 matching lines...) Expand 10 before | Expand all | Expand 10 after
3899 __ JumpIfSmi(r0, &done); 3899 __ JumpIfSmi(r0, &done);
3900 // If the object is not a value type, return the object. 3900 // If the object is not a value type, return the object.
3901 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE); 3901 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE);
3902 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset), eq); 3902 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset), eq);
3903 3903
3904 __ bind(&done); 3904 __ bind(&done);
3905 context()->Plug(r0); 3905 context()->Plug(r0);
3906 } 3906 }
3907 3907
3908 3908
3909 void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) { 3909 void FullCodeGenerator::EmitIsDate(CallRuntime* expr) {
3910 ZoneList<Expression*>* args = expr->arguments(); 3910 ZoneList<Expression*>* args = expr->arguments();
3911 DCHECK_EQ(1, args->length()); 3911 DCHECK_EQ(1, args->length());
3912 3912
3913 VisitForAccumulatorValue(args->at(0)); // Load the object. 3913 VisitForAccumulatorValue(args->at(0));
3914 3914
3915 Label done, not_date_object; 3915 Label materialize_true, materialize_false;
3916 Register object = r0; 3916 Label* if_true = nullptr;
3917 Register result = r0; 3917 Label* if_false = nullptr;
3918 Register scratch0 = r9; 3918 Label* fall_through = nullptr;
3919 context()->PrepareTest(&materialize_true, &materialize_false, &if_true,
3920 &if_false, &fall_through);
3919 3921
3920 __ JumpIfSmi(object, &not_date_object); 3922 __ JumpIfSmi(r0, if_false);
3921 __ CompareObjectType(object, scratch0, scratch0, JS_DATE_TYPE); 3923 __ CompareObjectType(r0, r1, r1, JS_DATE_TYPE);
3922 __ b(eq, &done); 3924 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3923 __ bind(&not_date_object); 3925 Split(eq, if_true, if_false, fall_through);
3924 __ CallRuntime(Runtime::kThrowNotDateError, 0);
3925 3926
3926 __ bind(&done); 3927 context()->Plug(if_true, if_false);
3927 context()->Plug(result);
3928 } 3928 }
3929 3929
3930 3930
3931 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { 3931 void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
3932 ZoneList<Expression*>* args = expr->arguments(); 3932 ZoneList<Expression*>* args = expr->arguments();
3933 DCHECK(args->length() == 2); 3933 DCHECK(args->length() == 2);
3934 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); 3934 DCHECK_NOT_NULL(args->at(1)->AsLiteral());
3935 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); 3935 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
3936 3936
3937 VisitForAccumulatorValue(args->at(0)); // Load the object. 3937 VisitForAccumulatorValue(args->at(0)); // Load the object.
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
5609 DCHECK(interrupt_address == 5609 DCHECK(interrupt_address ==
5610 isolate->builtins()->OsrAfterStackCheck()->entry()); 5610 isolate->builtins()->OsrAfterStackCheck()->entry());
5611 return OSR_AFTER_STACK_CHECK; 5611 return OSR_AFTER_STACK_CHECK;
5612 } 5612 }
5613 5613
5614 5614
5615 } // namespace internal 5615 } // namespace internal
5616 } // namespace v8 5616 } // namespace v8
5617 5617
5618 #endif // V8_TARGET_ARCH_ARM 5618 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698