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

Side by Side Diff: src/ppc/full-codegen-ppc.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 | « src/mips64/full-codegen-mips64.cc ('k') | src/runtime/runtime.h » ('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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_PPC 7 #if V8_TARGET_ARCH_PPC
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 3901 matching lines...) Expand 10 before | Expand all | Expand 10 after
3912 // If the object is not a value type, return the object. 3912 // If the object is not a value type, return the object.
3913 __ CompareObjectType(r3, r4, r4, JS_VALUE_TYPE); 3913 __ CompareObjectType(r3, r4, r4, JS_VALUE_TYPE);
3914 __ bne(&done); 3914 __ bne(&done);
3915 __ LoadP(r3, FieldMemOperand(r3, JSValue::kValueOffset)); 3915 __ LoadP(r3, FieldMemOperand(r3, JSValue::kValueOffset));
3916 3916
3917 __ bind(&done); 3917 __ bind(&done);
3918 context()->Plug(r3); 3918 context()->Plug(r3);
3919 } 3919 }
3920 3920
3921 3921
3922 void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) { 3922 void FullCodeGenerator::EmitIsDate(CallRuntime* expr) {
3923 ZoneList<Expression*>* args = expr->arguments(); 3923 ZoneList<Expression*>* args = expr->arguments();
3924 DCHECK_EQ(1, args->length()); 3924 DCHECK_EQ(1, args->length());
3925 3925
3926 VisitForAccumulatorValue(args->at(0)); // Load the object. 3926 VisitForAccumulatorValue(args->at(0));
3927 3927
3928 Label done, not_date_object; 3928 Label materialize_true, materialize_false;
3929 Register object = r3; 3929 Label* if_true = nullptr;
3930 Register result = r3; 3930 Label* if_false = nullptr;
3931 Register scratch0 = r4; 3931 Label* fall_through = nullptr;
3932 context()->PrepareTest(&materialize_true, &materialize_false, &if_true,
3933 &if_false, &fall_through);
3932 3934
3933 __ JumpIfSmi(object, &not_date_object); 3935 __ JumpIfSmi(r3, if_false);
3934 __ CompareObjectType(object, scratch0, scratch0, JS_DATE_TYPE); 3936 __ CompareObjectType(r3, r4, r4, JS_DATE_TYPE);
3935 __ beq(&done); 3937 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3936 __ bind(&not_date_object); 3938 Split(eq, if_true, if_false, fall_through);
3937 __ CallRuntime(Runtime::kThrowNotDateError, 0);
3938 3939
3939 __ bind(&done); 3940 context()->Plug(if_true, if_false);
3940 context()->Plug(result);
3941 } 3941 }
3942 3942
3943 3943
3944 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { 3944 void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
3945 ZoneList<Expression*>* args = expr->arguments(); 3945 ZoneList<Expression*>* args = expr->arguments();
3946 DCHECK(args->length() == 2); 3946 DCHECK(args->length() == 2);
3947 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); 3947 DCHECK_NOT_NULL(args->at(1)->AsLiteral());
3948 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); 3948 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
3949 3949
3950 VisitForAccumulatorValue(args->at(0)); // Load the object. 3950 VisitForAccumulatorValue(args->at(0)); // Load the object.
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after
5560 return ON_STACK_REPLACEMENT; 5560 return ON_STACK_REPLACEMENT;
5561 } 5561 }
5562 5562
5563 DCHECK(interrupt_address == 5563 DCHECK(interrupt_address ==
5564 isolate->builtins()->OsrAfterStackCheck()->entry()); 5564 isolate->builtins()->OsrAfterStackCheck()->entry());
5565 return OSR_AFTER_STACK_CHECK; 5565 return OSR_AFTER_STACK_CHECK;
5566 } 5566 }
5567 } // namespace internal 5567 } // namespace internal
5568 } // namespace v8 5568 } // namespace v8
5569 #endif // V8_TARGET_ARCH_PPC 5569 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698