OLD | NEW |
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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 3873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3884 __ GetObjectType(v0, a1, a1); | 3884 __ GetObjectType(v0, a1, a1); |
3885 __ Branch(&done, ne, a1, Operand(JS_VALUE_TYPE)); | 3885 __ Branch(&done, ne, a1, Operand(JS_VALUE_TYPE)); |
3886 | 3886 |
3887 __ ld(v0, FieldMemOperand(v0, JSValue::kValueOffset)); | 3887 __ ld(v0, FieldMemOperand(v0, JSValue::kValueOffset)); |
3888 | 3888 |
3889 __ bind(&done); | 3889 __ bind(&done); |
3890 context()->Plug(v0); | 3890 context()->Plug(v0); |
3891 } | 3891 } |
3892 | 3892 |
3893 | 3893 |
3894 void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) { | 3894 void FullCodeGenerator::EmitIsDate(CallRuntime* expr) { |
3895 ZoneList<Expression*>* args = expr->arguments(); | 3895 ZoneList<Expression*>* args = expr->arguments(); |
3896 DCHECK_EQ(1, args->length()); | 3896 DCHECK_EQ(1, args->length()); |
3897 | 3897 |
3898 VisitForAccumulatorValue(args->at(0)); // Load the object. | 3898 VisitForAccumulatorValue(args->at(0)); |
3899 | 3899 |
3900 Label done, not_date_object; | 3900 Label materialize_true, materialize_false; |
3901 Register object = v0; | 3901 Label* if_true = nullptr; |
3902 Register result = v0; | 3902 Label* if_false = nullptr; |
3903 Register scratch1 = a1; | 3903 Label* fall_through = nullptr; |
| 3904 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3905 &if_false, &fall_through); |
3904 | 3906 |
3905 __ JumpIfSmi(object, ¬_date_object); | 3907 __ JumpIfSmi(v0, if_false); |
3906 __ GetObjectType(object, scratch1, scratch1); | 3908 __ GetObjectType(v0, a1, a1); |
3907 __ Branch(&done, eq, scratch1, Operand(JS_DATE_TYPE)); | 3909 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3908 __ bind(¬_date_object); | 3910 Split(eq, a1, Operand(JS_DATE_TYPE), if_true, if_false, fall_through); |
3909 __ CallRuntime(Runtime::kThrowNotDateError, 0); | |
3910 | 3911 |
3911 __ bind(&done); | 3912 context()->Plug(if_true, if_false); |
3912 context()->Plug(result); | |
3913 } | 3913 } |
3914 | 3914 |
3915 | 3915 |
3916 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { | 3916 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
3917 ZoneList<Expression*>* args = expr->arguments(); | 3917 ZoneList<Expression*>* args = expr->arguments(); |
3918 DCHECK(args->length() == 2); | 3918 DCHECK(args->length() == 2); |
3919 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); | 3919 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); |
3920 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); | 3920 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); |
3921 | 3921 |
3922 VisitForAccumulatorValue(args->at(0)); // Load the object. | 3922 VisitForAccumulatorValue(args->at(0)); // Load the object. |
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5560 reinterpret_cast<uint64_t>( | 5560 reinterpret_cast<uint64_t>( |
5561 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5561 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5562 return OSR_AFTER_STACK_CHECK; | 5562 return OSR_AFTER_STACK_CHECK; |
5563 } | 5563 } |
5564 | 5564 |
5565 | 5565 |
5566 } // namespace internal | 5566 } // namespace internal |
5567 } // namespace v8 | 5567 } // namespace v8 |
5568 | 5568 |
5569 #endif // V8_TARGET_ARCH_MIPS64 | 5569 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |