OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3114 | 3114 |
3115 __ JumpIfSmi(x0, if_false); | 3115 __ JumpIfSmi(x0, if_false); |
3116 __ CompareObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE); | 3116 __ CompareObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE); |
3117 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3117 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3118 Split(ge, if_true, if_false, fall_through); | 3118 Split(ge, if_true, if_false, fall_through); |
3119 | 3119 |
3120 context()->Plug(if_true, if_false); | 3120 context()->Plug(if_true, if_false); |
3121 } | 3121 } |
3122 | 3122 |
3123 | 3123 |
| 3124 void FullCodeGenerator::EmitIsSimdObject(CallRuntime* expr) { |
| 3125 ZoneList<Expression*>* args = expr->arguments(); |
| 3126 DCHECK(args->length() == 1); |
| 3127 |
| 3128 VisitForAccumulatorValue(args->at(0)); |
| 3129 |
| 3130 Label materialize_true, materialize_false; |
| 3131 Label* if_true = NULL; |
| 3132 Label* if_false = NULL; |
| 3133 Label* fall_through = NULL; |
| 3134 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3135 &if_false, &fall_through); |
| 3136 |
| 3137 __ JumpIfSmi(x0, if_false); |
| 3138 Register map = x10; |
| 3139 Register type_reg = x11; |
| 3140 __ Ldr(map, FieldMemOperand(x0, HeapObject::kMapOffset)); |
| 3141 __ Ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 3142 __ Sub(type_reg, type_reg, Operand(FIRST_SIMD_VALUE_TYPE)); |
| 3143 __ Cmp(type_reg, Operand(LAST_SIMD_VALUE_TYPE - FIRST_SIMD_VALUE_TYPE)); |
| 3144 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3145 Split(ls, if_true, if_false, fall_through); |
| 3146 |
| 3147 context()->Plug(if_true, if_false); |
| 3148 } |
| 3149 |
| 3150 |
3124 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3151 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
3125 ASM_LOCATION("FullCodeGenerator::EmitIsUndetectableObject"); | 3152 ASM_LOCATION("FullCodeGenerator::EmitIsUndetectableObject"); |
3126 ZoneList<Expression*>* args = expr->arguments(); | 3153 ZoneList<Expression*>* args = expr->arguments(); |
3127 DCHECK(args->length() == 1); | 3154 DCHECK(args->length() == 1); |
3128 | 3155 |
3129 VisitForAccumulatorValue(args->at(0)); | 3156 VisitForAccumulatorValue(args->at(0)); |
3130 | 3157 |
3131 Label materialize_true, materialize_false; | 3158 Label materialize_true, materialize_false; |
3132 Label* if_true = NULL; | 3159 Label* if_true = NULL; |
3133 Label* if_false = NULL; | 3160 Label* if_false = NULL; |
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4766 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof symbol_string"); | 4793 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof symbol_string"); |
4767 __ JumpIfSmi(x0, if_false); | 4794 __ JumpIfSmi(x0, if_false); |
4768 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE); | 4795 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE); |
4769 Split(eq, if_true, if_false, fall_through); | 4796 Split(eq, if_true, if_false, fall_through); |
4770 } else if (String::Equals(check, factory->float32x4_string())) { | 4797 } else if (String::Equals(check, factory->float32x4_string())) { |
4771 ASM_LOCATION( | 4798 ASM_LOCATION( |
4772 "FullCodeGenerator::EmitLiteralCompareTypeof float32x4_string"); | 4799 "FullCodeGenerator::EmitLiteralCompareTypeof float32x4_string"); |
4773 __ JumpIfSmi(x0, if_false); | 4800 __ JumpIfSmi(x0, if_false); |
4774 __ CompareObjectType(x0, x0, x1, FLOAT32X4_TYPE); | 4801 __ CompareObjectType(x0, x0, x1, FLOAT32X4_TYPE); |
4775 Split(eq, if_true, if_false, fall_through); | 4802 Split(eq, if_true, if_false, fall_through); |
| 4803 } else if (String::Equals(check, factory->int32x4_string())) { |
| 4804 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof int32x4_string"); |
| 4805 __ JumpIfSmi(x0, if_false); |
| 4806 __ CompareObjectType(x0, x0, x1, INT32X4_TYPE); |
| 4807 Split(eq, if_true, if_false, fall_through); |
| 4808 } else if (String::Equals(check, factory->bool32x4_string())) { |
| 4809 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof bool32x4_string"); |
| 4810 __ JumpIfSmi(x0, if_false); |
| 4811 __ CompareObjectType(x0, x0, x1, BOOL32X4_TYPE); |
| 4812 Split(eq, if_true, if_false, fall_through); |
| 4813 } else if (String::Equals(check, factory->int16x8_string())) { |
| 4814 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof int16x8_string"); |
| 4815 __ JumpIfSmi(x0, if_false); |
| 4816 __ CompareObjectType(x0, x0, x1, INT16X8_TYPE); |
| 4817 Split(eq, if_true, if_false, fall_through); |
| 4818 } else if (String::Equals(check, factory->bool16x8_string())) { |
| 4819 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof bool16x8_string"); |
| 4820 __ JumpIfSmi(x0, if_false); |
| 4821 __ CompareObjectType(x0, x0, x1, BOOL16X8_TYPE); |
| 4822 Split(eq, if_true, if_false, fall_through); |
| 4823 } else if (String::Equals(check, factory->int8x16_string())) { |
| 4824 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof int8x16_string"); |
| 4825 __ JumpIfSmi(x0, if_false); |
| 4826 __ CompareObjectType(x0, x0, x1, INT8X16_TYPE); |
| 4827 Split(eq, if_true, if_false, fall_through); |
| 4828 } else if (String::Equals(check, factory->bool8x16_string())) { |
| 4829 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof bool8x16_string"); |
| 4830 __ JumpIfSmi(x0, if_false); |
| 4831 __ CompareObjectType(x0, x0, x1, BOOL8X16_TYPE); |
| 4832 Split(eq, if_true, if_false, fall_through); |
4776 } else if (String::Equals(check, factory->boolean_string())) { | 4833 } else if (String::Equals(check, factory->boolean_string())) { |
4777 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string"); | 4834 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string"); |
4778 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true); | 4835 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true); |
4779 __ CompareRoot(x0, Heap::kFalseValueRootIndex); | 4836 __ CompareRoot(x0, Heap::kFalseValueRootIndex); |
4780 Split(eq, if_true, if_false, fall_through); | 4837 Split(eq, if_true, if_false, fall_through); |
4781 } else if (String::Equals(check, factory->undefined_string())) { | 4838 } else if (String::Equals(check, factory->undefined_string())) { |
4782 ASM_LOCATION( | 4839 ASM_LOCATION( |
4783 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string"); | 4840 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string"); |
4784 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); | 4841 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); |
4785 __ JumpIfSmi(x0, if_false); | 4842 __ JumpIfSmi(x0, if_false); |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5454 } | 5511 } |
5455 | 5512 |
5456 return INTERRUPT; | 5513 return INTERRUPT; |
5457 } | 5514 } |
5458 | 5515 |
5459 | 5516 |
5460 } // namespace internal | 5517 } // namespace internal |
5461 } // namespace v8 | 5518 } // namespace v8 |
5462 | 5519 |
5463 #endif // V8_TARGET_ARCH_ARM64 | 5520 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |