| OLD | NEW |
| 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 Loading... |
| 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, ¬_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(¬_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 Loading... |
| 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 |
| OLD | NEW |